Struct ring::aead::OpeningKey [] [src]

pub struct OpeningKey {
    // some fields omitted
}

A key for authenticating and decrypting (“opening”) AEAD-protected data.

C analog: EVP_AEAD_CTX with direction evp_aead_open

Go analog: [crypto.cipher.AEAD]

Methods

impl OpeningKey
[src]

fn new(algorithm: &'static Algorithm, key_bytes: &[u8]) -> Result<OpeningKeyUnspecified>

Create a new opening key.

key_bytes must be exactly algorithm.key_len bytes long.

C analogs: EVP_AEAD_CTX_init_with_direction with direction evp_aead_open, EVP_AEAD_CTX_init.

Go analog: crypto.aes.NewCipher + crypto.cipher.NewGCM

fn algorithm(&self) -> &'static Algorithm

The key's AEAD algorithm.

C analog: EVP_AEAD_CTX.aead