Skip to main content

HostWithStore

Trait HostWithStore 

Source
pub trait HostWithStore<T>: HasData + Send {
    // Required methods
    fn prepare(
        accessor: &Accessor<T, Self>,
        variant: Sha2Variant,
        input: Resource<Ikm>,
        salt: Vec<u8>,
        info: Vec<u8>,
    ) -> impl Future<Output = Result<Result<Resource<DeriveInput>, Error>>> + Send;
    fn prepare_from(
        accessor: &Accessor<T, Self>,
        variant: Sha2Variant,
        input: Resource<DeriveInput>,
        salt: Vec<u8>,
        info: Vec<u8>,
    ) -> impl Future<Output = Result<Result<Resource<DeriveInput>, Error>>> + Send;
}

Required Methods§

Source

fn prepare( accessor: &Accessor<T, Self>, variant: Sha2Variant, input: Resource<Ikm>, salt: Vec<u8>, info: Vec<u8>, ) -> impl Future<Output = Result<Result<Resource<DeriveInput>, Error>>> + Send

Parameterize a derivation: HKDF-Extract with salt runs over the material (eagerly, so the returned input retains the PRK rather than the IKM), and info is bound for the expand step at use. An implementation not serving the variant fails error.unsupported (the truncated SHA-2 variants are unserved package-wide, as for hmac-sha2).

Source

fn prepare_from( accessor: &Accessor<T, Self>, variant: Sha2Variant, input: Resource<DeriveInput>, salt: Vec<u8>, info: Vec<u8>, ) -> impl Future<Output = Result<Result<Resource<DeriveInput>, Error>>> + Send

Parameterize a derivation whose IKM is another derivation’s output — the chaining step (a future agreement’s shared secret fed to HKDF without transiting the caller).

The upstream derivation runs at its natural output length, which requires it to have one: chaining from another KDF’s input fails error.other, exactly as the platform’s deriveKey(… → "HKDF") does (get key length for a KDF target is null, and a KDF’s derive-bits rejects null). Requires can-derive-key on the upstream input, whose grants the new input copies.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§