From: tb Date: Tue, 25 Apr 2023 17:13:06 +0000 (+0000) Subject: Move a few now internal prototypes to bn_local.h X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3606bd1e54c8917ea3a2e65d9ae9cee9bbe5b7ea;p=openbsd Move a few now internal prototypes to bn_local.h --- diff --git a/lib/libcrypto/bn/bn.h b/lib/libcrypto/bn/bn.h index 79a802eeedd..9fefde20a8e 100644 --- a/lib/libcrypto/bn/bn.h +++ b/lib/libcrypto/bn/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.65 2023/04/25 17:01:21 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.66 2023/04/25 17:13:06 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -340,10 +340,6 @@ int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); int BN_num_bits(const BIGNUM *a); int BN_num_bits_word(BN_ULONG); BIGNUM *BN_new(void); -/* Move to bn_local.h in the next major bump. */ -#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL) -void BN_init(BIGNUM *); -#endif void BN_clear_free(BIGNUM *a); BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); void BN_swap(BIGNUM *a, BIGNUM *b); @@ -420,10 +416,6 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, int BN_mask_bits(BIGNUM *a, int n); int BN_print_fp(FILE *fp, const BIGNUM *a); int BN_print(BIO *fp, const BIGNUM *a); -/* Move to bn_local.h in the next major bump. */ -#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL) -int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); -#endif int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); int BN_rshift1(BIGNUM *r, const BIGNUM *a); void BN_clear(BIGNUM *a); @@ -517,20 +509,6 @@ void BN_set_params(int mul, int high, int low, int mont); int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ #endif -/* Move to bn_local.h in the next major bump. */ -#if !defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL) -void BN_RECP_CTX_init(BN_RECP_CTX *recp); -BN_RECP_CTX *BN_RECP_CTX_new(void); -void BN_RECP_CTX_free(BN_RECP_CTX *recp); -int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); -int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, - BN_RECP_CTX *recp, BN_CTX *ctx); -int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); -int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, - BN_RECP_CTX *recp, BN_CTX *ctx); -#endif - #ifndef OPENSSL_NO_EC2M /* Functions for arithmetic over binary polynomials represented by BIGNUMs. diff --git a/lib/libcrypto/bn/bn_local.h b/lib/libcrypto/bn/bn_local.h index 5e85dfc3de1..061544056b4 100644 --- a/lib/libcrypto/bn/bn_local.h +++ b/lib/libcrypto/bn/bn_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_local.h,v 1.19 2023/04/19 10:51:22 jsing Exp $ */ +/* $OpenBSD: bn_local.h,v 1.20 2023/04/25 17:13:06 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -279,6 +279,21 @@ void bn_div_rem_words(BN_ULONG h, BN_ULONG l, BN_ULONG d, BN_ULONG *out_q, int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); int bn_rand_interval(BIGNUM *rnd, const BIGNUM *lower_inc, const BIGNUM *upper_exc); +void BN_init(BIGNUM *); + +int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); + +void BN_RECP_CTX_init(BN_RECP_CTX *recp); +BN_RECP_CTX *BN_RECP_CTX_new(void); +void BN_RECP_CTX_free(BN_RECP_CTX *recp); +int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); +int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, + BN_RECP_CTX *recp, BN_CTX *ctx); +int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, + BN_RECP_CTX *recp, BN_CTX *ctx); + /* Explicitly const time / non-const time versions for internal use */ int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx);