~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/mpx-mul4-*.S: Use more portable type syntax for ambiguous instructions.
[catacomb]
/
pub
/
bbs-gen.c
diff --git
a/pub/bbs-gen.c
b/pub/bbs-gen.c
index
d2b4b6e
..
6ec65e2
100644
(file)
--- a/
pub/bbs-gen.c
+++ b/
pub/bbs-gen.c
@@
-98,11
+98,14
@@
int bbs_gen(bbs_priv *bp, unsigned nbits, grand *r, unsigned n,
/* --- Compute @n@ --- */
bp->n = mp_mul(MP_NEW, bp->p, bp->q);
/* --- Compute @n@ --- */
bp->n = mp_mul(MP_NEW, bp->p, bp->q);
+ if (mp_bits(bp->n) != nbits) goto fail_n;
mp_drop(x);
return (PGEN_DONE);
/* --- Tidy up if things went wrong --- */
mp_drop(x);
return (PGEN_DONE);
/* --- Tidy up if things went wrong --- */
+fail_n:
+ mp_drop(bp->n);
fail_q:
mp_drop(bp->p);
fail_p:
fail_q:
mp_drop(bp->p);
fail_p: