summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_local.h
diff options
context:
space:
mode:
authortb <>2025-02-13 11:04:20 +0000
committertb <>2025-02-13 11:04:20 +0000
commitade8722cf772f75a9dd24ace7878bf2f0730171c (patch)
tree6331480d1d99f90f319b23c696f38c97cf3908da /src/lib/libcrypto/bn/bn_local.h
parent70b5e4a9ddfad29232b45bb7cfe175cb06edf1a7 (diff)
downloadopenbsd-ade8722cf772f75a9dd24ace7878bf2f0730171c.tar.gz
openbsd-ade8722cf772f75a9dd24ace7878bf2f0730171c.tar.bz2
openbsd-ade8722cf772f75a9dd24ace7878bf2f0730171c.zip
bn: add internal BN_MONT_CTX_create()
This does what the public BN_MONT_CTX_new() should have done in the first place rather than doing the toolkit thing of returning an invalid object that you need to figure out how to populate and with what because the docs are abysmal. It takes the required arguments and calls BN_MONT_CTX_set(), which all callers do immediately after _new() (except for DSA which managed to squeeze 170 lines of garbage between the two calls). ok jsing
Diffstat (limited to 'src/lib/libcrypto/bn/bn_local.h')
-rw-r--r--src/lib/libcrypto/bn/bn_local.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h
index 4b42ae95ee..067ffab3d9 100644
--- a/src/lib/libcrypto/bn/bn_local.h
+++ b/src/lib/libcrypto/bn/bn_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_local.h,v 1.49 2025/02/12 21:21:34 tb Exp $ */ 1/* $OpenBSD: bn_local.h,v 1.50 2025/02/13 11:04:20 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 *
@@ -271,6 +271,8 @@ int bn_rand_interval(BIGNUM *rnd, BN_ULONG lower_word, const BIGNUM *upper_exc);
271 271
272void BN_init(BIGNUM *); 272void BN_init(BIGNUM *);
273 273
274BN_MONT_CTX *BN_MONT_CTX_create(const BIGNUM *bn, BN_CTX *ctx);
275
274BN_RECP_CTX *BN_RECP_CTX_create(const BIGNUM *N); 276BN_RECP_CTX *BN_RECP_CTX_create(const BIGNUM *N);
275void BN_RECP_CTX_free(BN_RECP_CTX *recp); 277void BN_RECP_CTX_free(BN_RECP_CTX *recp);
276int BN_div_reciprocal(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, 278int BN_div_reciprocal(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,