()
| 223 | |
| 224 | #[test] |
| 225 | fn array_segment_encrypted_at_rest() { |
| 226 | let s = schema(); |
| 227 | let mut w = SegmentWriter::new(0xCAFE); |
| 228 | w.append_sparse(TileId::snapshot(1), &sparse_tile(&s)) |
| 229 | .unwrap(); |
| 230 | let kek = test_kek(); |
| 231 | let bytes = w.finish(Some(&kek)).unwrap(); |
| 232 | // Output must start with SEGA, not NDAS. |
| 233 | assert_eq!(&bytes[..4], b"SEGA"); |
| 234 | // Must not start with plaintext NDAS magic. |
| 235 | assert_ne!(&bytes[..4], b"NDAS"); |
| 236 | } |
| 237 | |
| 238 | #[test] |
| 239 | fn array_segment_refuses_plaintext_with_kek() { |
nothing calls this directly
no test coverage detected