diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_mont.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_mont.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index 3eb9913a9e..3496502435 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.24 2015/02/09 15:49:22 jsing Exp $ */ | 1 | /* $OpenBSD: bn_mont.c,v 1.25 2017/01/21 10:38:29 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 | * |
@@ -418,7 +418,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) | |||
418 | Ri->d[1] = BN_MASK2; | 418 | Ri->d[1] = BN_MASK2; |
419 | Ri->top = 2; | 419 | Ri->top = 2; |
420 | } | 420 | } |
421 | if (!BN_div(Ri, NULL, Ri, &tmod, ctx)) | 421 | if (!BN_div_ct(Ri, NULL, Ri, &tmod, ctx)) |
422 | goto err; | 422 | goto err; |
423 | /* Ni = (R*Ri-1)/N, | 423 | /* Ni = (R*Ri-1)/N, |
424 | * keep only couple of least significant words: */ | 424 | * keep only couple of least significant words: */ |
@@ -446,7 +446,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) | |||
446 | if (!BN_set_word(Ri, BN_MASK2)) | 446 | if (!BN_set_word(Ri, BN_MASK2)) |
447 | goto err; /* Ri-- (mod word size) */ | 447 | goto err; /* Ri-- (mod word size) */ |
448 | } | 448 | } |
449 | if (!BN_div(Ri, NULL, Ri, &tmod, ctx)) | 449 | if (!BN_div_ct(Ri, NULL, Ri, &tmod, ctx)) |
450 | goto err; | 450 | goto err; |
451 | /* Ni = (R*Ri-1)/N, | 451 | /* Ni = (R*Ri-1)/N, |
452 | * keep only least significant word: */ | 452 | * keep only least significant word: */ |
@@ -468,7 +468,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) | |||
468 | if (!BN_sub_word(Ri, 1)) | 468 | if (!BN_sub_word(Ri, 1)) |
469 | goto err; | 469 | goto err; |
470 | /* Ni = (R*Ri-1) / N */ | 470 | /* Ni = (R*Ri-1) / N */ |
471 | if (!BN_div(&(mont->Ni), NULL, Ri, &mont->N, ctx)) | 471 | if (!BN_div_ct(&(mont->Ni), NULL, Ri, &mont->N, ctx)) |
472 | goto err; | 472 | goto err; |
473 | } | 473 | } |
474 | #endif | 474 | #endif |
@@ -477,7 +477,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) | |||
477 | BN_zero(&(mont->RR)); | 477 | BN_zero(&(mont->RR)); |
478 | if (!BN_set_bit(&(mont->RR), mont->ri*2)) | 478 | if (!BN_set_bit(&(mont->RR), mont->ri*2)) |
479 | goto err; | 479 | goto err; |
480 | if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx)) | 480 | if (!BN_mod_ct(&(mont->RR), &(mont->RR), &(mont->N), ctx)) |
481 | goto err; | 481 | goto err; |
482 | 482 | ||
483 | ret = 1; | 483 | ret = 1; |