miniproto_native::crypto::aes_256_gcm_encrypt
Provenance
Section titled “Provenance”- Crate:
miniproto_native - Rust visibility:
restricted - Source:
rust/miniproto/src/crypto.rs - Python exposure:
miniproto._native.aes_256_gcm_encrypt(confirmed from adjacent PyO3 attributes)
Signature
Section titled “Signature”fn aes_256_gcm_encrypt(py: _, plaintext: _, key: _, nonce: _, associated_data: _) -> _Arguments
Section titled “Arguments”py: The acquired GIL token used to detach large authenticated-encryption work.plaintext: Bytes to encrypt.key: The 32-byte AES-256 key.nonce: The 12-byte GCM nonce.associated_data: Authenticated bytes that are not encrypted.
cargo-docs-md rendering
Section titled “cargo-docs-md rendering”aes_256_gcm_encrypt
Section titled “aes_256_gcm_encrypt”fn aes_256_gcm_encrypt(py: Python<'_>, plaintext: Vec<u8>, key: Vec<u8>, nonce: Vec<u8>, associated_data: Vec<u8>) -> PyResult<Vec<u8>>Defined in rust/miniproto/src/crypto.rs:386-397
Authenticated-encrypts Python aes_256_gcm_encrypt plaintext and associated data.
Returns ciphertext followed by its GCM tag, or ValueError for a bad 32-byte key, 12-byte
nonce, or encryption failure; large work releases the GIL.
Arguments
Section titled “Arguments”py: The acquired GIL token used to detach large authenticated-encryption work.plaintext: Bytes to encrypt.key: The 32-byte AES-256 key.nonce: The 12-byte GCM nonce.associated_data: Authenticated bytes that are not encrypted.