Trait sarkara::aead::AeadCipher
[−]
[src]
pub trait AeadCipher { fn new(key: &[u8]) -> Self; fn key_length() -> usize; fn tag_length() -> usize; fn nonce_length() -> usize; fn with_aad(&mut self, aad: &[u8]) -> &mut Self; fn encrypt(&mut self, nonce: &[u8], data: &[u8]) -> Vec<u8>; fn decrypt(&mut self, nonce: &[u8], data: &[u8]) -> Result<Vec<u8>, DecryptFail>; }
AeadCipher
trait.
Required Methods
fn new(key: &[u8]) -> Self
Create a new AeadCipher.
fn key_length() -> usize
Key length.
fn tag_length() -> usize
Tag length.
fn nonce_length() -> usize
Nonce length.
fn with_aad(&mut self, aad: &[u8]) -> &mut Self
Set associated data.
fn encrypt(&mut self, nonce: &[u8], data: &[u8]) -> Vec<u8>
Encryption.
fn decrypt(&mut self, nonce: &[u8], data: &[u8]) -> Result<Vec<u8>, DecryptFail>
Implementors
impl<C, M, H> AeadCipher for General<C, M, H> where C: StreamCipher, M: NonceMac, H: GenericHash
impl AeadCipher for Ascon