Skip to main content

Crate opentele2_core

Crate opentele2_core 

Source
Expand description

Pure core of opentele2.

This crate holds every Telegram Desktop tdata format and crypto rule shared by the Python and Node bindings. Its contract:

  • Pure: the core transforms bytes and values it is given; it walks no filesystem beyond explicit paths passed by the caller.
  • No async: every function is synchronous; there is no runtime dependency such as tokio.
  • No network: the core opens no sockets and speaks no MTProto transport.
  • No FFI: bindings live in separate crates; this crate exports a plain Rust API and forbids unsafe code.

Every fallible operation returns Result, whose error type Error carries a stable Error::code that bindings map onto their own exception types.

The default feature parallel runs the batch entry points over independent folders on a dedicated rayon pool; without it they run sequentially with identical results.

Modules§

api
The official Telegram client API profiles.
auth
The client-independent parts of login, session admin and consistency checks.
batch
Batch entry points over independent tdata folders.
compress
Gzip compression of MTProto payloads (gzip_packed), in pure Rust through flate2’s miniz_oxide backend.
crypto
Telegram Desktop local crypto: auth keys, prepareAES_oldmtp, AES-256-IGE and the tdata local encryption envelope, plus the primitives an MTProto client needs: SHA-1, SHA-256, HMAC-SHA256, PBKDF2, AES-256-CTR, pq factorisation and the operating system’s random source.
devices
Device fingerprints, picked from weighted catalogs by a seed hash.
fingerprint
The pure initConnection fingerprint helpers.
kdf
Passcode key derivation: the PBKDF2 local keys and the Argon2id / scrypt passcode wraps of the v2 key_data file.
qt
Big-endian QDataStream values as Telegram Desktop writes them.
session
Session formats of other Telegram libraries, built from tdata accounts.
tdata
Telegram Desktop tdata folder formats, built on the crate::tdf container, the crate::qt stream encoding, and the crate::crypto and crate::kdf primitives.
tdf
The TDF$ container that wraps every Telegram Desktop tdata file.

Enums§

ConfigFailure
What an Error::BadConfigData was raised for: the MTP config checks, and the endpoint, session and self-user checks that report the same code.
Error
Every failure the core can report.
KeyDataFailure
What an Error::KeyDataInvalid was raised for (crate::tdata::key_data and crate::tdata::TData::load).
MagicContext
What an Error::InvalidMagic was raised for.
MapReadFailure
What an Error::ReadMapDataFailed was raised for (MapData.read).

Type Aliases§

Result
Result alias used by every fallible operation in the core.