diff options
author | tb <> | 2024-03-02 09:27:31 +0000 |
---|---|---|
committer | tb <> | 2024-03-02 09:27:31 +0000 |
commit | c9bc42b7edc08f714c31d8ec1a974cc5b287ef4c (patch) | |
tree | d56583ceff6f4723ec51bb6b5743dbe552a6a98d /src/lib/libcrypto/bn/bn_local.h | |
parent | 2309a3f36e13452642a7ad2ed127e96ed774e1c5 (diff) | |
download | openbsd-c9bc42b7edc08f714c31d8ec1a974cc5b287ef4c.tar.gz openbsd-c9bc42b7edc08f714c31d8ec1a974cc5b287ef4c.tar.bz2 openbsd-c9bc42b7edc08f714c31d8ec1a974cc5b287ef4c.zip |
Make BN_mod_exp2_mont() and BN_mod_exp_mont_word() internal
The former could be useful but nothing uses it. The latter is a
dangerous implementation detail of Montgomery exponentiation that
should never have been leaked out of the library. Fix this.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/bn/bn_local.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn_local.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index e5c4cddc92..5acb546d07 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.39 2024/03/02 09:24:59 tb Exp $ */ | 1 | /* $OpenBSD: bn_local.h,v 1.40 2024/03/02 09:27:31 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 | * |
@@ -308,6 +308,12 @@ int BN_div_ct(BIGNUM *q, BIGNUM *r, const BIGNUM *n, const BIGNUM *d, | |||
308 | int BN_mod_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | 308 | int BN_mod_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); |
309 | int BN_mod_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | 309 | int BN_mod_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); |
310 | 310 | ||
311 | int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, | ||
312 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
313 | int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, | ||
314 | const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, | ||
315 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
316 | |||
311 | int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 317 | int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
312 | const BIGNUM *m, BN_CTX *ctx); | 318 | const BIGNUM *m, BN_CTX *ctx); |
313 | 319 | ||