()
| 507 | |
| 508 | #[test] |
| 509 | fn tampered_ciphertext_fails() { |
| 510 | let key = test_key(); |
| 511 | let epoch = *key.epoch(); |
| 512 | let header = test_header(1); |
| 513 | |
| 514 | let mut ciphertext = key.encrypt(1, &header, b"secret").unwrap(); |
| 515 | ciphertext[0] ^= 0xFF; |
| 516 | assert!(key.decrypt(&epoch, 1, &header, &ciphertext).is_err()); |
| 517 | } |
| 518 | |
| 519 | #[test] |
| 520 | fn tampered_header_fails() { |
nothing calls this directly
no test coverage detected