summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-03-02 09:25:00 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-03-02 09:25:00 +0000
commit96ad4157c52e9d25b8a58afbd251a6b582d8217f (patch)
treec7535654482f9b29b304a52a8f8327edd1a077a9 /lib/libcrypto
parentf4ff54ba7dc5d599b32fa852c716e67faedc7e6c (diff)
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 'lib/libcrypto')
-rw-r--r--lib/libcrypto/Symbols.list1
-rw-r--r--lib/libcrypto/Symbols.namespace1
-rw-r--r--lib/libcrypto/bn/bn.h4
-rw-r--r--lib/libcrypto/bn/bn_exp.c3
-rw-r--r--lib/libcrypto/bn/bn_local.h5
-rw-r--r--lib/libcrypto/hidden/openssl/bn.h3
6 files changed, 7 insertions, 10 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list
index 19f88c6917e..c439138eb7b 100644
--- a/lib/libcrypto/Symbols.list
+++ b/lib/libcrypto/Symbols.list
@@ -411,7 +411,6 @@ BN_mod_exp2_mont
BN_mod_exp_mont
BN_mod_exp_mont_consttime
BN_mod_exp_mont_word
-BN_mod_exp_simple
BN_mod_inverse
BN_mod_lshift
BN_mod_lshift1
diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace
index e97629108a1..772fb1876ba 100644
--- a/lib/libcrypto/Symbols.namespace
+++ b/lib/libcrypto/Symbols.namespace
@@ -2223,7 +2223,6 @@ _libre_BN_exp
_libre_BN_mod_exp_mont_consttime
_libre_BN_mod_exp_mont_word
_libre_BN_mod_exp2_mont
-_libre_BN_mod_exp_simple
_libre_BN_mask_bits
_libre_BN_print_fp
_libre_BN_print
diff --git a/lib/libcrypto/bn/bn.h b/lib/libcrypto/bn/bn.h
index e00953ea2ca..39a5180c2ca 100644
--- a/lib/libcrypto/bn/bn.h
+++ b/lib/libcrypto/bn/bn.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn.h,v 1.75 2023/07/31 05:04:06 tb Exp $ */
+/* $OpenBSD: bn.h,v 1.76 2024/03/02 09:24:59 tb Exp $ */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -396,8 +396,6 @@ int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
BN_CTX *ctx, BN_MONT_CTX *m_ctx);
-int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx);
int BN_mask_bits(BIGNUM *a, int n);
int BN_print_fp(FILE *fp, const BIGNUM *a);
diff --git a/lib/libcrypto/bn/bn_exp.c b/lib/libcrypto/bn/bn_exp.c
index 8293ae54f99..e4e06db1495 100644
--- a/lib/libcrypto/bn/bn_exp.c
+++ b/lib/libcrypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_exp.c,v 1.50 2023/10/19 10:27:27 tb Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.51 2024/03/02 09:24:59 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -304,7 +304,6 @@ BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
return ret;
}
-LCRYPTO_ALIAS(BN_mod_exp_simple);
/* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout
* so that accessing any of these table values shows the same access pattern as far
diff --git a/lib/libcrypto/bn/bn_local.h b/lib/libcrypto/bn/bn_local.h
index a9ce466db38..e5c4cddc927 100644
--- a/lib/libcrypto/bn/bn_local.h
+++ b/lib/libcrypto/bn/bn_local.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_local.h,v 1.38 2023/08/09 09:23:03 tb Exp $ */
+/* $OpenBSD: bn_local.h,v 1.39 2024/03/02 09:24:59 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -308,6 +308,9 @@ int BN_div_ct(BIGNUM *q, BIGNUM *r, const BIGNUM *n, const BIGNUM *d,
int BN_mod_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+
BIGNUM *BN_mod_inverse_ct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,
BN_CTX *ctx);
BIGNUM *BN_mod_inverse_nonct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,
diff --git a/lib/libcrypto/hidden/openssl/bn.h b/lib/libcrypto/hidden/openssl/bn.h
index 9942cf6fc74..1aa5b10d9d6 100644
--- a/lib/libcrypto/hidden/openssl/bn.h
+++ b/lib/libcrypto/hidden/openssl/bn.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn.h,v 1.4 2023/07/29 03:13:38 tb Exp $ */
+/* $OpenBSD: bn.h,v 1.5 2024/03/02 09:24:59 tb Exp $ */
/*
* Copyright (c) 2023 Bob Beck <beck@openbsd.org>
*
@@ -99,7 +99,6 @@ LCRYPTO_USED(BN_exp);
LCRYPTO_USED(BN_mod_exp_mont_consttime);
LCRYPTO_USED(BN_mod_exp_mont_word);
LCRYPTO_USED(BN_mod_exp2_mont);
-LCRYPTO_USED(BN_mod_exp_simple);
LCRYPTO_USED(BN_mask_bits);
LCRYPTO_USED(BN_print_fp);
LCRYPTO_USED(BN_print);