Metadata-Version: 2.4
Name: vugusu
Version: 2.0.0
Summary: Fast and Portable Cryptography Extension Library for Pyrogram (Zig backend)
Author: tboy1337
Author-email: Dan <dan@pyrogram.org>
License-Expression: LGPL-3.0-or-later
Project-URL: Homepage, https://github.com/tboy1337/vugusu
Project-URL: Source, https://github.com/tboy1337/vugusu
Project-URL: Issues, https://github.com/tboy1337/vugusu/issues
Keywords: pyrogram,telegram,crypto,cryptography,encryption,mtproto,extension,library,aes,zig
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Security
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Internet
Classifier: Topic :: Communications
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <4.0,>=3.9
Description-Content-Type: text/markdown
License-File: COPYING
License-File: COPYING.lesser
License-File: NOTICE
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# 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

```bash
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

```bash
pip install -e .
python -m pytest
```

## What's inside

- `ige256_encrypt`, `ige256_decrypt`
- `ctr256_encrypt`, `ctr256_decrypt`
- `cbc256_encrypt`, `cbc256_decrypt`
- `xor` — native byte-wise XOR (not in the original C `_tgcrypto`; added so
  callers don't need a slow Python-bignum `xor` fallback)

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).
