Struct parity_crypto::aes_gcm::Encryptor [−][src]
pub struct Encryptor<'a> { /* fields omitted */ }
AES GCM encryptor.
Methods
impl<'a> Encryptor<'a>
[src]
impl<'a> Encryptor<'a>
pub fn aes_128_gcm(key: &[u8; 16]) -> Result<Encryptor<'a>, SymmError>
[src]
pub fn aes_128_gcm(key: &[u8; 16]) -> Result<Encryptor<'a>, SymmError>
pub fn aes_256_gcm(key: &[u8; 32]) -> Result<Encryptor<'a>, SymmError>
[src]
pub fn aes_256_gcm(key: &[u8; 32]) -> Result<Encryptor<'a>, SymmError>
pub fn associate(&mut self, data: &'a [u8]) -> &mut Self
[src]
pub fn associate(&mut self, data: &'a [u8]) -> &mut Self
Optional associated data which is not encrypted but authenticated.
pub fn offset(&mut self, off: usize) -> &mut Self
[src]
pub fn offset(&mut self, off: usize) -> &mut Self
Optional offset value. Only the slice [offset..]
will be encrypted.
pub fn encrypt(
&self,
nonce: &[u8; 12],
data: Vec<u8>
) -> Result<Vec<u8>, SymmError>
[src]
pub fn encrypt(
&self,
nonce: &[u8; 12],
data: Vec<u8>
) -> Result<Vec<u8>, SymmError>
Please note that the pair (key, nonce) must never be reused. Using random nonces limits the number of messages encrypted with the same key to 2^32 (cf. [1])