diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2023-07-08 12:21:59 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2023-07-08 12:21:59 +0000 |
commit | 5022f59e58d2d32fb763591c7fb0e76cdf7af0a0 (patch) | |
tree | 8c2cd62ece1ce161dd92aa41125415dbbf6edb98 | |
parent | d75a60596ea3ee16ef5d7680a98f9e1b1fd8600e (diff) |
Hide symbols in bn
ok tb@
-rw-r--r-- | lib/libcrypto/Symbols.namespace | 134 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_add.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_blind.c | 13 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_const.c | 18 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_convert.c | 16 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_ctx.c | 7 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_err.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_exp.c | 7 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_kron.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_lib.c | 40 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_mod.c | 13 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_mod_sqrt.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_mont.c | 10 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_mul.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_prime.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_rand.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_shift.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_sqr.c | 3 | ||||
-rw-r--r-- | lib/libcrypto/bn/bn_word.c | 7 | ||||
-rw-r--r-- | lib/libcrypto/hidden/openssl/bn.h | 163 |
20 files changed, 449 insertions, 18 deletions
diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 2c5ec993c22..66de59acdb7 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2255,3 +2255,137 @@ _libre_TXT_DB_create_index _libre_TXT_DB_free _libre_TXT_DB_get_by_index _libre_TXT_DB_insert +_libre_BN_set_flags +_libre_BN_get_flags +_libre_BN_with_flags +_libre_BN_GENCB_new +_libre_BN_GENCB_free +_libre_BN_GENCB_call +_libre_BN_GENCB_set_old +_libre_BN_GENCB_set +_libre_BN_GENCB_get_arg +_libre_BN_abs_is_word +_libre_BN_is_zero +_libre_BN_is_one +_libre_BN_is_word +_libre_BN_is_odd +_libre_BN_zero +_libre_BN_one +_libre_BN_value_one +_libre_BN_options +_libre_BN_CTX_new +_libre_BN_CTX_free +_libre_BN_CTX_start +_libre_BN_CTX_get +_libre_BN_CTX_end +_libre_BN_rand +_libre_BN_pseudo_rand +_libre_BN_rand_range +_libre_BN_pseudo_rand_range +_libre_BN_num_bits +_libre_BN_num_bits_word +_libre_BN_new +_libre_BN_clear_free +_libre_BN_copy +_libre_BN_swap +_libre_BN_bin2bn +_libre_BN_bn2bin +_libre_BN_bn2binpad +_libre_BN_lebin2bn +_libre_BN_bn2lebinpad +_libre_BN_mpi2bn +_libre_BN_bn2mpi +_libre_BN_sub +_libre_BN_usub +_libre_BN_uadd +_libre_BN_add +_libre_BN_mul +_libre_BN_sqr +_libre_BN_set_negative +_libre_BN_is_negative +_libre_BN_nnmod +_libre_BN_mod_add +_libre_BN_mod_add_quick +_libre_BN_mod_sub +_libre_BN_mod_sub_quick +_libre_BN_mod_mul +_libre_BN_mod_sqr +_libre_BN_mod_lshift1 +_libre_BN_mod_lshift1_quick +_libre_BN_mod_lshift +_libre_BN_mod_lshift_quick +_libre_BN_mod_word +_libre_BN_div_word +_libre_BN_mul_word +_libre_BN_add_word +_libre_BN_sub_word +_libre_BN_set_word +_libre_BN_get_word +_libre_BN_cmp +_libre_BN_free +_libre_BN_is_bit_set +_libre_BN_lshift +_libre_BN_lshift1 +_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 +_libre_BN_rshift +_libre_BN_rshift1 +_libre_BN_clear +_libre_BN_dup +_libre_BN_ucmp +_libre_BN_set_bit +_libre_BN_clear_bit +_libre_BN_bn2hex +_libre_BN_bn2dec +_libre_BN_hex2bn +_libre_BN_dec2bn +_libre_BN_asc2bn +_libre_BN_kronecker +_libre_BN_mod_sqrt +_libre_BN_consttime_swap +_libre_BN_security_bits +_libre_BN_generate_prime_ex +_libre_BN_is_prime_ex +_libre_BN_is_prime_fasttest_ex +_libre_BN_MONT_CTX_new +_libre_BN_mod_mul_montgomery +_libre_BN_to_montgomery +_libre_BN_from_montgomery +_libre_BN_MONT_CTX_free +_libre_BN_MONT_CTX_set +_libre_BN_MONT_CTX_copy +_libre_BN_MONT_CTX_set_locked +_libre_BN_BLINDING_new +_libre_BN_BLINDING_free +_libre_BN_BLINDING_update +_libre_BN_BLINDING_convert +_libre_BN_BLINDING_invert +_libre_BN_BLINDING_convert_ex +_libre_BN_BLINDING_invert_ex +_libre_BN_BLINDING_thread_id +_libre_BN_BLINDING_get_flags +_libre_BN_BLINDING_set_flags +_libre_BN_BLINDING_create_param +_libre_get_rfc2409_prime_768 +_libre_get_rfc2409_prime_1024 +_libre_BN_get_rfc2409_prime_768 +_libre_BN_get_rfc2409_prime_1024 +_libre_get_rfc3526_prime_1536 +_libre_get_rfc3526_prime_2048 +_libre_get_rfc3526_prime_3072 +_libre_get_rfc3526_prime_4096 +_libre_get_rfc3526_prime_6144 +_libre_get_rfc3526_prime_8192 +_libre_BN_get_rfc3526_prime_1536 +_libre_BN_get_rfc3526_prime_2048 +_libre_BN_get_rfc3526_prime_3072 +_libre_BN_get_rfc3526_prime_4096 +_libre_BN_get_rfc3526_prime_6144 +_libre_BN_get_rfc3526_prime_8192 +_libre_ERR_load_BN_strings diff --git a/lib/libcrypto/bn/bn_add.c b/lib/libcrypto/bn/bn_add.c index 36f160ab5fe..86768a312ad 100644 --- a/lib/libcrypto/bn/bn_add.c +++ b/lib/libcrypto/bn/bn_add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_add.c,v 1.25 2023/06/12 16:17:24 jsing Exp $ */ +/* $OpenBSD: bn_add.c,v 1.26 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -248,6 +248,7 @@ BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) return 1; } +LCRYPTO_ALIAS(BN_uadd); int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) @@ -277,6 +278,7 @@ BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) return 1; } +LCRYPTO_ALIAS(BN_usub); int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) @@ -306,6 +308,7 @@ BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) return ret; } +LCRYPTO_ALIAS(BN_add); int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) @@ -335,3 +338,4 @@ BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) return ret; } +LCRYPTO_ALIAS(BN_sub); diff --git a/lib/libcrypto/bn/bn_blind.c b/lib/libcrypto/bn/bn_blind.c index 77ba691b6df..07cd359e7e6 100644 --- a/lib/libcrypto/bn/bn_blind.c +++ b/lib/libcrypto/bn/bn_blind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_blind.c,v 1.22 2023/04/25 19:57:59 tb Exp $ */ +/* $OpenBSD: bn_blind.c,v 1.23 2023/07/08 12:21:58 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -169,6 +169,7 @@ err: BN_BLINDING_free(ret); return (NULL); } +LCRYPTO_ALIAS(BN_BLINDING_new); void BN_BLINDING_free(BN_BLINDING *r) @@ -182,6 +183,7 @@ BN_BLINDING_free(BN_BLINDING *r) BN_free(r->mod); free(r); } +LCRYPTO_ALIAS(BN_BLINDING_free); int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx) @@ -215,12 +217,14 @@ err: b->counter = 0; return (ret); } +LCRYPTO_ALIAS(BN_BLINDING_update); int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) { return BN_BLINDING_convert_ex(n, NULL, b, ctx); } +LCRYPTO_ALIAS(BN_BLINDING_convert); int BN_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) return ret; } +LCRYPTO_ALIAS(BN_BLINDING_convert_ex); int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) { return BN_BLINDING_invert_ex(n, NULL, b, ctx); } +LCRYPTO_ALIAS(BN_BLINDING_invert); int BN_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) return (ret); } +LCRYPTO_ALIAS(BN_BLINDING_invert_ex); CRYPTO_THREADID * BN_BLINDING_thread_id(BN_BLINDING *b) { return &b->tid; } +LCRYPTO_ALIAS(BN_BLINDING_thread_id); unsigned long BN_BLINDING_get_flags(const BN_BLINDING *b) { return b->flags; } +LCRYPTO_ALIAS(BN_BLINDING_get_flags); void BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags) { b->flags = flags; } +LCRYPTO_ALIAS(BN_BLINDING_set_flags); BN_BLINDING * BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, @@ -363,3 +373,4 @@ err: return ret; } +LCRYPTO_ALIAS(BN_BLINDING_create_param); diff --git a/lib/libcrypto/bn/bn_const.c b/lib/libcrypto/bn/bn_const.c index 0ceff9160dd..e0009b0be4d 100644 --- a/lib/libcrypto/bn/bn_const.c +++ b/lib/libcrypto/bn/bn_const.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_const.c,v 1.5 2018/02/20 17:02:30 jsing Exp $ */ +/* $OpenBSD: bn_const.c,v 1.6 2023/07/08 12:21:58 beck Exp $ */ /* Insert boilerplate */ #include <openssl/bn.h> @@ -26,12 +26,14 @@ get_rfc2409_prime_768(BIGNUM *bn) }; return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn); } +LCRYPTO_ALIAS(get_rfc2409_prime_768); BIGNUM * BN_get_rfc2409_prime_768(BIGNUM *bn) { return get_rfc2409_prime_768(bn); } +LCRYPTO_ALIAS(BN_get_rfc2409_prime_768); /* "Second Oakley Default Group" from RFC2409, section 6.2. * @@ -59,12 +61,14 @@ get_rfc2409_prime_1024(BIGNUM *bn) }; return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn); } +LCRYPTO_ALIAS(get_rfc2409_prime_1024); BIGNUM * BN_get_rfc2409_prime_1024(BIGNUM *bn) { return get_rfc2409_prime_1024(bn); } +LCRYPTO_ALIAS(BN_get_rfc2409_prime_1024); /* "1536-bit MODP Group" from RFC3526, Section 2. * @@ -97,12 +101,14 @@ get_rfc3526_prime_1536(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn); } +LCRYPTO_ALIAS(get_rfc3526_prime_1536); BIGNUM * BN_get_rfc3526_prime_1536(BIGNUM *bn) { return get_rfc3526_prime_1536(bn); } +LCRYPTO_ALIAS(BN_get_rfc3526_prime_1536); /* "2048-bit MODP Group" from RFC3526, Section 3. * @@ -140,12 +146,14 @@ get_rfc3526_prime_2048(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_2048, sizeof(RFC3526_PRIME_2048), bn); } +LCRYPTO_ALIAS(get_rfc3526_prime_2048); BIGNUM * BN_get_rfc3526_prime_2048(BIGNUM *bn) { return get_rfc3526_prime_2048(bn); } +LCRYPTO_ALIAS(BN_get_rfc3526_prime_2048); /* "3072-bit MODP Group" from RFC3526, Section 4. * @@ -193,12 +201,14 @@ get_rfc3526_prime_3072(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_3072, sizeof(RFC3526_PRIME_3072), bn); } +LCRYPTO_ALIAS(get_rfc3526_prime_3072); BIGNUM * BN_get_rfc3526_prime_3072(BIGNUM *bn) { return get_rfc3526_prime_3072(bn); } +LCRYPTO_ALIAS(BN_get_rfc3526_prime_3072); /* "4096-bit MODP Group" from RFC3526, Section 5. * @@ -257,12 +267,14 @@ get_rfc3526_prime_4096(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_4096, sizeof(RFC3526_PRIME_4096), bn); } +LCRYPTO_ALIAS(get_rfc3526_prime_4096); BIGNUM * BN_get_rfc3526_prime_4096(BIGNUM *bn) { return get_rfc3526_prime_4096(bn); } +LCRYPTO_ALIAS(BN_get_rfc3526_prime_4096); /* "6144-bit MODP Group" from RFC3526, Section 6. * @@ -342,12 +354,14 @@ get_rfc3526_prime_6144(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_6144, sizeof(RFC3526_PRIME_6144), bn); } +LCRYPTO_ALIAS(get_rfc3526_prime_6144); BIGNUM * BN_get_rfc3526_prime_6144(BIGNUM *bn) { return get_rfc3526_prime_6144(bn); } +LCRYPTO_ALIAS(BN_get_rfc3526_prime_6144); /* "8192-bit MODP Group" from RFC3526, Section 7. * @@ -449,9 +463,11 @@ get_rfc3526_prime_8192(BIGNUM *bn) }; return BN_bin2bn(RFC3526_PRIME_8192, sizeof(RFC3526_PRIME_8192), bn); } +LCRYPTO_ALIAS(get_rfc3526_prime_8192); BIGNUM * BN_get_rfc3526_prime_8192(BIGNUM *bn) { return get_rfc3526_prime_8192(bn); } +LCRYPTO_ALIAS(BN_get_rfc3526_prime_8192); diff --git a/lib/libcrypto/bn/bn_convert.c b/lib/libcrypto/bn/bn_convert.c index 4736099cdc6..cb0a23e0108 100644 --- a/lib/libcrypto/bn/bn_convert.c +++ b/lib/libcrypto/bn/bn_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_convert.c,v 1.12 2023/06/23 10:48:40 tb Exp $ */ +/* $OpenBSD: bn_convert.c,v 1.13 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -142,6 +142,7 @@ BN_bn2bin(const BIGNUM *a, unsigned char *to) { return bn2binpad(a, to, -1, big); } +LCRYPTO_ALIAS(BN_bn2bin); int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) @@ -150,6 +151,7 @@ BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) return -1; return bn2binpad(a, to, tolen, big); } +LCRYPTO_ALIAS(BN_bn2binpad); BIGNUM * BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) @@ -192,6 +194,7 @@ BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) bn_correct_top(ret); return (ret); } +LCRYPTO_ALIAS(BN_bin2bn); int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen) @@ -201,6 +204,7 @@ BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen) return bn2binpad(a, to, tolen, little); } +LCRYPTO_ALIAS(BN_bn2lebinpad); BIGNUM * BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret) @@ -254,6 +258,7 @@ BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret) return ret; } +LCRYPTO_ALIAS(BN_lebin2bn); int BN_asc2bn(BIGNUM **bnp, const char *s) @@ -306,6 +311,7 @@ BN_asc2bn(BIGNUM **bnp, const char *s) return 1; } +LCRYPTO_ALIAS(BN_asc2bn); char * BN_bn2dec(const BIGNUM *bn) @@ -384,6 +390,7 @@ BN_bn2dec(const BIGNUM *bn) return s; } +LCRYPTO_ALIAS(BN_bn2dec); static int bn_dec2bn_cbs(BIGNUM **bnp, CBS *cbs) @@ -488,6 +495,7 @@ BN_dec2bn(BIGNUM **bnp, const char *s) return bn_dec2bn_cbs(bnp, &cbs); } +LCRYPTO_ALIAS(BN_dec2bn); char * BN_bn2hex(const BIGNUM *bn) @@ -533,6 +541,7 @@ BN_bn2hex(const BIGNUM *bn) return s; } +LCRYPTO_ALIAS(BN_bn2hex); static int bn_hex2bn_cbs(BIGNUM **bnp, CBS *cbs) @@ -641,6 +650,7 @@ BN_hex2bn(BIGNUM **bnp, const char *s) return bn_hex2bn_cbs(bnp, &cbs); } +LCRYPTO_ALIAS(BN_hex2bn); int BN_bn2mpi(const BIGNUM *a, unsigned char *d) @@ -670,6 +680,7 @@ BN_bn2mpi(const BIGNUM *a, unsigned char *d) d[4] |= 0x80; return (num + 4 + ext); } +LCRYPTO_ALIAS(BN_bn2mpi); BIGNUM * BN_mpi2bn(const unsigned char *d, int n, BIGNUM *ain) @@ -713,6 +724,7 @@ BN_mpi2bn(const unsigned char *d, int n, BIGNUM *ain) } return (a); } +LCRYPTO_ALIAS(BN_mpi2bn); #ifndef OPENSSL_NO_BIO int @@ -728,6 +740,7 @@ BN_print_fp(FILE *fp, const BIGNUM *a) BIO_free(b); return (ret); } +LCRYPTO_ALIAS(BN_print_fp); int BN_print(BIO *bp, const BIGNUM *a) @@ -755,4 +768,5 @@ BN_print(BIO *bp, const BIGNUM *a) end: return (ret); } +LCRYPTO_ALIAS(BN_print); #endif diff --git a/lib/libcrypto/bn/bn_ctx.c b/lib/libcrypto/bn/bn_ctx.c index 357eda17834..129b9c97810 100644 --- a/lib/libcrypto/bn/bn_ctx.c +++ b/lib/libcrypto/bn/bn_ctx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_ctx.c,v 1.21 2023/04/25 16:41:29 tb Exp $ */ +/* $OpenBSD: bn_ctx.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ /* * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> * @@ -70,6 +70,7 @@ BN_CTX_new(void) { return calloc(1, sizeof(struct bignum_ctx)); } +LCRYPTO_ALIAS(BN_CTX_new); void BN_CTX_free(BN_CTX *bctx) @@ -89,6 +90,7 @@ BN_CTX_free(BN_CTX *bctx) freezero(bctx, sizeof(*bctx)); } +LCRYPTO_ALIAS(BN_CTX_free); void BN_CTX_start(BN_CTX *bctx) @@ -101,6 +103,7 @@ BN_CTX_start(BN_CTX *bctx) return; } } +LCRYPTO_ALIAS(BN_CTX_start); BIGNUM * BN_CTX_get(BN_CTX *bctx) @@ -139,6 +142,7 @@ BN_CTX_get(BN_CTX *bctx) return bn; } +LCRYPTO_ALIAS(BN_CTX_get); void BN_CTX_end(BN_CTX *bctx) @@ -154,3 +158,4 @@ BN_CTX_end(BN_CTX *bctx) bctx->group--; } +LCRYPTO_ALIAS(BN_CTX_end); diff --git a/lib/libcrypto/bn/bn_err.c b/lib/libcrypto/bn/bn_err.c index b861ea9374a..6fd6030a0c6 100644 --- a/lib/libcrypto/bn/bn_err.c +++ b/lib/libcrypto/bn/bn_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_err.c,v 1.16 2023/06/13 09:12:22 tb Exp $ */ +/* $OpenBSD: bn_err.c,v 1.17 2023/07/08 12:21:58 beck Exp $ */ /* ==================================================================== * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. * @@ -105,3 +105,4 @@ ERR_load_BN_strings(void) } #endif } +LCRYPTO_ALIAS(ERR_load_BN_strings); diff --git a/lib/libcrypto/bn/bn_exp.c b/lib/libcrypto/bn/bn_exp.c index 9e5d1fd26db..a50fa5953ce 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.46 2023/05/09 05:38:11 tb Exp $ */ +/* $OpenBSD: bn_exp.c,v 1.47 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -173,6 +173,7 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) return ret; } +LCRYPTO_ALIAS(BN_exp); /* The old fallback, simple version :-) */ int @@ -291,6 +292,7 @@ err: BN_CTX_end(ctx); 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 @@ -632,6 +634,7 @@ err: BN_CTX_end(ctx); return (ret); } +LCRYPTO_ALIAS(BN_mod_exp_mont_consttime); static int BN_mod_exp_mont_internal(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, @@ -947,6 +950,7 @@ err: BN_CTX_end(ctx); return (ret); } +LCRYPTO_ALIAS(BN_mod_exp_mont_word); int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, @@ -1331,3 +1335,4 @@ err: BN_CTX_end(ctx); return (ret); } +LCRYPTO_ALIAS(BN_mod_exp2_mont); diff --git a/lib/libcrypto/bn/bn_kron.c b/lib/libcrypto/bn/bn_kron.c index f48823acabb..a170d688e95 100644 --- a/lib/libcrypto/bn/bn_kron.c +++ b/lib/libcrypto/bn/bn_kron.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_kron.c,v 1.14 2023/03/27 10:21:23 tb Exp $ */ +/* $OpenBSD: bn_kron.c,v 1.15 2023/07/08 12:21:58 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. * @@ -192,3 +192,4 @@ BN_kronecker(const BIGNUM *A, const BIGNUM *B, BN_CTX *ctx) return ret; } +LCRYPTO_ALIAS(BN_kronecker); diff --git a/lib/libcrypto/bn/bn_lib.c b/lib/libcrypto/bn/bn_lib.c index bac0290efa2..74359dab37c 100644 --- a/lib/libcrypto/bn/bn_lib.c +++ b/lib/libcrypto/bn/bn_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lib.c,v 1.88 2023/06/21 07:48:41 jsing Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.89 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -81,6 +81,7 @@ BN_new(void) return bn; } +LCRYPTO_ALIAS(BN_new); void BN_init(BIGNUM *a) @@ -96,6 +97,7 @@ BN_clear(BIGNUM *a) a->top = 0; a->neg = 0; } +LCRYPTO_ALIAS(BN_clear); void BN_free(BIGNUM *bn) @@ -113,24 +115,28 @@ BN_free(BIGNUM *bn) freezero(bn, sizeof(*bn)); } +LCRYPTO_ALIAS(BN_free); void BN_clear_free(BIGNUM *bn) { BN_free(bn); } +LCRYPTO_ALIAS(BN_clear_free); void BN_set_flags(BIGNUM *b, int n) { b->flags |= n; } +LCRYPTO_ALIAS(BN_set_flags); int BN_get_flags(const BIGNUM *b, int n) { return b->flags & n; } +LCRYPTO_ALIAS(BN_get_flags); void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags) @@ -143,6 +149,7 @@ BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags) *dest = *b; dest->flags = dest_flags; } +LCRYPTO_ALIAS(BN_with_flags); static const BN_ULONG bn_value_one_data = 1; static const BIGNUM bn_value_one = { @@ -158,18 +165,21 @@ BN_value_one(void) { return &bn_value_one; } +LCRYPTO_ALIAS(BN_value_one); int BN_num_bits_word(BN_ULONG w) { return BN_BITS2 - bn_clzw(w); } +LCRYPTO_ALIAS(BN_num_bits_word); int BN_num_bits(const BIGNUM *bn) { return bn_bitsize(bn); } +LCRYPTO_ALIAS(BN_num_bits); void bn_correct_top(BIGNUM *a) @@ -253,6 +263,7 @@ BN_dup(const BIGNUM *a) } return t; } +LCRYPTO_ALIAS(BN_dup); static inline void bn_copy_words(BN_ULONG *ap, const BN_ULONG *bp, int n) @@ -284,6 +295,7 @@ BN_copy(BIGNUM *a, const BIGNUM *b) return (a); } +LCRYPTO_ALIAS(BN_copy); int bn_copy(BIGNUM *dst, const BIGNUM *src) @@ -322,6 +334,7 @@ BN_swap(BIGNUM *a, BIGNUM *b) b->flags = (flags_old_b & BN_FLG_MALLOCED) | (flags_old_a & BN_FLG_STATIC_DATA); } +LCRYPTO_ALIAS(BN_swap); BN_ULONG BN_get_word(const BIGNUM *a) @@ -333,6 +346,7 @@ BN_get_word(const BIGNUM *a) /* a->top == 0 */ return 0; } +LCRYPTO_ALIAS(BN_get_word); int BN_set_word(BIGNUM *a, BN_ULONG w) @@ -344,6 +358,7 @@ BN_set_word(BIGNUM *a, BN_ULONG w) a->top = (w ? 1 : 0); return (1); } +LCRYPTO_ALIAS(BN_set_word); int BN_ucmp(const BIGNUM *a, const BIGNUM *b) @@ -362,6 +377,7 @@ BN_ucmp(const BIGNUM *a, const BIGNUM *b) return 0; } +LCRYPTO_ALIAS(BN_ucmp); int BN_cmp(const BIGNUM *a, const BIGNUM *b) @@ -382,6 +398,7 @@ BN_cmp(const BIGNUM *a, const BIGNUM *b) return BN_ucmp(a, b); } +LCRYPTO_ALIAS(BN_cmp); int BN_set_bit(BIGNUM *a, int n) @@ -404,6 +421,7 @@ BN_set_bit(BIGNUM *a, int n) a->d[i] |= (((BN_ULONG)1) << j); return (1); } +LCRYPTO_ALIAS(BN_set_bit); int BN_clear_bit(BIGNUM *a, int n) @@ -422,6 +440,7 @@ BN_clear_bit(BIGNUM *a, int n) bn_correct_top(a); return (1); } +LCRYPTO_ALIAS(BN_clear_bit); int BN_is_bit_set(const BIGNUM *a, int n) @@ -436,6 +455,7 @@ BN_is_bit_set(const BIGNUM *a, int n) return 0; return (int)(((a->d[i]) >> j) & ((BN_ULONG)1)); } +LCRYPTO_ALIAS(BN_is_bit_set); int BN_mask_bits(BIGNUM *a, int n) @@ -458,12 +478,14 @@ BN_mask_bits(BIGNUM *a, int n) bn_correct_top(a); return (1); } +LCRYPTO_ALIAS(BN_mask_bits); void BN_set_negative(BIGNUM *bn, int neg) { bn->neg = ~BN_is_zero(bn) & bn_ct_ne_zero(neg); } +LCRYPTO_ALIAS(BN_set_negative); /* * Constant-time conditional swap of a and b. @@ -517,6 +539,7 @@ BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords) } #undef BN_CONSTTIME_SWAP } +LCRYPTO_ALIAS(BN_consttime_swap); /* * Constant-time conditional swap of a and b. @@ -575,18 +598,21 @@ BN_zero(BIGNUM *a) a->neg = 0; a->top = 0; } +LCRYPTO_ALIAS(BN_zero); int BN_one(BIGNUM *a) { return BN_set_word(a, 1); } +LCRYPTO_ALIAS(BN_one); int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) { return (a->top == 1 && a->d[0] == w) || (w == 0 && a->top == 0); } +LCRYPTO_ALIAS(BN_abs_is_word); int BN_is_zero(const BIGNUM *bn) @@ -599,30 +625,35 @@ BN_is_zero(const BIGNUM *bn) return bits == 0; } +LCRYPTO_ALIAS(BN_is_zero); int BN_is_one(const BIGNUM *a) { return BN_abs_is_word(a, 1) && !a->neg; } +LCRYPTO_ALIAS(BN_is_one); int BN_is_word(const BIGNUM *a, const BN_ULONG w) { return BN_abs_is_word(a, w) && (w == 0 || !a->neg); } +LCRYPTO_ALIAS(BN_is_word); int BN_is_odd(const BIGNUM *a) { return a->top > 0 && (a->d[0] & 1); } +LCRYPTO_ALIAS(BN_is_odd); int BN_is_negative(const BIGNUM *a) { return a->neg != 0; } +LCRYPTO_ALIAS(BN_is_negative); char * BN_options(void) @@ -642,6 +673,7 @@ BN_options(void) } return (data); } +LCRYPTO_ALIAS(BN_options); /* * Bits of security, see SP800-57, section 5.6.11, table 2. @@ -673,6 +705,7 @@ BN_security_bits(int L, int N) return bits >= secbits ? secbits : bits; } +LCRYPTO_ALIAS(BN_security_bits); BN_GENCB * BN_GENCB_new(void) @@ -684,6 +717,7 @@ BN_GENCB_new(void) return cb; } +LCRYPTO_ALIAS(BN_GENCB_new); void BN_GENCB_free(BN_GENCB *cb) @@ -692,6 +726,7 @@ BN_GENCB_free(BN_GENCB *cb) return; free(cb); } +LCRYPTO_ALIAS(BN_GENCB_free); /* Populate a BN_GENCB structure with an "old"-style callback */ void @@ -701,6 +736,7 @@ BN_GENCB_set_old(BN_GENCB *gencb, void (*cb)(int, int, void *), void *cb_arg) gencb->cb.cb_1 = cb; gencb->arg = cb_arg; } +LCRYPTO_ALIAS(BN_GENCB_set_old); /* Populate a BN_GENCB structure with a "new"-style callback */ void @@ -710,9 +746,11 @@ BN_GENCB_set(BN_GENCB *gencb, int (*cb)(int, int, BN_GENCB *), void *cb_arg) gencb->cb.cb_2 = cb; gencb->arg = cb_arg; } +LCRYPTO_ALIAS(BN_GENCB_set); void * BN_GENCB_get_arg(BN_GENCB *cb) { return cb->arg; } +LCRYPTO_ALIAS(BN_GENCB_get_arg); diff --git a/lib/libcrypto/bn/bn_mod.c b/lib/libcrypto/bn/bn_mod.c index 79766d00362..365f6fcf03e 100644 --- a/lib/libcrypto/bn/bn_mod.c +++ b/lib/libcrypto/bn/bn_mod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mod.c,v 1.21 2023/06/13 09:28:13 tb Exp $ */ +/* $OpenBSD: bn_mod.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> * for the OpenSSL project. */ /* ==================================================================== @@ -146,6 +146,7 @@ BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) return BN_usub(r, m, r); return 1; } +LCRYPTO_ALIAS(BN_nnmod); int BN_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, return 0; return BN_nnmod(r, r, m, ctx); } +LCRYPTO_ALIAS(BN_mod_add); /* * 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) return BN_usub(r, r, m); return 1; } +LCRYPTO_ALIAS(BN_mod_add_quick); int BN_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, return 0; return BN_nnmod(r, r, m, ctx); } +LCRYPTO_ALIAS(BN_mod_sub); /* * 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) return 0; return BN_usub(r, m, r); } +LCRYPTO_ALIAS(BN_mod_sub_quick); int BN_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, return ret; } +LCRYPTO_ALIAS(BN_mod_mul); int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) { return BN_mod_mul(r, a, a, m, ctx); } +LCRYPTO_ALIAS(BN_mod_sqr); int BN_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) return 0; return BN_nnmod(r, r, m, ctx); } +LCRYPTO_ALIAS(BN_mod_lshift1); /* * 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) return BN_usub(r, r, m); return 1; } +LCRYPTO_ALIAS(BN_mod_lshift1_quick); int BN_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) return ret; } +LCRYPTO_ALIAS(BN_mod_lshift); /* * 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) return 1; } +LCRYPTO_ALIAS(BN_mod_lshift_quick); diff --git a/lib/libcrypto/bn/bn_mod_sqrt.c b/lib/libcrypto/bn/bn_mod_sqrt.c index acca540e25a..bdd5b2cdba0 100644 --- a/lib/libcrypto/bn/bn_mod_sqrt.c +++ b/lib/libcrypto/bn/bn_mod_sqrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2023/04/11 10:08:44 tb Exp $ */ +/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2023/07/08 12:21:58 beck Exp $ */ /* * 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) return NULL; } +LCRYPTO_ALIAS(BN_mod_sqrt); diff --git a/lib/libcrypto/bn/bn_mont.c b/lib/libcrypto/bn/bn_mont.c index b44246e0701..12fea44c5af 100644 --- a/lib/libcrypto/bn/bn_mont.c +++ b/lib/libcrypto/bn/bn_mont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mont.c,v 1.60 2023/06/17 14:43:50 jsing Exp $ */ +/* $OpenBSD: bn_mont.c,v 1.61 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -137,6 +137,7 @@ BN_MONT_CTX_new(void) return mctx; } +LCRYPTO_ALIAS(BN_MONT_CTX_new); void BN_MONT_CTX_free(BN_MONT_CTX *mctx) @@ -150,6 +151,7 @@ BN_MONT_CTX_free(BN_MONT_CTX *mctx) if (mctx->flags & BN_FLG_MALLOCED) free(mctx); } +LCRYPTO_ALIAS(BN_MONT_CTX_free); BN_MONT_CTX * BN_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) return dst; } +LCRYPTO_ALIAS(BN_MONT_CTX_copy); int BN_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) return ret; } +LCRYPTO_ALIAS(BN_MONT_CTX_set); BN_MONT_CTX * BN_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, done: return mctx; } +LCRYPTO_ALIAS(BN_MONT_CTX_set_locked); static int bn_montgomery_reduce(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mctx); @@ -497,6 +502,7 @@ BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, /* Compute r = aR * bR * R^-1 mod N = abR mod N */ return bn_mod_mul_montgomery(r, a, b, mctx, ctx); } +LCRYPTO_ALIAS(BN_mod_mul_montgomery); int BN_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) /* Compute r = a * R * R * R^-1 mod N = aR mod N */ return bn_mod_mul_montgomery(r, a, &mctx->RR, mctx, ctx); } +LCRYPTO_ALIAS(BN_to_montgomery); /* * 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) return ret; } +LCRYPTO_ALIAS(BN_from_montgomery); diff --git a/lib/libcrypto/bn/bn_mul.c b/lib/libcrypto/bn/bn_mul.c index 65088cc5c4d..bdeb9b0fe81 100644 --- a/lib/libcrypto/bn/bn_mul.c +++ b/lib/libcrypto/bn/bn_mul.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mul.c,v 1.38 2023/06/12 16:17:24 jsing Exp $ */ +/* $OpenBSD: bn_mul.c,v 1.39 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -367,3 +367,4 @@ BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) return ret; } +LCRYPTO_ALIAS(BN_mul); diff --git a/lib/libcrypto/bn/bn_prime.c b/lib/libcrypto/bn/bn_prime.c index b8f0eb69ce9..a09bac4ae9e 100644 --- a/lib/libcrypto/bn/bn_prime.c +++ b/lib/libcrypto/bn/bn_prime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_prime.c,v 1.32 2023/05/10 12:21:55 tb Exp $ */ +/* $OpenBSD: bn_prime.c,v 1.33 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -150,6 +150,7 @@ BN_GENCB_call(BN_GENCB *cb, int a, int b) /* Unrecognised callback type */ return 0; } +LCRYPTO_ALIAS(BN_GENCB_call); int BN_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, return found; } +LCRYPTO_ALIAS(BN_generate_prime_ex); int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb) { return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); } +LCRYPTO_ALIAS(BN_is_prime_ex); int BN_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, return is_prime; } +LCRYPTO_ALIAS(BN_is_prime_fasttest_ex); static int probable_prime(BIGNUM *rnd, int bits) diff --git a/lib/libcrypto/bn/bn_rand.c b/lib/libcrypto/bn/bn_rand.c index a03d70053bd..f68913473f4 100644 --- a/lib/libcrypto/bn/bn_rand.c +++ b/lib/libcrypto/bn/bn_rand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_rand.c,v 1.27 2022/11/26 16:08:51 tb Exp $ */ +/* $OpenBSD: bn_rand.c,v 1.28 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -198,12 +198,14 @@ BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { return bnrand(0, rnd, bits, top, bottom); } +LCRYPTO_ALIAS(BN_rand); int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) { return bnrand(1, rnd, bits, top, bottom); } +LCRYPTO_ALIAS(BN_pseudo_rand); #if 1 int @@ -279,6 +281,7 @@ BN_rand_range(BIGNUM *r, const BIGNUM *range) { return bn_rand_range(0, r, range); } +LCRYPTO_ALIAS(BN_rand_range); int bn_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) { return bn_rand_range(1, r, range); } +LCRYPTO_ALIAS(BN_pseudo_rand_range); diff --git a/lib/libcrypto/bn/bn_shift.c b/lib/libcrypto/bn/bn_shift.c index eee34367022..12edc7c0a08 100644 --- a/lib/libcrypto/bn/bn_shift.c +++ b/lib/libcrypto/bn/bn_shift.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_shift.c,v 1.21 2023/02/13 04:25:37 jsing Exp $ */ +/* $OpenBSD: bn_shift.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ /* * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org> * @@ -151,21 +151,25 @@ BN_lshift1(BIGNUM *r, const BIGNUM *a) { return bn_lshift(r, a, 1); } +LCRYPTO_ALIAS(BN_lshift1); int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { return bn_lshift(r, a, n); } +LCRYPTO_ALIAS(BN_lshift); int BN_rshift1(BIGNUM *r, const BIGNUM *a) { return bn_rshift(r, a, 1); } +LCRYPTO_ALIAS(BN_rshift1); int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { return bn_rshift(r, a, n); } +LCRYPTO_ALIAS(BN_rshift); diff --git a/lib/libcrypto/bn/bn_sqr.c b/lib/libcrypto/bn/bn_sqr.c index 2879d34c0e7..0dbccbf85df 100644 --- a/lib/libcrypto/bn/bn_sqr.c +++ b/lib/libcrypto/bn/bn_sqr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_sqr.c,v 1.35 2023/07/02 13:11:23 jsing Exp $ */ +/* $OpenBSD: bn_sqr.c,v 1.36 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -302,3 +302,4 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) return ret; } +LCRYPTO_ALIAS(BN_sqr); diff --git a/lib/libcrypto/bn/bn_word.c b/lib/libcrypto/bn/bn_word.c index 68d5c2a4b46..a82b911e674 100644 --- a/lib/libcrypto/bn/bn_word.c +++ b/lib/libcrypto/bn/bn_word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_word.c,v 1.20 2023/03/11 14:14:54 jsing Exp $ */ +/* $OpenBSD: bn_word.c,v 1.21 2023/07/08 12:21:58 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -100,6 +100,7 @@ BN_mod_word(const BIGNUM *a, BN_ULONG w) } return ((BN_ULONG)ret); } +LCRYPTO_ALIAS(BN_mod_word); BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) @@ -137,6 +138,7 @@ BN_div_word(BIGNUM *a, BN_ULONG w) return (ret); } +LCRYPTO_ALIAS(BN_div_word); int BN_add_word(BIGNUM *a, BN_ULONG w) @@ -171,6 +173,7 @@ BN_add_word(BIGNUM *a, BN_ULONG w) } return (1); } +LCRYPTO_ALIAS(BN_add_word); int BN_sub_word(BIGNUM *a, BN_ULONG w) @@ -217,6 +220,7 @@ BN_sub_word(BIGNUM *a, BN_ULONG w) a->top--; return (1); } +LCRYPTO_ALIAS(BN_sub_word); int BN_mul_word(BIGNUM *a, BN_ULONG w) @@ -238,3 +242,4 @@ BN_mul_word(BIGNUM *a, BN_ULONG w) } return (1); } +LCRYPTO_ALIAS(BN_mul_word); diff --git a/lib/libcrypto/hidden/openssl/bn.h b/lib/libcrypto/hidden/openssl/bn.h new file mode 100644 index 00000000000..6c23a5c6d83 --- /dev/null +++ b/lib/libcrypto/hidden/openssl/bn.h @@ -0,0 +1,163 @@ +/* $OpenBSD: bn.h,v 1.1 2023/07/08 12:21:58 beck Exp $ */ +/* + * Copyright (c) 2023 Bob Beck <beck@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBCRYPTO_BN_H +#define _LIBCRYPTO_BN_H + +#ifndef _MSC_VER +#include_next <openssl/bn.h> +#else +#include "../include/openssl/bn.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(BN_set_flags); +LCRYPTO_USED(BN_get_flags); +LCRYPTO_USED(BN_with_flags); +LCRYPTO_USED(BN_GENCB_new); +LCRYPTO_USED(BN_GENCB_free); +LCRYPTO_USED(BN_GENCB_call); +LCRYPTO_USED(BN_GENCB_set_old); +LCRYPTO_USED(BN_GENCB_set); +LCRYPTO_USED(BN_GENCB_get_arg); +LCRYPTO_USED(BN_abs_is_word); +LCRYPTO_USED(BN_is_zero); +LCRYPTO_USED(BN_is_one); +LCRYPTO_USED(BN_is_word); +LCRYPTO_USED(BN_is_odd); +LCRYPTO_USED(BN_zero); +LCRYPTO_USED(BN_one); +LCRYPTO_USED(BN_value_one); +LCRYPTO_USED(BN_options); +LCRYPTO_USED(BN_CTX_new); +LCRYPTO_USED(BN_CTX_free); +LCRYPTO_USED(BN_CTX_start); +LCRYPTO_USED(BN_CTX_get); +LCRYPTO_USED(BN_CTX_end); +LCRYPTO_USED(BN_rand); +LCRYPTO_USED(BN_pseudo_rand); +LCRYPTO_USED(BN_rand_range); +LCRYPTO_USED(BN_pseudo_rand_range); +LCRYPTO_USED(BN_num_bits); +LCRYPTO_USED(BN_num_bits_word); +LCRYPTO_USED(BN_new); +LCRYPTO_USED(BN_clear_free); +LCRYPTO_USED(BN_copy); +LCRYPTO_USED(BN_swap); +LCRYPTO_USED(BN_bin2bn); +LCRYPTO_USED(BN_bn2bin); +LCRYPTO_USED(BN_bn2binpad); +LCRYPTO_USED(BN_lebin2bn); +LCRYPTO_USED(BN_bn2lebinpad); +LCRYPTO_USED(BN_mpi2bn); +LCRYPTO_USED(BN_bn2mpi); +LCRYPTO_USED(BN_sub); +LCRYPTO_USED(BN_usub); +LCRYPTO_USED(BN_uadd); +LCRYPTO_USED(BN_add); +LCRYPTO_USED(BN_mul); +LCRYPTO_USED(BN_sqr); +LCRYPTO_USED(BN_set_negative); +LCRYPTO_USED(BN_is_negative); +LCRYPTO_USED(BN_nnmod); +LCRYPTO_USED(BN_mod_add); +LCRYPTO_USED(BN_mod_add_quick); +LCRYPTO_USED(BN_mod_sub); +LCRYPTO_USED(BN_mod_sub_quick); +LCRYPTO_USED(BN_mod_mul); +LCRYPTO_USED(BN_mod_sqr); +LCRYPTO_USED(BN_mod_lshift1); +LCRYPTO_USED(BN_mod_lshift1_quick); +LCRYPTO_USED(BN_mod_lshift); +LCRYPTO_USED(BN_mod_lshift_quick); +LCRYPTO_USED(BN_mod_word); +LCRYPTO_USED(BN_div_word); +LCRYPTO_USED(BN_mul_word); +LCRYPTO_USED(BN_add_word); +LCRYPTO_USED(BN_sub_word); +LCRYPTO_USED(BN_set_word); +LCRYPTO_USED(BN_get_word); +LCRYPTO_USED(BN_cmp); +LCRYPTO_USED(BN_free); +LCRYPTO_USED(BN_is_bit_set); +LCRYPTO_USED(BN_lshift); +LCRYPTO_USED(BN_lshift1); +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); +LCRYPTO_USED(BN_rshift); +LCRYPTO_USED(BN_rshift1); +LCRYPTO_USED(BN_clear); +LCRYPTO_USED(BN_dup); +LCRYPTO_USED(BN_ucmp); +LCRYPTO_USED(BN_set_bit); +LCRYPTO_USED(BN_clear_bit); +LCRYPTO_USED(BN_bn2hex); +LCRYPTO_USED(BN_bn2dec); +LCRYPTO_USED(BN_hex2bn); +LCRYPTO_USED(BN_dec2bn); +LCRYPTO_USED(BN_asc2bn); +LCRYPTO_USED(BN_kronecker); +LCRYPTO_USED(BN_mod_sqrt); +LCRYPTO_USED(BN_consttime_swap); +LCRYPTO_USED(BN_security_bits); +LCRYPTO_USED(BN_generate_prime_ex); +LCRYPTO_USED(BN_is_prime_ex); +LCRYPTO_USED(BN_is_prime_fasttest_ex); +LCRYPTO_USED(BN_MONT_CTX_new); +LCRYPTO_USED(BN_mod_mul_montgomery); +LCRYPTO_USED(BN_to_montgomery); +LCRYPTO_USED(BN_from_montgomery); +LCRYPTO_USED(BN_MONT_CTX_free); +LCRYPTO_USED(BN_MONT_CTX_set); +LCRYPTO_USED(BN_MONT_CTX_copy); +LCRYPTO_USED(BN_MONT_CTX_set_locked); +LCRYPTO_USED(BN_BLINDING_new); +LCRYPTO_USED(BN_BLINDING_free); +LCRYPTO_USED(BN_BLINDING_update); +LCRYPTO_USED(BN_BLINDING_convert); +LCRYPTO_USED(BN_BLINDING_invert); +LCRYPTO_USED(BN_BLINDING_convert_ex); +LCRYPTO_USED(BN_BLINDING_invert_ex); +LCRYPTO_USED(BN_BLINDING_thread_id); +LCRYPTO_USED(BN_BLINDING_get_flags); +LCRYPTO_USED(BN_BLINDING_set_flags); +LCRYPTO_USED(BN_BLINDING_create_param); +LCRYPTO_USED(get_rfc2409_prime_768); +LCRYPTO_USED(get_rfc2409_prime_1024); +LCRYPTO_USED(BN_get_rfc2409_prime_768); +LCRYPTO_USED(BN_get_rfc2409_prime_1024); +LCRYPTO_USED(get_rfc3526_prime_1536); +LCRYPTO_USED(get_rfc3526_prime_2048); +LCRYPTO_USED(get_rfc3526_prime_3072); +LCRYPTO_USED(get_rfc3526_prime_4096); +LCRYPTO_USED(get_rfc3526_prime_6144); +LCRYPTO_USED(get_rfc3526_prime_8192); +LCRYPTO_USED(BN_get_rfc3526_prime_1536); +LCRYPTO_USED(BN_get_rfc3526_prime_2048); +LCRYPTO_USED(BN_get_rfc3526_prime_3072); +LCRYPTO_USED(BN_get_rfc3526_prime_4096); +LCRYPTO_USED(BN_get_rfc3526_prime_6144); +LCRYPTO_USED(BN_get_rfc3526_prime_8192); +LCRYPTO_USED(ERR_load_BN_strings); + +#endif /* _LIBCRYPTO_BN_H */ |