pub struct Key { /* private fields */ }
Expand description
References a specific key in the cipher set.
Implementations§
Source§impl Key
impl Key
pub fn key_id(&self) -> u64
Sourcepub fn encrypt(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
pub fn encrypt(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
Encrypts data in the buffer
.
offset
is the byte offset within the file.buffer
is mutated in place.
buffer
must be 16 byte aligned.
Sourcepub fn decrypt(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
pub fn decrypt(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
Decrypt the data in buffer
.
offset
is the byte offset within the file.buffer
is mutated in place.
buffer
must be 16 byte aligned.
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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