pub fn p_sha(
message_digest: MessageDigest,
secret: &[u8],
seed: &[u8],
length: usize
) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
Expand description
Pseudo random P_SHA
implementation for creating pseudo random range of bytes from an input
https://www.ietf.org/rfc/rfc4346.txt https://tools.ietf.org/html/rfc5246
P_SHA1(secret, seed) = HMAC_SHA1(secret, A(1) + seed) + HMAC_SHA1(secret, A(2) + seed) + HMAC_SHA1(secret, A(3) + seed) + …
Where A(n) is defined as: A(0) = seed A(n) = HMAC_SHA1(secret, A(n-1))
- indicates that the results are appended to previous results.