projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
General robustification.
[u/mdw/catacomb]
/
gfreduce.c
diff --git
a/gfreduce.c
b/gfreduce.c
index
819c276
..
4f07ccf
100644
(file)
--- a/
gfreduce.c
+++ b/
gfreduce.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: gfreduce.c,v 1.
2 2004/03/21 22:52:0
6 mdw Exp $
+ * $Id: gfreduce.c,v 1.
4 2004/03/27 00:04:4
6 mdw Exp $
*
* Efficient reduction modulo sparse binary polynomials
*
*
* Efficient reduction modulo sparse binary polynomials
*
@@
-30,6
+30,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: gfreduce.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: gfreduce.c,v $
+ * Revision 1.4 2004/03/27 00:04:46 mdw
+ * Implement efficient reduction for pleasant-looking primes.
+ *
+ * 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.2 2004/03/21 22:52:06 mdw
* Merge and close elliptic curve branch.
*
@@
-95,7
+101,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;
@@
-159,8
+166,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);
@@
-440,7
+447,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);
}