Simulation of Atomic Post-Quantum Cryptography on Intermittent Power
Project description
Tessera-PQC
Tessera is a research simulation framework for Post-Quantum Cryptography (PQC) on intermittent-power (battery-free IoT) devices.
It models Atomic Cryptography — breaking lattice-based operations (NTT, Kyber KEM) into small checkpointed tiles that survive arbitrary power failures by persisting state to Non-Volatile Memory (NVM) after every layer. Side-channel power leakage is modelled using the Hamming Weight of each NVM write.
Features
- Baby-Kyber KEM — full Module-LWE key generation, encapsulation, and decapsulation (k=2, q=3329, n=256, η=2)
- NTT engine — Cooley-Tukey DIT forward transform + Gentleman-Sande DIF inverse over ℤ_3329[X]/(X²⁵⁶+1)
- Atomic scheduler — SimPy discrete-event simulation with exponential on/off power model; checkpoints every NTT layer to NVM
- Hamming Weight leakage model — records side-channel power trace on every NVM write
- Rich terminal demo — live animated panels showing hardware state, NTT progress, event log, and leakage trace
- 62 tests across math, KEM, memory, and scheduler
Installation
pip install tessera-pqc
Requires Python ≥ 3.10.
Development install
git clone https://github.com/abhinavgulisetty/tessera-pqc.git
cd tessera-pqc
pip install -e ".[dev]"
pytest
CLI Usage
tessera verify # NTT round-trip correctness (5 tests)
tessera kem # Baby-Kyber key exchange demo
tessera run # Atomic NTT simulation with SimPy
tessera demo # Full animated Rich terminal demo
Example — KEM
============================================================
Tessera — Baby-Kyber KEM Demo
============================================================
[KEM] Generating key pair...
pk length = 672 bytes
sk length = 768 bytes
[KEM] Encapsulating...
ciphertext length = 768 bytes
shared secret (enc) = 1292eb5807fd564239ffa78ab484e840...
[KEM] Decapsulating...
shared secret (dec) = 1292eb5807fd564239ffa78ab484e840...
[KEM] SUCCESS — shared secrets match! ✓
Architecture
tessera-pqc/
├── src/tessera/
│ ├── core/
│ │ ├── math.py # NTT / inverse-NTT / polynomial ring
│ │ └── primitives.py # Baby-Kyber KEM (keygen / encaps / decaps)
│ ├── hardware/
│ │ ├── memory.py # NVM simulator + Hamming Weight leakage model
│ │ └── power.py # SimPy intermittent-power chaos source
│ ├── scheduler.py # Atomic tile scheduler with NVM checkpointing
│ ├── cli.py # CLI entry point
│ └── demo.py # Rich animated terminal demo
└── tests/ # 62 pytest tests
Key parameters
| Symbol | Value | Meaning |
|---|---|---|
| n | 256 | Polynomial degree |
| q | 3329 | NTT prime |
| ω | 3061 | Primitive 256th root of unity (mod q) |
| k | 2 | Module rank (Baby-Kyber) |
| η | 2 | CBD noise parameter |
| D_U | 10 bits | Ciphertext u compression |
| D_V | 4 bits | Ciphertext v compression |
Publishing workflow
Releases are published to PyPI automatically via GitHub Actions OIDC Trusted Publisher.
No API tokens are stored — publishing is triggered by creating a GitHub Release.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tessera_pqc-0.1.1.tar.gz.
File metadata
- Download URL: tessera_pqc-0.1.1.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd80be1c826165009740c215a0ca3084e19ce8cd5769d8782f3d66fe2eda723
|
|
| MD5 |
9c5f8e8991e4287b5647cb29486e1db0
|
|
| BLAKE2b-256 |
dac534b5cff1e3688399e84ebf2a4ce48a2b3b66011151f9e485f9f469534590
|
Provenance
The following attestation bundles were made for tessera_pqc-0.1.1.tar.gz:
Publisher:
publish.yml on abhinavgulisetty/tessera-pqc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tessera_pqc-0.1.1.tar.gz -
Subject digest:
1bd80be1c826165009740c215a0ca3084e19ce8cd5769d8782f3d66fe2eda723 - Sigstore transparency entry: 975648967
- Sigstore integration time:
-
Permalink:
abhinavgulisetty/tessera-pqc@265a27b8afad1ce5c2f1b5855ff52e137162f29e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/abhinavgulisetty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@265a27b8afad1ce5c2f1b5855ff52e137162f29e -
Trigger Event:
release
-
Statement type:
File details
Details for the file tessera_pqc-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tessera_pqc-0.1.1-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5cd453e3461f8b3cfc94e289b9cf000f8d5a7d9f0010d2eea29477f2a708a15
|
|
| MD5 |
ab02e7167ae41aaf47c462265014ed93
|
|
| BLAKE2b-256 |
f4622a2cf823a1729d56614bda8b4a85c072f652a78a7deb50bdb3a4099a22fa
|
Provenance
The following attestation bundles were made for tessera_pqc-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on abhinavgulisetty/tessera-pqc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tessera_pqc-0.1.1-py3-none-any.whl -
Subject digest:
d5cd453e3461f8b3cfc94e289b9cf000f8d5a7d9f0010d2eea29477f2a708a15 - Sigstore transparency entry: 975648973
- Sigstore integration time:
-
Permalink:
abhinavgulisetty/tessera-pqc@265a27b8afad1ce5c2f1b5855ff52e137162f29e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/abhinavgulisetty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@265a27b8afad1ce5c2f1b5855ff52e137162f29e -
Trigger Event:
release
-
Statement type: