Struct orion::hkdf::Hkdf [] [src]

pub struct Hkdf {
    pub salt: Vec<u8>,
    pub ikm: Vec<u8>,
    pub info: Vec<u8>,
    pub hmac: ShaVariantOption,
    pub length: usize,
}

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

Fields

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::util::gen_rand_key;
use orion::options::ShaVariantOption;

let key = gen_rand_key(16);
let salt = gen_rand_key(16);
let info = gen_rand_key(16);

let dk = Hkdf { salt: salt, ikm: key, info: info, hmac: ShaVariantOption::SHA256, length: 50 };
let dk_extract = dk.hkdf_extract(&dk.ikm, &dk.salt);
dk.hkdf_expand(&dk_extract);

[src]

Return HMAC matching argument passsed to Hkdf.

[src]

The HKDF Expand step. Returns an HKDF.

Trait Implementations

impl Drop for Hkdf
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl Send for Hkdf

impl Sync for Hkdf