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_mod.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_mod.c')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_mod.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_mod.c b/src/lib/libcrypto/bn/bn_mod.c index eb2d5b072e..4c30c098d4 100644 --- a/src/lib/libcrypto/bn/bn_mod.c +++ b/src/lib/libcrypto/bn/bn_mod.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_mod.c,v 1.10 2016/11/05 10:47:16 miod Exp $ */ | 1 | /* $OpenBSD: bn_mod.c,v 1.11 2017/01/21 10:38:29 beck Exp $ */ |
| 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> | 2 | /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> |
| 3 | * for the OpenSSL project. */ | 3 | * for the OpenSSL project. */ |
| 4 | /* ==================================================================== | 4 | /* ==================================================================== |
| @@ -121,7 +121,7 @@ BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) | |||
| 121 | /* like BN_mod, but returns non-negative remainder | 121 | /* like BN_mod, but returns non-negative remainder |
| 122 | * (i.e., 0 <= r < |d| always holds) */ | 122 | * (i.e., 0 <= r < |d| always holds) */ |
| 123 | 123 | ||
| 124 | if (!(BN_mod(r, m,d, ctx))) | 124 | if (!(BN_mod_ct(r, m,d, ctx))) |
| 125 | return 0; | 125 | return 0; |
| 126 | if (!r->neg) | 126 | if (!r->neg) |
| 127 | return 1; | 127 | return 1; |
| @@ -212,7 +212,7 @@ BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) | |||
| 212 | if (!BN_sqr(r, a, ctx)) | 212 | if (!BN_sqr(r, a, ctx)) |
| 213 | return 0; | 213 | return 0; |
| 214 | /* r->neg == 0, thus we don't need BN_nnmod */ | 214 | /* r->neg == 0, thus we don't need BN_nnmod */ |
| 215 | return BN_mod(r, r, m, ctx); | 215 | return BN_mod_ct(r, r, m, ctx); |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | int | 218 | int |
