diff options
Diffstat (limited to 'src/lib/libssl/src/crypto/bn/bn.h')
-rw-r--r-- | src/lib/libssl/src/crypto/bn/bn.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/libssl/src/crypto/bn/bn.h b/src/lib/libssl/src/crypto/bn/bn.h index f34248ec4f..21a1a3fe35 100644 --- a/src/lib/libssl/src/crypto/bn/bn.h +++ b/src/lib/libssl/src/crypto/bn/bn.h | |||
@@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret, | |||
538 | BIGNUM *BN_mod_sqrt(BIGNUM *ret, | 538 | BIGNUM *BN_mod_sqrt(BIGNUM *ret, |
539 | const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); | 539 | const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); |
540 | 540 | ||
541 | void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); | ||
542 | |||
541 | /* Deprecated versions */ | 543 | /* Deprecated versions */ |
542 | #ifndef OPENSSL_NO_DEPRECATED | 544 | #ifndef OPENSSL_NO_DEPRECATED |
543 | BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, | 545 | BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, |
@@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf,int num); | |||
774 | 776 | ||
775 | #define bn_fix_top(a) bn_check_top(a) | 777 | #define bn_fix_top(a) bn_check_top(a) |
776 | 778 | ||
779 | #define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2) | ||
780 | #define bn_wcheck_size(bn, words) \ | ||
781 | do { \ | ||
782 | const BIGNUM *_bnum2 = (bn); \ | ||
783 | assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \ | ||
784 | } while(0) | ||
785 | |||
777 | #else /* !BN_DEBUG */ | 786 | #else /* !BN_DEBUG */ |
778 | 787 | ||
779 | #define bn_pollute(a) | 788 | #define bn_pollute(a) |
780 | #define bn_check_top(a) | 789 | #define bn_check_top(a) |
781 | #define bn_fix_top(a) bn_correct_top(a) | 790 | #define bn_fix_top(a) bn_correct_top(a) |
791 | #define bn_check_size(bn, bits) | ||
792 | #define bn_wcheck_size(bn, words) | ||
782 | 793 | ||
783 | #endif | 794 | #endif |
784 | 795 | ||