pub trait SignatureAlgorithm {
const ALG: Algorithm;
// Required methods
fn generate_keypair( ) -> Result<(Vec<u8>, Zeroizing<Vec<u8>>), AlgorithmError>;
fn sign(secret: &[u8], msg: &[u8]) -> Result<Vec<u8>, AlgorithmError>;
fn verify(
public: &[u8],
msg: &[u8],
sig: &[u8],
) -> Result<(), AlgorithmError>;
}Expand description
Adapter contract for a detached-signature algorithm.
Required Associated Constants§
Required Methods§
Sourcefn generate_keypair() -> Result<(Vec<u8>, Zeroizing<Vec<u8>>), AlgorithmError>
fn generate_keypair() -> Result<(Vec<u8>, Zeroizing<Vec<u8>>), AlgorithmError>
Generate a keypair, returning (public_key, secret_key); the secret
zeroizes on drop.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".