diff options
author | jbj <devnull@localhost> | 2002-05-13 22:45:30 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-05-13 22:45:30 +0000 |
commit | bc9d22eeb9034966654091306e3e3fc9a9dd7c71 (patch) | |
tree | 67b38378c5b6c5f4c742df1b215b43d65fb23077 /beecrypt | |
parent | f9f1064dc0681321e13d240b193895ecc7d6d5cf (diff) | |
download | rpm-bc9d22eeb9034966654091306e3e3fc9a9dd7c71.tar.gz rpm-bc9d22eeb9034966654091306e3e3fc9a9dd7c71.tar.bz2 rpm-bc9d22eeb9034966654091306e3e3fc9a9dd7c71.zip |
AIX fiddles (Albert Chin <rpm-list@thewrittenword.com>).
CVS patchset: 5434
CVS date: 2002/05/13 22:45:30
Diffstat (limited to 'beecrypt')
-rw-r--r-- | beecrypt/base64.c | 2 | ||||
-rw-r--r-- | beecrypt/base64.h | 2 | ||||
-rw-r--r-- | beecrypt/dsa.c | 34 |
3 files changed, 19 insertions, 19 deletions
diff --git a/beecrypt/base64.c b/beecrypt/base64.c index 15103eec7..632445ffa 100644 --- a/beecrypt/base64.c +++ b/beecrypt/base64.c @@ -328,7 +328,7 @@ fprintf(stderr, "%7u %02x %02x %02x -> %02x %02x %02x %02x\n", #define CRC24_INIT 0xb704ceL #define CRC24_POLY 0x1864cfbL -char * b64crc (const void * data, int ns) +char * b64crc (const unsigned char * data, int ns) { const unsigned char *s = data; uint32 crc = CRC24_INIT; diff --git a/beecrypt/base64.h b/beecrypt/base64.h index b2fe50e19..30745a22b 100644 --- a/beecrypt/base64.h +++ b/beecrypt/base64.h @@ -78,7 +78,7 @@ char * b64encode (const void * data, int ns) * @return (malloc'd) base64 string */ BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/ -char * b64crc (const void * data, int ns) +char * b64crc (const unsigned char * data, int ns) /*@*/; /** diff --git a/beecrypt/dsa.c b/beecrypt/dsa.c index 8497035cf..f006300db 100644 --- a/beecrypt/dsa.c +++ b/beecrypt/dsa.c @@ -54,8 +54,8 @@ int dsasign(const mp32barrett* p, const mp32barrett* q, const mp32number* g, ran { register uint32 psize = p->size; register uint32 qsize = q->size; - // k + inv(k) = 2 * qsize - // g^k mod p = psize+4*psize+2 + /* k + inv(k) = 2 * qsize */ + /* g^k mod p = psize+4*psize+2 */ register uint32* ptemp; register uint32* qtemp; @@ -74,11 +74,11 @@ int dsasign(const mp32barrett* p, const mp32barrett* q, const mp32number* g, ran register uint32* pwksp = ptemp+psize; register uint32* qwksp = qtemp+3*qsize; - // allocate r + /* allocate r */ mp32nfree(r); mp32nsize(r, qsize); - // get a random k, invertible modulo q + /* get a random k, invertible modulo q */ mp32brndinv_w(q, rgc, qtemp, qtemp+qsize, qwksp); #if 0 @@ -92,24 +92,24 @@ int dsasign(const mp32barrett* p, const mp32barrett* q, const mp32number* g, ran mp32binv_w(q, qsize, qtemp, qtemp+qsize, qwksp); #endif - // g^k mod p + /* g^k mod p */ mp32bpowmod_w(p, g->size, g->data, qsize, qtemp, ptemp, pwksp); - // (g^k mod p) mod q - simple modulo + /* (g^k mod p) mod q - simple modulo */ mp32nmod(qtemp+2*qsize, psize, ptemp, qsize, q->modl, pwksp); mp32copy(qsize, r->data, qtemp+psize+qsize); - // allocate s + /* allocate s */ mp32nfree(s); mp32nsize(s, qsize); - // x*r mod q + /* x*r mod q */ mp32bmulmod_w(q, x->size, x->data, r->size, r->data, qtemp, qwksp); - // add h(m) mod q + /* add h(m) mod q */ mp32baddmod_w(q, qsize, qtemp, hm->size, hm->data, qtemp+2*qsize, qwksp); - // multiply inv(k) mod q + /* multiply inv(k) mod q */ mp32bmulmod_w(q, qsize, qtemp+qsize, qsize, qtemp+2*qsize, s->data, qwksp); rc = 0; @@ -162,49 +162,49 @@ fprintf(stderr, "\t r: "), mp32println(stderr, r->size, r->data) fprintf(stderr, "\t s: "), mp32println(stderr, s->size, s->data); /*@=modfilesys@*/ } - // compute w = inv(s) mod q + /* compute w = inv(s) mod q */ if (mp32binv_w(q, s->size, s->data, qtemp, qwksp)) { /*@-modfilesys@*/ if (_debug) fprintf(stderr, "\t w = inv(s) mod q: "), mp32println(stderr, qsize, qtemp); /*@=modfilesys@*/ - // compute u1 = h(m)*w mod q + /* compute u1 = h(m)*w mod q */ mp32bmulmod_w(q, hm->size, hm->data, qsize, qtemp, qtemp+qsize, qwksp); /*@-modfilesys@*/ if (_debug) fprintf(stderr, "\tu1 = h(m)*w mod q: "), mp32println(stderr, qsize, qtemp+qsize); /*@=modfilesys@*/ - // compute u2 = r*w mod q + /* compute u2 = r*w mod q */ mp32bmulmod_w(q, r->size, r->data, qsize, qtemp, qtemp, qwksp); /*@-modfilesys@*/ if (_debug) fprintf(stderr, "\tu2 = r*w mod q : "), mp32println(stderr, qsize, qtemp); /*@=modfilesys@*/ - // compute g^u1 mod p + /* compute g^u1 mod p */ mp32bpowmod_w(p, g->size, g->data, qsize, qtemp+qsize, ptemp, pwksp); /*@-modfilesys@*/ if (_debug) fprintf(stderr, "\t g^u1 mod p: "), mp32println(stderr, psize, ptemp); /*@=modfilesys@*/ - // compute y^u2 mod p + /* compute y^u2 mod p */ mp32bpowmod_w(p, y->size, y->data, qsize, qtemp, ptemp+psize, pwksp); /*@-modfilesys@*/ if (_debug) fprintf(stderr, "\t y^u2 mod p: "), mp32println(stderr, psize, ptemp+psize); /*@=modfilesys@*/ - // multiply mod p + /* multiply mod p */ mp32bmulmod_w(p, psize, ptemp, psize, ptemp+psize, ptemp, pwksp); /*@-modfilesys@*/ if (_debug) fprintf(stderr, "\t multiply mod p: "), mp32println(stderr, psize, ptemp); /*@=modfilesys@*/ - // modulo q + /* modulo q */ mp32nmod(ptemp+psize, psize, ptemp, qsize, q->modl, pwksp); /*@-modfilesys@*/ if (_debug) |