#[repr(align(16))]pub struct DeoxysII { /* private fields */ }
Expand description
Deoxys-II-256-128 state.
We don’t store the key itself, but only components derived from the key. These components are automatically erased after the structure is dropped.
Implementations§
§impl DeoxysII
impl DeoxysII
pub fn seal(
&self,
nonce: &[u8; 15],
plaintext: impl AsRef<[u8]>,
additional_data: impl AsRef<[u8]>,
) -> Vec<u8> ⓘ
pub fn seal( &self, nonce: &[u8; 15], plaintext: impl AsRef<[u8]>, additional_data: impl AsRef<[u8]>, ) -> Vec<u8> ⓘ
Encrypts and authenticates plaintext, authenticates the additional data and returns the result.
pub fn seal_into(
&self,
nonce: &[u8; 15],
plaintext: &[u8],
additional_data: &[u8],
ciphertext_with_tag: &mut [u8],
) -> Result<usize, EncryptionError>
pub fn seal_into( &self, nonce: &[u8; 15], plaintext: &[u8], additional_data: &[u8], ciphertext_with_tag: &mut [u8], ) -> Result<usize, EncryptionError>
Like DeoxysII::seal
but seals into ciphertext_with_tag
,
returning the number of bytes written.
pub fn open(
&self,
nonce: &[u8; 15],
ciphertext_with_tag: impl AsMut<[u8]>,
additional_data: impl AsRef<[u8]>,
) -> Result<Vec<u8>, DecryptionError>
pub fn open( &self, nonce: &[u8; 15], ciphertext_with_tag: impl AsMut<[u8]>, additional_data: impl AsRef<[u8]>, ) -> Result<Vec<u8>, DecryptionError>
Decrypts and authenticates ciphertext, authenticates the additional data and, if successful, returns the resulting plaintext. If the tag verification fails, an error is returned and the intermediary plaintext is securely erased from memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeoxysII
impl RefUnwindSafe for DeoxysII
impl Send for DeoxysII
impl Sync for DeoxysII
impl Unpin for DeoxysII
impl UnwindSafe for DeoxysII
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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