jtdowney / speck

Toy implementation of Speck cipher in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

speck

This is a Rust implementation of the Speck cipher. I built it as a quick experiment to see how I'd implement it with #[no_std] Rust and have no intention of putting it into production use. It does pass the test vectors from the paper, after they were converted to little-endian.

Example

let id = 456789;
let cipher = Speck64_128::new([0, 1, 3, 4]);
let mut data = id.to_le_bytes();
cipher.seal_in_place(&mut data).unwrap();
let encrypted_id = u64::from_le_bytes(data)
// => 6883383884621847717

About

Toy implementation of Speck cipher in Rust

License:MIT License


Languages

Language:Rust 100.0%