Skip to content

Commit

Permalink
Change verification to strict
Browse files Browse the repository at this point in the history
Closes: aptos-labs#5057
Approved by: kchalkias
  • Loading branch information
huitseeker authored and bors-libra committed Jul 14, 2020
1 parent 0afa28e commit 77fd504
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crypto/crypto/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ impl Signature for Ed25519Signature {
type VerifyingKeyMaterial = Ed25519PublicKey;
type SigningKeyMaterial = Ed25519PrivateKey;

/// Verifies that the provided signature is valid for the provided
/// message, according to the RFC8032 algorithm. This strict verification performs the
/// recommended check of 5.1.7 §3, on top of the required RFC8032 verifications.
fn verify<T: CryptoHash + Serialize>(
&self,
message: &T,
Expand All @@ -415,7 +418,7 @@ impl Signature for Ed25519Signature {

public_key
.0
.verify(message, &self.0)
.verify_strict(message, &self.0)
.map_err(|e| anyhow!("{}", e))
.and(Ok(()))
}
Expand Down

0 comments on commit 77fd504

Please sign in to comment.