added max mask

This commit is contained in:
2026-04-12 23:11:07 +02:00
parent 973b4dba18
commit c9325c3557

View File

@@ -18,6 +18,9 @@ async fn run() {
File::create("results.txt").expect("cannot create results.txt"), File::create("results.txt").expect("cannot create results.txt"),
); );
let width: u8 = 13;
let width_max_mask: u32 = (1 << width) - 1;
let count = cracker.run( let count = cracker.run(
&[ &[
TestCase::masked(vec![0x01, 0x23, 0x45, 0x67, 0x89, 0x00], 0x94, 0x00FF), TestCase::masked(vec![0x01, 0x23, 0x45, 0x67, 0x89, 0x00], 0x94, 0x00FF),
@@ -38,9 +41,9 @@ async fn run() {
TestCase::masked(vec![0x01, 0x23, 0x45, 0x67, 0x89, 0x0F], 0x3C, 0x00FF), TestCase::masked(vec![0x01, 0x23, 0x45, 0x67, 0x89, 0x0F], 0x3C, 0x00FF),
], ],
&Constraints { &Constraints {
width: 13, width,
poly: ValueRange::Range(0x0000..=0x1FFF), poly: ValueRange::Range(0x0000..=width_max_mask),
init: ValueRange::Range(0x0000..=0x1FFF), init: ValueRange::Range(0x0000..=width_max_mask),
xorout: ValueRange::Fixed(0x0000), xorout: ValueRange::Fixed(0x0000),
refin: None, refin: None,
refout: None, refout: None,