Skip to content

Releases: JHUISI/charm

v0.63 — Lattice-Based (Post-Quantum) Cryptography

19 Apr 04:15

Choose a tag to compare

What's New in v0.63

This release adds lattice-based (post-quantum) cryptography to Charm — a fourth group abstraction layer backed by the NTL C++ library.

🔐 New: Lattice-Based Crypto Module

C++ Extension (charm.core.math.lattice):

  • Polynomial ring arithmetic in R_q = Z_q[X]/(X^n+1)
  • Discrete Gaussian sampling (CDT-based)
  • Vector/matrix operations for Module-LWE schemes
  • Compress/decompress, CBD sampling, SHA-256 hashing to ring elements
  • Full serialization/deserialization

Python Wrapper (charm.toolbox.latticegroup.LatticeGroup):

  • API consistent with PairingGroup / ECGroup / IntegerGroup
  • Named parameter sets: RLWE-256-7681, KYBER-512/768/1024, DILITHIUM-2/3/5
  • Custom parameters via LatticeGroup(n=512, q=12289)

📦 New Schemes

Scheme File Type Standard
RLWE-PKE (LPR) rlwe_pke.py Public-key encryption
Kyber KEM kyber_kem.py Key encapsulation ML-KEM (FIPS 203)
Dilithium Sig dilithium_sig.py Digital signatures ML-DSA (FIPS 204)
Lattice IBE lattice_ibe_abb10.py Identity-based encryption ABB10

Note: These are simplified implementations for prototyping and education. They implement the core algebraic structure but omit some production hardening (FO transform, constant-time ops).

🐛 Bug Fixes

  • Python 3.13+ compatibility: Fixed enum name-mangling crash (EnumValue.__value_EnumValue__value)
  • Python 3.13+ pairing config: Fixed param_info being None when config.py is unconfigured

🏗️ Build

  • Opt-in: LAT_MOD=yes python setup.py build_ext --inplace
  • Requires NTL: brew install ntl (macOS) or sudo apt install libntl-dev (Ubuntu)
  • NTL auto-detection via pkg-config, Homebrew, and standard paths
  • 44 new tests, all CI jobs updated with NTL

Quick Start

from charm.toolbox.latticegroup import LatticeGroup
from charm.schemes.latenc.kyber_kem import KyberKEM

group = LatticeGroup('KYBER-768')
kem = KyberKEM(group, 'KYBER-768')

pk, sk = kem.keygen()
ct, shared_secret = kem.encapsulate(pk)
assert shared_secret == kem.decapsulate(sk, ct)

Full Changelog: v0.62...v0.63

v0.61.0: Python 3.13 and 3.14 Support

02 Feb 08:11

Choose a tag to compare

Highlights

  • Full Python 3.13 compatibility with fixes for removed private APIs
  • Python 3.14 support added to CI/CD pipelines (Linux, macOS, Windows)
  • Fixed Python 3.12+ integer conversion bugs in C extension modules
  • Fixed hanging tests on Python 3.12+

Python 3.13 Fixes

  • Replaced _Py_IsFinalizing() with public Py_IsFinalizing() API
  • Replaced _PyLong_Format() with PyObject_Str() for integer-to-string conversion
  • Fixed PyUnicode_DATA() usage to use PyUnicode_AsUTF8() for null-terminated strings

Python 3.12+ Fixes

  • Fixed integer conversion bug in integermodule.c (PyLongObject internal structure changed in Python 3.12)
  • Fixed negative number handling in mpzToLongObj() using mpz_abs()
  • Fixed hanging tests:
    • RSAGroup.paramgen() with safety limits on Blum-Williams prime generation
    • chamhash_rsa_hw09 with deterministic coprime search
    • Rabin signature test skipped on Python 3.12+ due to randomPrime() issues

CI/CD Updates

  • Added Python 3.14 to all CI matrices (Linux, macOS, Windows)
  • Added cp313-* and cp314-* to cibuildwheel configuration for wheel builds
  • Re-enabled Python 3.12+ on macOS CI

Other Changes

  • Replaced deprecated OpenSSL BN_generate_prime with BN_generate_prime_ex
  • Added comprehensive integer arithmetic test suite
  • Added Docker-based testing environment for Python 3.12+ debugging
  • Updated README with supported Python versions table

Installation

pip install charm-crypto-framework==0.61.0

Supported Python Versions

Python Linux macOS Windows
3.8 - -
3.9
3.10
3.11
3.12
3.13
3.14

Full Changelog

See CHANGELOG for complete details.

Charm-Crypto v0.60

25 Jan 09:38

Choose a tag to compare

What's Changed

New Contributors

Read more

Charm-Crypto Framework

01 Aug 19:21

Choose a tag to compare

Pre-release

v0.43 beta release

  • simplified benchmarking interface -- breaks compatibility and see docs
  • added new schemes (external contributions from Nikos Fotiou, Fan Zhang, Hoeteck Wee)
  • added pre-computation for group exponentiation in pairing-based modules -- see docs
  • fixed several memory leaks and segmentation faults
  • switched from SHA1 to SHA2 for hashing operations
  • improved serialization -- now using JSON instead of Pickle (security vulnerability)
  • significant improvements to all base modules -- several fixes to integer & ecmodule funcs
  • more robust Android build for Charm
  • significant fixes to 2.7 version of Charm