Trait KeyedCryptoPrimitive

Source
pub trait KeyedCryptoPrimitive: Send + Sync {
    type PrivateKey;
    type PublicKey;
    type Input;
    type Output;
    type Message;
    type Signature;

    // Required methods
    fn generate_keypair<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(Self::PrivateKey, Self::PublicKey)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn compute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 Self::PrivateKey,
        input: Self::Input,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn verify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 Self::PublicKey,
        input: Self::Input,
        output: &'life2 Self::Output,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn sign<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        private_key: &'life1 Self::PrivateKey,
        message: &'life2 Self::Message,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Signature>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for keyed cryptographic primitives (signatures, VRF, etc.)

Required Associated Types§

Required Methods§

Source

fn generate_keypair<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(Self::PrivateKey, Self::PublicKey)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn compute<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 Self::PrivateKey, input: Self::Input, ) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn verify<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 Self::PublicKey, input: Self::Input, output: &'life2 Self::Output, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn sign<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, private_key: &'life1 Self::PrivateKey, message: &'life2 Self::Message, ) -> Pin<Box<dyn Future<Output = Result<Self::Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§