use clamp_scalar for StaticSecret

This ensures that the `StaticSecret`'s scalar always has the X25519 bit-twiddles applied.

Co-Authored-By: DebugSteven <debugsteven@gmail.com>
This commit is contained in:
Henry de Valence 2019-02-16 16:31:05 -05:00 committed by GitHub
parent bcea24308f
commit aee783ae82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,7 +122,7 @@ impl StaticSecret {
impl From<[u8; 32]> for StaticSecret {
/// Load a `StaticSecret` from a byte array.
fn from(bytes: [u8; 32]) -> StaticSecret {
StaticSecret(Scalar::from_bits(bytes))
StaticSecret(clamp_scalar(bytes))
}
}