summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_lib.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2007-03-28 00:15:28 +0000
committerBodo Möller <bodo@openssl.org>2007-03-28 00:15:28 +0000
commitbd31fb21454609b125ade1ad569ebcc2a2b9b73c (patch)
tree812dbe6bff6096ca490e26dd48a6bc3fee51b320 /crypto/bn/bn_lib.c
parentb506821d43f0b0114d91b74398f0ead4b51cc32b (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index 244a430d72..63cdc34c59 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)