aws_lc_rs::aead

Struct UnboundKey

Source
pub struct UnboundKey {
    ctx: AeadCtx,
    algorithm: &'static Algorithm,
}
Expand description

An AEAD key without a designated role or nonce sequence.

Fields§

§ctx: AeadCtx§algorithm: &'static Algorithm

Implementations§

Source§

impl UnboundKey

Source

pub fn new( algorithm: &'static Algorithm, key_bytes: &[u8], ) -> Result<Self, Unspecified>

Constructs an UnboundKey.

§Errors

error::Unspecified if key_bytes.len() != algorithm.key_len().

Source

pub(crate) fn open_within<'in_out>( &self, nonce: Nonce, aad: &[u8], in_out: &'in_out mut [u8], ciphertext_and_tag: RangeFrom<usize>, ) -> Result<&'in_out mut [u8], Unspecified>

Source

pub(crate) fn open_separate_gather( &self, nonce: &Nonce, aad: &[u8], in_ciphertext: &[u8], in_tag: &[u8], out_plaintext: &mut [u8], ) -> Result<(), Unspecified>

Source

pub(crate) fn seal_in_place_append_tag<'a, InOut>( &self, nonce: Option<Nonce>, aad: &[u8], in_out: &'a mut InOut, ) -> Result<Nonce, Unspecified>
where InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,

Source

pub(crate) fn seal_in_place_separate_tag( &self, nonce: Option<Nonce>, aad: &[u8], in_out: &mut [u8], ) -> Result<(Nonce, Tag), Unspecified>

Source

pub(crate) fn seal_in_place_separate_scatter( &self, nonce: Nonce, aad: &[u8], in_out: &mut [u8], extra_in: &[u8], extra_out_and_tag: &mut [u8], ) -> Result<(), Unspecified>

Source

pub fn algorithm(&self) -> &'static Algorithm

The key’s AEAD algorithm.

Source

pub(crate) fn check_per_nonce_max_bytes( &self, in_out_len: usize, ) -> Result<(), Unspecified>

Source

fn open_combined( &self, nonce: Nonce, aad: &[u8], in_out: &mut [u8], ) -> Result<(), Unspecified>

Source

fn open_combined_randnonce( &self, nonce: Nonce, aad: &[u8], in_out: &mut [u8], ) -> Result<(), Unspecified>

Source

fn seal_combined<InOut>( &self, nonce: Nonce, aad: &[u8], in_out: &mut InOut, ) -> Result<Nonce, Unspecified>
where InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,

Source

fn seal_combined_randnonce<InOut>( &self, aad: &[u8], in_out: &mut InOut, ) -> Result<Nonce, Unspecified>
where InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,

Source

fn seal_separate( &self, nonce: Nonce, aad: &[u8], in_out: &mut [u8], ) -> Result<(Nonce, Tag), Unspecified>

Source

fn seal_separate_randnonce( &self, aad: &[u8], in_out: &mut [u8], ) -> Result<(Nonce, Tag), Unspecified>

Trait Implementations§

Source§

impl Debug for UnboundKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<AeadCtx> for UnboundKey

Source§

fn from(value: AeadCtx) -> Self

Converts to this type from the input type.
Source§

impl From<Okm<'_, &'static Algorithm>> for UnboundKey

Source§

fn from(okm: Okm<'_, &'static Algorithm>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.