Trait ockam_core::vault::Hasher

source ·
pub trait Hasher {
    // Required methods
    fn sha256<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<[u8; 32]>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn hkdf_sha256<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        salt: &'life1 KeyId,
        info: &'life2 [u8],
        ikm: Option<&'life3 KeyId>,
        output_attributes: SmallBuffer<SecretAttributes>
    ) -> Pin<Box<dyn Future<Output = Result<SmallBuffer<KeyId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

A trait for hashing input data into a fixed length output.

Required Methods§

source

fn sha256<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<[u8; 32]>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Compute the SHA-256 digest given input data.

source

fn hkdf_sha256<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, salt: &'life1 KeyId, info: &'life2 [u8], ikm: Option<&'life3 KeyId>, output_attributes: SmallBuffer<SecretAttributes> ) -> Pin<Box<dyn Future<Output = Result<SmallBuffer<KeyId>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Derive multiple output super::Secrets with given attributes using the HKDF-SHA256 given the specified salt, info and input key material.

Implementors§