summaryrefslogtreecommitdiff
path: root/lib/libcrypto/bn/bn_mont.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2002-06-07 03:45:35 +0000
committerBob Beck <beck@cvs.openbsd.org>2002-06-07 03:45:35 +0000
commitff121e423efd3c611e74f00bc681230532d543d7 (patch)
treeb699b77cb7d8375af148ae64ef32410f3fa82e93 /lib/libcrypto/bn/bn_mont.c
parentd638bbbd4d30397af50fadfd5f2bb4bb609f04f0 (diff)
Merge OpenSSL 0.9.7-stable-20020605,
correctly autogenerate obj_mac.h
Diffstat (limited to 'lib/libcrypto/bn/bn_mont.c')
-rw-r--r--lib/libcrypto/bn/bn_mont.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/bn/bn_mont.c b/lib/libcrypto/bn/bn_mont.c
index 82942a47592..c9ebdbaabeb 100644
--- a/lib/libcrypto/bn/bn_mont.c
+++ b/lib/libcrypto/bn/bn_mont.c
@@ -221,7 +221,7 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
if (!BN_mul(t1,t2,&mont->N,ctx)) goto err;
if (!BN_add(t2,a,t1)) goto err;
- BN_rshift(ret,t2,mont->ri);
+ if (!BN_rshift(ret,t2,mont->ri)) goto err;
#endif /* MONT_WORD */
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)
BN_ULONG buf[2];
mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2;
- BN_zero(R);
- BN_set_bit(R,BN_BITS2); /* R */
+ if (!(BN_zero(R))) goto err;
+ if (!(BN_set_bit(R,BN_BITS2))) goto err; /* R */
buf[0]=mod->d[0]; /* tmod = N mod word size */
buf[1]=0;