diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/bn/bn_mont.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index 82942a4759..c9ebdbaabe 100644 --- a/src/lib/libcrypto/bn/bn_mont.c +++ b/src/lib/libcrypto/bn/bn_mont.c | |||
@@ -221,7 +221,7 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, | |||
221 | 221 | ||
222 | if (!BN_mul(t1,t2,&mont->N,ctx)) goto err; | 222 | if (!BN_mul(t1,t2,&mont->N,ctx)) goto err; |
223 | if (!BN_add(t2,a,t1)) goto err; | 223 | if (!BN_add(t2,a,t1)) goto err; |
224 | BN_rshift(ret,t2,mont->ri); | 224 | if (!BN_rshift(ret,t2,mont->ri)) goto err; |
225 | #endif /* MONT_WORD */ | 225 | #endif /* MONT_WORD */ |
226 | 226 | ||
227 | if (BN_ucmp(ret, &(mont->N)) >= 0) | 227 | if (BN_ucmp(ret, &(mont->N)) >= 0) |
@@ -282,8 +282,8 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) | |||
282 | BN_ULONG buf[2]; | 282 | BN_ULONG buf[2]; |
283 | 283 | ||
284 | mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2; | 284 | mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2; |
285 | BN_zero(R); | 285 | if (!(BN_zero(R))) goto err; |
286 | BN_set_bit(R,BN_BITS2); /* R */ | 286 | if (!(BN_set_bit(R,BN_BITS2))) goto err; /* R */ |
287 | 287 | ||
288 | buf[0]=mod->d[0]; /* tmod = N mod word size */ | 288 | buf[0]=mod->d[0]; /* tmod = N mod word size */ |
289 | buf[1]=0; | 289 | buf[1]=0; |