Skip to main content

Simulation of Atomic Post-Quantum Cryptography on Intermittent Power

Project description

Tessera-PQC

CI PyPI Python License: MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tessera_pqc-0.1.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tessera_pqc-0.1.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

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

Hashes for tessera_pqc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1bd80be1c826165009740c215a0ca3084e19ce8cd5769d8782f3d66fe2eda723
MD5 9c5f8e8991e4287b5647cb29486e1db0
BLAKE2b-256 dac534b5cff1e3688399e84ebf2a4ce48a2b3b66011151f9e485f9f469534590

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessera_pqc-0.1.1.tar.gz:

Publisher: publish.yml on abhinavgulisetty/tessera-pqc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tessera_pqc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5cd453e3461f8b3cfc94e289b9cf000f8d5a7d9f0010d2eea29477f2a708a15
MD5 ab02e7167ae41aaf47c462265014ed93
BLAKE2b-256 f4622a2cf823a1729d56614bda8b4a85c072f652a78a7deb50bdb3a4099a22fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for tessera_pqc-0.1.1-py3-none-any.whl:

Publisher: publish.yml on abhinavgulisetty/tessera-pqc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page