Repository navigation
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_infobeingNonewhenconfig.pyis unconfigured
🏗️ Build
- Opt-in:
LAT_MOD=yes python setup.py build_ext --inplace - Requires NTL:
brew install ntl(macOS) orsudo 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