()
| 3894 | |
| 3895 | #[test] |
| 3896 | fn hmac_sha256_basic() { |
| 3897 | // Test vector from RFC 4231 (HMAC-SHA256 test case 1) |
| 3898 | let key = b""; |
| 3899 | let message = b""; |
| 3900 | let mac = sz::hmac_sha256(key, message); |
| 3901 | // HMAC-SHA256("", "") = b613... |
| 3902 | let expected = [ |
| 3903 | 0xb6, 0x13, 0x67, 0x9a, 0x08, 0x14, 0xd9, 0xec, 0x77, 0x2f, 0x95, 0xd7, 0x78, 0xc3, 0x5f, 0xc5, 0xff, 0x16, |
| 3904 | 0x97, 0xc4, 0x93, 0x71, 0x56, 0x53, 0xc6, 0xc7, 0x12, 0x14, 0x42, 0x92, 0xc5, 0xad, |
| 3905 | ]; |
| 3906 | assert_eq!(mac, expected); |
| 3907 | } |
| 3908 | |
| 3909 | #[test] |
| 3910 | fn hmac_sha256_short_key() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…