summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-02-13 11:10:01 +0000
committertb <>2025-02-13 11:10:01 +0000
commit9f74244c49777c6372916bb15863377b2ca08bb1 (patch)
tree29a9522e273d47bbc123a3a98f1da84ee43f7b9c
parentf307469b52e7ab66fc7c5acb93cf47fa6b32d3e5 (diff)
downloadopenbsd-9f74244c49777c6372916bb15863377b2ca08bb1.tar.gz
openbsd-9f74244c49777c6372916bb15863377b2ca08bb1.tar.bz2
openbsd-9f74244c49777c6372916bb15863377b2ca08bb1.zip
Convert BPSW to BN_MONT_CTX_create()
ok jsing
-rw-r--r--src/lib/libcrypto/bn/bn_bpsw.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bn/bn_bpsw.c b/src/lib/libcrypto/bn/bn_bpsw.c
index 14f2800ad3..04db17b527 100644
--- a/src/lib/libcrypto/bn/bn_bpsw.c
+++ b/src/lib/libcrypto/bn/bn_bpsw.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_bpsw.c,v 1.11 2023/08/03 18:53:55 tb Exp $ */ 1/* $OpenBSD: bn_bpsw.c,v 1.12 2025/02/13 11:10:01 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr> 3 * Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr>
4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -426,10 +426,7 @@ bn_miller_rabin(int *is_pseudoprime, const BIGNUM *n, BN_CTX *ctx,
426 * Montgomery setup for n. 426 * Montgomery setup for n.
427 */ 427 */
428 428
429 if ((mctx = BN_MONT_CTX_new()) == NULL) 429 if ((mctx = BN_MONT_CTX_create(n, ctx)) == NULL)
430 goto err;
431
432 if (!BN_MONT_CTX_set(mctx, n, ctx))
433 goto err; 430 goto err;
434 431
435 /* 432 /*