Enum hpke_rs_crypto::types::AeadAlgorithm
source · [−]#[repr(u16)]
pub enum AeadAlgorithm {
Aes128Gcm,
Aes256Gcm,
ChaCha20Poly1305,
HpkeExport,
}
Expand description
AEAD types
Variants
Aes128Gcm
AES GCM 128
Aes256Gcm
AES GCM 256
ChaCha20Poly1305
ChaCha20 Poly1305
HpkeExport
HPKE Export-only
Implementations
sourceimpl AeadAlgorithm
impl AeadAlgorithm
sourcepub const fn tag_length(&self) -> usize
pub const fn tag_length(&self) -> usize
Get the tag size of the AeadAlgorithm
in bytes.
Note that the function returns 0
for unknown lengths such as the
AeadAlgorithm::HpkeExport
type.
sourcepub const fn key_length(&self) -> usize
pub const fn key_length(&self) -> usize
Get the key size of the AeadAlgorithm
in bytes.
Note that the function returns 0
for unknown lengths such as the
AeadAlgorithm::HpkeExport
type.
sourcepub const fn nonce_length(&self) -> usize
pub const fn nonce_length(&self) -> usize
Get the nonce size of the AeadAlgorithm
in bytes.
Note that the function returns 0
for unknown lengths such as the
AeadAlgorithm::HpkeExport
type.
Further note that while the AEAD mechanisms generally allow for different nonce lengths, this HPKE implementation expects the most common nonce size.
Trait Implementations
sourceimpl Clone for AeadAlgorithm
impl Clone for AeadAlgorithm
sourcefn clone(&self) -> AeadAlgorithm
fn clone(&self) -> AeadAlgorithm
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AeadAlgorithm
impl Debug for AeadAlgorithm
sourceimpl<'de> Deserialize<'de> for AeadAlgorithm
impl<'de> Deserialize<'de> for AeadAlgorithm
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for AeadAlgorithm
impl Display for AeadAlgorithm
sourceimpl PartialEq<AeadAlgorithm> for AeadAlgorithm
impl PartialEq<AeadAlgorithm> for AeadAlgorithm
sourceimpl Serialize for AeadAlgorithm
impl Serialize for AeadAlgorithm
sourceimpl TryFrom<u16> for AeadAlgorithm
impl TryFrom<u16> for AeadAlgorithm
impl Copy for AeadAlgorithm
impl Eq for AeadAlgorithm
impl StructuralEq for AeadAlgorithm
impl StructuralPartialEq for AeadAlgorithm
Auto Trait Implementations
impl RefUnwindSafe for AeadAlgorithm
impl Send for AeadAlgorithm
impl Sync for AeadAlgorithm
impl Unpin for AeadAlgorithm
impl UnwindSafe for AeadAlgorithm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more