miniproto_native::crypto::mtproto_encrypt_payload
Provenance
Section titled “Provenance”- Crate:
miniproto_native - Rust visibility:
restricted - Source:
rust/miniproto/src/crypto.rs - Python exposure:
miniproto._native.mtproto_encrypt_payload(confirmed from adjacent PyO3 attributes)
Signature
Section titled “Signature”fn mtproto_encrypt_payload(py: _, auth_key: _, plaintext_with_padding: _, client_to_server: bool) -> _Arguments
Section titled “Arguments”py: The acquired GIL token used to detach large encryption work.auth_key: The 256-byte MTProto authorization key.plaintext_with_padding: AES-block-aligned inner plaintext to encrypt.client_to_server: Selects the directional MTProto key schedule.
cargo-docs-md rendering
Section titled “cargo-docs-md rendering”mtproto_encrypt_payload
Section titled “mtproto_encrypt_payload”fn mtproto_encrypt_payload(py: Python<'_>, auth_key: Vec<u8>, plaintext_with_padding: Vec<u8>, client_to_server: bool) -> PyResult<(Vec<u8>, Vec<u8>, Vec<u8>)>Defined in rust/miniproto/src/crypto.rs:202-212
Encrypts padded MTProto plaintext for Python mtproto_encrypt_payload.
Returns (auth_key_id, msg_key, ciphertext) or ValueError for invalid key or block input;
large work runs without the GIL.
Arguments
Section titled “Arguments”py: The acquired GIL token used to detach large encryption work.auth_key: The 256-byte MTProto authorization key.plaintext_with_padding: AES-block-aligned inner plaintext to encrypt.client_to_server: Selects the directional MTProto key schedule.