projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gather up another utility.
[u/mdw/catacomb]
/
gfreduce.c
diff --git
a/gfreduce.c
b/gfreduce.c
index
3969f11
..
ae31d5c
100644
(file)
--- a/
gfreduce.c
+++ b/
gfreduce.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: gfreduce.c,v 1.
1.2.1 2004/03/21 22:39:46
mdw Exp $
+ * $Id: gfreduce.c,v 1.
5 2004/04/08 01:36:15
mdw Exp $
*
* Efficient reduction modulo sparse binary polynomials
*
*
* Efficient reduction modulo sparse binary polynomials
*
@@
-27,14
+27,6
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: gfreduce.c,v $
- * Revision 1.1.2.1 2004/03/21 22:39:46 mdw
- * Elliptic curves on binary fields work.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include <mLib/alloc.h>
/*----- Header files ------------------------------------------------------*/
#include <mLib/alloc.h>
@@
-92,7
+84,8
@@
DA_DECL(instr_v, gfreduce_instr);
void gfreduce_create(gfreduce *r, mp *p)
{
instr_v iv = DA_INIT;
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;
mpscan sc;
unsigned long i;
gfreduce_instr *ip;
@@
-156,8
+149,8
@@
void gfreduce_create(gfreduce *r, mp *p)
w = ww;
wi = DA_LEN(&iv);
}
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);
f |= f_lsr;
}
wl = DA_LEN(&iv);
@@
-437,7
+430,7
@@
mp *gfreduce_quadsolve(gfreduce *r, mp *d, mp *x)
}
MP_DROP(t);
MP_DROP(x);
}
MP_DROP(t);
MP_DROP(x);
- d->v[0] &= ~(mpw)1;
+
if (d)
d->v[0] &= ~(mpw)1;
return (d);
}
return (d);
}