Fix PBKDF2 incorrect result on okm_len with length greater than HLEN. Missing hmac.reset()
@@ -124,6 +124,8 @@ pub fn derive_key(
for (idx, dk_block) in dk_out.chunks_mut(HLEN).enumerate() {
function_f(salt, iterations, idx + 1, dk_block, &mut hmac);
+ // Reset the HMAC state to clear the data from tis iteration
+ hmac.reset();
}
Ok(())
