Skip to content

miniproto_native::crypto::aes_256_ctr_crypt

  • Crate: miniproto_native
  • Rust visibility: restricted
  • Source: rust/miniproto/src/crypto.rs
  • Python exposure: miniproto._native.aes_256_ctr_crypt (confirmed from adjacent PyO3 attributes)
fn aes_256_ctr_crypt(py: _, data: _, key: _, iv: _) -> _
  • py: The acquired GIL token used to detach large counter-mode work.
  • data: Bytes to encrypt or decrypt.
  • key: The 32-byte AES-256 key.
  • iv: The 16-byte initial counter block.
fn aes_256_ctr_crypt(py: Python<'_>, data: Vec<u8>, key: Vec<u8>, iv: Vec<u8>) -> PyResult<Vec<u8>>

Defined in rust/miniproto/src/crypto.rs:361-371

Applies Python aes_256_ctr_crypt to data using AES-CTR keystream XOR.

The same routine encrypts and decrypts; it validates the 32-byte key and 16-byte counter IV, and releases the GIL for large data.

  • py: The acquired GIL token used to detach large counter-mode work.
  • data: Bytes to encrypt or decrypt.
  • key: The 32-byte AES-256 key.
  • iv: The 16-byte initial counter block.