mod chip;
pub mod cmac;
mod family;
pub use chip::{detect_chip, ChipError, ChipInfo};
pub use family::{family, hardware, Family, Hardware, FAMILY_SCHEME};
use crate::layout;
pub fn is_uhd(image: &[u8]) -> bool {
layout::UHD_REVOCATION
.of(image)
.is_some_and(|region| !layout::is_erased(region))
}
pub fn is_drive_read(read: &[u8]) -> bool {
match (layout::BOOT_PAGE.of(read), layout::BOOT_MIRROR.of(read)) {
(Some(boot), Some(mirror)) => boot == mirror,
_ => false,
}
}
#[cfg(test)]
#[path = "image_tests.rs"]
mod tests;