diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-04-23 12:31:35 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-04-23 12:31:35 +0200 |
commit | 0c5af0c28f23f75f93e253aeccb00c5ad20c116e (patch) | |
tree | fae9826018c36f1011007d029b728c290c50485c /main/openssl/crypto/bn/bn.h | |
parent | c69ba1780496c260a1b4498596bae428e0df232d (diff) |
Update OpenSSL to 1.0.1g
Diffstat (limited to 'main/openssl/crypto/bn/bn.h')
-rw-r--r-- | main/openssl/crypto/bn/bn.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/openssl/crypto/bn/bn.h b/main/openssl/crypto/bn/bn.h index 9281ce59..e776c07a 100644 --- a/main/openssl/crypto/bn/bn.h +++ b/main/openssl/crypto/bn/bn.h @@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret, BIGNUM *BN_mod_sqrt(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); +void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); + /* Deprecated versions */ #ifndef OPENSSL_NO_DEPRECATED BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, @@ -778,11 +780,20 @@ int RAND_pseudo_bytes(unsigned char *buf,int num); #define bn_fix_top(a) bn_check_top(a) +#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2) +#define bn_wcheck_size(bn, words) \ + do { \ + const BIGNUM *_bnum2 = (bn); \ + assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \ + } while(0) + #else /* !BN_DEBUG */ #define bn_pollute(a) #define bn_check_top(a) #define bn_fix_top(a) bn_correct_top(a) +#define bn_check_size(bn, bits) +#define bn_wcheck_size(bn, words) #endif |