aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/bn/bn.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-04-14 23:45:39 +0200
committermarha <marha@users.sourceforge.net>2014-04-14 23:45:39 +0200
commit7c21629fbeb51b65fd0625bb36d888587d62fd89 (patch)
tree425433df36d64f529d2222de2d1680e0b0abca3f /openssl/crypto/bn/bn.h
parent0bd141efd4832e01c8b269b8566dd5749e30ed55 (diff)
parent242d48135a12fc9167430f391ba0d27d9ad44c6b (diff)
downloadvcxsrv-7c21629fbeb51b65fd0625bb36d888587d62fd89.tar.gz
vcxsrv-7c21629fbeb51b65fd0625bb36d888587d62fd89.tar.bz2
vcxsrv-7c21629fbeb51b65fd0625bb36d888587d62fd89.zip
Merge remote-tracking branch 'origin/released'
Conflicts: openssl/Configure openssl/Makefile openssl/util/pl/VC-32.pl
Diffstat (limited to 'openssl/crypto/bn/bn.h')
-rw-r--r--openssl/crypto/bn/bn.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/openssl/crypto/bn/bn.h b/openssl/crypto/bn/bn.h
index f34248ec4..21a1a3fe3 100644
--- a/openssl/crypto/bn/bn.h
+++ b/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,
@@ -774,11 +776,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