projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Keep numbers positive.
[u/mdw/catacomb]
/
bbs-jump.c
diff --git
a/bbs-jump.c
b/bbs-jump.c
index
629871d
..
428915d
100644
(file)
--- a/
bbs-jump.c
+++ b/
bbs-jump.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: bbs-jump.c,v 1.
1 1999/12/10 23:14:59
mdw Exp $
+ * $Id: bbs-jump.c,v 1.
4 2000/07/01 11:20:36
mdw Exp $
*
* Jumping around a BBS sequence
*
*
* Jumping around a BBS sequence
*
@@
-30,6
+30,15
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: bbs-jump.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: bbs-jump.c,v $
+ * Revision 1.4 2000/07/01 11:20:36 mdw
+ * Remove bad type name `bbs_param'.
+ *
+ * Revision 1.3 2000/06/17 10:44:17 mdw
+ * Typesetting fix.
+ *
+ * Revision 1.2 1999/12/22 15:52:08 mdw
+ * Rename `bbs_params' to `bbs_param' for consistency.
+ *
* Revision 1.1 1999/12/10 23:14:59 mdw
* Blum-Blum-Shub generator, and Blum-Goldwasser encryption.
*
* Revision 1.1 1999/12/10 23:14:59 mdw
* Blum-Blum-Shub generator, and Blum-Goldwasser encryption.
*
@@
-48,7
+57,7
@@
/* --- @jump@ --- *
*
* Arguments: @bbs *b@ = pointer to BBS generator context
/* --- @jump@ --- *
*
* Arguments: @bbs *b@ = pointer to BBS generator context
- * @bbs_p
arams
*bp@ = pointer to BBS modulus factors
+ * @bbs_p
riv
*bp@ = pointer to BBS modulus factors
* @unsigned long n@ = number of steps to move
* @mp *px@ = exponent mod @p@ for a one-step jump
* @mp *qx@ = exponent mod @q@ for a one-step jump
* @unsigned long n@ = number of steps to move
* @mp *px@ = exponent mod @p@ for a one-step jump
* @mp *qx@ = exponent mod @q@ for a one-step jump
@@
-74,7
+83,7
@@
*
* If you want to step the generator forwards, simply set
* %$px = qx = 2$%. If you want to step backwards, make
*
* If you want to step the generator forwards, simply set
* %$px = qx = 2$%. If you want to step backwards, make
- * %$px = (p + 1)/4$% and %$qx = (q + 1)/4
%$
. Note that, if
+ * %$px = (p + 1)/4$% and %$qx = (q + 1)/4
$%
. Note that, if
* %$x$% is a quadratic residue mod $%p$%, then
*
* %$(x^2) ^ {(p + 1)/4}$%
* %$x$% is a quadratic residue mod $%p$%, then
*
* %$(x^2) ^ {(p + 1)/4}$%
@@
-86,7
+95,7
@@
* %$p \equiv 3 \pmod 4$%.)
*/
* %$p \equiv 3 \pmod 4$%.)
*/
-static void jump(bbs *b, bbs_p
arams
*bp, unsigned long n,
+static void jump(bbs *b, bbs_p
riv
*bp, unsigned long n,
mp *px, mp *qx)
{
mp *ep, *eq;
mp *px, mp *qx)
{
mp *ep, *eq;
@@
-166,7
+175,7
@@
static void jump(bbs *b, bbs_params *bp, unsigned long n,
/* --- @bbs_ff@ --- *
*
* Arguments: @bbs *b@ = pointer to a BBS generator state
/* --- @bbs_ff@ --- *
*
* Arguments: @bbs *b@ = pointer to a BBS generator state
- * @bbs_p
arams
*bp@ = pointer to BBS modulus factors
+ * @bbs_p
riv
*bp@ = pointer to BBS modulus factors
* @unsigned long n@ = number of steps to make
*
* Returns: ---
* @unsigned long n@ = number of steps to make
*
* Returns: ---
@@
-176,7
+185,7
@@
static void jump(bbs *b, bbs_params *bp, unsigned long n,
* efficiently.
*/
* efficiently.
*/
-void bbs_ff(bbs *b, bbs_p
arams
*bp, unsigned long n)
+void bbs_ff(bbs *b, bbs_p
riv
*bp, unsigned long n)
{
jump(b, bp, n, MP_TWO, MP_TWO);
}
{
jump(b, bp, n, MP_TWO, MP_TWO);
}
@@
-184,7
+193,7
@@
void bbs_ff(bbs *b, bbs_params *bp, unsigned long n)
/* --- @bbs_rew@ --- *
*
* Arguments: @bbs *b@ = pointer to a BBS generator state
/* --- @bbs_rew@ --- *
*
* Arguments: @bbs *b@ = pointer to a BBS generator state
- * @bbs_p
arams
*bp@ = pointer to BBS modulus factors
+ * @bbs_p
riv
*bp@ = pointer to BBS modulus factors
* @unsigned long n@ = number of steps to make
*
* Returns: ---
* @unsigned long n@ = number of steps to make
*
* Returns: ---
@@
-194,7
+203,7
@@
void bbs_ff(bbs *b, bbs_params *bp, unsigned long n)
* at all.
*/
* at all.
*/
-void bbs_rew(bbs *b, bbs_p
arams
*bp, unsigned long n)
+void bbs_rew(bbs *b, bbs_p
riv
*bp, unsigned long n)
{
mp *px = mp_lsr(MP_NEW, bp->p, 2);
mp *qx = mp_lsr(MP_NEW, bp->q, 2);
{
mp *px = mp_lsr(MP_NEW, bp->p, 2);
mp *qx = mp_lsr(MP_NEW, bp->q, 2);
@@
-211,7
+220,7
@@
void bbs_rew(bbs *b, bbs_params *bp, unsigned long n)
static int verify(dstr *v)
{
static int verify(dstr *v)
{
- bbs_p
arams
bp;
+ bbs_p
riv
bp;
bbs b;
mp *x;
unsigned long n;
bbs b;
mp *x;
unsigned long n;