How gmucerg/dilithium works
This repository is an FPGA implementation of CRYSTALS-Dilithium supporting key generation, signing, and verification at security levels 2, 3, and 5. Its principal workflow is an operation request to the combined_top hardware, which produces the corresponding key or signature result. The RTL tree identifies supporting hashing, sampling, polynomial, and NTT components, but their wiring is not shown in the sampled source, so those connections are omitted. dilithium-256 provides a separate NTT-2x2 implementation and reference model; its relationship to the top-level RTL is not established by the available evidence.
Main entry points: combined_top.v Keygen sign verify
Components 16
Top-level operations
- Keygen sign verify
rtl_src/combined_top.v - Operation control
rtl_src/operation_module.v
Crypto primitives
- Keccak engine
rtl_src/keccak_top.vhd - SHA3 control
rtl_src/sha3_fsm3.vhd - Secret sampling
rtl_src/sampler_s.v - Matrix sampling
rtl_src/sampler_a_ext.v - Mask sampling
rtl_src/sampler_y_ext.v
Polynomial hardware
- Coefficient operations
rtl_src/coeff_decomposer.v - Hint processing
rtl_src/makehint.v - Norm checking
rtl_src/norm_check.v
NTT models
- Butterfly arithmetic
rtl_src/butterfly2x2.v - Coefficient memory
rtl_src/dual_port_ram.v - Reference NTT
dilithium-256/reference_code/ref_ntt.cpp - NTT-2x2 model
dilithium-256/hardware_code/ntt2x2_fwdntt.cpp
Other components
- Operation requester
- Key or signature result
Connections 2
- Operation requester → Keygen sign verify: requests operation
- Keygen sign verify → Key or signature result: produces result