-
purepycrypto v3.2.1 Stable
released this
2026-09-27 03:37:38 +00:00 | 0 commits to main since this release[3.2.1] - 2026-09-27
Changed — performance overhaul (pure Python, no API change)
Every hot path was reworked. The library is still 100% pure Python with zero
dependencies; no primitive was replaced by a C-backed shortcut. The public
API, the error semantics and the security properties are unchanged.Measured speed-ups (v3.2.0 -> v3.2.1, interleaved A/B min-of-N on an idle
16-core machine, 1 KiB payload):Operation Speed-up Base64 decode 21.98x Base58 encode / decode 8.01x / 3.98x ChaCha20-Poly1305 / XChaCha20-Poly1305 encrypt 3.54x / 3.28x Base64 encode 2.98x AES-256-GCM encrypt / decrypt 2.25x / 2.26x AES-GCM-SIV encrypt 2.06x AES-256 CTR / ECB / CBC 2.01x / 1.96x / 1.88x AES single block (256-bit) 1.87x Poly1305 MAC 1.41x Ed25519 sign / verify / publickey 1.41x / 1.39x / 1.39x X25519 base 1.19x BLAKE2b / SHA3-256 / SHA3-512 / SHAKE128 1.34x / 1.26x / 1.33x / 1.30x Geometric mean over 27 operations 1.96x 24 improved, 3 unchanged, 0 regressed. See
docs/benchmark.md
for the full table and methodology.Techniques used (all pure-Python):
- Code-generated, fully unrolled functions for the AES round function and
the Keccak-f[1600] permutation, eliminating per-round loops, indexing and
attribute lookups. - Big-integer bulk operations for GHASH, POLYVAL, buffer XOR and the
Base64 pack/unpack paths (int.from_bytes/to_bytes/^execute in C
over a whole buffer in a single call). - Precomputed lookup tables: AES T-tables, GHASH / POLYVAL 4-bit windows,
Keccak rho/pi offset tables, precomputed DER length headers. - Constant-time-safe selection in the Ed25519 scalar scan and the X25519
Montgomery ladder (branch-free masking, timing proven comparable). - Lazy modular reduction in X25519 field arithmetic, replacing a
% p
per multiply with a cheaper fold. - Batch Base58 / Base64 processing, removing the per-character
divmod
(the previous Base58 hot spot). - Inlined inner loops in AEAD assembly, the CTR/GCM block loops and the
message schedule of SHA-2.
Verified — no behavior change
- Full test suite: 639 passed, 1 skipped, 0 failed.
- Standard vectors (FIPS 180-4 / FIPS 197 / FIPS 202 / RFC 5869 / RFC 6070 /
RFC 7748 / RFC 7914 / RFC 8032 / RFC 8439 / RFC 8452 / RFC 9106 / NIST GCM)
reproduce byte-for-byte. - Differential probe of 1266 deterministic inputs against v3.2.0: identical,
except one unreachable private helper (der._der_lenwith a negative
argument, which no caller can produce since every call site passeslen()). - Public API signature comparison: 0 removals, 0 changes.
- Independent security regression suite: 35 / 35 (AEAD tamper detection,
constant-time comparison helpers, X25519 low-order points, Ed25519
constant-time selection, RSA failure paths, error-message hygiene).
Changed — full English localization
- Documentation, code comments and error messages are now entirely in English.
This covers all modules underpurepycrypto/,docs/*.md,README.md,
CHANGELOG.md,setup.py,pyproject.toml, the test suite and the examples.
No public API, identifier, error code or behavior was changed. - The interactive TUI keeps its Chinese interface: the
cnlanguage pack and the
TUI menu text are intentionally left as-is and switch with the TUI language.
Fixed — TUI error localization
- Errors surfaced inside the TUI are now localized at the display layer: the library
itself always reports English messages/suggestions, while the TUI maps a known
PPYC_ERR_*code back to Chinese when the TUI language iscn
(see_TUI_ERR_TEXT/_tui_error_text()incli.py). Unknown codes fall back to
the original English text. menu9/menu10(Encoding/Decoding, Secure Random) were missing from the
language pack and rendered as raw key names; both are now proper i18n entries in
enandcn.- The Encoding and Secure Random sub-menus were rewritten to use the i18n layer, so
they are now fully Chinese incnmode and fully English inenmode
(previously they mixed both). Ctrl+Cprinted the literalbyebecause_t('bye')referenced a non-existent
key; it now uses_t('goodbye').
Downloads
- Code-generated, fully unrolled functions for the AES round function and
-
purepycrypto v3.2.0 Stable
released this
2026-09-27 01:45:31 +00:00 | 1 commits to main since this releasepurepycrypto v3.2.0
Pure-Python cryptography library (zero dependencies).
Highlights
- Zero third-party dependencies — standard library only, no compilation.
- Hashes: SHA-256 / SHA-512, SHA-3 (Keccak) / SHAKE, BLAKE2b, HMAC.
- KDF: PBKDF2, HKDF, scrypt (RFC 7914), Argon2id (RFC 9106).
- Symmetric: AES (ECB / CBC / CTR / CFB / OFB / GCM), AES-GCM-SIV (RFC 8452),
ChaCha20-Poly1305 / XChaCha20-Poly1305 (RFC 8439). - Asymmetric: X25519 (RFC 7748), Ed25519 (RFC 8032),
RSA (keygen / OAEP / PSS / PKCS#1 / PKCS#8 / SPKI / PEM), ASN.1 DER. - Encodings: Base64 / Base64URL / Base32 / Base32-Hex / Hex / Base58, big-int Base64URL.
- Secure random: CSPRNG-backed bytes, ints, tokens, passwords, UUID v4.
- Unified error system: fatal
PPYC_ERRexceptions vs non-fatal
(code, message, suggestion)3-tuple returns. - Two interfaces: an interactive TUI (Chinese / English i18n) and a
non-interactive CLI for scripts and CI. - Single-file build:
purepycrypto/single/purepycrypto.py
(no arguments → TUI, with arguments → CLI).
v3.2.0 additions
purepycrypto.encoding— hand-written, byte-for-byte identical to the stdlib.purepycrypto.rand— OS CSPRNG only (rejection sampling, no modulo bias).purepycrypto.kdf2— extended Argon2id / PHC-string support.
This release
- Documentation, code comments and error messages are fully in English.
The interactive TUI keeps its Chinese interface (cnlanguage pack). - TUI error messages are localized at the display layer by error code.
menu9(Encoding / Decoding) andmenu10(Secure Random) added to the i18n layer.
Verification
- Standard test vectors: RFC 5869, RFC 7748, RFC 8032, RFC 8439, RFC 8452,
RFC 9106, FIPS 197, FIPS 202, NIST GCM. - Test suite: 639 passing, 1 skipped, 0 failed.
Artifacts
purepycrypto-3.2.0-py3-none-any.whlpurepycrypto-3.2.0.tar.gz
Install
pip install purepycrypto-3.2.0-py3-none-any.whlLicense
MIT
Repository
- Source: https://git.dvscloud.net/dvs/purepycrypto
- Release: https://git.dvscloud.net/dvs/purepycrypto/releases/tag/v3.2.0
Artifacts
purepycrypto-3.2.0-py3-none-any.whlpurepycrypto-3.2.0.tar.gz
Downloads