Skip to content

miniproto_native::crypto::mtproto_decrypt_payload

  • Crate: miniproto_native
  • Rust visibility: restricted
  • Source: rust/miniproto/src/crypto.rs
  • Python exposure: miniproto._native.mtproto_decrypt_payload (confirmed from adjacent PyO3 attributes)
fn mtproto_decrypt_payload(py: _, auth_key: _, msg_key: _, ciphertext: _, client_to_server: bool) -> _
  • py: The acquired GIL token used to detach large decryption work.
  • auth_key: The 256-byte MTProto authorization key.
  • msg_key: The 16-byte message key to verify.
  • ciphertext: AES-IGE ciphertext whose length must be an AES-block multiple.
  • client_to_server: Selects the directional MTProto key schedule.
fn mtproto_decrypt_payload(py: Python<'_>, auth_key: Vec<u8>, msg_key: Vec<u8>, ciphertext: Vec<u8>, client_to_server: bool) -> PyResult<Vec<u8>>

Defined in rust/miniproto/src/crypto.rs:227-238

Decrypts and verifies Python mtproto_decrypt_payload ciphertext.

Returns padded plaintext or ValueError for invalid lengths, key material, or message-key verification; large work runs without the GIL.

  • py: The acquired GIL token used to detach large decryption work.
  • auth_key: The 256-byte MTProto authorization key.
  • msg_key: The 16-byte message key to verify.
  • ciphertext: AES-IGE ciphertext whose length must be an AES-block multiple.
  • client_to_server: Selects the directional MTProto key schedule.