diff --git a/examples/and.rs b/examples/and.rs index 35fb965b..2f2fad80 100644 --- a/examples/and.rs +++ b/examples/and.rs @@ -72,7 +72,7 @@ pub fn u64_into_bit_vec_le>( let mut tmp = Vec::with_capacity(64); for i in 0..64 { - tmp.push(Some(*value >> i & 1 == 1)); + tmp.push(Some((*value >> i) & 1 == 1)); } tmp diff --git a/src/gadgets/nonnative/mod.rs b/src/gadgets/nonnative/mod.rs index 80c8e12a..d2d590df 100644 --- a/src/gadgets/nonnative/mod.rs +++ b/src/gadgets/nonnative/mod.rs @@ -26,7 +26,7 @@ impl BitAccess for Scalar { let (byte_pos, bit_pos) = (i / 8, i % 8); let byte = self.to_repr().as_ref()[byte_pos]; - let bit = byte >> bit_pos & 1; + let bit = (byte >> bit_pos) & 1; Some(bit == 1) } }