pub struct Aes256Gcm { /* private fields */ }Expand description
AES-256 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 Aes256Gcm
impl Aes256Gcm
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 Aes256Gcm
impl !Unpin for Aes256Gcm
impl !UnwindSafe for Aes256Gcm
impl Freeze for Aes256Gcm
impl Send for Aes256Gcm
impl Sync for Aes256Gcm
impl UnsafeUnpin for Aes256Gcm
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