pub struct Decipher { /* private fields */ }Expand description
Main AES-CBC Decipher structure.
Usage:
extern crate dumb_crypto;
use::dumb_crypto::aes::BLOCK_SIZE;
use::dumb_crypto::aes_cbc::Decipher;
let iv = [
0x4c, 0xb4, 0x52, 0xd6, 0x78, 0xca, 0x94, 0x61,
0x92, 0xcd, 0xc6, 0x91, 0xb7, 0xab, 0x61, 0x76,
];
let key: [u8; 16] = [
0x69, 0xc2, 0xa9, 0xe6, 0x2b, 0x61, 0x30, 0x60,
0xc9, 0x79, 0x7b, 0xdc, 0xe4, 0xf6, 0x40, 0x8e,
];
let mut decipher = Decipher::new(iv);
decipher.init(&key).unwrap();
let mut cleartext = decipher.write(&[
0x98, 0xba, 0x8e, 0x07, 0x5b, 0xcf, 0xa7, 0xb9,
0x3a, 0xbe, 0x45, 0x3a, 0xb1, 0x84, 0xdc, 0x68,
]).unwrap();
cleartext.append(&mut decipher.flush().unwrap());Implementations§
Source§impl Decipher
impl Decipher
Auto Trait Implementations§
impl Freeze for Decipher
impl RefUnwindSafe for Decipher
impl Send for Decipher
impl Sync for Decipher
impl Unpin for Decipher
impl UnsafeUnpin for Decipher
impl UnwindSafe for Decipher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more