How xcyclonev3/tgcrypto-pyrofork works
TgCrypto is a C-backed Python extension providing AES-256 encryption modes for Telegram-related workloads. A Python caller supplies data, key, and IV (plus streaming state for CTR); the extension validates buffers, dispatches to a mode implementation, and returns encrypted or decrypted bytes. The modes use portable AES or, when available, CPU hardware instructions. The README documents the three modes and their use cases. Some implementation connections rely on the source index or README because excerpts are incomplete.
Main entry points: tgcrypto.c Extension API · tgcrypto CPU AES backends · ige256.c AES-IGE · ctr256.c AES-CTR
Components 8
Python API
- Extension API
tgcrypto/tgcrypto.c
AES Engines
- Portable AES
tgcrypto/aes256.c - CPU AES backends
tgcrypto
Other components
- Python caller
- CPU capabilities
Connections 11
- Python caller → Extension API: calls API
README.md - Extension API → AES-IGE: dispatches IGE
tgcrypto/tgcrypto.c - Extension API → AES-CTR: dispatches CTR
tgcrypto/tgcrypto.c - Extension API → AES-CBC: dispatches CBC
tgcrypto/tgcrypto.c - AES-IGE → Portable AES: uses AES
tgcrypto/ige256.c - AES-CTR → Portable AES: uses AES
tgcrypto/ctr256.c - AES-CBC → Portable AES: uses AES
tgcrypto/cbc256.c - AES-IGE → CPU AES backends: dispatches when available
tgcrypto/ige256.c - AES-CTR → CPU AES backends: dispatches when available
tgcrypto/ctr256.c - AES-CBC → CPU AES backends: dispatches when available
tgcrypto/cbc256.c - CPU capabilities → CPU AES backends: enables acceleration
README.md