diff --git a/crypto/bn/internal.h b/crypto/bn/internal.h index 1ee29fd4..55659488 100644 --- a/crypto/bn/internal.h +++ b/crypto/bn/internal.h @@ -199,6 +199,15 @@ BIGNUM *bn_expand(BIGNUM *bn, size_t bits); #define Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2) #endif +/* bn_correct_top decrements |bn->top| until |bn->d[top-1]| is non-zero or + * until |top| is zero. If |bn| is zero, |bn->neg| is set to zero. */ +void bn_correct_top(BIGNUM *bn); + +/* bn_wexpand ensures that |bn| has at least |words| works of space without + * altering its value. It returns |bn| on success or NULL on allocation + * failure. */ +BIGNUM *bn_wexpand(BIGNUM *bn, size_t words); + /* bn_set_words sets |bn| to the value encoded in the |num| words in |words|, * least significant word first. */ int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num); diff --git a/include/openssl/bn.h b/include/openssl/bn.h index 6e3e601b..e54ee1d3 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h @@ -326,22 +326,6 @@ OPENSSL_EXPORT int BN_parse_asn1_unsigned_buggy(CBS *cbs, BIGNUM *ret); OPENSSL_EXPORT int BN_marshal_asn1(CBB *cbb, const BIGNUM *bn); -/* Internal functions. - * - * These functions are useful for code that is doing low-level manipulations of - * BIGNUM values. However, be sure that no other function in this file does - * what you want before turning to these. */ - -/* bn_correct_top decrements |bn->top| until |bn->d[top-1]| is non-zero or - * until |top| is zero. If |bn| is zero, |bn->neg| is set to zero. */ -OPENSSL_EXPORT void bn_correct_top(BIGNUM *bn); - -/* bn_wexpand ensures that |bn| has at least |words| works of space without - * altering its value. It returns |bn| on success or NULL on allocation - * failure. */ -OPENSSL_EXPORT BIGNUM *bn_wexpand(BIGNUM *bn, size_t words); - - /* BIGNUM pools. * * Certain BIGNUM operations need to use many temporary variables and