Function orion::default::hkdf [] [src]

pub fn hkdf(
    salt: &[u8],
    input_data: &[u8],
    info: &[u8],
    length: usize
) -> Result<Vec<u8>, UnknownCryptoError>

HKDF with HMAC-SHA512.

Exceptions:

An exception will be thrown if:

  • The length of the secret key is less than 64

Usage example:

use orion::default;
use orion::util;

let salt = util::gen_rand_key(64).unwrap();
let data = "Some data.".as_bytes();
let info = "Some info.".as_bytes();

let hkdf = default::hkdf(&salt, data, info, 64).unwrap();