Skip to main content

LessSafeKey

Struct LessSafeKey 

Source
pub struct LessSafeKey { /* private fields */ }
Expand description

A sealing/opening key that does not enforce nonce uniqueness (mirrors ring::aead::LessSafeKey).

Implementations§

Source§

impl LessSafeKey

Source

pub fn new(key: UnboundKey) -> Self

Source

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

Source

pub fn seal_in_place_append_tag<A: AsRef<[u8]>>( &self, nonce: Nonce, aad: &Aad<A>, in_out: &mut Vec<u8>, ) -> Result<(), Unspecified>

Encrypt in_out in-place and append the authentication tag.

§Errors

Returns Unspecified if the underlying OpenSSL AEAD operation fails.

Source

pub fn open_in_place<'in_out, A: AsRef<[u8]>>( &self, nonce: Nonce, aad: &Aad<A>, in_out: &'in_out mut [u8], ) -> Result<&'in_out mut [u8], Unspecified>

Decrypt in_out in-place; on success returns the plaintext slice.

in_out must end with the authentication tag.

§Errors

Returns Unspecified if authentication fails or the OpenSSL operation fails.

Source

pub fn open_within<'in_out, A: AsRef<[u8]>>( &self, nonce: Nonce, aad: &Aad<A>, in_out: &'in_out mut [u8], in_prefix_len: usize, ) -> Result<&'in_out mut [u8], Unspecified>

Variant that accepts in_out starting at in_prefix_len bytes of prefix.

§Errors

Returns Unspecified if authentication fails or the buffer is too short.

Trait Implementations§

Source§

impl Debug for LessSafeKey

Source§

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

Formats the value using the given formatter. Read more

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.