docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

core::crypto::hkdf

API 參考只有英文版,由標準函式庫原始碼中的英文文件註解產生。

HKDF (RFC 5869) over any HashAlgorithm: extract a pseudorandom key, expand it into output keying material.

Functions

extractSource

pub fn extract<S: AsBytes, I: AsBytes>(alg: HashAlgorithm, salt: S, ikm: I) -> Secret

HMAC(salt, ikm); an empty salt is output_len zero bytes.

expandSource

pub fn expand<P: AsBytes, I: AsBytes>(alg: HashAlgorithm, prk: P, info: I, len: usize) throws (ValueError) -> Secret

len bytes of output keying material; len is at most 255 * output_len.