diff options
author | Bodo Möller <bodo@openssl.org> | 2007-03-28 00:14:25 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2007-03-28 00:14:25 +0000 |
commit | 7cdb81582cafdddce891f1da8d85ca372e5dabbc (patch) | |
tree | 374a1b0f995e896fae1975822943f9e4f6d3e350 /crypto/bn/bn_lib.c | |
parent | 8f33b40302d7058c493c4620763c4861625e07c5 (diff) |
Change to mitigate branch prediction attacks
Submitted by: Matthew D Wood
Reviewed by: Bodo Moeller
Diffstat (limited to 'crypto/bn/bn_lib.c')
-rw-r--r-- | crypto/bn/bn_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index 210ccb42bb..2649b8c538 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -763,7 +763,7 @@ int BN_is_bit_set(const BIGNUM *a, int n) i=n/BN_BITS2; j=n%BN_BITS2; if (a->top <= i) return 0; - return((a->d[i]&(((BN_ULONG)1)<<j))?1:0); + return(((a->d[i])>>j)&((BN_ULONG)1)); } int BN_mask_bits(BIGNUM *a, int n) |