1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
//! Format-preserving encryption algorithms. //! //! # Example //! //! ``` //! extern crate aes; //! extern crate fpe; //! //! use aes::Aes256; //! use fpe::ff1::{BinaryNumeralString, FF1}; //! //! let key = [0; 32]; //! let radix = 2; //! let pt = [0xab, 0xcd, 0xef]; //! //! let ff = FF1::<Aes256>::new(&key, radix).unwrap(); //! let ct = ff.encrypt(&[], &BinaryNumeralString::from_bytes_le(&pt)).unwrap(); //! assert_eq!(ct.to_bytes_le(), [0x75, 0xfb, 0x62]); //! //! let p2 = ff.decrypt(&[], &ct).unwrap(); //! assert_eq!(p2.to_bytes_le(), pt); //! ``` #![deny(missing_docs)] // refuse to compile if documentation is missing pub mod ff1;