pub struct JournalXtsCipher { /* private fields */ }Expand description
Cipher used for encrypting and decrypting journal mutations with AES-256-XTS and CTS.
Implementations§
Source§impl JournalXtsCipher
impl JournalXtsCipher
pub fn new(key: &UnwrappedKey, tweak: u64) -> Self
Sourcepub fn encrypt(&mut self, buffer: &[u8]) -> Vec<u8> ⓘ
pub fn encrypt(&mut self, buffer: &[u8]) -> Vec<u8> ⓘ
Encrypts buffer using AES-256-XTS with ciphertext stealing into a newly allocated vector.
If buffer.len() < 16, it will be zero-padded to 16 bytes first.
Sourcepub fn decrypt(&mut self, buffer: &mut [u8])
pub fn decrypt(&mut self, buffer: &mut [u8])
Decrypts buffer in place using AES-256-XTS with ciphertext stealing.
buffer.len() must be >= 16.
pub fn current_tweak(&self) -> u64
pub fn key_is_new(&self) -> bool
Auto Trait Implementations§
impl Freeze for JournalXtsCipher
impl RefUnwindSafe for JournalXtsCipher
impl Send for JournalXtsCipher
impl Sync for JournalXtsCipher
impl Unpin for JournalXtsCipher
impl UnsafeUnpin for JournalXtsCipher
impl UnwindSafe for JournalXtsCipher
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