summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeck <>2023-07-08 12:21:58 +0000
committerbeck <>2023-07-08 12:21:58 +0000
commit4fff81a3a2e2fb3d68e73e2fcc951cee3548c554 (patch)
tree789e1276988198ecf8411c8f5bb376e2ea404f91 /src
parentde1ea0d71a59536dfa9a5b0b755c13d3d6eddbeb (diff)
downloadopenbsd-4fff81a3a2e2fb3d68e73e2fcc951cee3548c554.tar.gz
openbsd-4fff81a3a2e2fb3d68e73e2fcc951cee3548c554.tar.bz2
openbsd-4fff81a3a2e2fb3d68e73e2fcc951cee3548c554.zip
Hide symbols in bn
ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/Symbols.namespace134
-rw-r--r--src/lib/libcrypto/bn/bn_add.c6
-rw-r--r--src/lib/libcrypto/bn/bn_blind.c13
-rw-r--r--src/lib/libcrypto/bn/bn_const.c18
-rw-r--r--src/lib/libcrypto/bn/bn_convert.c16
-rw-r--r--src/lib/libcrypto/bn/bn_ctx.c7
-rw-r--r--src/lib/libcrypto/bn/bn_err.c3
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c7
-rw-r--r--src/lib/libcrypto/bn/bn_kron.c3
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c40
-rw-r--r--src/lib/libcrypto/bn/bn_mod.c13
-rw-r--r--src/lib/libcrypto/bn/bn_mod_sqrt.c3
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c10
-rw-r--r--src/lib/libcrypto/bn/bn_mul.c3
-rw-r--r--src/lib/libcrypto/bn/bn_prime.c6
-rw-r--r--src/lib/libcrypto/bn/bn_rand.c6
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c6
-rw-r--r--src/lib/libcrypto/bn/bn_sqr.c3
-rw-r--r--src/lib/libcrypto/bn/bn_word.c7
-rw-r--r--src/lib/libcrypto/hidden/openssl/bn.h163
20 files changed, 449 insertions, 18 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace
index 2c5ec993c2..66de59acdb 100644
--- a/src/lib/libcrypto/Symbols.namespace
+++ b/src/lib/libcrypto/Symbols.namespace
@@ -2255,3 +2255,137 @@ _libre_TXT_DB_create_index
2255_libre_TXT_DB_free 2255_libre_TXT_DB_free
2256_libre_TXT_DB_get_by_index 2256_libre_TXT_DB_get_by_index
2257_libre_TXT_DB_insert 2257_libre_TXT_DB_insert
2258_libre_BN_set_flags
2259_libre_BN_get_flags
2260_libre_BN_with_flags
2261_libre_BN_GENCB_new
2262_libre_BN_GENCB_free
2263_libre_BN_GENCB_call
2264_libre_BN_GENCB_set_old
2265_libre_BN_GENCB_set
2266_libre_BN_GENCB_get_arg
2267_libre_BN_abs_is_word
2268_libre_BN_is_zero
2269_libre_BN_is_one
2270_libre_BN_is_word
2271_libre_BN_is_odd
2272_libre_BN_zero
2273_libre_BN_one
2274_libre_BN_value_one
2275_libre_BN_options
2276_libre_BN_CTX_new
2277_libre_BN_CTX_free
2278_libre_BN_CTX_start
2279_libre_BN_CTX_get
2280_libre_BN_CTX_end
2281_libre_BN_rand
2282_libre_BN_pseudo_rand
2283_libre_BN_rand_range
2284_libre_BN_pseudo_rand_range
2285_libre_BN_num_bits
2286_libre_BN_num_bits_word
2287_libre_BN_new
2288_libre_BN_clear_free
2289_libre_BN_copy
2290_libre_BN_swap
2291_libre_BN_bin2bn
2292_libre_BN_bn2bin
2293_libre_BN_bn2binpad
2294_libre_BN_lebin2bn
2295_libre_BN_bn2lebinpad
2296_libre_BN_mpi2bn
2297_libre_BN_bn2mpi
2298_libre_BN_sub
2299_libre_BN_usub
2300_libre_BN_uadd
2301_libre_BN_add
2302_libre_BN_mul
2303_libre_BN_sqr
2304_libre_BN_set_negative
2305_libre_BN_is_negative
2306_libre_BN_nnmod
2307_libre_BN_mod_add
2308_libre_BN_mod_add_quick
2309_libre_BN_mod_sub
2310_libre_BN_mod_sub_quick
2311_libre_BN_mod_mul
2312_libre_BN_mod_sqr
2313_libre_BN_mod_lshift1
2314_libre_BN_mod_lshift1_quick
2315_libre_BN_mod_lshift
2316_libre_BN_mod_lshift_quick
2317_libre_BN_mod_word
2318_libre_BN_div_word
2319_libre_BN_mul_word
2320_libre_BN_add_word
2321_libre_BN_sub_word
2322_libre_BN_set_word
2323_libre_BN_get_word
2324_libre_BN_cmp
2325_libre_BN_free
2326_libre_BN_is_bit_set
2327_libre_BN_lshift
2328_libre_BN_lshift1
2329_libre_BN_exp
2330_libre_BN_mod_exp_mont_consttime
2331_libre_BN_mod_exp_mont_word
2332_libre_BN_mod_exp2_mont
2333_libre_BN_mod_exp_simple
2334_libre_BN_mask_bits
2335_libre_BN_print_fp
2336_libre_BN_print
2337_libre_BN_rshift
2338_libre_BN_rshift1
2339_libre_BN_clear
2340_libre_BN_dup
2341_libre_BN_ucmp
2342_libre_BN_set_bit
2343_libre_BN_clear_bit
2344_libre_BN_bn2hex
2345_libre_BN_bn2dec
2346_libre_BN_hex2bn
2347_libre_BN_dec2bn
2348_libre_BN_asc2bn
2349_libre_BN_kronecker
2350_libre_BN_mod_sqrt
2351_libre_BN_consttime_swap
2352_libre_BN_security_bits
2353_libre_BN_generate_prime_ex
2354_libre_BN_is_prime_ex
2355_libre_BN_is_prime_fasttest_ex
2356_libre_BN_MONT_CTX_new
2357_libre_BN_mod_mul_montgomery
2358_libre_BN_to_montgomery
2359_libre_BN_from_montgomery
2360_libre_BN_MONT_CTX_free
2361_libre_BN_MONT_CTX_set
2362_libre_BN_MONT_CTX_copy
2363_libre_BN_MONT_CTX_set_locked
2364_libre_BN_BLINDING_new
2365_libre_BN_BLINDING_free
2366_libre_BN_BLINDING_update
2367_libre_BN_BLINDING_convert
2368_libre_BN_BLINDING_invert
2369_libre_BN_BLINDING_convert_ex
2370_libre_BN_BLINDING_invert_ex
2371_libre_BN_BLINDING_thread_id
2372_libre_BN_BLINDING_get_flags
2373_libre_BN_BLINDING_set_flags
2374_libre_BN_BLINDING_create_param
2375_libre_get_rfc2409_prime_768
2376_libre_get_rfc2409_prime_1024
2377_libre_BN_get_rfc2409_prime_768
2378_libre_BN_get_rfc2409_prime_1024
2379_libre_get_rfc3526_prime_1536
2380_libre_get_rfc3526_prime_2048
2381_libre_get_rfc3526_prime_3072
2382_libre_get_rfc3526_prime_4096
2383_libre_get_rfc3526_prime_6144
2384_libre_get_rfc3526_prime_8192
2385_libre_BN_get_rfc3526_prime_1536
2386_libre_BN_get_rfc3526_prime_2048
2387_libre_BN_get_rfc3526_prime_3072
2388_libre_BN_get_rfc3526_prime_4096
2389_libre_BN_get_rfc3526_prime_6144
2390_libre_BN_get_rfc3526_prime_8192
2391_libre_ERR_load_BN_strings
diff --git a/src/lib/libcrypto/bn/bn_add.c b/src/lib/libcrypto/bn/bn_add.c
index 36f160ab5f..86768a312a 100644
--- a/src/lib/libcrypto/bn/bn_add.c
+++ b/src/lib/libcrypto/bn/bn_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_add.c,v 1.25 2023/06/12 16:17:24 jsing Exp $ */ 1/* $OpenBSD: bn_add.c,v 1.26 2023/07/08 12:21:58 beck 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 *
@@ -248,6 +248,7 @@ BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
248 248
249 return 1; 249 return 1;
250} 250}
251LCRYPTO_ALIAS(BN_uadd);
251 252
252int 253int
253BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 254BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
@@ -277,6 +278,7 @@ BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
277 278
278 return 1; 279 return 1;
279} 280}
281LCRYPTO_ALIAS(BN_usub);
280 282
281int 283int
282BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 284BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
@@ -306,6 +308,7 @@ BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
306 308
307 return ret; 309 return ret;
308} 310}
311LCRYPTO_ALIAS(BN_add);
309 312
310int 313int
311BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 314BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
@@ -335,3 +338,4 @@ BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
335 338
336 return ret; 339 return ret;
337} 340}
341LCRYPTO_ALIAS(BN_sub);
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c
index 77ba691b6d..07cd359e7e 100644
--- a/src/lib/libcrypto/bn/bn_blind.c
+++ b/src/lib/libcrypto/bn/bn_blind.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_blind.c,v 1.22 2023/04/25 19:57:59 tb Exp $ */ 1/* $OpenBSD: bn_blind.c,v 1.23 2023/07/08 12:21:58 beck Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -169,6 +169,7 @@ err:
169 BN_BLINDING_free(ret); 169 BN_BLINDING_free(ret);
170 return (NULL); 170 return (NULL);
171} 171}
172LCRYPTO_ALIAS(BN_BLINDING_new);
172 173
173void 174void
174BN_BLINDING_free(BN_BLINDING *r) 175BN_BLINDING_free(BN_BLINDING *r)
@@ -182,6 +183,7 @@ BN_BLINDING_free(BN_BLINDING *r)
182 BN_free(r->mod); 183 BN_free(r->mod);
183 free(r); 184 free(r);
184} 185}
186LCRYPTO_ALIAS(BN_BLINDING_free);
185 187
186int 188int
187BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx) 189BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)
@@ -215,12 +217,14 @@ err:
215 b->counter = 0; 217 b->counter = 0;
216 return (ret); 218 return (ret);
217} 219}
220LCRYPTO_ALIAS(BN_BLINDING_update);
218 221
219int 222int
220BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) 223BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx)
221{ 224{
222 return BN_BLINDING_convert_ex(n, NULL, b, ctx); 225 return BN_BLINDING_convert_ex(n, NULL, b, ctx);
223} 226}
227LCRYPTO_ALIAS(BN_BLINDING_convert);
224 228
225int 229int
226BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx) 230BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
@@ -249,12 +253,14 @@ BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
249 253
250 return ret; 254 return ret;
251} 255}
256LCRYPTO_ALIAS(BN_BLINDING_convert_ex);
252 257
253int 258int
254BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) 259BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx)
255{ 260{
256 return BN_BLINDING_invert_ex(n, NULL, b, ctx); 261 return BN_BLINDING_invert_ex(n, NULL, b, ctx);
257} 262}
263LCRYPTO_ALIAS(BN_BLINDING_invert);
258 264
259int 265int
260BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx) 266BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
@@ -274,24 +280,28 @@ BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
274 280
275 return (ret); 281 return (ret);
276} 282}
283LCRYPTO_ALIAS(BN_BLINDING_invert_ex);
277 284
278CRYPTO_THREADID * 285CRYPTO_THREADID *
279BN_BLINDING_thread_id(BN_BLINDING *b) 286BN_BLINDING_thread_id(BN_BLINDING *b)
280{ 287{
281 return &b->tid; 288 return &b->tid;
282} 289}
290LCRYPTO_ALIAS(BN_BLINDING_thread_id);
283 291
284unsigned long 292unsigned long
285BN_BLINDING_get_flags(const BN_BLINDING *b) 293BN_BLINDING_get_flags(const BN_BLINDING *b)
286{ 294{
287 return b->flags; 295 return b->flags;
288} 296}
297LCRYPTO_ALIAS(BN_BLINDING_get_flags);
289 298
290void 299void
291BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags) 300BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags)
292{ 301{
293 b->flags = flags; 302 b->flags = flags;
294} 303}
304LCRYPTO_ALIAS(BN_BLINDING_set_flags);
295 305
296BN_BLINDING * 306BN_BLINDING *
297BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, 307BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m,
@@ -363,3 +373,4 @@ err:
363 373
364 return ret; 374 return ret;
365} 375}
376LCRYPTO_ALIAS(BN_BLINDING_create_param);
diff --git a/src/lib/libcrypto/bn/bn_const.c b/src/lib/libcrypto/bn/bn_const.c
index 0ceff9160d..e0009b0be4 100644
--- a/src/lib/libcrypto/bn/bn_const.c
+++ b/src/lib/libcrypto/bn/bn_const.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_const.c,v 1.5 2018/02/20 17:02:30 jsing Exp $ */ 1/* $OpenBSD: bn_const.c,v 1.6 2023/07/08 12:21:58 beck Exp $ */
2/* Insert boilerplate */ 2/* Insert boilerplate */
3 3
4#include <openssl/bn.h> 4#include <openssl/bn.h>
@@ -26,12 +26,14 @@ get_rfc2409_prime_768(BIGNUM *bn)
26 }; 26 };
27 return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn); 27 return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn);
28} 28}
29LCRYPTO_ALIAS(get_rfc2409_prime_768);
29 30
30BIGNUM * 31BIGNUM *
31BN_get_rfc2409_prime_768(BIGNUM *bn) 32BN_get_rfc2409_prime_768(BIGNUM *bn)
32{ 33{
33 return get_rfc2409_prime_768(bn); 34 return get_rfc2409_prime_768(bn);
34} 35}
36LCRYPTO_ALIAS(BN_get_rfc2409_prime_768);
35 37
36/* "Second Oakley Default Group" from RFC2409, section 6.2. 38/* "Second Oakley Default Group" from RFC2409, section 6.2.
37 * 39 *
@@ -59,12 +61,14 @@ get_rfc2409_prime_1024(BIGNUM *bn)
59 }; 61 };
60 return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn); 62 return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn);
61} 63}
64LCRYPTO_ALIAS(get_rfc2409_prime_1024);
62 65
63BIGNUM * 66BIGNUM *
64BN_get_rfc2409_prime_1024(BIGNUM *bn) 67BN_get_rfc2409_prime_1024(BIGNUM *bn)
65{ 68{
66 return get_rfc2409_prime_1024(bn); 69 return get_rfc2409_prime_1024(bn);
67} 70}
71LCRYPTO_ALIAS(BN_get_rfc2409_prime_1024);
68 72
69/* "1536-bit MODP Group" from RFC3526, Section 2. 73/* "1536-bit MODP Group" from RFC3526, Section 2.
70 * 74 *
@@ -97,12 +101,14 @@ get_rfc3526_prime_1536(BIGNUM *bn)
97 }; 101 };
98 return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn); 102 return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn);
99} 103}
104LCRYPTO_ALIAS(get_rfc3526_prime_1536);
100 105
101BIGNUM * 106BIGNUM *
102BN_get_rfc3526_prime_1536(BIGNUM *bn) 107BN_get_rfc3526_prime_1536(BIGNUM *bn)
103{ 108{
104 return get_rfc3526_prime_1536(bn); 109 return get_rfc3526_prime_1536(bn);
105} 110}
111LCRYPTO_ALIAS(BN_get_rfc3526_prime_1536);
106 112
107/* "2048-bit MODP Group" from RFC3526, Section 3. 113/* "2048-bit MODP Group" from RFC3526, Section 3.
108 * 114 *
@@ -140,12 +146,14 @@ get_rfc3526_prime_2048(BIGNUM *bn)
140 }; 146 };
141 return BN_bin2bn(RFC3526_PRIME_2048, sizeof(RFC3526_PRIME_2048), bn); 147 return BN_bin2bn(RFC3526_PRIME_2048, sizeof(RFC3526_PRIME_2048), bn);
142} 148}
149LCRYPTO_ALIAS(get_rfc3526_prime_2048);
143 150
144BIGNUM * 151BIGNUM *
145BN_get_rfc3526_prime_2048(BIGNUM *bn) 152BN_get_rfc3526_prime_2048(BIGNUM *bn)
146{ 153{
147 return get_rfc3526_prime_2048(bn); 154 return get_rfc3526_prime_2048(bn);
148} 155}
156LCRYPTO_ALIAS(BN_get_rfc3526_prime_2048);
149 157
150/* "3072-bit MODP Group" from RFC3526, Section 4. 158/* "3072-bit MODP Group" from RFC3526, Section 4.
151 * 159 *
@@ -193,12 +201,14 @@ get_rfc3526_prime_3072(BIGNUM *bn)
193 }; 201 };
194 return BN_bin2bn(RFC3526_PRIME_3072, sizeof(RFC3526_PRIME_3072), bn); 202 return BN_bin2bn(RFC3526_PRIME_3072, sizeof(RFC3526_PRIME_3072), bn);
195} 203}
204LCRYPTO_ALIAS(get_rfc3526_prime_3072);
196 205
197BIGNUM * 206BIGNUM *
198BN_get_rfc3526_prime_3072(BIGNUM *bn) 207BN_get_rfc3526_prime_3072(BIGNUM *bn)
199{ 208{
200 return get_rfc3526_prime_3072(bn); 209 return get_rfc3526_prime_3072(bn);
201} 210}
211LCRYPTO_ALIAS(BN_get_rfc3526_prime_3072);
202 212
203/* "4096-bit MODP Group" from RFC3526, Section 5. 213/* "4096-bit MODP Group" from RFC3526, Section 5.
204 * 214 *
@@ -257,12 +267,14 @@ get_rfc3526_prime_4096(BIGNUM *bn)
257 }; 267 };
258 return BN_bin2bn(RFC3526_PRIME_4096, sizeof(RFC3526_PRIME_4096), bn); 268 return BN_bin2bn(RFC3526_PRIME_4096, sizeof(RFC3526_PRIME_4096), bn);
259} 269}
270LCRYPTO_ALIAS(get_rfc3526_prime_4096);
260 271
261BIGNUM * 272BIGNUM *
262BN_get_rfc3526_prime_4096(BIGNUM *bn) 273BN_get_rfc3526_prime_4096(BIGNUM *bn)
263{ 274{
264 return get_rfc3526_prime_4096(bn); 275 return get_rfc3526_prime_4096(bn);
265} 276}
277LCRYPTO_ALIAS(BN_get_rfc3526_prime_4096);
266 278
267/* "6144-bit MODP Group" from RFC3526, Section 6. 279/* "6144-bit MODP Group" from RFC3526, Section 6.
268 * 280 *
@@ -342,12 +354,14 @@ get_rfc3526_prime_6144(BIGNUM *bn)
342 }; 354 };
343 return BN_bin2bn(RFC3526_PRIME_6144, sizeof(RFC3526_PRIME_6144), bn); 355 return BN_bin2bn(RFC3526_PRIME_6144, sizeof(RFC3526_PRIME_6144), bn);
344} 356}
357LCRYPTO_ALIAS(get_rfc3526_prime_6144);
345 358
346BIGNUM * 359BIGNUM *
347BN_get_rfc3526_prime_6144(BIGNUM *bn) 360BN_get_rfc3526_prime_6144(BIGNUM *bn)
348{ 361{
349 return get_rfc3526_prime_6144(bn); 362 return get_rfc3526_prime_6144(bn);
350} 363}
364LCRYPTO_ALIAS(BN_get_rfc3526_prime_6144);
351 365
352/* "8192-bit MODP Group" from RFC3526, Section 7. 366/* "8192-bit MODP Group" from RFC3526, Section 7.
353 * 367 *
@@ -449,9 +463,11 @@ get_rfc3526_prime_8192(BIGNUM *bn)
449 }; 463 };
450 return BN_bin2bn(RFC3526_PRIME_8192, sizeof(RFC3526_PRIME_8192), bn); 464 return BN_bin2bn(RFC3526_PRIME_8192, sizeof(RFC3526_PRIME_8192), bn);
451} 465}
466LCRYPTO_ALIAS(get_rfc3526_prime_8192);
452 467
453BIGNUM * 468BIGNUM *
454BN_get_rfc3526_prime_8192(BIGNUM *bn) 469BN_get_rfc3526_prime_8192(BIGNUM *bn)
455{ 470{
456 return get_rfc3526_prime_8192(bn); 471 return get_rfc3526_prime_8192(bn);
457} 472}
473LCRYPTO_ALIAS(BN_get_rfc3526_prime_8192);
diff --git a/src/lib/libcrypto/bn/bn_convert.c b/src/lib/libcrypto/bn/bn_convert.c
index 4736099cdc..cb0a23e010 100644
--- a/src/lib/libcrypto/bn/bn_convert.c
+++ b/src/lib/libcrypto/bn/bn_convert.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_convert.c,v 1.12 2023/06/23 10:48:40 tb Exp $ */ 1/* $OpenBSD: bn_convert.c,v 1.13 2023/07/08 12:21:58 beck 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 *
@@ -142,6 +142,7 @@ BN_bn2bin(const BIGNUM *a, unsigned char *to)
142{ 142{
143 return bn2binpad(a, to, -1, big); 143 return bn2binpad(a, to, -1, big);
144} 144}
145LCRYPTO_ALIAS(BN_bn2bin);
145 146
146int 147int
147BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) 148BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
@@ -150,6 +151,7 @@ BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
150 return -1; 151 return -1;
151 return bn2binpad(a, to, tolen, big); 152 return bn2binpad(a, to, tolen, big);
152} 153}
154LCRYPTO_ALIAS(BN_bn2binpad);
153 155
154BIGNUM * 156BIGNUM *
155BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 157BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
@@ -192,6 +194,7 @@ BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
192 bn_correct_top(ret); 194 bn_correct_top(ret);
193 return (ret); 195 return (ret);
194} 196}
197LCRYPTO_ALIAS(BN_bin2bn);
195 198
196int 199int
197BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen) 200BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen)
@@ -201,6 +204,7 @@ BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen)
201 204
202 return bn2binpad(a, to, tolen, little); 205 return bn2binpad(a, to, tolen, little);
203} 206}
207LCRYPTO_ALIAS(BN_bn2lebinpad);
204 208
205BIGNUM * 209BIGNUM *
206BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret) 210BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
@@ -254,6 +258,7 @@ BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
254 258
255 return ret; 259 return ret;
256} 260}
261LCRYPTO_ALIAS(BN_lebin2bn);
257 262
258int 263int
259BN_asc2bn(BIGNUM **bnp, const char *s) 264BN_asc2bn(BIGNUM **bnp, const char *s)
@@ -306,6 +311,7 @@ BN_asc2bn(BIGNUM **bnp, const char *s)
306 311
307 return 1; 312 return 1;
308} 313}
314LCRYPTO_ALIAS(BN_asc2bn);
309 315
310char * 316char *
311BN_bn2dec(const BIGNUM *bn) 317BN_bn2dec(const BIGNUM *bn)
@@ -384,6 +390,7 @@ BN_bn2dec(const BIGNUM *bn)
384 390
385 return s; 391 return s;
386} 392}
393LCRYPTO_ALIAS(BN_bn2dec);
387 394
388static int 395static int
389bn_dec2bn_cbs(BIGNUM **bnp, CBS *cbs) 396bn_dec2bn_cbs(BIGNUM **bnp, CBS *cbs)
@@ -488,6 +495,7 @@ BN_dec2bn(BIGNUM **bnp, const char *s)
488 495
489 return bn_dec2bn_cbs(bnp, &cbs); 496 return bn_dec2bn_cbs(bnp, &cbs);
490} 497}
498LCRYPTO_ALIAS(BN_dec2bn);
491 499
492char * 500char *
493BN_bn2hex(const BIGNUM *bn) 501BN_bn2hex(const BIGNUM *bn)
@@ -533,6 +541,7 @@ BN_bn2hex(const BIGNUM *bn)
533 541
534 return s; 542 return s;
535} 543}
544LCRYPTO_ALIAS(BN_bn2hex);
536 545
537static int 546static int
538bn_hex2bn_cbs(BIGNUM **bnp, CBS *cbs) 547bn_hex2bn_cbs(BIGNUM **bnp, CBS *cbs)
@@ -641,6 +650,7 @@ BN_hex2bn(BIGNUM **bnp, const char *s)
641 650
642 return bn_hex2bn_cbs(bnp, &cbs); 651 return bn_hex2bn_cbs(bnp, &cbs);
643} 652}
653LCRYPTO_ALIAS(BN_hex2bn);
644 654
645int 655int
646BN_bn2mpi(const BIGNUM *a, unsigned char *d) 656BN_bn2mpi(const BIGNUM *a, unsigned char *d)
@@ -670,6 +680,7 @@ BN_bn2mpi(const BIGNUM *a, unsigned char *d)
670 d[4] |= 0x80; 680 d[4] |= 0x80;
671 return (num + 4 + ext); 681 return (num + 4 + ext);
672} 682}
683LCRYPTO_ALIAS(BN_bn2mpi);
673 684
674BIGNUM * 685BIGNUM *
675BN_mpi2bn(const unsigned char *d, int n, BIGNUM *ain) 686BN_mpi2bn(const unsigned char *d, int n, BIGNUM *ain)
@@ -713,6 +724,7 @@ BN_mpi2bn(const unsigned char *d, int n, BIGNUM *ain)
713 } 724 }
714 return (a); 725 return (a);
715} 726}
727LCRYPTO_ALIAS(BN_mpi2bn);
716 728
717#ifndef OPENSSL_NO_BIO 729#ifndef OPENSSL_NO_BIO
718int 730int
@@ -728,6 +740,7 @@ BN_print_fp(FILE *fp, const BIGNUM *a)
728 BIO_free(b); 740 BIO_free(b);
729 return (ret); 741 return (ret);
730} 742}
743LCRYPTO_ALIAS(BN_print_fp);
731 744
732int 745int
733BN_print(BIO *bp, const BIGNUM *a) 746BN_print(BIO *bp, const BIGNUM *a)
@@ -755,4 +768,5 @@ BN_print(BIO *bp, const BIGNUM *a)
755end: 768end:
756 return (ret); 769 return (ret);
757} 770}
771LCRYPTO_ALIAS(BN_print);
758#endif 772#endif
diff --git a/src/lib/libcrypto/bn/bn_ctx.c b/src/lib/libcrypto/bn/bn_ctx.c
index 357eda1783..129b9c9781 100644
--- a/src/lib/libcrypto/bn/bn_ctx.c
+++ b/src/lib/libcrypto/bn/bn_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_ctx.c,v 1.21 2023/04/25 16:41:29 tb Exp $ */ 1/* $OpenBSD: bn_ctx.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -70,6 +70,7 @@ BN_CTX_new(void)
70{ 70{
71 return calloc(1, sizeof(struct bignum_ctx)); 71 return calloc(1, sizeof(struct bignum_ctx));
72} 72}
73LCRYPTO_ALIAS(BN_CTX_new);
73 74
74void 75void
75BN_CTX_free(BN_CTX *bctx) 76BN_CTX_free(BN_CTX *bctx)
@@ -89,6 +90,7 @@ BN_CTX_free(BN_CTX *bctx)
89 90
90 freezero(bctx, sizeof(*bctx)); 91 freezero(bctx, sizeof(*bctx));
91} 92}
93LCRYPTO_ALIAS(BN_CTX_free);
92 94
93void 95void
94BN_CTX_start(BN_CTX *bctx) 96BN_CTX_start(BN_CTX *bctx)
@@ -101,6 +103,7 @@ BN_CTX_start(BN_CTX *bctx)
101 return; 103 return;
102 } 104 }
103} 105}
106LCRYPTO_ALIAS(BN_CTX_start);
104 107
105BIGNUM * 108BIGNUM *
106BN_CTX_get(BN_CTX *bctx) 109BN_CTX_get(BN_CTX *bctx)
@@ -139,6 +142,7 @@ BN_CTX_get(BN_CTX *bctx)
139 142
140 return bn; 143 return bn;
141} 144}
145LCRYPTO_ALIAS(BN_CTX_get);
142 146
143void 147void
144BN_CTX_end(BN_CTX *bctx) 148BN_CTX_end(BN_CTX *bctx)
@@ -154,3 +158,4 @@ BN_CTX_end(BN_CTX *bctx)
154 158
155 bctx->group--; 159 bctx->group--;
156} 160}
161LCRYPTO_ALIAS(BN_CTX_end);
diff --git a/src/lib/libcrypto/bn/bn_err.c b/src/lib/libcrypto/bn/bn_err.c
index b861ea9374..6fd6030a0c 100644
--- a/src/lib/libcrypto/bn/bn_err.c
+++ b/src/lib/libcrypto/bn/bn_err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_err.c,v 1.16 2023/06/13 09:12:22 tb Exp $ */ 1/* $OpenBSD: bn_err.c,v 1.17 2023/07/08 12:21:58 beck Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -105,3 +105,4 @@ ERR_load_BN_strings(void)
105 } 105 }
106#endif 106#endif
107} 107}
108LCRYPTO_ALIAS(ERR_load_BN_strings);
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index 9e5d1fd26d..a50fa5953c 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.46 2023/05/09 05:38:11 tb Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.47 2023/07/08 12:21:58 beck 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 *
@@ -173,6 +173,7 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
173 173
174 return ret; 174 return ret;
175} 175}
176LCRYPTO_ALIAS(BN_exp);
176 177
177/* The old fallback, simple version :-) */ 178/* The old fallback, simple version :-) */
178int 179int
@@ -291,6 +292,7 @@ err:
291 BN_CTX_end(ctx); 292 BN_CTX_end(ctx);
292 return (ret); 293 return (ret);
293} 294}
295LCRYPTO_ALIAS(BN_mod_exp_simple);
294 296
295/* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout 297/* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout
296 * so that accessing any of these table values shows the same access pattern as far 298 * so that accessing any of these table values shows the same access pattern as far
@@ -632,6 +634,7 @@ err:
632 BN_CTX_end(ctx); 634 BN_CTX_end(ctx);
633 return (ret); 635 return (ret);
634} 636}
637LCRYPTO_ALIAS(BN_mod_exp_mont_consttime);
635 638
636static int 639static int
637BN_mod_exp_mont_internal(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 640BN_mod_exp_mont_internal(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
@@ -947,6 +950,7 @@ err:
947 BN_CTX_end(ctx); 950 BN_CTX_end(ctx);
948 return (ret); 951 return (ret);
949} 952}
953LCRYPTO_ALIAS(BN_mod_exp_mont_word);
950 954
951int 955int
952BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 956BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
@@ -1331,3 +1335,4 @@ err:
1331 BN_CTX_end(ctx); 1335 BN_CTX_end(ctx);
1332 return (ret); 1336 return (ret);
1333} 1337}
1338LCRYPTO_ALIAS(BN_mod_exp2_mont);
diff --git a/src/lib/libcrypto/bn/bn_kron.c b/src/lib/libcrypto/bn/bn_kron.c
index f48823acab..a170d688e9 100644
--- a/src/lib/libcrypto/bn/bn_kron.c
+++ b/src/lib/libcrypto/bn/bn_kron.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_kron.c,v 1.14 2023/03/27 10:21:23 tb Exp $ */ 1/* $OpenBSD: bn_kron.c,v 1.15 2023/07/08 12:21:58 beck Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -192,3 +192,4 @@ BN_kronecker(const BIGNUM *A, const BIGNUM *B, BN_CTX *ctx)
192 192
193 return ret; 193 return ret;
194} 194}
195LCRYPTO_ALIAS(BN_kronecker);
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index bac0290efa..74359dab37 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.88 2023/06/21 07:48:41 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.89 2023/07/08 12:21:58 beck 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 *
@@ -81,6 +81,7 @@ BN_new(void)
81 81
82 return bn; 82 return bn;
83} 83}
84LCRYPTO_ALIAS(BN_new);
84 85
85void 86void
86BN_init(BIGNUM *a) 87BN_init(BIGNUM *a)
@@ -96,6 +97,7 @@ BN_clear(BIGNUM *a)
96 a->top = 0; 97 a->top = 0;
97 a->neg = 0; 98 a->neg = 0;
98} 99}
100LCRYPTO_ALIAS(BN_clear);
99 101
100void 102void
101BN_free(BIGNUM *bn) 103BN_free(BIGNUM *bn)
@@ -113,24 +115,28 @@ BN_free(BIGNUM *bn)
113 115
114 freezero(bn, sizeof(*bn)); 116 freezero(bn, sizeof(*bn));
115} 117}
118LCRYPTO_ALIAS(BN_free);
116 119
117void 120void
118BN_clear_free(BIGNUM *bn) 121BN_clear_free(BIGNUM *bn)
119{ 122{
120 BN_free(bn); 123 BN_free(bn);
121} 124}
125LCRYPTO_ALIAS(BN_clear_free);
122 126
123void 127void
124BN_set_flags(BIGNUM *b, int n) 128BN_set_flags(BIGNUM *b, int n)
125{ 129{
126 b->flags |= n; 130 b->flags |= n;
127} 131}
132LCRYPTO_ALIAS(BN_set_flags);
128 133
129int 134int
130BN_get_flags(const BIGNUM *b, int n) 135BN_get_flags(const BIGNUM *b, int n)
131{ 136{
132 return b->flags & n; 137 return b->flags & n;
133} 138}
139LCRYPTO_ALIAS(BN_get_flags);
134 140
135void 141void
136BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags) 142BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
@@ -143,6 +149,7 @@ BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
143 *dest = *b; 149 *dest = *b;
144 dest->flags = dest_flags; 150 dest->flags = dest_flags;
145} 151}
152LCRYPTO_ALIAS(BN_with_flags);
146 153
147static const BN_ULONG bn_value_one_data = 1; 154static const BN_ULONG bn_value_one_data = 1;
148static const BIGNUM bn_value_one = { 155static const BIGNUM bn_value_one = {
@@ -158,18 +165,21 @@ BN_value_one(void)
158{ 165{
159 return &bn_value_one; 166 return &bn_value_one;
160} 167}
168LCRYPTO_ALIAS(BN_value_one);
161 169
162int 170int
163BN_num_bits_word(BN_ULONG w) 171BN_num_bits_word(BN_ULONG w)
164{ 172{
165 return BN_BITS2 - bn_clzw(w); 173 return BN_BITS2 - bn_clzw(w);
166} 174}
175LCRYPTO_ALIAS(BN_num_bits_word);
167 176
168int 177int
169BN_num_bits(const BIGNUM *bn) 178BN_num_bits(const BIGNUM *bn)
170{ 179{
171 return bn_bitsize(bn); 180 return bn_bitsize(bn);
172} 181}
182LCRYPTO_ALIAS(BN_num_bits);
173 183
174void 184void
175bn_correct_top(BIGNUM *a) 185bn_correct_top(BIGNUM *a)
@@ -253,6 +263,7 @@ BN_dup(const BIGNUM *a)
253 } 263 }
254 return t; 264 return t;
255} 265}
266LCRYPTO_ALIAS(BN_dup);
256 267
257static inline void 268static inline void
258bn_copy_words(BN_ULONG *ap, const BN_ULONG *bp, int n) 269bn_copy_words(BN_ULONG *ap, const BN_ULONG *bp, int n)
@@ -284,6 +295,7 @@ BN_copy(BIGNUM *a, const BIGNUM *b)
284 295
285 return (a); 296 return (a);
286} 297}
298LCRYPTO_ALIAS(BN_copy);
287 299
288int 300int
289bn_copy(BIGNUM *dst, const BIGNUM *src) 301bn_copy(BIGNUM *dst, const BIGNUM *src)
@@ -322,6 +334,7 @@ BN_swap(BIGNUM *a, BIGNUM *b)
322 b->flags = (flags_old_b & BN_FLG_MALLOCED) | 334 b->flags = (flags_old_b & BN_FLG_MALLOCED) |
323 (flags_old_a & BN_FLG_STATIC_DATA); 335 (flags_old_a & BN_FLG_STATIC_DATA);
324} 336}
337LCRYPTO_ALIAS(BN_swap);
325 338
326BN_ULONG 339BN_ULONG
327BN_get_word(const BIGNUM *a) 340BN_get_word(const BIGNUM *a)
@@ -333,6 +346,7 @@ BN_get_word(const BIGNUM *a)
333 /* a->top == 0 */ 346 /* a->top == 0 */
334 return 0; 347 return 0;
335} 348}
349LCRYPTO_ALIAS(BN_get_word);
336 350
337int 351int
338BN_set_word(BIGNUM *a, BN_ULONG w) 352BN_set_word(BIGNUM *a, BN_ULONG w)
@@ -344,6 +358,7 @@ BN_set_word(BIGNUM *a, BN_ULONG w)
344 a->top = (w ? 1 : 0); 358 a->top = (w ? 1 : 0);
345 return (1); 359 return (1);
346} 360}
361LCRYPTO_ALIAS(BN_set_word);
347 362
348int 363int
349BN_ucmp(const BIGNUM *a, const BIGNUM *b) 364BN_ucmp(const BIGNUM *a, const BIGNUM *b)
@@ -362,6 +377,7 @@ BN_ucmp(const BIGNUM *a, const BIGNUM *b)
362 377
363 return 0; 378 return 0;
364} 379}
380LCRYPTO_ALIAS(BN_ucmp);
365 381
366int 382int
367BN_cmp(const BIGNUM *a, const BIGNUM *b) 383BN_cmp(const BIGNUM *a, const BIGNUM *b)
@@ -382,6 +398,7 @@ BN_cmp(const BIGNUM *a, const BIGNUM *b)
382 398
383 return BN_ucmp(a, b); 399 return BN_ucmp(a, b);
384} 400}
401LCRYPTO_ALIAS(BN_cmp);
385 402
386int 403int
387BN_set_bit(BIGNUM *a, int n) 404BN_set_bit(BIGNUM *a, int n)
@@ -404,6 +421,7 @@ BN_set_bit(BIGNUM *a, int n)
404 a->d[i] |= (((BN_ULONG)1) << j); 421 a->d[i] |= (((BN_ULONG)1) << j);
405 return (1); 422 return (1);
406} 423}
424LCRYPTO_ALIAS(BN_set_bit);
407 425
408int 426int
409BN_clear_bit(BIGNUM *a, int n) 427BN_clear_bit(BIGNUM *a, int n)
@@ -422,6 +440,7 @@ BN_clear_bit(BIGNUM *a, int n)
422 bn_correct_top(a); 440 bn_correct_top(a);
423 return (1); 441 return (1);
424} 442}
443LCRYPTO_ALIAS(BN_clear_bit);
425 444
426int 445int
427BN_is_bit_set(const BIGNUM *a, int n) 446BN_is_bit_set(const BIGNUM *a, int n)
@@ -436,6 +455,7 @@ BN_is_bit_set(const BIGNUM *a, int n)
436 return 0; 455 return 0;
437 return (int)(((a->d[i]) >> j) & ((BN_ULONG)1)); 456 return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
438} 457}
458LCRYPTO_ALIAS(BN_is_bit_set);
439 459
440int 460int
441BN_mask_bits(BIGNUM *a, int n) 461BN_mask_bits(BIGNUM *a, int n)
@@ -458,12 +478,14 @@ BN_mask_bits(BIGNUM *a, int n)
458 bn_correct_top(a); 478 bn_correct_top(a);
459 return (1); 479 return (1);
460} 480}
481LCRYPTO_ALIAS(BN_mask_bits);
461 482
462void 483void
463BN_set_negative(BIGNUM *bn, int neg) 484BN_set_negative(BIGNUM *bn, int neg)
464{ 485{
465 bn->neg = ~BN_is_zero(bn) & bn_ct_ne_zero(neg); 486 bn->neg = ~BN_is_zero(bn) & bn_ct_ne_zero(neg);
466} 487}
488LCRYPTO_ALIAS(BN_set_negative);
467 489
468/* 490/*
469 * Constant-time conditional swap of a and b. 491 * Constant-time conditional swap of a and b.
@@ -517,6 +539,7 @@ BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
517 } 539 }
518#undef BN_CONSTTIME_SWAP 540#undef BN_CONSTTIME_SWAP
519} 541}
542LCRYPTO_ALIAS(BN_consttime_swap);
520 543
521/* 544/*
522 * Constant-time conditional swap of a and b. 545 * Constant-time conditional swap of a and b.
@@ -575,18 +598,21 @@ BN_zero(BIGNUM *a)
575 a->neg = 0; 598 a->neg = 0;
576 a->top = 0; 599 a->top = 0;
577} 600}
601LCRYPTO_ALIAS(BN_zero);
578 602
579int 603int
580BN_one(BIGNUM *a) 604BN_one(BIGNUM *a)
581{ 605{
582 return BN_set_word(a, 1); 606 return BN_set_word(a, 1);
583} 607}
608LCRYPTO_ALIAS(BN_one);
584 609
585int 610int
586BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 611BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
587{ 612{
588 return (a->top == 1 && a->d[0] == w) || (w == 0 && a->top == 0); 613 return (a->top == 1 && a->d[0] == w) || (w == 0 && a->top == 0);
589} 614}
615LCRYPTO_ALIAS(BN_abs_is_word);
590 616
591int 617int
592BN_is_zero(const BIGNUM *bn) 618BN_is_zero(const BIGNUM *bn)
@@ -599,30 +625,35 @@ BN_is_zero(const BIGNUM *bn)
599 625
600 return bits == 0; 626 return bits == 0;
601} 627}
628LCRYPTO_ALIAS(BN_is_zero);
602 629
603int 630int
604BN_is_one(const BIGNUM *a) 631BN_is_one(const BIGNUM *a)
605{ 632{
606 return BN_abs_is_word(a, 1) && !a->neg; 633 return BN_abs_is_word(a, 1) && !a->neg;
607} 634}
635LCRYPTO_ALIAS(BN_is_one);
608 636
609int 637int
610BN_is_word(const BIGNUM *a, const BN_ULONG w) 638BN_is_word(const BIGNUM *a, const BN_ULONG w)
611{ 639{
612 return BN_abs_is_word(a, w) && (w == 0 || !a->neg); 640 return BN_abs_is_word(a, w) && (w == 0 || !a->neg);
613} 641}
642LCRYPTO_ALIAS(BN_is_word);
614 643
615int 644int
616BN_is_odd(const BIGNUM *a) 645BN_is_odd(const BIGNUM *a)
617{ 646{
618 return a->top > 0 && (a->d[0] & 1); 647 return a->top > 0 && (a->d[0] & 1);
619} 648}
649LCRYPTO_ALIAS(BN_is_odd);
620 650
621int 651int
622BN_is_negative(const BIGNUM *a) 652BN_is_negative(const BIGNUM *a)
623{ 653{
624 return a->neg != 0; 654 return a->neg != 0;
625} 655}
656LCRYPTO_ALIAS(BN_is_negative);
626 657
627char * 658char *
628BN_options(void) 659BN_options(void)
@@ -642,6 +673,7 @@ BN_options(void)
642 } 673 }
643 return (data); 674 return (data);
644} 675}
676LCRYPTO_ALIAS(BN_options);
645 677
646/* 678/*
647 * Bits of security, see SP800-57, section 5.6.11, table 2. 679 * Bits of security, see SP800-57, section 5.6.11, table 2.
@@ -673,6 +705,7 @@ BN_security_bits(int L, int N)
673 705
674 return bits >= secbits ? secbits : bits; 706 return bits >= secbits ? secbits : bits;
675} 707}
708LCRYPTO_ALIAS(BN_security_bits);
676 709
677BN_GENCB * 710BN_GENCB *
678BN_GENCB_new(void) 711BN_GENCB_new(void)
@@ -684,6 +717,7 @@ BN_GENCB_new(void)
684 717
685 return cb; 718 return cb;
686} 719}
720LCRYPTO_ALIAS(BN_GENCB_new);
687 721
688void 722void
689BN_GENCB_free(BN_GENCB *cb) 723BN_GENCB_free(BN_GENCB *cb)
@@ -692,6 +726,7 @@ BN_GENCB_free(BN_GENCB *cb)
692 return; 726 return;
693 free(cb); 727 free(cb);
694} 728}
729LCRYPTO_ALIAS(BN_GENCB_free);
695 730
696/* Populate a BN_GENCB structure with an "old"-style callback */ 731/* Populate a BN_GENCB structure with an "old"-style callback */
697void 732void
@@ -701,6 +736,7 @@ BN_GENCB_set_old(BN_GENCB *gencb, void (*cb)(int, int, void *), void *cb_arg)
701 gencb->cb.cb_1 = cb; 736 gencb->cb.cb_1 = cb;
702 gencb->arg = cb_arg; 737 gencb->arg = cb_arg;
703} 738}
739LCRYPTO_ALIAS(BN_GENCB_set_old);
704 740
705/* Populate a BN_GENCB structure with a "new"-style callback */ 741/* Populate a BN_GENCB structure with a "new"-style callback */
706void 742void
@@ -710,9 +746,11 @@ BN_GENCB_set(BN_GENCB *gencb, int (*cb)(int, int, BN_GENCB *), void *cb_arg)
710 gencb->cb.cb_2 = cb; 746 gencb->cb.cb_2 = cb;
711 gencb->arg = cb_arg; 747 gencb->arg = cb_arg;
712} 748}
749LCRYPTO_ALIAS(BN_GENCB_set);
713 750
714void * 751void *
715BN_GENCB_get_arg(BN_GENCB *cb) 752BN_GENCB_get_arg(BN_GENCB *cb)
716{ 753{
717 return cb->arg; 754 return cb->arg;
718} 755}
756LCRYPTO_ALIAS(BN_GENCB_get_arg);
diff --git a/src/lib/libcrypto/bn/bn_mod.c b/src/lib/libcrypto/bn/bn_mod.c
index 79766d0036..365f6fcf03 100644
--- a/src/lib/libcrypto/bn/bn_mod.c
+++ b/src/lib/libcrypto/bn/bn_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod.c,v 1.21 2023/06/13 09:28:13 tb Exp $ */ 1/* $OpenBSD: bn_mod.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. */ 3 * for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -146,6 +146,7 @@ BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
146 return BN_usub(r, m, r); 146 return BN_usub(r, m, r);
147 return 1; 147 return 1;
148} 148}
149LCRYPTO_ALIAS(BN_nnmod);
149 150
150int 151int
151BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 152BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
@@ -159,6 +160,7 @@ BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
159 return 0; 160 return 0;
160 return BN_nnmod(r, r, m, ctx); 161 return BN_nnmod(r, r, m, ctx);
161} 162}
163LCRYPTO_ALIAS(BN_mod_add);
162 164
163/* 165/*
164 * BN_mod_add() variant that may only be used if both a and b are non-negative 166 * BN_mod_add() variant that may only be used if both a and b are non-negative
@@ -177,6 +179,7 @@ BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m)
177 return BN_usub(r, r, m); 179 return BN_usub(r, r, m);
178 return 1; 180 return 1;
179} 181}
182LCRYPTO_ALIAS(BN_mod_add_quick);
180 183
181int 184int
182BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 185BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
@@ -190,6 +193,7 @@ BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
190 return 0; 193 return 0;
191 return BN_nnmod(r, r, m, ctx); 194 return BN_nnmod(r, r, m, ctx);
192} 195}
196LCRYPTO_ALIAS(BN_mod_sub);
193 197
194/* 198/*
195 * BN_mod_sub() variant that may only be used if both a and b are non-negative 199 * BN_mod_sub() variant that may only be used if both a and b are non-negative
@@ -208,6 +212,7 @@ BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m)
208 return 0; 212 return 0;
209 return BN_usub(r, m, r); 213 return BN_usub(r, m, r);
210} 214}
215LCRYPTO_ALIAS(BN_mod_sub_quick);
211 216
212int 217int
213BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 218BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
@@ -246,12 +251,14 @@ BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
246 251
247 return ret; 252 return ret;
248} 253}
254LCRYPTO_ALIAS(BN_mod_mul);
249 255
250int 256int
251BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) 257BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
252{ 258{
253 return BN_mod_mul(r, a, a, m, ctx); 259 return BN_mod_mul(r, a, a, m, ctx);
254} 260}
261LCRYPTO_ALIAS(BN_mod_sqr);
255 262
256int 263int
257BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) 264BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
@@ -264,6 +271,7 @@ BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
264 return 0; 271 return 0;
265 return BN_nnmod(r, r, m, ctx); 272 return BN_nnmod(r, r, m, ctx);
266} 273}
274LCRYPTO_ALIAS(BN_mod_lshift1);
267 275
268/* 276/*
269 * BN_mod_lshift1() variant that may be used if a is non-negative 277 * BN_mod_lshift1() variant that may be used if a is non-negative
@@ -282,6 +290,7 @@ BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m)
282 return BN_usub(r, r, m); 290 return BN_usub(r, r, m);
283 return 1; 291 return 1;
284} 292}
293LCRYPTO_ALIAS(BN_mod_lshift1_quick);
285 294
286int 295int
287BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx) 296BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx)
@@ -316,6 +325,7 @@ BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx)
316 325
317 return ret; 326 return ret;
318} 327}
328LCRYPTO_ALIAS(BN_mod_lshift);
319 329
320/* 330/*
321 * BN_mod_lshift() variant that may be used if a is non-negative 331 * BN_mod_lshift() variant that may be used if a is non-negative
@@ -356,3 +366,4 @@ BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m)
356 366
357 return 1; 367 return 1;
358} 368}
369LCRYPTO_ALIAS(BN_mod_lshift_quick);
diff --git a/src/lib/libcrypto/bn/bn_mod_sqrt.c b/src/lib/libcrypto/bn/bn_mod_sqrt.c
index acca540e25..bdd5b2cdba 100644
--- a/src/lib/libcrypto/bn/bn_mod_sqrt.c
+++ b/src/lib/libcrypto/bn/bn_mod_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2023/04/11 10:08:44 tb Exp $ */ 1/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2023/07/08 12:21:58 beck Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -724,3 +724,4 @@ BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
724 724
725 return NULL; 725 return NULL;
726} 726}
727LCRYPTO_ALIAS(BN_mod_sqrt);
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index b44246e070..12fea44c5a 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.60 2023/06/17 14:43:50 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.61 2023/07/08 12:21:58 beck 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 *
@@ -137,6 +137,7 @@ BN_MONT_CTX_new(void)
137 137
138 return mctx; 138 return mctx;
139} 139}
140LCRYPTO_ALIAS(BN_MONT_CTX_new);
140 141
141void 142void
142BN_MONT_CTX_free(BN_MONT_CTX *mctx) 143BN_MONT_CTX_free(BN_MONT_CTX *mctx)
@@ -150,6 +151,7 @@ BN_MONT_CTX_free(BN_MONT_CTX *mctx)
150 if (mctx->flags & BN_FLG_MALLOCED) 151 if (mctx->flags & BN_FLG_MALLOCED)
151 free(mctx); 152 free(mctx);
152} 153}
154LCRYPTO_ALIAS(BN_MONT_CTX_free);
153 155
154BN_MONT_CTX * 156BN_MONT_CTX *
155BN_MONT_CTX_copy(BN_MONT_CTX *dst, BN_MONT_CTX *src) 157BN_MONT_CTX_copy(BN_MONT_CTX *dst, BN_MONT_CTX *src)
@@ -168,6 +170,7 @@ BN_MONT_CTX_copy(BN_MONT_CTX *dst, BN_MONT_CTX *src)
168 170
169 return dst; 171 return dst;
170} 172}
173LCRYPTO_ALIAS(BN_MONT_CTX_copy);
171 174
172int 175int
173BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 176BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
@@ -257,6 +260,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
257 260
258 return ret; 261 return ret;
259} 262}
263LCRYPTO_ALIAS(BN_MONT_CTX_set);
260 264
261BN_MONT_CTX * 265BN_MONT_CTX *
262BN_MONT_CTX_set_locked(BN_MONT_CTX **pmctx, int lock, const BIGNUM *mod, 266BN_MONT_CTX_set_locked(BN_MONT_CTX **pmctx, int lock, const BIGNUM *mod,
@@ -293,6 +297,7 @@ BN_MONT_CTX_set_locked(BN_MONT_CTX **pmctx, int lock, const BIGNUM *mod,
293 done: 297 done:
294 return mctx; 298 return mctx;
295} 299}
300LCRYPTO_ALIAS(BN_MONT_CTX_set_locked);
296 301
297static int bn_montgomery_reduce(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mctx); 302static int bn_montgomery_reduce(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mctx);
298 303
@@ -497,6 +502,7 @@ BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
497 /* Compute r = aR * bR * R^-1 mod N = abR mod N */ 502 /* Compute r = aR * bR * R^-1 mod N = abR mod N */
498 return bn_mod_mul_montgomery(r, a, b, mctx, ctx); 503 return bn_mod_mul_montgomery(r, a, b, mctx, ctx);
499} 504}
505LCRYPTO_ALIAS(BN_mod_mul_montgomery);
500 506
501int 507int
502BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mctx, BN_CTX *ctx) 508BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mctx, BN_CTX *ctx)
@@ -504,6 +510,7 @@ BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mctx, BN_CTX *ctx)
504 /* Compute r = a * R * R * R^-1 mod N = aR mod N */ 510 /* Compute r = a * R * R * R^-1 mod N = aR mod N */
505 return bn_mod_mul_montgomery(r, a, &mctx->RR, mctx, ctx); 511 return bn_mod_mul_montgomery(r, a, &mctx->RR, mctx, ctx);
506} 512}
513LCRYPTO_ALIAS(BN_to_montgomery);
507 514
508/* 515/*
509 * bn_montgomery_reduce() performs Montgomery reduction, reducing the input 516 * bn_montgomery_reduce() performs Montgomery reduction, reducing the input
@@ -597,3 +604,4 @@ BN_from_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mctx, BN_CTX *ctx)
597 604
598 return ret; 605 return ret;
599} 606}
607LCRYPTO_ALIAS(BN_from_montgomery);
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c
index 65088cc5c4..bdeb9b0fe8 100644
--- a/src/lib/libcrypto/bn/bn_mul.c
+++ b/src/lib/libcrypto/bn/bn_mul.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mul.c,v 1.38 2023/06/12 16:17:24 jsing Exp $ */ 1/* $OpenBSD: bn_mul.c,v 1.39 2023/07/08 12:21:58 beck 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 *
@@ -367,3 +367,4 @@ BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
367 367
368 return ret; 368 return ret;
369} 369}
370LCRYPTO_ALIAS(BN_mul);
diff --git a/src/lib/libcrypto/bn/bn_prime.c b/src/lib/libcrypto/bn/bn_prime.c
index b8f0eb69ce..a09bac4ae9 100644
--- a/src/lib/libcrypto/bn/bn_prime.c
+++ b/src/lib/libcrypto/bn/bn_prime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_prime.c,v 1.32 2023/05/10 12:21:55 tb Exp $ */ 1/* $OpenBSD: bn_prime.c,v 1.33 2023/07/08 12:21:58 beck 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 *
@@ -150,6 +150,7 @@ BN_GENCB_call(BN_GENCB *cb, int a, int b)
150 /* Unrecognised callback type */ 150 /* Unrecognised callback type */
151 return 0; 151 return 0;
152} 152}
153LCRYPTO_ALIAS(BN_GENCB_call);
153 154
154int 155int
155BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, 156BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
@@ -230,12 +231,14 @@ BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
230 231
231 return found; 232 return found;
232} 233}
234LCRYPTO_ALIAS(BN_generate_prime_ex);
233 235
234int 236int
235BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb) 237BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb)
236{ 238{
237 return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); 239 return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
238} 240}
241LCRYPTO_ALIAS(BN_is_prime_ex);
239 242
240int 243int
241BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 244BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
@@ -255,6 +258,7 @@ BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
255 258
256 return is_prime; 259 return is_prime;
257} 260}
261LCRYPTO_ALIAS(BN_is_prime_fasttest_ex);
258 262
259static int 263static int
260probable_prime(BIGNUM *rnd, int bits) 264probable_prime(BIGNUM *rnd, int bits)
diff --git a/src/lib/libcrypto/bn/bn_rand.c b/src/lib/libcrypto/bn/bn_rand.c
index a03d70053b..f68913473f 100644
--- a/src/lib/libcrypto/bn/bn_rand.c
+++ b/src/lib/libcrypto/bn/bn_rand.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_rand.c,v 1.27 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: bn_rand.c,v 1.28 2023/07/08 12:21:58 beck 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 *
@@ -198,12 +198,14 @@ BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
198{ 198{
199 return bnrand(0, rnd, bits, top, bottom); 199 return bnrand(0, rnd, bits, top, bottom);
200} 200}
201LCRYPTO_ALIAS(BN_rand);
201 202
202int 203int
203BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) 204BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
204{ 205{
205 return bnrand(1, rnd, bits, top, bottom); 206 return bnrand(1, rnd, bits, top, bottom);
206} 207}
208LCRYPTO_ALIAS(BN_pseudo_rand);
207 209
208#if 1 210#if 1
209int 211int
@@ -279,6 +281,7 @@ BN_rand_range(BIGNUM *r, const BIGNUM *range)
279{ 281{
280 return bn_rand_range(0, r, range); 282 return bn_rand_range(0, r, range);
281} 283}
284LCRYPTO_ALIAS(BN_rand_range);
282 285
283int 286int
284bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc) 287bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc)
@@ -312,3 +315,4 @@ BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range)
312{ 315{
313 return bn_rand_range(1, r, range); 316 return bn_rand_range(1, r, range);
314} 317}
318LCRYPTO_ALIAS(BN_pseudo_rand_range);
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index eee3436702..12edc7c0a0 100644
--- a/src/lib/libcrypto/bn/bn_shift.c
+++ b/src/lib/libcrypto/bn/bn_shift.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_shift.c,v 1.21 2023/02/13 04:25:37 jsing Exp $ */ 1/* $OpenBSD: bn_shift.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -151,21 +151,25 @@ BN_lshift1(BIGNUM *r, const BIGNUM *a)
151{ 151{
152 return bn_lshift(r, a, 1); 152 return bn_lshift(r, a, 1);
153} 153}
154LCRYPTO_ALIAS(BN_lshift1);
154 155
155int 156int
156BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 157BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
157{ 158{
158 return bn_lshift(r, a, n); 159 return bn_lshift(r, a, n);
159} 160}
161LCRYPTO_ALIAS(BN_lshift);
160 162
161int 163int
162BN_rshift1(BIGNUM *r, const BIGNUM *a) 164BN_rshift1(BIGNUM *r, const BIGNUM *a)
163{ 165{
164 return bn_rshift(r, a, 1); 166 return bn_rshift(r, a, 1);
165} 167}
168LCRYPTO_ALIAS(BN_rshift1);
166 169
167int 170int
168BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 171BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
169{ 172{
170 return bn_rshift(r, a, n); 173 return bn_rshift(r, a, n);
171} 174}
175LCRYPTO_ALIAS(BN_rshift);
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c
index 2879d34c0e..0dbccbf85d 100644
--- a/src/lib/libcrypto/bn/bn_sqr.c
+++ b/src/lib/libcrypto/bn/bn_sqr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqr.c,v 1.35 2023/07/02 13:11:23 jsing Exp $ */ 1/* $OpenBSD: bn_sqr.c,v 1.36 2023/07/08 12:21:58 beck 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 *
@@ -302,3 +302,4 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
302 302
303 return ret; 303 return ret;
304} 304}
305LCRYPTO_ALIAS(BN_sqr);
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c
index 68d5c2a4b4..a82b911e67 100644
--- a/src/lib/libcrypto/bn/bn_word.c
+++ b/src/lib/libcrypto/bn/bn_word.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_word.c,v 1.20 2023/03/11 14:14:54 jsing Exp $ */ 1/* $OpenBSD: bn_word.c,v 1.21 2023/07/08 12:21:58 beck 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 *
@@ -100,6 +100,7 @@ BN_mod_word(const BIGNUM *a, BN_ULONG w)
100 } 100 }
101 return ((BN_ULONG)ret); 101 return ((BN_ULONG)ret);
102} 102}
103LCRYPTO_ALIAS(BN_mod_word);
103 104
104BN_ULONG 105BN_ULONG
105BN_div_word(BIGNUM *a, BN_ULONG w) 106BN_div_word(BIGNUM *a, BN_ULONG w)
@@ -137,6 +138,7 @@ BN_div_word(BIGNUM *a, BN_ULONG w)
137 138
138 return (ret); 139 return (ret);
139} 140}
141LCRYPTO_ALIAS(BN_div_word);
140 142
141int 143int
142BN_add_word(BIGNUM *a, BN_ULONG w) 144BN_add_word(BIGNUM *a, BN_ULONG w)
@@ -171,6 +173,7 @@ BN_add_word(BIGNUM *a, BN_ULONG w)
171 } 173 }
172 return (1); 174 return (1);
173} 175}
176LCRYPTO_ALIAS(BN_add_word);
174 177
175int 178int
176BN_sub_word(BIGNUM *a, BN_ULONG w) 179BN_sub_word(BIGNUM *a, BN_ULONG w)
@@ -217,6 +220,7 @@ BN_sub_word(BIGNUM *a, BN_ULONG w)
217 a->top--; 220 a->top--;
218 return (1); 221 return (1);
219} 222}
223LCRYPTO_ALIAS(BN_sub_word);
220 224
221int 225int
222BN_mul_word(BIGNUM *a, BN_ULONG w) 226BN_mul_word(BIGNUM *a, BN_ULONG w)
@@ -238,3 +242,4 @@ BN_mul_word(BIGNUM *a, BN_ULONG w)
238 } 242 }
239 return (1); 243 return (1);
240} 244}
245LCRYPTO_ALIAS(BN_mul_word);
diff --git a/src/lib/libcrypto/hidden/openssl/bn.h b/src/lib/libcrypto/hidden/openssl/bn.h
new file mode 100644
index 0000000000..6c23a5c6d8
--- /dev/null
+++ b/src/lib/libcrypto/hidden/openssl/bn.h
@@ -0,0 +1,163 @@
1/* $OpenBSD: bn.h,v 1.1 2023/07/08 12:21:58 beck Exp $ */
2/*
3 * Copyright (c) 2023 Bob Beck <beck@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _LIBCRYPTO_BN_H
19#define _LIBCRYPTO_BN_H
20
21#ifndef _MSC_VER
22#include_next <openssl/bn.h>
23#else
24#include "../include/openssl/bn.h"
25#endif
26#include "crypto_namespace.h"
27
28LCRYPTO_USED(BN_set_flags);
29LCRYPTO_USED(BN_get_flags);
30LCRYPTO_USED(BN_with_flags);
31LCRYPTO_USED(BN_GENCB_new);
32LCRYPTO_USED(BN_GENCB_free);
33LCRYPTO_USED(BN_GENCB_call);
34LCRYPTO_USED(BN_GENCB_set_old);
35LCRYPTO_USED(BN_GENCB_set);
36LCRYPTO_USED(BN_GENCB_get_arg);
37LCRYPTO_USED(BN_abs_is_word);
38LCRYPTO_USED(BN_is_zero);
39LCRYPTO_USED(BN_is_one);
40LCRYPTO_USED(BN_is_word);
41LCRYPTO_USED(BN_is_odd);
42LCRYPTO_USED(BN_zero);
43LCRYPTO_USED(BN_one);
44LCRYPTO_USED(BN_value_one);
45LCRYPTO_USED(BN_options);
46LCRYPTO_USED(BN_CTX_new);
47LCRYPTO_USED(BN_CTX_free);
48LCRYPTO_USED(BN_CTX_start);
49LCRYPTO_USED(BN_CTX_get);
50LCRYPTO_USED(BN_CTX_end);
51LCRYPTO_USED(BN_rand);
52LCRYPTO_USED(BN_pseudo_rand);
53LCRYPTO_USED(BN_rand_range);
54LCRYPTO_USED(BN_pseudo_rand_range);
55LCRYPTO_USED(BN_num_bits);
56LCRYPTO_USED(BN_num_bits_word);
57LCRYPTO_USED(BN_new);
58LCRYPTO_USED(BN_clear_free);
59LCRYPTO_USED(BN_copy);
60LCRYPTO_USED(BN_swap);
61LCRYPTO_USED(BN_bin2bn);
62LCRYPTO_USED(BN_bn2bin);
63LCRYPTO_USED(BN_bn2binpad);
64LCRYPTO_USED(BN_lebin2bn);
65LCRYPTO_USED(BN_bn2lebinpad);
66LCRYPTO_USED(BN_mpi2bn);
67LCRYPTO_USED(BN_bn2mpi);
68LCRYPTO_USED(BN_sub);
69LCRYPTO_USED(BN_usub);
70LCRYPTO_USED(BN_uadd);
71LCRYPTO_USED(BN_add);
72LCRYPTO_USED(BN_mul);
73LCRYPTO_USED(BN_sqr);
74LCRYPTO_USED(BN_set_negative);
75LCRYPTO_USED(BN_is_negative);
76LCRYPTO_USED(BN_nnmod);
77LCRYPTO_USED(BN_mod_add);
78LCRYPTO_USED(BN_mod_add_quick);
79LCRYPTO_USED(BN_mod_sub);
80LCRYPTO_USED(BN_mod_sub_quick);
81LCRYPTO_USED(BN_mod_mul);
82LCRYPTO_USED(BN_mod_sqr);
83LCRYPTO_USED(BN_mod_lshift1);
84LCRYPTO_USED(BN_mod_lshift1_quick);
85LCRYPTO_USED(BN_mod_lshift);
86LCRYPTO_USED(BN_mod_lshift_quick);
87LCRYPTO_USED(BN_mod_word);
88LCRYPTO_USED(BN_div_word);
89LCRYPTO_USED(BN_mul_word);
90LCRYPTO_USED(BN_add_word);
91LCRYPTO_USED(BN_sub_word);
92LCRYPTO_USED(BN_set_word);
93LCRYPTO_USED(BN_get_word);
94LCRYPTO_USED(BN_cmp);
95LCRYPTO_USED(BN_free);
96LCRYPTO_USED(BN_is_bit_set);
97LCRYPTO_USED(BN_lshift);
98LCRYPTO_USED(BN_lshift1);
99LCRYPTO_USED(BN_exp);
100LCRYPTO_USED(BN_mod_exp_mont_consttime);
101LCRYPTO_USED(BN_mod_exp_mont_word);
102LCRYPTO_USED(BN_mod_exp2_mont);
103LCRYPTO_USED(BN_mod_exp_simple);
104LCRYPTO_USED(BN_mask_bits);
105LCRYPTO_USED(BN_print_fp);
106LCRYPTO_USED(BN_print);
107LCRYPTO_USED(BN_rshift);
108LCRYPTO_USED(BN_rshift1);
109LCRYPTO_USED(BN_clear);
110LCRYPTO_USED(BN_dup);
111LCRYPTO_USED(BN_ucmp);
112LCRYPTO_USED(BN_set_bit);
113LCRYPTO_USED(BN_clear_bit);
114LCRYPTO_USED(BN_bn2hex);
115LCRYPTO_USED(BN_bn2dec);
116LCRYPTO_USED(BN_hex2bn);
117LCRYPTO_USED(BN_dec2bn);
118LCRYPTO_USED(BN_asc2bn);
119LCRYPTO_USED(BN_kronecker);
120LCRYPTO_USED(BN_mod_sqrt);
121LCRYPTO_USED(BN_consttime_swap);
122LCRYPTO_USED(BN_security_bits);
123LCRYPTO_USED(BN_generate_prime_ex);
124LCRYPTO_USED(BN_is_prime_ex);
125LCRYPTO_USED(BN_is_prime_fasttest_ex);
126LCRYPTO_USED(BN_MONT_CTX_new);
127LCRYPTO_USED(BN_mod_mul_montgomery);
128LCRYPTO_USED(BN_to_montgomery);
129LCRYPTO_USED(BN_from_montgomery);
130LCRYPTO_USED(BN_MONT_CTX_free);
131LCRYPTO_USED(BN_MONT_CTX_set);
132LCRYPTO_USED(BN_MONT_CTX_copy);
133LCRYPTO_USED(BN_MONT_CTX_set_locked);
134LCRYPTO_USED(BN_BLINDING_new);
135LCRYPTO_USED(BN_BLINDING_free);
136LCRYPTO_USED(BN_BLINDING_update);
137LCRYPTO_USED(BN_BLINDING_convert);
138LCRYPTO_USED(BN_BLINDING_invert);
139LCRYPTO_USED(BN_BLINDING_convert_ex);
140LCRYPTO_USED(BN_BLINDING_invert_ex);
141LCRYPTO_USED(BN_BLINDING_thread_id);
142LCRYPTO_USED(BN_BLINDING_get_flags);
143LCRYPTO_USED(BN_BLINDING_set_flags);
144LCRYPTO_USED(BN_BLINDING_create_param);
145LCRYPTO_USED(get_rfc2409_prime_768);
146LCRYPTO_USED(get_rfc2409_prime_1024);
147LCRYPTO_USED(BN_get_rfc2409_prime_768);
148LCRYPTO_USED(BN_get_rfc2409_prime_1024);
149LCRYPTO_USED(get_rfc3526_prime_1536);
150LCRYPTO_USED(get_rfc3526_prime_2048);
151LCRYPTO_USED(get_rfc3526_prime_3072);
152LCRYPTO_USED(get_rfc3526_prime_4096);
153LCRYPTO_USED(get_rfc3526_prime_6144);
154LCRYPTO_USED(get_rfc3526_prime_8192);
155LCRYPTO_USED(BN_get_rfc3526_prime_1536);
156LCRYPTO_USED(BN_get_rfc3526_prime_2048);
157LCRYPTO_USED(BN_get_rfc3526_prime_3072);
158LCRYPTO_USED(BN_get_rfc3526_prime_4096);
159LCRYPTO_USED(BN_get_rfc3526_prime_6144);
160LCRYPTO_USED(BN_get_rfc3526_prime_8192);
161LCRYPTO_USED(ERR_load_BN_strings);
162
163#endif /* _LIBCRYPTO_BN_H */