Merge branch 'master' into develop

This commit is contained in:
Henry de Valence 2020-05-29 12:36:16 -07:00
commit f04b83055c

View file

@ -243,7 +243,7 @@ impl Scalar {
/// This function is intended for applications like X25519 which
/// require specific bit-patterns when performing scalar
/// multiplication.
pub fn from_bits(bytes: [u8; 32]) -> Scalar {
pub const fn from_bits(bytes: [u8; 32]) -> Scalar {
let mut s = Scalar{bytes};
// Ensure that s < 2^255 by masking the high bit
s.bytes[31] &= 0b0111_1111;