summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_mont.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_mont.c')
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 3496502435..eeac046826 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.25 2017/01/21 10:38:29 beck Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.26 2017/01/21 11:00:46 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -400,7 +400,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
400 if ((buf[1] = mod->top > 1 ? mod->d[1] : 0)) 400 if ((buf[1] = mod->top > 1 ? mod->d[1] : 0))
401 tmod.top = 2; 401 tmod.top = 2;
402 402
403 if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) 403 if ((BN_mod_inverse_ct(Ri, R, &tmod, ctx)) == NULL)
404 goto err; 404 goto err;
405 if (!BN_lshift(Ri, Ri, 2 * BN_BITS2)) 405 if (!BN_lshift(Ri, Ri, 2 * BN_BITS2))
406 goto err; /* R*Ri */ 406 goto err; /* R*Ri */
@@ -433,7 +433,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
433 buf[1] = 0; 433 buf[1] = 0;
434 tmod.top = buf[0] != 0 ? 1 : 0; 434 tmod.top = buf[0] != 0 ? 1 : 0;
435 /* Ri = R^-1 mod N*/ 435 /* Ri = R^-1 mod N*/
436 if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) 436 if ((BN_mod_inverse_ct(Ri, R, &tmod, ctx)) == NULL)
437 goto err; 437 goto err;
438 if (!BN_lshift(Ri, Ri, BN_BITS2)) 438 if (!BN_lshift(Ri, Ri, BN_BITS2))
439 goto err; /* R*Ri */ 439 goto err; /* R*Ri */
@@ -461,7 +461,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
461 if (!BN_set_bit(R, mont->ri)) 461 if (!BN_set_bit(R, mont->ri))
462 goto err; /* R = 2^ri */ 462 goto err; /* R = 2^ri */
463 /* Ri = R^-1 mod N*/ 463 /* Ri = R^-1 mod N*/
464 if ((BN_mod_inverse(Ri, R, &mont->N, ctx)) == NULL) 464 if ((BN_mod_inverse_ct(Ri, R, &mont->N, ctx)) == NULL)
465 goto err; 465 goto err;
466 if (!BN_lshift(Ri, Ri, mont->ri)) 466 if (!BN_lshift(Ri, Ri, mont->ri))
467 goto err; /* R*Ri */ 467 goto err; /* R*Ri */