aboutsummaryrefslogtreecommitdiff
path: root/src/libsec/port/dsaprimes.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-04-01 19:24:03 +0000
committerrsc <devnull@localhost>2006-04-01 19:24:03 +0000
commitcbeb0b26e4c7caa8d1b47de791a7418dc20a4567 (patch)
treee0f7e445de1aa22a42ef873dc4b1118a8105ae93 /src/libsec/port/dsaprimes.c
parent226d80b8213821af0cbf092d1507c52b504fd368 (diff)
downloadplan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.gz
plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.bz2
plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.zip
Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
Diffstat (limited to 'src/libsec/port/dsaprimes.c')
-rw-r--r--src/libsec/port/dsaprimes.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsec/port/dsaprimes.c b/src/libsec/port/dsaprimes.c
index ff1dd5d8..72546f15 100644
--- a/src/libsec/port/dsaprimes.c
+++ b/src/libsec/port/dsaprimes.c
@@ -2,12 +2,12 @@
#include <mp.h>
#include <libsec.h>
-// NIST algorithm for generating DSA primes
-// Menezes et al (1997) Handbook of Applied Cryptography, p.151
-// q is a 160-bit prime; p is a 1024-bit prime; q divides p-1
+/* NIST algorithm for generating DSA primes */
+/* Menezes et al (1997) Handbook of Applied Cryptography, p.151 */
+/* q is a 160-bit prime; p is a 1024-bit prime; q divides p-1 */
-// arithmetic on unsigned ints mod 2**160, represented
-// as 20-byte, little-endian uchar array
+/* arithmetic on unsigned ints mod 2**160, represented */
+/* as 20-byte, little-endian uchar array */
static void
Hrand(uchar *s)
@@ -29,7 +29,7 @@ Hincr(uchar *s)
break;
}
-// this can run for quite a while; be patient
+/* this can run for quite a while; be patient */
void
DSAprimes(mpint *q, mpint *p, uchar seed[SHA1dlen])
{
@@ -58,7 +58,7 @@ forever:
Hs[19] |= 0x80;
letomp(Hs, 20, q);
}while(!probably_prime(q, 18));
- if(seed != nil) // allow skeptics to confirm computation
+ if(seed != nil) /* allow skeptics to confirm computation */
memmove(seed, s, SHA1dlen);
i = 0;
j = 2;