1 #[cfg(not(feature = "reset"))]
2 use digest
::new_mac_test
as test
;
3 #[cfg(feature = "reset")]
4 use digest
::new_resettable_mac_test
as test
;
5 use hmac
::{Hmac, SimpleHmac}
;
7 use sha2
::{Sha224, Sha256, Sha384, Sha512}
;
8 use streebog
::{Streebog256, Streebog512}
;
10 // Test vectors from RFC 2104, plus wiki test
11 test
!(hmac_md5_rfc2104
, "md5", Hmac
<md5
::Md5
>);
12 test
!(hmac_md5_rfc2104_simple
, "md5", SimpleHmac
<md5
::Md5
>);
14 // Test vectors from RFC 4231
15 test
!(hmac_sha224_rfc4231
, "sha224", Hmac
<Sha224
>);
16 test
!(hmac_sha256_rfc4231
, "sha256", Hmac
<Sha256
>);
17 test
!(hmac_sha384_rfc4231
, "sha384", Hmac
<Sha384
>);
18 test
!(hmac_sha512_rfc4231
, "sha512", Hmac
<Sha512
>);
19 test
!(hmac_sha224_rfc4231_simple
, "sha224", SimpleHmac
<Sha224
>);
20 test
!(hmac_sha256_rfc4231_simple
, "sha256", SimpleHmac
<Sha256
>);
21 test
!(hmac_sha384_rfc4231_simple
, "sha384", SimpleHmac
<Sha384
>);
22 test
!(hmac_sha512_rfc4231_simple
, "sha512", SimpleHmac
<Sha512
>);
24 // Test vectors from R 50.1.113-2016:
25 // https://tc26.ru/standard/rs/Р 50.1.113-2016.pdf
26 test
!(hmac_streebog256
, "streebog256", Hmac
<Streebog256
>);
27 test
!(hmac_streebog512
, "streebog512", Hmac
<Streebog512
>);
29 hmac_streebog256_simple
,
31 SimpleHmac
<Streebog256
>
34 hmac_streebog512_simple
,
36 SimpleHmac
<Streebog512
>
39 // Tests from Project Wycheproof:
40 // https://github.com/google/wycheproof
48 hmac_sha256_wycheproof
,
54 hmac_sha384_wycheproof
,
60 hmac_sha512_wycheproof
,
66 hmac_sha1_wycheproof_simple
,
72 hmac_sha256_wycheproof_simple
,
78 hmac_sha384_wycheproof_simple
,
84 hmac_sha512_wycheproof_simple
,