summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-01-21 15:45:13 +0000
committertb <>2025-01-21 15:45:13 +0000
commit97a1e4556e358ccbb109b1616615061cd9777905 (patch)
treea547d6846f5640c98cfd6cd350b4ceb4fbee65d1 /src
parentbc6dc1ff28111bbeaccd1e4fbf2ba86016af9563 (diff)
downloadopenbsd-97a1e4556e358ccbb109b1616615061cd9777905.tar.gz
openbsd-97a1e4556e358ccbb109b1616615061cd9777905.tar.bz2
openbsd-97a1e4556e358ccbb109b1616615061cd9777905.zip
bn_test: use BN_RECP_CTX_create() rather than _new()/_set()
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/bn/bn_test.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_test.c b/src/regress/lib/libcrypto/bn/bn_test.c
index f73799b3a8..d3fe485ec8 100644
--- a/src/regress/lib/libcrypto/bn/bn_test.c
+++ b/src/regress/lib/libcrypto/bn/bn_test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_test.c,v 1.19 2023/04/25 17:17:21 tb Exp $ */ 1/* $OpenBSD: bn_test.c,v 1.20 2025/01/21 15:45:13 tb 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 *
@@ -581,9 +581,6 @@ test_div_recp(BIO *bp, BN_CTX *ctx)
581 if ((e = BN_CTX_get(ctx)) == NULL) 581 if ((e = BN_CTX_get(ctx)) == NULL)
582 goto err; 582 goto err;
583 583
584 if ((recp = BN_RECP_CTX_new()) == NULL)
585 goto err;
586
587 for (i = 0; i < num0 + num1; i++) { 584 for (i = 0; i < num0 + num1; i++) {
588 if (i < num1) { 585 if (i < num1) {
589 CHECK_GOTO(BN_bntest_rand(a, 400, 0, 0)); 586 CHECK_GOTO(BN_bntest_rand(a, 400, 0, 0));
@@ -594,7 +591,8 @@ test_div_recp(BIO *bp, BN_CTX *ctx)
594 CHECK_GOTO(BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0)); 591 CHECK_GOTO(BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0));
595 BN_set_negative(a, rand_neg()); 592 BN_set_negative(a, rand_neg());
596 BN_set_negative(b, rand_neg()); 593 BN_set_negative(b, rand_neg());
597 CHECK_GOTO(BN_RECP_CTX_set(recp, b, ctx)); 594 BN_RECP_CTX_free(recp);
595 CHECK_GOTO(recp = BN_RECP_CTX_create(b));
598 CHECK_GOTO(BN_div_recp(d, c, a, recp, ctx)); 596 CHECK_GOTO(BN_div_recp(d, c, a, recp, ctx));
599 if (bp != NULL) { 597 if (bp != NULL) {
600 if (!results) { 598 if (!results) {