diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-14 20:48:08 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-14 20:49:10 +0200 |
commit | 27973ecf8605f17aab82d23aee57ea8219929fb8 (patch) | |
tree | b8ca1cc7acb1c862027464e0bfa8c82887907fd2 /libtomcrypt | |
parent | 0201edca222dbfe408690b6b7fd0e9c34e6a02d9 (diff) | |
download | cryptodev-linux-27973ecf8605f17aab82d23aee57ea8219929fb8.tar.gz cryptodev-linux-27973ecf8605f17aab82d23aee57ea8219929fb8.tar.xz cryptodev-linux-27973ecf8605f17aab82d23aee57ea8219929fb8.zip |
use mp_int* instead of void*
Diffstat (limited to 'libtomcrypt')
-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); |