()
| 121 | |
| 122 | #[test] |
| 123 | fn hmac_rejects_tampered_data() { |
| 124 | let key = MacKey::from_bytes([7u8; MAC_LEN]); |
| 125 | let tag = compute_hmac(&key, b"hello world"); |
| 126 | let err = verify_hmac(&key, b"hello WORLD", &tag).unwrap_err(); |
| 127 | assert!(err.to_string().contains("MAC verification failed")); |
| 128 | } |
| 129 | |
| 130 | #[test] |
| 131 | fn hmac_rejects_wrong_key() { |
nothing calls this directly
no test coverage detected