Chacha20Poly1305Encryption

Trait Chacha20Poly1305Encryption 

Source
pub trait Chacha20Poly1305Encryption {
    // Required methods
    fn generate_key() -> Vec<u8> ;
    fn encrypt_plaintext(
        aes_key: Vec<u8>,
        nonce: Vec<u8>,
        plaintext: Vec<u8>,
    ) -> Vec<u8> ;
    fn decrypt_ciphertext(
        aes_key: Vec<u8>,
        nonce: Vec<u8>,
        ciphertext: Vec<u8>,
    ) -> Vec<u8> ;
    fn generate_nonce() -> Vec<u8> ;
}

Required Methods§

Source

fn generate_key() -> Vec<u8>

Source

fn encrypt_plaintext( aes_key: Vec<u8>, nonce: Vec<u8>, plaintext: Vec<u8>, ) -> Vec<u8>

Source

fn decrypt_ciphertext( aes_key: Vec<u8>, nonce: Vec<u8>, ciphertext: Vec<u8>, ) -> Vec<u8>

Source

fn generate_nonce() -> Vec<u8>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§