Struct orion::hkdf::Hkdf
[−]
[src]
pub struct Hkdf { pub salt: Vec<u8>, pub data: Vec<u8>, pub info: Vec<u8>, pub hmac: usize, pub length: usize, }
HKDF (HMAC-based Extract-and-Expand Key Derivation Function) as specified in the RFC 5869.
Fields
salt: Vec<u8>
data: Vec<u8>
info: Vec<u8>
hmac: usize
length: usize
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; let key = gen_rand_key(10); let salt = gen_rand_key(10); let info = gen_rand_key(10); let dk = Hkdf { salt: salt, data: key, info: info, hmac: 256, length: 50 }; dk.hkdf_compute();
pub fn hkdf_extract(&self, data: &[u8], salt: &[u8]) -> Vec<u8>
[src]
Return HMAC matching argument passsed to Hkdf.
pub fn hkdf_compute(&self) -> Vec<u8>
[src]
The HKDF Expand step. Returns an HKDF.