use sparrowdb_storage::encryption::EncryptionContext;
use std::path::PathBuf;
fn main() {
let ctx = EncryptionContext::with_key([0x42u8; 32]);
let plaintext = vec![0xABu8; 512];
let ciphertext = ctx
.encrypt_page(0, &plaintext)
.expect("encrypt must succeed");
assert_eq!(ciphertext.len(), 552, "fixture must be 552 bytes");
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.pop(); path.pop(); path.push("tests");
path.push("fixtures");
std::fs::create_dir_all(&path).expect("create fixture directory");
path.push("encrypted_page.bin");
std::fs::write(&path, &ciphertext).expect("write fixture");
println!(
"Wrote golden fixture ({} bytes) to {}",
ciphertext.len(),
path.display()
);
}