Skip to main content

decrypt

Function decrypt 

Source
pub fn decrypt(
    key: &[u8; 32],
    ciphertext: &[u8],
    aad: &[u8],
) -> Result<Vec<u8>, CryptoError>
Expand description

Decrypts ciphertext using AES-256-GCM with Additional Authenticated Data (AAD).

The AAD must match what was used during encryption, otherwise decryption fails.

Expects input format: nonce (12 bytes) || ciphertext || tag (16 bytes)