From 2aadc03ef15cb5ca5cc2af8a7c08e070742f0ac4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:47:55 +0200 Subject: Adding upstream version 0.70.1+ds1. Signed-off-by: Daniel Baumann --- vendor/hmac/tests/data/md5.blb | Bin 0 -> 245 bytes vendor/hmac/tests/data/sha224.blb | Bin 0 -> 803 bytes vendor/hmac/tests/data/sha256.blb | Bin 0 -> 831 bytes vendor/hmac/tests/data/sha384.blb | Bin 0 -> 943 bytes vendor/hmac/tests/data/sha512.blb | Bin 0 -> 1062 bytes vendor/hmac/tests/data/streebog256.blb | Bin 0 -> 84 bytes vendor/hmac/tests/data/streebog512.blb | Bin 0 -> 117 bytes vendor/hmac/tests/data/wycheproof-sha1.blb | Bin 0 -> 4875 bytes vendor/hmac/tests/data/wycheproof-sha256.blb | Bin 0 -> 6153 bytes vendor/hmac/tests/data/wycheproof-sha384.blb | Bin 0 -> 7857 bytes vendor/hmac/tests/data/wycheproof-sha512.blb | Bin 0 -> 9648 bytes vendor/hmac/tests/mod.rs | 88 +++++++++++++++++++++++++++ 12 files changed, 88 insertions(+) create mode 100644 vendor/hmac/tests/data/md5.blb create mode 100644 vendor/hmac/tests/data/sha224.blb create mode 100644 vendor/hmac/tests/data/sha256.blb create mode 100644 vendor/hmac/tests/data/sha384.blb create mode 100644 vendor/hmac/tests/data/sha512.blb create mode 100644 vendor/hmac/tests/data/streebog256.blb create mode 100644 vendor/hmac/tests/data/streebog512.blb create mode 100644 vendor/hmac/tests/data/wycheproof-sha1.blb create mode 100644 vendor/hmac/tests/data/wycheproof-sha256.blb create mode 100644 vendor/hmac/tests/data/wycheproof-sha384.blb create mode 100644 vendor/hmac/tests/data/wycheproof-sha512.blb create mode 100644 vendor/hmac/tests/mod.rs (limited to 'vendor/hmac/tests') diff --git a/vendor/hmac/tests/data/md5.blb b/vendor/hmac/tests/data/md5.blb new file mode 100644 index 0000000..731a0ae Binary files /dev/null and b/vendor/hmac/tests/data/md5.blb differ diff --git a/vendor/hmac/tests/data/sha224.blb b/vendor/hmac/tests/data/sha224.blb new file mode 100644 index 0000000..dabb20b Binary files /dev/null and b/vendor/hmac/tests/data/sha224.blb differ diff --git a/vendor/hmac/tests/data/sha256.blb b/vendor/hmac/tests/data/sha256.blb new file mode 100644 index 0000000..6b5b288 Binary files /dev/null and b/vendor/hmac/tests/data/sha256.blb differ diff --git a/vendor/hmac/tests/data/sha384.blb b/vendor/hmac/tests/data/sha384.blb new file mode 100644 index 0000000..d5cddb3 Binary files /dev/null and b/vendor/hmac/tests/data/sha384.blb differ diff --git a/vendor/hmac/tests/data/sha512.blb b/vendor/hmac/tests/data/sha512.blb new file mode 100644 index 0000000..b79ae49 Binary files /dev/null and b/vendor/hmac/tests/data/sha512.blb differ diff --git a/vendor/hmac/tests/data/streebog256.blb b/vendor/hmac/tests/data/streebog256.blb new file mode 100644 index 0000000..99d9722 Binary files /dev/null and b/vendor/hmac/tests/data/streebog256.blb differ diff --git a/vendor/hmac/tests/data/streebog512.blb b/vendor/hmac/tests/data/streebog512.blb new file mode 100644 index 0000000..8f0f151 Binary files /dev/null and b/vendor/hmac/tests/data/streebog512.blb differ diff --git a/vendor/hmac/tests/data/wycheproof-sha1.blb b/vendor/hmac/tests/data/wycheproof-sha1.blb new file mode 100644 index 0000000..a4f8f43 Binary files /dev/null and b/vendor/hmac/tests/data/wycheproof-sha1.blb differ diff --git a/vendor/hmac/tests/data/wycheproof-sha256.blb b/vendor/hmac/tests/data/wycheproof-sha256.blb new file mode 100644 index 0000000..62f1d35 Binary files /dev/null and b/vendor/hmac/tests/data/wycheproof-sha256.blb differ diff --git a/vendor/hmac/tests/data/wycheproof-sha384.blb b/vendor/hmac/tests/data/wycheproof-sha384.blb new file mode 100644 index 0000000..69a7874 Binary files /dev/null and b/vendor/hmac/tests/data/wycheproof-sha384.blb differ diff --git a/vendor/hmac/tests/data/wycheproof-sha512.blb b/vendor/hmac/tests/data/wycheproof-sha512.blb new file mode 100644 index 0000000..e061fd5 Binary files /dev/null and b/vendor/hmac/tests/data/wycheproof-sha512.blb differ diff --git a/vendor/hmac/tests/mod.rs b/vendor/hmac/tests/mod.rs new file mode 100644 index 0000000..bcdcbee --- /dev/null +++ b/vendor/hmac/tests/mod.rs @@ -0,0 +1,88 @@ +#[cfg(not(feature = "reset"))] +use digest::new_mac_test as test; +#[cfg(feature = "reset")] +use digest::new_resettable_mac_test as test; +use hmac::{Hmac, SimpleHmac}; +use sha1::Sha1; +use sha2::{Sha224, Sha256, Sha384, Sha512}; +//use streebog::{Streebog256, Streebog512}; + +// Test vectors from RFC 2104, plus wiki test +test!(hmac_md5_rfc2104, "md5", Hmac); +test!(hmac_md5_rfc2104_simple, "md5", SimpleHmac); + +// Test vectors from RFC 4231 +test!(hmac_sha224_rfc4231, "sha224", Hmac); +test!(hmac_sha256_rfc4231, "sha256", Hmac); +test!(hmac_sha384_rfc4231, "sha384", Hmac); +test!(hmac_sha512_rfc4231, "sha512", Hmac); +test!(hmac_sha224_rfc4231_simple, "sha224", SimpleHmac); +test!(hmac_sha256_rfc4231_simple, "sha256", SimpleHmac); +test!(hmac_sha384_rfc4231_simple, "sha384", SimpleHmac); +test!(hmac_sha512_rfc4231_simple, "sha512", SimpleHmac); + +// Test vectors from R 50.1.113-2016: +// https://tc26.ru/standard/rs/Р 50.1.113-2016.pdf +//test!(hmac_streebog256, "streebog256", Hmac); +//test!(hmac_streebog512, "streebog512", Hmac); +/*test!( + hmac_streebog256_simple, + "streebog256", + SimpleHmac +); +test!( + hmac_streebog512_simple, + "streebog512", + SimpleHmac +);*/ + +// Tests from Project Wycheproof: +// https://github.com/google/wycheproof +test!( + hmac_sha1_wycheproof, + "wycheproof-sha1", + Hmac, + trunc_left, +); +test!( + hmac_sha256_wycheproof, + "wycheproof-sha256", + Hmac, + trunc_left, +); +test!( + hmac_sha384_wycheproof, + "wycheproof-sha384", + Hmac, + trunc_left, +); +test!( + hmac_sha512_wycheproof, + "wycheproof-sha512", + Hmac, + trunc_left, +); +test!( + hmac_sha1_wycheproof_simple, + "wycheproof-sha1", + SimpleHmac, + trunc_left, +); +test!( + hmac_sha256_wycheproof_simple, + "wycheproof-sha256", + SimpleHmac, + trunc_left, +); +test!( + hmac_sha384_wycheproof_simple, + "wycheproof-sha384", + SimpleHmac, + trunc_left, +); +test!( + hmac_sha512_wycheproof_simple, + "wycheproof-sha512", + SimpleHmac, + trunc_left, +); -- cgit v1.2.3