How lannisterarthur/efficient-dgtotp works
This repository contains two experimental C implementations of DGTOTP: LWDGT (Low-Wastage) and NWDGT (No-Wastage). The visible runtime is built around cryptographic key generation, signing, and verification APIs, rather than an OTP service or registration server. Each scheme has its own parameterization and signature logic, with hash and randomness support. LWDGT’s parameters include FORS and custom counters; NWDGT sets FORS dimensions to zero. The README also mentions benchmarking, but that is build/test activity and is excluded. Some helper wiring is omitted because only partial source excerpts were supplied.
Main entry points: LWDGT/sign.c Key/sign/verify API · NWDGT/sign.c Key/sign/verify API · hash_shake.c Hash selection · merkle.c Merkle stage
Components 20
LWDGT scheme
- Key/sign/verify API
LWDGT/sign.c - LWDGT parameters
LWDGT/params/params-sphincs-shake-128s.h - FORS stage
LWDGT/fors.c - Merkle stage
LWDGT/merkle.c - WOTS stage
LWDGT/wots.c
NWDGT scheme
- Key/sign/verify API
NWDGT/sign.c - NWDGT parameters
NWDGT/params/params-sphincs-shake-128s.h - Merkle stage
NWDGT/merkle.c - WOTS stage
Crypto primitives
- Hash selection
LWDGT/hash_shake.c - SHAKE primitives
LWDGT/fips202.c - SHA-2 primitives
LWDGT/sha2.c - Haraka primitives
LWDGT/haraka.c - Hash selection
NWDGT/hash_shake.c - SHAKE primitives
NWDGT/fips202.c
Scheme support
- Random bytes
NWDGT/randombytes.c - Random bytes
LWDGT/randombytes.c - Hash context
LWDGT/context.h - Hash context
NWDGT/context.h
Other components
- API caller
Connections 18
- API caller → Key/sign/verify API: invokes
- API caller → Key/sign/verify API: invokes
- Key/sign/verify API → FORS stage: signs / recovers
- Key/sign/verify API → Merkle stage: builds / checks roots
- Key/sign/verify API → Random bytes: requests randomness
- Key/sign/verify API → Hash selection: hashes messages
- Merkle stage → WOTS stage: uses WOTS
- Hash selection → SHAKE primitives: uses SHAKE
- Hash selection → SHA-2 primitives: provides hash option
- Hash selection → Haraka primitives: provides hash option
- Key/sign/verify API → Hash context: initializes context
- Key/sign/verify API → Merkle stage: builds / checks roots
- Key/sign/verify API → WOTS stage: signs / recovers
- Key/sign/verify API → Random bytes: requests randomness
- Key/sign/verify API → Hash selection: hashes messages
- Merkle stage → WOTS stage: uses WOTS
- Hash selection → SHAKE primitives: uses SHAKE
- Key/sign/verify API → Hash context: initializes context