pub struct Aes256GcmKey { /* private fields */ }Expand description
An AES-256-GCM key that seals under module-chosen nonces and opens under stored ones.
Implementations§
Source§impl Aes256GcmKey
impl Aes256GcmKey
Sourcepub fn seal_in_place(
&self,
aad: &[u8],
buf: &mut [u8],
) -> Result<([u8; 12], [u8; 16]), CryptoError>
pub fn seal_in_place( &self, aad: &[u8], buf: &mut [u8], ) -> Result<([u8; 12], [u8; 16]), CryptoError>
Encrypts buf in place; the module picks the nonce, which the caller must store beside the ciphertext.
Sourcepub fn open_in_place<'b>(
&self,
nonce: &[u8; 12],
aad: &[u8],
buf: &'b mut [u8],
) -> Result<&'b mut [u8], CryptoError>
pub fn open_in_place<'b>( &self, nonce: &[u8; 12], aad: &[u8], buf: &'b mut [u8], ) -> Result<&'b mut [u8], CryptoError>
Authenticates and decrypts buf in place, returning the plaintext prefix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Aes256GcmKey
impl RefUnwindSafe for Aes256GcmKey
impl Send for Aes256GcmKey
impl Sync for Aes256GcmKey
impl Unpin for Aes256GcmKey
impl UnsafeUnpin for Aes256GcmKey
impl UnwindSafe for Aes256GcmKey
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