mod aes; use aes::Aes; fn main() { let key: [u8; 16] = [ 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c, ]; let mut found_key: [u8; 16] = Aes::findroundkey(&key); for &byte in &found_key { print!("{:02x}", byte); } println!(); // should be // ef44a541 // a8525b7f // b671253b // db0bad00 let found_key_origininal = Aes::reverse_key_schedule(&mut found_key, 4); for &byte in &found_key_origininal { print!("{:02x}", byte); } println!(); // 247e156b 22aed2a6 a7f71588 01cf4f3c // 2b7e1516, 28aed2a6, abf71588, 09cf4f3c, EXPECTED // 2b7e1574 27aed2a6 a4f71588 00cf4f3c // 2b7e1516 28aed2a6 abf71588 09cf4f3c // 2b7e1516, 28aed2a6, abf71588, 09cf4f3c, // a0fafe17, 88542cb1, 23a33939, 2a6c7605, // f2c295f2, 7a96b943, 5935807a, 7359f67f, // 3d80477d, 4716fe3e, 1e237e44, 6d7a883b, // ef44a541, a8525b7f, b671253b, db0bad00 }