summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_sqrt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_sqrt.c')
-rw-r--r--src/lib/libcrypto/bn/bn_sqrt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/bn_sqrt.c b/src/lib/libcrypto/bn/bn_sqrt.c
index 5928dfc79d..8514f23a27 100644
--- a/src/lib/libcrypto/bn/bn_sqrt.c
+++ b/src/lib/libcrypto/bn/bn_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqrt.c,v 1.8 2017/01/21 09:38:58 beck Exp $ */ 1/* $OpenBSD: bn_sqrt.c,v 1.9 2017/01/29 17:49:22 beck Exp $ */
2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * and Bodo Moeller for the OpenSSL project. */ 3 * and Bodo Moeller for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -89,7 +89,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
89 return ret; 89 return ret;
90 } 90 }
91 91
92 BNerr(BN_F_BN_MOD_SQRT, BN_R_P_IS_NOT_PRIME); 92 BNerror(BN_R_P_IS_NOT_PRIME);
93 return (NULL); 93 return (NULL);
94 } 94 }
95 95
@@ -250,7 +250,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
250 goto end; 250 goto end;
251 if (r == 0) { 251 if (r == 0) {
252 /* m divides p */ 252 /* m divides p */
253 BNerr(BN_F_BN_MOD_SQRT, BN_R_P_IS_NOT_PRIME); 253 BNerror(BN_R_P_IS_NOT_PRIME);
254 goto end; 254 goto end;
255 } 255 }
256 } 256 }
@@ -262,7 +262,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
262 * Even if p is not prime, we should have found some y 262 * Even if p is not prime, we should have found some y
263 * such that r == -1. 263 * such that r == -1.
264 */ 264 */
265 BNerr(BN_F_BN_MOD_SQRT, BN_R_TOO_MANY_ITERATIONS); 265 BNerror(BN_R_TOO_MANY_ITERATIONS);
266 goto end; 266 goto end;
267 } 267 }
268 268
@@ -275,7 +275,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
275 if (!BN_mod_exp_ct(y, y, q, p, ctx)) 275 if (!BN_mod_exp_ct(y, y, q, p, ctx))
276 goto end; 276 goto end;
277 if (BN_is_one(y)) { 277 if (BN_is_one(y)) {
278 BNerr(BN_F_BN_MOD_SQRT, BN_R_P_IS_NOT_PRIME); 278 BNerror(BN_R_P_IS_NOT_PRIME);
279 goto end; 279 goto end;
280 } 280 }
281 281
@@ -359,7 +359,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
359 while (!BN_is_one(t)) { 359 while (!BN_is_one(t)) {
360 i++; 360 i++;
361 if (i == e) { 361 if (i == e) {
362 BNerr(BN_F_BN_MOD_SQRT, BN_R_NOT_A_SQUARE); 362 BNerror(BN_R_NOT_A_SQUARE);
363 goto end; 363 goto end;
364 } 364 }
365 if (!BN_mod_mul(t, t, t, p, ctx)) 365 if (!BN_mod_mul(t, t, t, p, ctx))
@@ -392,7 +392,7 @@ vrfy:
392 err = 1; 392 err = 1;
393 393
394 if (!err && 0 != BN_cmp(x, A)) { 394 if (!err && 0 != BN_cmp(x, A)) {
395 BNerr(BN_F_BN_MOD_SQRT, BN_R_NOT_A_SQUARE); 395 BNerror(BN_R_NOT_A_SQUARE);
396 err = 1; 396 err = 1;
397 } 397 }
398 } 398 }