summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_mod.c
diff options
context:
space:
mode:
authorbeck <>2017-01-21 10:38:29 +0000
committerbeck <>2017-01-21 10:38:29 +0000
commitbce45cc241b51da39ead8b476c811b47d76ccc46 (patch)
treeec1232403b181357067d4ac6dc7124fb566c88d8 /src/lib/libcrypto/bn/bn_mod.c
parentba7dab5b77b1e4dd797dbe7a4c31b5f4cbea0cd7 (diff)
downloadopenbsd-bce45cc241b51da39ead8b476c811b47d76ccc46.tar.gz
openbsd-bce45cc241b51da39ead8b476c811b47d76ccc46.tar.bz2
openbsd-bce45cc241b51da39ead8b476c811b47d76ccc46.zip
Split out BN_div and BN_mod into ct and nonct versions for Internal use.
ok jsing@
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/bn/bn_mod.c6
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
218int 218int