()
| 496 | |
| 497 | #[test] |
| 498 | fn wrong_lsn_fails() { |
| 499 | let key = test_key(); |
| 500 | let epoch = *key.epoch(); |
| 501 | let header = test_header(1); |
| 502 | |
| 503 | let ciphertext = key.encrypt(1, &header, b"secret").unwrap(); |
| 504 | // Different LSN = different nonce = decryption fails. |
| 505 | assert!(key.decrypt(&epoch, 2, &header, &ciphertext).is_err()); |
| 506 | } |
| 507 | |
| 508 | #[test] |
| 509 | fn tampered_ciphertext_fails() { |
nothing calls this directly
no test coverage detected