Trait wedpr_l_utils::traits::Signature [−][src]
Trait of a replaceable signature algorithm.
Required methods
fn sign<T: ?Sized + AsRef<[u8]>>(
&self,
private_key: &T,
msg_hash: &T
) -> Result<Vec<u8>, WedprError>
[src]
&self,
private_key: &T,
msg_hash: &T
) -> Result<Vec<u8>, WedprError>
Signs a message hash with the private key.
fn verify<T: ?Sized + AsRef<[u8]>>(
&self,
public_key: &T,
msg_hash: &T,
signature: &T
) -> bool
[src]
&self,
public_key: &T,
msg_hash: &T,
signature: &T
) -> bool
Verifies a message hash with the public key.
fn generate_keypair(&self) -> (Vec<u8>, Vec<u8>)
[src]
Generates a new key pair for signature algorithm, where the first part is public key, the second part is private key.