pub struct Present { /* private fields */ }
Expand description
PRESENT block cipher.
Based on version 1.2 of the following Python implementation https://github.com/doegox/python-cryptoplus
Implementations§
Source§impl Present
impl Present
pub fn try_new_rounds(key: Vec<u8>, rounds: usize) -> Result<Present>
Sourcepub fn try_new(key: Vec<u8>) -> Result<Present>
pub fn try_new(key: Vec<u8>) -> Result<Present>
Create a new instance of the PRESENT cipher.
Valid key lengths are 80 and 128 bits. All other key lengths will return an error.
Sourcepub fn encrypt_block(&self, block: u64) -> u64
pub fn encrypt_block(&self, block: u64) -> u64
Encrypt a 64-bit block.
Sourcepub fn decrypt_block(&self, block: u64) -> u64
pub fn decrypt_block(&self, block: u64) -> u64
Decrypt a 64-bit block.
Auto Trait Implementations§
impl Freeze for Present
impl RefUnwindSafe for Present
impl Send for Present
impl Sync for Present
impl Unpin for Present
impl UnwindSafe for Present
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