pub fn validate_ecc(data: &[u8]) -> boolExpand description
Checks whether data is a pristine ECC codeword.
This is an unkeyed Reed-Solomon syndrome check: it detects accidental
corruption, not tampering. Authenticity is verified by the Poly1305 tag
during decrypt. Returns false for corrupted-but-correctable
codewords that decrypt still accepts.
ยงExamples
let data = b"important data";
let encrypted = encrypt(data).expect("encryption failed");
assert!(validate_ecc(&encrypted));