Skip to content

Commit

Permalink
Use the existing ExpandedSecretKey::from_bytes method for to_scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Nov 14, 2023
1 parent 923b14d commit 2314fce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ed25519-dalek/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ impl SigningKey {
// where the two outputs are both 32 bytes. To use for signing, scalar_bytes must be
// clamped and reduced (see ExpandedSecretKey::from_bytes). We return the clamped and
// reduced form.
let hash = Sha512::default().chain_update(self.secret_key).finalize();
ExpandedSecretKey::from_bytes(hash.as_ref()).scalar
ExpandedSecretKey::from(&self.secret_key).scalar
}
}

Expand Down

0 comments on commit 2314fce

Please sign in to comment.