[go: up one dir, main page]

Enum orion::hkdf::Hkdf [] [src]

pub enum Hkdf {
    hmac_SHA1,
    hmac_SHA256,
    hmac_SHA384,
    hmac_SHA512,
}

HKDF (HMAC-based Extract-and-Expand Key Derivation Function) as specified in the RFC 5869.

Variants

Methods

impl Hkdf
[src]

HKDF (HMAC-based Extract-and-Expand Key Derivation Function) as specified in the RFC 5869.

Usage examples:

use orion::hkdf::Hkdf;
use orion::functions;

let key = functions::gen_rand_key(10);
let salt = functions::gen_rand_key(10);
let info = functions::gen_rand_key(10);

let prk = Hkdf::hmac_SHA512.hkdf_extract(&salt, &key);
let d_key = Hkdf::hmac_SHA512.hkdf_expand(&prk, &info, 50);

[src]

The HKDF Extract step. Returns a PRK (HMAC) from passed salt and IKM.

[src]

The HKDF Expand step. Returns an HKDF.