projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copy attributes from parameter keys.
[u/mdw/catacomb]
/
bbs-jump.c
diff --git
a/bbs-jump.c
b/bbs-jump.c
index
629871d
..
135d048
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.
5 2004/04/08 01:36:15
mdw Exp $
*
* Jumping around a BBS sequence
*
*
* Jumping around a BBS sequence
*
@@
-27,14
+27,6
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: bbs-jump.c,v $
- * Revision 1.1 1999/12/10 23:14:59 mdw
- * Blum-Blum-Shub generator, and Blum-Goldwasser encryption.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include "bbs.h"
/*----- Header files ------------------------------------------------------*/
#include "bbs.h"
@@
-48,7
+40,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
+66,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
+78,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
+158,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
+168,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
+176,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
+186,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
+203,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;