summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_prime.c
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-05-20 01:43:07 +0000
committerUlf Möller <ulf@openssl.org>1999-05-20 01:43:07 +0000
commite14d4443a27816b05b044350ad39cd15668c55b8 (patch)
tree4f3baea5f0c59bcbe5a1f359113d7f1b4ef32fd7 /crypto/bn/bn_prime.c
parent257e206da6b42181b0dc8976792164c4d9cff89b (diff)
Bignum library bug fix. IRIX 6 passes "make test" now!
This also avoids the problems with SC4.2 and unpatched SC5. Submitted by: Andy Polyakov <appro@fy.chalmers.se>
Diffstat (limited to 'crypto/bn/bn_prime.c')
-rw-r--r--crypto/bn/bn_prime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c
index 28610766d0..118eb35159 100644
--- a/crypto/bn/bn_prime.c
+++ b/crypto/bn/bn_prime.c
@@ -319,7 +319,7 @@ static int probable_prime_dh(BIGNUM *rnd, int bits, BIGNUM *add, BIGNUM *rem,
loop: for (i=1; i<NUMPRIMES; i++)
{
/* check that rnd is a prime */
- if (BN_mod_word(rnd,(BN_LONG)primes[i]) <= 1)
+ if (BN_mod_word(rnd,(BN_ULONG)primes[i]) <= 1)
{
if (!BN_add(rnd,rnd,add)) goto err;
goto loop;
@@ -366,8 +366,8 @@ static int probable_prime_dh_strong(BIGNUM *p, int bits, BIGNUM *padd,
/* check that p and q are prime */
/* check that for p and q
* gcd(p-1,primes) == 1 (except for 2) */
- if ( (BN_mod_word(p,(BN_LONG)primes[i]) == 0) ||
- (BN_mod_word(q,(BN_LONG)primes[i]) == 0))
+ if ( (BN_mod_word(p,(BN_ULONG)primes[i]) == 0) ||
+ (BN_mod_word(q,(BN_ULONG)primes[i]) == 0))
{
if (!BN_add(p,p,padd)) goto err;
if (!BN_add(q,q,qadd)) goto err;