[][src]Trait rcmixed::traits::SignatureAlgorithm

pub trait SignatureAlgorithm {
    type SignKey: Serialize + DeserializeOwned;
    type VerifyKey: Serialize + DeserializeOwned;

    const SIGNATURE_LENGTH: usize;
    const SIGN_KEY_LENGTH: usize;

    fn sign(plain: &[u8], sign_key: &Self::SignKey) -> Vec<u8>;
fn verify(plain: &[u8], sign: &[u8], verify_key: &Self::VerifyKey) -> bool;
fn from_bytes(bytes: &[u8]) -> Option<Self::SignKey>;
fn to_bytes(sign_key: &Self::SignKey) -> Vec<u8>; }

Associated Types

Loading content...

Associated Constants

Loading content...

Required methods

fn sign(plain: &[u8], sign_key: &Self::SignKey) -> Vec<u8>

fn verify(plain: &[u8], sign: &[u8], verify_key: &Self::VerifyKey) -> bool

fn from_bytes(bytes: &[u8]) -> Option<Self::SignKey>

fn to_bytes(sign_key: &Self::SignKey) -> Vec<u8>

Loading content...

Implementors

Loading content...