diff options
author | tb <> | 2024-03-02 09:24:59 +0000 |
---|---|---|
committer | tb <> | 2024-03-02 09:24:59 +0000 |
commit | 2309a3f36e13452642a7ad2ed127e96ed774e1c5 (patch) | |
tree | 89f8d7085a178d2059b43cba1c1809f147cc1431 /src | |
parent | 2c5808653fa0d563b5f341caa86dd3f3acc8f5cc (diff) | |
download | openbsd-2309a3f36e13452642a7ad2ed127e96ed774e1c5.tar.gz openbsd-2309a3f36e13452642a7ad2ed127e96ed774e1c5.tar.bz2 openbsd-2309a3f36e13452642a7ad2ed127e96ed774e1c5.zip |
Make BN_mod_exp_simple() internal
This function is very slow and useful for testing purposes only. It
should never have been part of the public API. Remove it from there.
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_exp.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_local.h | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/bn.h | 3 |
6 files changed, 7 insertions, 10 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 19f88c6917..c439138eb7 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
@@ -411,7 +411,6 @@ BN_mod_exp2_mont | |||
411 | BN_mod_exp_mont | 411 | BN_mod_exp_mont |
412 | BN_mod_exp_mont_consttime | 412 | BN_mod_exp_mont_consttime |
413 | BN_mod_exp_mont_word | 413 | BN_mod_exp_mont_word |
414 | BN_mod_exp_simple | ||
415 | BN_mod_inverse | 414 | BN_mod_inverse |
416 | BN_mod_lshift | 415 | BN_mod_lshift |
417 | BN_mod_lshift1 | 416 | BN_mod_lshift1 |
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index e97629108a..772fb1876b 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -2223,7 +2223,6 @@ _libre_BN_exp | |||
2223 | _libre_BN_mod_exp_mont_consttime | 2223 | _libre_BN_mod_exp_mont_consttime |
2224 | _libre_BN_mod_exp_mont_word | 2224 | _libre_BN_mod_exp_mont_word |
2225 | _libre_BN_mod_exp2_mont | 2225 | _libre_BN_mod_exp2_mont |
2226 | _libre_BN_mod_exp_simple | ||
2227 | _libre_BN_mask_bits | 2226 | _libre_BN_mask_bits |
2228 | _libre_BN_print_fp | 2227 | _libre_BN_print_fp |
2229 | _libre_BN_print | 2228 | _libre_BN_print |
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index e00953ea2c..39a5180c2c 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn.h,v 1.75 2023/07/31 05:04:06 tb Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.76 2024/03/02 09:24:59 tb Exp $ */ |
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -396,8 +396,6 @@ int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, | |||
396 | int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, | 396 | int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, |
397 | const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, | 397 | const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, |
398 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 398 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
399 | int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
400 | const BIGNUM *m, BN_CTX *ctx); | ||
401 | 399 | ||
402 | int BN_mask_bits(BIGNUM *a, int n); | 400 | int BN_mask_bits(BIGNUM *a, int n); |
403 | int BN_print_fp(FILE *fp, const BIGNUM *a); | 401 | int BN_print_fp(FILE *fp, const BIGNUM *a); |
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c index 8293ae54f9..e4e06db149 100644 --- a/src/lib/libcrypto/bn/bn_exp.c +++ b/src/lib/libcrypto/bn/bn_exp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_exp.c,v 1.50 2023/10/19 10:27:27 tb Exp $ */ | 1 | /* $OpenBSD: bn_exp.c,v 1.51 2024/03/02 09:24:59 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 | * |
@@ -304,7 +304,6 @@ BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, | |||
304 | 304 | ||
305 | return ret; | 305 | return ret; |
306 | } | 306 | } |
307 | LCRYPTO_ALIAS(BN_mod_exp_simple); | ||
308 | 307 | ||
309 | /* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout | 308 | /* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout |
310 | * so that accessing any of these table values shows the same access pattern as far | 309 | * so that accessing any of these table values shows the same access pattern as far |
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index a9ce466db3..e5c4cddc92 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.38 2023/08/09 09:23:03 tb Exp $ */ | 1 | /* $OpenBSD: bn_local.h,v 1.39 2024/03/02 09:24:59 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,9 @@ 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_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
312 | const BIGNUM *m, BN_CTX *ctx); | ||
313 | |||
311 | BIGNUM *BN_mod_inverse_ct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, | 314 | BIGNUM *BN_mod_inverse_ct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, |
312 | BN_CTX *ctx); | 315 | BN_CTX *ctx); |
313 | BIGNUM *BN_mod_inverse_nonct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, | 316 | BIGNUM *BN_mod_inverse_nonct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, |
diff --git a/src/lib/libcrypto/hidden/openssl/bn.h b/src/lib/libcrypto/hidden/openssl/bn.h index 9942cf6fc7..1aa5b10d9d 100644 --- a/src/lib/libcrypto/hidden/openssl/bn.h +++ b/src/lib/libcrypto/hidden/openssl/bn.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn.h,v 1.4 2023/07/29 03:13:38 tb Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.5 2024/03/02 09:24:59 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -99,7 +99,6 @@ LCRYPTO_USED(BN_exp); | |||
99 | LCRYPTO_USED(BN_mod_exp_mont_consttime); | 99 | LCRYPTO_USED(BN_mod_exp_mont_consttime); |
100 | LCRYPTO_USED(BN_mod_exp_mont_word); | 100 | LCRYPTO_USED(BN_mod_exp_mont_word); |
101 | LCRYPTO_USED(BN_mod_exp2_mont); | 101 | LCRYPTO_USED(BN_mod_exp2_mont); |
102 | LCRYPTO_USED(BN_mod_exp_simple); | ||
103 | LCRYPTO_USED(BN_mask_bits); | 102 | LCRYPTO_USED(BN_mask_bits); |
104 | LCRYPTO_USED(BN_print_fp); | 103 | LCRYPTO_USED(BN_print_fp); |
105 | LCRYPTO_USED(BN_print); | 104 | LCRYPTO_USED(BN_print); |