Skip to main content

Crate warpcrypto

Crate warpcrypto 

Source
Expand description

Fast AES-256-IGE, AES-256-CTR and MTProto 2.0 message packing for Telegram clients.

The same code also builds the warpcrypto Python extension (behind the python feature).

Structs§

Ctr256
AES-256-CTR with the key expanded once, for a stream processed piece by piece.
Message
A decrypted MTProto message.

Enums§

Error
Why an operation was rejected.

Functions§

ctr256
AES-256-CTR encrypts or decrypts data in place.
ige256_decrypt
AES-256-IGE decrypts data in place. data.len() must be a multiple of 16.
ige256_encrypt
AES-256-IGE encrypts data in place. data.len() must be a multiple of 16.
kdf
MTProto 2.0 key derivation: returns (aes_key, aes_iv) for a message. outgoing is true for client→server messages (x=0) and false for server→client (x=8).
pack_message
Encrypts a client→server MTProto 2.0 message, ready to send.
unpack_message
Decrypts and checks an MTProto 2.0 message. incoming is true for server→client messages, the usual case for a client.