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
impl LessSafeKey
pub fn new(key: UnboundKey) -> Self
pub fn algorithm(&self) -> &'static Algorithm
Sourcepub fn seal_in_place_append_tag<A: AsRef<[u8]>>(
&self,
nonce: Nonce,
aad: &Aad<A>,
in_out: &mut Vec<u8>,
) -> Result<(), Unspecified>
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.
Sourcepub 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>
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.
Sourcepub 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>
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§
Auto Trait Implementations§
impl Freeze for LessSafeKey
impl RefUnwindSafe for LessSafeKey
impl Send for LessSafeKey
impl Sync for LessSafeKey
impl Unpin for LessSafeKey
impl UnsafeUnpin for LessSafeKey
impl UnwindSafe for LessSafeKey
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