aes_decrypt

Function aes_decrypt 

Source
pub fn aes_decrypt<K: AsRef<EncryptionKey>>(
    data: &mut [u8],
    key: K,
    nonce: K,
) -> Result<(), InvalidKeyNonceLength>
Expand description

Decrypts the specified data with the AES CFB cipher.

§Parameters

  • data: The encrypted data buffer. After this function has been called, it will store the decrypted data.
  • key: The decryption key. It must be exactly 32 bytes.
  • nonce: The unique nonce. It must be exactly 16 bytes.

§Returns

If the data could be successfully decrypted Ok(()) will be returned. If the key or nonce are invalid, Err(InvalidKeyNonceLength) will be returned.