diff options
| author | beck <> | 2017-01-21 10:38:29 +0000 |
|---|---|---|
| committer | beck <> | 2017-01-21 10:38:29 +0000 |
| commit | 55a172a1ed5b0cd8f7de3628fcc2e56df6716d59 (patch) | |
| tree | ec1232403b181357067d4ac6dc7124fb566c88d8 /src/lib/libcrypto/bn/bn_exp2.c | |
| parent | a0a595cda97de2b217b0582cfa601ee4c746bfce (diff) | |
| download | openbsd-55a172a1ed5b0cd8f7de3628fcc2e56df6716d59.tar.gz openbsd-55a172a1ed5b0cd8f7de3628fcc2e56df6716d59.tar.bz2 openbsd-55a172a1ed5b0cd8f7de3628fcc2e56df6716d59.zip | |
Split out BN_div and BN_mod into ct and nonct versions for Internal use.
ok jsing@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_exp2.c')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_exp2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp2.c b/src/lib/libcrypto/bn/bn_exp2.c index 38bf467a38..1d938d3818 100644 --- a/src/lib/libcrypto/bn/bn_exp2.c +++ b/src/lib/libcrypto/bn/bn_exp2.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_exp2.c,v 1.10 2015/02/09 15:49:22 jsing Exp $ */ | 1 | /* $OpenBSD: bn_exp2.c,v 1.11 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 | * |
| @@ -175,7 +175,7 @@ BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, | |||
| 175 | * Build table for a1: val1[i] := a1^(2*i + 1) mod m for i = 0 .. 2^(window1-1) | 175 | * Build table for a1: val1[i] := a1^(2*i + 1) mod m for i = 0 .. 2^(window1-1) |
| 176 | */ | 176 | */ |
| 177 | if (a1->neg || BN_ucmp(a1, m) >= 0) { | 177 | if (a1->neg || BN_ucmp(a1, m) >= 0) { |
| 178 | if (!BN_mod(val1[0], a1, m, ctx)) | 178 | if (!BN_mod_ct(val1[0], a1, m, ctx)) |
| 179 | goto err; | 179 | goto err; |
| 180 | a_mod_m = val1[0]; | 180 | a_mod_m = val1[0]; |
| 181 | } else | 181 | } else |
| @@ -206,7 +206,7 @@ BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, | |||
| 206 | * Build table for a2: val2[i] := a2^(2*i + 1) mod m for i = 0 .. 2^(window2-1) | 206 | * Build table for a2: val2[i] := a2^(2*i + 1) mod m for i = 0 .. 2^(window2-1) |
| 207 | */ | 207 | */ |
| 208 | if (a2->neg || BN_ucmp(a2, m) >= 0) { | 208 | if (a2->neg || BN_ucmp(a2, m) >= 0) { |
| 209 | if (!BN_mod(val2[0], a2, m, ctx)) | 209 | if (!BN_mod_ct(val2[0], a2, m, ctx)) |
| 210 | goto err; | 210 | goto err; |
| 211 | a_mod_m = val2[0]; | 211 | a_mod_m = val2[0]; |
| 212 | } else | 212 | } else |
