Skip to content

miniproto.crypto.native.aes_256_gcm_decrypt_cryptography

miniproto.crypto.native.aes_256_gcm_decrypt_cryptography

Section titled “miniproto.crypto.native.aes_256_gcm_decrypt_cryptography”
aes_256_gcm_decrypt_cryptography(ciphertext_and_tag: bytes, key: bytes, nonce: bytes, associated_data: bytes) -> bytes

Authenticate and decrypt through the explicit cryptography AES-GCM path.

Parameters:

  • ciphertext_and_tag (bytes) – Ciphertext with its authentication tag.
  • key (bytes) – AES-256 key material accepted by cryptography.
  • nonce (bytes) – The nonce used during encryption.
  • associated_data (bytes) – Exact associated data used during encryption.

Returns:

  • bytes – Verified plaintext.

Raises:

  • ValueError – If inputs are rejected or GCM authentication fails.

This explicitly bypasses Rust; discard all output state after an error.