X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/bc985cefafea2e1b02095a2ff2a9982c4c647d17..578a86d91941a0f722b87973d88e84ec2cf9a608:/gfreduce.c diff --git a/gfreduce.c b/gfreduce.c index 929c46c..ae31d5c 100644 --- a/gfreduce.c +++ b/gfreduce.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: gfreduce.c,v 1.3 2004/03/23 15:19:32 mdw Exp $ + * $Id: gfreduce.c,v 1.5 2004/04/08 01:36:15 mdw Exp $ * * Efficient reduction modulo sparse binary polynomials * @@ -27,20 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: gfreduce.c,v $ - * Revision 1.3 2004/03/23 15:19:32 mdw - * Test elliptic curves more thoroughly. - * - * Revision 1.2 2004/03/21 22:52:06 mdw - * Merge and close elliptic curve branch. - * - * Revision 1.1.2.1 2004/03/21 22:39:46 mdw - * Elliptic curves on binary fields work. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -98,7 +84,8 @@ DA_DECL(instr_v, gfreduce_instr); void gfreduce_create(gfreduce *r, mp *p) { instr_v iv = DA_INIT; - unsigned long d, dw; + unsigned long d; + unsigned dw; mpscan sc; unsigned long i; gfreduce_instr *ip; @@ -162,8 +149,8 @@ void gfreduce_create(gfreduce *r, mp *p) w = ww; wi = DA_LEN(&iv); } - INSTR(GFRI_LSL, (i - d)%MPW_BITS); - if ((i - d)%MPW_BITS) + INSTR(GFRI_LSL, (MPW_BITS + i - d)%MPW_BITS); + if ((MPW_BITS + i - d)%MPW_BITS) f |= f_lsr; } wl = DA_LEN(&iv);