projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change name for S-box header file.
[u/mdw/catacomb]
/
bbs-jump.c
diff --git
a/bbs-jump.c
b/bbs-jump.c
index
629871d
..
fe2787a
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.
3 2000/06/17 10:44:17
mdw Exp $
*
* Jumping around a BBS sequence
*
*
* Jumping around a BBS sequence
*
@@
-30,6
+30,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: bbs-jump.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: bbs-jump.c,v $
+ * 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
+54,7
@@
/* --- @jump@ --- *
*
* Arguments: @bbs *b@ = pointer to BBS generator context
/* --- @jump@ --- *
*
* Arguments: @bbs *b@ = pointer to BBS generator context
- * @bbs_param
s
*bp@ = pointer to BBS modulus factors
+ * @bbs_param *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
+80,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
+92,7
@@
* %$p \equiv 3 \pmod 4$%.)
*/
* %$p \equiv 3 \pmod 4$%.)
*/
-static void jump(bbs *b, bbs_param
s
*bp, unsigned long n,
+static void jump(bbs *b, bbs_param *bp, unsigned long n,
mp *px, mp *qx)
{
mp *ep, *eq;
mp *px, mp *qx)
{
mp *ep, *eq;
@@
-166,7
+172,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_param
s
*bp@ = pointer to BBS modulus factors
+ * @bbs_param *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
+182,7
@@
static void jump(bbs *b, bbs_params *bp, unsigned long n,
* efficiently.
*/
* efficiently.
*/
-void bbs_ff(bbs *b, bbs_param
s
*bp, unsigned long n)
+void bbs_ff(bbs *b, bbs_param *bp, unsigned long n)
{
jump(b, bp, n, MP_TWO, MP_TWO);
}
{
jump(b, bp, n, MP_TWO, MP_TWO);
}
@@
-184,7
+190,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_param
s
*bp@ = pointer to BBS modulus factors
+ * @bbs_param *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
+200,7
@@
void bbs_ff(bbs *b, bbs_params *bp, unsigned long n)
* at all.
*/
* at all.
*/
-void bbs_rew(bbs *b, bbs_param
s
*bp, unsigned long n)
+void bbs_rew(bbs *b, bbs_param *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
+217,7
@@
void bbs_rew(bbs *b, bbs_params *bp, unsigned long n)
static int verify(dstr *v)
{
static int verify(dstr *v)
{
- bbs_param
s
bp;
+ bbs_param bp;
bbs b;
mp *x;
unsigned long n;
bbs b;
mp *x;
unsigned long n;