miniproto.crypto.native.aes_256_gcm_encrypt_cryptography
miniproto.crypto.native.aes_256_gcm_encrypt_cryptography
Section titled “miniproto.crypto.native.aes_256_gcm_encrypt_cryptography”aes_256_gcm_encrypt_cryptography(plaintext: bytes, key: bytes, nonce: bytes, associated_data: bytes) -> bytesEncrypt and authenticate with the explicit cryptography AES-GCM path.
Parameters:
- plaintext (
bytes) – Bytes to protect. - key (
bytes) – AES-256 key material accepted bycryptography. - nonce (
bytes) – Nonce bytes accepted bycryptography; use a unique 12-byte nonce for interoperable native parity. - associated_data (
bytes) – Authenticated but unencrypted bytes.
Returns:
bytes– Ciphertext with its appended authentication tag.
Raises:
ValueError– Ifcryptographyrejects the inputs.
This explicitly bypasses Rust. It does not track nonce reuse or clear secret buffers.