pub enum CipherMode {
None,
Aes128Gcm,
Aes256Gcm,
Aegis256,
Aegis128L,
Aegis128X2,
Aegis128X4,
Aegis256X2,
Aegis256X4,
}Variants§
Implementations§
Source§impl CipherMode
impl CipherMode
Sourcepub fn required_key_size(&self) -> usize
pub fn required_key_size(&self) -> usize
Every cipher requires a specific key size. For 256-bit algorithms, this is 32 bytes. For 128-bit algorithms, it would be 16 bytes, etc.
Sourcepub fn nonce_size(&self) -> usize
pub fn nonce_size(&self) -> usize
Returns the nonce size for this cipher mode.
Sourcepub fn metadata_size(&self) -> usize
pub fn metadata_size(&self) -> usize
Returns the total metadata size (nonce + tag) for this cipher mode.
Sourcepub fn from_cipher_id(id: u8) -> Result<Self>
pub fn from_cipher_id(id: u8) -> Result<Self>
Creates a CipherMode from cipher identifier byte. This is used when read from Turso header.
Trait Implementations§
Source§impl Clone for CipherMode
impl Clone for CipherMode
Source§fn clone(&self) -> CipherMode
fn clone(&self) -> CipherMode
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 moreimpl Copy for CipherMode
Source§impl Debug for CipherMode
impl Debug for CipherMode
Source§impl Display for CipherMode
impl Display for CipherMode
impl Eq for CipherMode
Source§impl PartialEq for CipherMode
impl PartialEq for CipherMode
impl StructuralPartialEq for CipherMode
Auto Trait Implementations§
impl Freeze for CipherMode
impl RefUnwindSafe for CipherMode
impl Send for CipherMode
impl Sync for CipherMode
impl Unpin for CipherMode
impl UnsafeUnpin for CipherMode
impl UnwindSafe for CipherMode
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,
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.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