docs

你正在阅读 v0.1.2 的文档。Nabi 0.1.2 已不再提供支持。 最新版本: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.