#crypto #encryption #radix #optimized #ff1 #binary #aes-256

no-std binary-ff1

Optimized Rust implementation of FF1 encryption with radix 2

2 unstable releases

0.2.0 Aug 1, 2021
0.1.0 Apr 9, 2020

#1179 in Cryptography

Download history 61/week @ 2024-03-26 210/week @ 2024-04-02 228/week @ 2024-04-09 122/week @ 2024-04-16 78/week @ 2024-04-23 230/week @ 2024-04-30 225/week @ 2024-05-07 300/week @ 2024-05-14 246/week @ 2024-05-21 139/week @ 2024-05-28 87/week @ 2024-06-04 113/week @ 2024-06-11 95/week @ 2024-06-18 103/week @ 2024-06-25 93/week @ 2024-07-02 136/week @ 2024-07-09

440 downloads per month

MIT/Apache

29KB
578 lines

binary-ff1

Optimized Rust implementation of FF1 encryption with radix 2, specified in NIST Special Publication 800-38G.


lib.rs:

Optimized Rust implementation of FF1 encryption with radix 2, specified in NIST Special Publication 800-38G.

Example

#
const KEY: [u8; 32] = [0; 32];
const LEN: usize = 3;

let cipher = Aes256::new(GenericArray::from_slice(&KEY));
let mut scratch = [0; LEN + 1];
let mut ff1 = BinaryFF1::new(&cipher, LEN, &[], &mut scratch).unwrap();

let mut x: [u8; LEN] = [0xAB, 0xCD, 0xEF];
ff1.encrypt(&mut x).unwrap();
assert_eq!(x, [0x75, 0xFB, 0x62]);
ff1.decrypt(&mut x).unwrap();
assert_eq!(x, [0xAB, 0xCD, 0xEF]);

Dependencies

~320KB