projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modify `mprand' slightly. Add `mprand_range'.
[u/mdw/catacomb]
/
pgen.c
diff --git
a/pgen.c
b/pgen.c
index
a57c30a
..
e9a5e75
100644
(file)
--- a/
pgen.c
+++ b/
pgen.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: pgen.c,v 1.
2 1999/11/20 22:23:0
5 mdw Exp $
+ * $Id: pgen.c,v 1.
3 1999/12/10 23:28:3
5 mdw Exp $
*
* Finding and testing prime numbers
*
*
* Finding and testing prime numbers
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: pgen.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: pgen.c,v $
+ * Revision 1.3 1999/12/10 23:28:35 mdw
+ * Track suggested destination changes.
+ *
* Revision 1.2 1999/11/20 22:23:05 mdw
* Add multiply-and-add function for Diffie-Hellman safe prime generation.
*
* Revision 1.2 1999/11/20 22:23:05 mdw
* Add multiply-and-add function for Diffie-Hellman safe prime generation.
*
@@
-129,7
+132,8
@@
int pgen_step(pgen *p, mpw step)
/* --- Add the step on to the number --- */
/* --- Add the step on to the number --- */
- p->m = mp_modify(p->m, MP_LEN(p->m) + 1);
+ p->m = mp_split(p->m);
+ mp_ensure(p->m, MP_LEN(p->m) + 1);
mpx_uaddn(p->m->v, p->m->vl, step);
mp_shrink(p->m);
mpx_uaddn(p->m->v, p->m->vl, step);
mp_shrink(p->m);
@@
-323,6
+327,7
@@
static int verify(dstr *v)
mp_drop(m);
mp_drop(r);
pgen_destroy(&p);
mp_drop(m);
mp_drop(r);
pgen_destroy(&p);
+ assert(mparena_count(MPARENA_GLOBAL) == 0);
return (ok);
}
return (ok);
}