tgcrypto2 (Zig backend)
Fast and Portable Cryptography Extension Library for Pyrogram — reimplemented
in Zig 0.16, drop-in compatible with the original C extension, plus a native
xor(a, b) helper.
Build & publish to PyPI
python -m pip install --upgrade build twine
python -m build # produces sdist + wheel in dist/
twine upload dist/*
ziglang==0.16.0 is declared as a [build-system] requires dependency in
pyproject.toml, so pip/build fetches it automatically into an isolated
build environment — no system Zig install needed, and no .so is committed
to the repo. When someone runs pip install tgcrypto2, setup.py's custom
build_ext step shells out to python -m ziglang build so to compile
src/tgcrypto.zig fresh for their platform/Python version, then places the
resulting _tgcrypto extension where Python expects it.
Local development build
pip install -e .
python -m pytest
What's inside
ige256_encrypt,ige256_decryptctr256_encrypt,ctr256_decryptcbc256_encrypt,cbc256_decryptxor— native byte-wise XOR (not in the original C_tgcrypto; added so callers don't need a slow Python-bignumxorfallback)
All six original functions match the reference C implementation's behavior and signatures exactly (verified against the full upstream NIST/random test suite — 3871 tests, all passing).
Metadata
Release files for vugusu 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 497.4 kB
Release files / vugusu-2.0.0-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | vugusu-2.0.0-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 50.2 kB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
f4fe2a089ec5a74e058353143120facc19b5974815de9a5faef1159770126034
|
|
BLAKE2b-256 checksum How to use checksums |
99dd83ddd77c9f63cecb01f0e16d34539377e798ac71247c11dc18505d3ead0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | vugusu-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.4 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
be255f861967e3a18efd38ecd47dd0e70c6571743d8ebf048f75e04457aee653
|
|
BLAKE2b-256 checksum How to use checksums |
3cefbf079a18a6213f29f61f49c783fb17896670d95aa43ef379db2a97b64522
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | vugusu-2.0.0-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 50.2 kB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
66dfd987f8b92f8892da80ad9423f0de921f6c70b36831a8f6d77eb72d077902
|
|
BLAKE2b-256 checksum How to use checksums |
f1fc4865112184ec96b9088c9553df6492a77772533689c64b295b6bb26beb27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | vugusu-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.4 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8ca2751e3ea9aa8455bb453803df5e65ff2a6abebb83e4f14980985233bd4360
|
|
BLAKE2b-256 checksum How to use checksums |
14ede61bcdcd3c84b41d653f1696ff49c079df72f1ea7cdd50b24427734106a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | vugusu-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 50.1 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
a333a07e6afe538997ac6772b6c7bc585e9b76376fff2b49ff405e9dd4cf79aa
|
|
BLAKE2b-256 checksum How to use checksums |
ffd6e24eb6ae062db80ff8ecd47f5c62523819b2196ff00ce5cc7e803f4956df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | vugusu-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.3 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
16b3500a9b1c139fe9bfa178bd9d6459cff6a8d098b0fcae70d2c18849d52d3d
|
|
BLAKE2b-256 checksum How to use checksums |
128ec120c6afb3315a46d6a5e8f05a63d8a6041a1bc7d7e42cfc4ecb855fc2e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | vugusu-2.0.0-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 50.1 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
ea5474cdf0682dcc3073c4f04efb188b38ece155e408cb9b19b4f62126b547b6
|
|
BLAKE2b-256 checksum How to use checksums |
b70f5730b675a0c7fbad8b790c93261d9d4d23df15cf71befa3469ce6bfb0d03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | vugusu-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.3 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
92a2e2d7d5e888deb2c508aa595f4fcf0efb972380facfe2abcd4e077959edf9
|
|
BLAKE2b-256 checksum How to use checksums |
bd9dd370cb0355360b9c26870168f0f2d0728146c7a60a95d9363527d67591e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp39-cp39-musllinux_1_2_x86_64.whl
| Download URL | vugusu-2.0.0-cp39-cp39-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 50.1 kB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
2298432bbd2f05a1f360010c6816b6fa858f7eed6f4616a14842b9d49658451c
|
|
BLAKE2b-256 checksum How to use checksums |
e8dbbdae1b348aa5bffbe604d0588f077aabbfc7cbfe10d182b2a146b0ef982d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / vugusu-2.0.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | vugusu-2.0.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.3 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
09cd6d9b4f501e7704f99e4f3b2854ab5f81a50c2b70d299fd1768d04422bfaf
|
|
BLAKE2b-256 checksum How to use checksums |
b47878d26d37a87a7ccfb8dc130c86b991e24d01fcc4d2609dc17946637dc9ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|