projects
/
u
/
mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3f0508
)
Improve initialization slightly.
author
mdw
<mdw>
Sat, 11 Dec 1999 01:50:56 +0000
(
01:50
+0000)
committer
mdw
<mdw>
Sat, 11 Dec 1999 01:50:56 +0000
(
01:50
+0000)
mpbarrett.c
patch
|
blob
|
blame
|
history
diff --git
a/mpbarrett.c
b/mpbarrett.c
index
e438d02
..
025d4e4
100644
(file)
--- a/
mpbarrett.c
+++ b/
mpbarrett.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mpbarrett.c,v 1.
1 1999/12/10 23:21:59
mdw Exp $
+ * $Id: mpbarrett.c,v 1.
2 1999/12/11 01:50:56
mdw Exp $
*
* Barrett modular reduction
*
*
* Barrett modular reduction
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mpbarrett.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mpbarrett.c,v $
+ * Revision 1.2 1999/12/11 01:50:56 mdw
+ * Improve initialization slightly.
+ *
* Revision 1.1 1999/12/10 23:21:59 mdw
* Barrett reduction support: works with even moduli.
*
* Revision 1.1 1999/12/10 23:21:59 mdw
* Barrett reduction support: works with even moduli.
*
@@
-66,7
+69,9
@@
void mpbarrett_create(mpbarrett *mb, mp *m)
mp_shrink(m);
mb->k = MP_LEN(m);
mb->m = MP_COPY(m);
mp_shrink(m);
mb->k = MP_LEN(m);
mb->m = MP_COPY(m);
- b = mp_lsl(MP_NEW, MP_ONE, 2 * MPW_BITS * mb->k);
+ b = mp_create(2 * mb->k + 1);
+ MPX_ZERO(b->v, b->vl - 1);
+ b->vl[-1] = 1;
mp_div(&b, 0, b, m);
mb->mu = b;
}
mp_div(&b, 0, b, m);
mb->mu = b;
}