Skip to content

Commit

Permalink
x25519: Fix debug_assert sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
brycx committed Apr 30, 2021
1 parent 40077bc commit cd5d97c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hazardous/ecc/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ mod public {

let mut u = [0u8; 32];
crate::util::secure_rand_bytes(&mut u).unwrap();
debug_assert_ne!(u[31] & 127u8, u[31] | 128u8);
debug_assert_ne!(u[31] & 127u8, (u[31] & 127u8) | 128u8);

// Mask bit to 0 as we do in `FieldElement::from_bytes()`.
u[31] &= 127u8;
Expand Down

0 comments on commit cd5d97c

Please sign in to comment.