Skip to content

miniproto_native::crypto::aes_256_cbc_encrypt

  • Crate: miniproto_native
  • Rust visibility: restricted
  • Source: rust/miniproto/src/crypto.rs
  • Python exposure: miniproto._native.aes_256_cbc_encrypt (confirmed from adjacent PyO3 attributes)
fn aes_256_cbc_encrypt(py: _, plaintext: _, key: _, iv: _) -> _
  • py: The acquired GIL token used to detach large encryption work.
  • plaintext: AES-block-aligned bytes to encrypt.
  • key: The 32-byte AES-256 key.
  • iv: The 16-byte CBC initialization vector.
fn aes_256_cbc_encrypt(py: Python<'_>, plaintext: Vec<u8>, key: Vec<u8>, iv: Vec<u8>) -> PyResult<Vec<u8>>

Defined in rust/miniproto/src/crypto.rs:313-323

Encrypts block-aligned bytes with Python aes_256_cbc_encrypt without padding.

Requires 32-byte key and 16-byte IV inputs; invalid lengths become ValueError and large plaintexts release the GIL.

  • py: The acquired GIL token used to detach large encryption work.
  • plaintext: AES-block-aligned bytes to encrypt.
  • key: The 32-byte AES-256 key.
  • iv: The 16-byte CBC initialization vector.