pub struct EncryptionContext { /* private fields */ }Implementations§
Source§impl EncryptionContext
impl EncryptionContext
pub fn new( cipher_mode: CipherMode, key: &EncryptionKey, page_size: usize, ) -> Result<Self>
pub fn cipher_mode(&self) -> CipherMode
Sourcepub fn required_reserved_bytes(&self) -> u8
pub fn required_reserved_bytes(&self) -> u8
Returns the number of reserved bytes required at the end of each page for encryption metadata.
pub fn encrypt_chunk( &self, plaintext: &[u8], aad: &[u8], ) -> Result<(Vec<u8>, Vec<u8>)>
pub fn decrypt_chunk( &self, ciphertext: &[u8], nonce: &[u8], aad: &[u8], ) -> Result<Vec<u8>>
pub fn decrypt_chunk_into( &self, ciphertext: &[u8], nonce: &[u8], aad: &[u8], out: &mut Vec<u8>, ) -> Result<()>
pub fn nonce_size(&self) -> usize
pub fn tag_size(&self) -> usize
pub fn encrypt_page(&self, page: &[u8], page_id: usize) -> Result<Vec<u8>>
pub fn decrypt_page( &self, encrypted_page: &[u8], page_id: usize, ) -> Result<Vec<u8>>
Trait Implementations§
Source§impl Clone for EncryptionContext
impl Clone for EncryptionContext
Source§fn clone(&self) -> EncryptionContext
fn clone(&self) -> EncryptionContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EncryptionContext
impl RefUnwindSafe for EncryptionContext
impl Send for EncryptionContext
impl Sync for EncryptionContext
impl Unpin for EncryptionContext
impl UnsafeUnpin for EncryptionContext
impl UnwindSafe for EncryptionContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more