Skip to content

Commit

Permalink
verify.rs: Initial Verify trait
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Mar 24, 2019
1 parent 1f7efa6 commit 9fd884c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion signature-crate/src/sign.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Trait for producing digital signatures
//! Trait for generating digital signatures of message bytestrings
use crate::{error::Error, Signature};

Expand Down
12 changes: 12 additions & 0 deletions signature-crate/src/verify.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Trait for verifying digital signatures of message bytestrings
use crate::{error::Error, Signature};

/// Verify the provided message bytestring using `Self` (e.g. a public key)
pub trait Verify<S: Signature>: Send + Sync {
/// Use `Self` to verify that the provided signature for a given message
/// bytestring is authentic.
///
/// Returns `Error` if it is inauthentic, or otherwise returns `()`.
fn verify(&self, msg: &[u8], signature: &S) -> Result<(), Error>;
}

0 comments on commit 9fd884c

Please sign in to comment.