Skip to content

miniproto_native::crypto::aes_256_gcm_encrypt

  • 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)
fn aes_256_gcm_encrypt(py: _, plaintext: _, key: _, nonce: _, associated_data: _) -> _
  • 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.
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.

  • 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.