From ed6d1bd2f0cd07a49530968e33d43955f1a3c1ca Mon Sep 17 00:00:00 2001 From: mdw Date: Sat, 11 Dec 1999 01:50:56 +0000 Subject: [PATCH] Improve initialization slightly. --- mpbarrett.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mpbarrett.c b/mpbarrett.c index e438d02..025d4e4 100644 --- a/mpbarrett.c +++ b/mpbarrett.c @@ -1,6 +1,6 @@ /* -*-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 * @@ -30,6 +30,9 @@ /*----- 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. * @@ -66,7 +69,9 @@ void mpbarrett_create(mpbarrett *mb, mp *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; } -- 2.11.0