Skip to main content

prepare_from

Function prepare_from 

Source
pub async fn prepare_from(
    variant: Sha2Variant,
    input: &DeriveInput,
    salt: Vec<u8>,
    info: Vec<u8>,
) -> Result<DeriveInput, Error>
Expand description

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.