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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_sqrt.c b/src/lib/libcrypto/bn/bn_sqrt.c
index 9bbca4267a..3d9f017f59 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.15 2023/03/07 09:27:10 jsing Exp $ */ 1/* $OpenBSD: bn_sqrt.c,v 1.16 2023/03/27 10:25:02 tb 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/* ====================================================================
@@ -209,7 +209,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
209 if (!BN_mod_mul(x, x, t, p, ctx)) 209 if (!BN_mod_mul(x, x, t, p, ctx))
210 goto end; 210 goto end;
211 211
212 if (!BN_copy(ret, x)) 212 if (!bn_copy(ret, x))
213 goto end; 213 goto end;
214 err = 0; 214 err = 0;
215 goto vrfy; 215 goto vrfy;
@@ -217,7 +217,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
217 217
218 /* e > 2, so we really have to use the Tonelli/Shanks algorithm. 218 /* e > 2, so we really have to use the Tonelli/Shanks algorithm.
219 * First, find some y that is not a square. */ 219 * First, find some y that is not a square. */
220 if (!BN_copy(q, p)) /* use 'q' as temp */ 220 if (!bn_copy(q, p)) /* use 'q' as temp */
221 goto end; 221 goto end;
222 q->neg = 0; 222 q->neg = 0;
223 i = 2; 223 i = 2;
@@ -344,7 +344,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
344 */ 344 */
345 345
346 if (BN_is_one(b)) { 346 if (BN_is_one(b)) {
347 if (!BN_copy(ret, x)) 347 if (!bn_copy(ret, x))
348 goto end; 348 goto end;
349 err = 0; 349 err = 0;
350 goto vrfy; 350 goto vrfy;
@@ -368,7 +368,7 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
368 } 368 }
369 369
370 /* t := y^2^(e - i - 1) */ 370 /* t := y^2^(e - i - 1) */
371 if (!BN_copy(t, y)) 371 if (!bn_copy(t, y))
372 goto end; 372 goto end;
373 for (j = e - i - 1; j > 0; j--) { 373 for (j = e - i - 1; j > 0; j--) {
374 if (!BN_mod_sqr(t, t, p, ctx)) 374 if (!BN_mod_sqr(t, t, p, ctx))