period finder

This commit is contained in:
2026-04-07 10:32:19 +02:00
parent 2cf6a50d40
commit ce0c8146ca
3 changed files with 170 additions and 64 deletions
+7 -2
View File
@@ -1,8 +1,10 @@
mod lfsr;
mod period;
mod tea3;
use lfsr::Lfsr;
use tea3::{Tea3, period_floyd};
use period::{period_bruteforce, period_floyd, period_paper};
use tea3::Tea3;
fn main() {
let mut lfsr = Lfsr::new(4, vec![0, 3], vec![0x12, 0x34, 0x56, 0x78]);
@@ -47,5 +49,8 @@ fn main() {
println!("Decrypted : {:?}", decrypted);
// println!("\nperiod: {}", period_floyd(vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0], vec![0; 8]));
println!(
"\nPaper period: {}",
period_paper(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
);
}