diff options
-rw-r--r-- | libtomcrypt/headers/tomcrypt_pk.h | 2 | ||||
-rw-r--r-- | libtomcrypt/math/rand_prime.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libtomcrypt/headers/tomcrypt_pk.h b/libtomcrypt/headers/tomcrypt_pk.h index 6d6f32f..c8279ff 100644 --- a/libtomcrypt/headers/tomcrypt_pk.h +++ b/libtomcrypt/headers/tomcrypt_pk.h @@ -5,7 +5,7 @@ enum { PK_PRIVATE=1 }; -int rand_prime(void *N, long len); +int rand_prime(mp_int *N, long len); /* ---- RSA ---- */ #ifdef LTC_MRSA diff --git a/libtomcrypt/math/rand_prime.c b/libtomcrypt/math/rand_prime.c index 43c7603..d48653a 100644 --- a/libtomcrypt/math/rand_prime.c +++ b/libtomcrypt/math/rand_prime.c @@ -17,7 +17,7 @@ #define USE_BBS 1 -int rand_prime(void *N, long len) +int rand_prime(mp_int *N, long len) { int err, res, type; unsigned char *buf; @@ -36,7 +36,7 @@ int rand_prime(void *N, long len) if (len < 2 || len > 512) { return CRYPT_INVALID_PRIME_SIZE; } - + /* allocate buffer to work with */ buf = XCALLOC(1, len); if (buf == NULL) { @@ -50,7 +50,7 @@ int rand_prime(void *N, long len) /* munge bits */ buf[0] |= 0x80 | 0x40; buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00); - + /* load value */ if ((err = mp_read_unsigned_bin(N, buf, len)) != CRYPT_OK) { XFREE(buf); |