pub struct Aes128Gcm { /* private fields */ }Expand description
AES-128 GCM.
GCM authenticated encryption with a 96-bit nonce and a 128-bit tag. The nonce must never repeat for a given key.
Implementations§
Source§impl Aes128Gcm
impl Aes128Gcm
Sourcepub const NONCE_SIZE: usize = 12
pub const NONCE_SIZE: usize = 12
Size of the nonce, in bytes.
Sourcepub fn encrypt(
&self,
nonce: &[u8; 12],
aad: &[u8],
buf: &mut [u8],
) -> Result<[u8; 16], Error>
pub fn encrypt( &self, nonce: &[u8; 12], aad: &[u8], buf: &mut [u8], ) -> Result<[u8; 16], Error>
Encrypt buf in place, authenticating it and aad, and return the tag.
Sourcepub fn encrypt_to(
&self,
nonce: &[u8; 12],
aad: &[u8],
input: &[u8],
output: &mut [u8],
) -> Result<[u8; 16], Error>
pub fn encrypt_to( &self, nonce: &[u8; 12], aad: &[u8], input: &[u8], output: &mut [u8], ) -> Result<[u8; 16], Error>
Encrypt input to output, authenticating it and aad, and return the tag.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Aes128Gcm
impl !Unpin for Aes128Gcm
impl !UnwindSafe for Aes128Gcm
impl Freeze for Aes128Gcm
impl Send for Aes128Gcm
impl Sync for Aes128Gcm
impl UnsafeUnpin for Aes128Gcm
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