Module HKDF_test_rfc5869_A3.
Definition IKM   := decode_hex "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b".
Definition salt  := decode_hex "".
Definition info  := decode_hex "".
Definition L     := 42.
Definition PRK   := decode_hex "19ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04".
Definition OKM   := decode_hex "8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8".
Goal map Byte.unsigned (HKDF_extract salt IKM) = map Byte.unsigned PRK.
vm_compute.  reflexivity. Qed.
Goal map Byte.unsigned (HKDF salt IKM info L) = map Byte.unsigned OKM.
vm_compute. reflexivity. Qed.
End HKDF_test_rfc5869_A3.
(********************************Lemmas*************************************)

Lemma Zlength_HKDF_expand x y z rest: 0 <= 32 * z -> 0 <= rest < 32 ->
(Zlength (HKDF_expand x y (32*z+rest)) = 32*z+rest)%Z.