()
| 269 | |
| 270 | #[test] |
| 271 | fn test_open_sealed_box_with_wrong_key() { |
| 272 | // Use the first test vector |
| 273 | let vector = &TEST_VECTORS[0]; |
| 274 | |
| 275 | // Use the correct public key but wrong secret key (from vector 1) |
| 276 | let public_key = public_key_from_bytes(&vector.public_key); |
| 277 | let wrong_secret_key = secret_key_from_bytes(&TEST_VECTORS[1].secret_key); |
| 278 | |
| 279 | // Try to open the sealed box with wrong key |
| 280 | let result = open_sealed_box(vector.sealed_box, &public_key, &wrong_secret_key); |
| 281 | |
| 282 | // Verify the result is an error |
| 283 | assert!(result.is_err(), "Should fail with wrong key"); |
| 284 | } |
| 285 | |
| 286 | #[test] |
| 287 | fn test_open_sealed_box_with_corrupted_data() { |
nothing calls this directly
no test coverage detected