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

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

#1348 in Cryptography

Download history 869/week @ 2024-07-19 876/week @ 2024-07-26 240/week @ 2024-08-02 208/week @ 2024-08-09 180/week @ 2024-08-16 125/week @ 2024-08-23 528/week @ 2024-08-30 361/week @ 2024-09-06 196/week @ 2024-09-13 162/week @ 2024-09-20 215/week @ 2024-09-27 391/week @ 2024-10-04 323/week @ 2024-10-11 505/week @ 2024-10-18 398/week @ 2024-10-25 235/week @ 2024-11-01

1,514 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

~325KB