How secworks/gcm works
Project type and purpose
• This is an RTL hardware project implementing the Galois/Counter Mode (GCM) block‐cipher mode for AES (128/256-bit keys, 64/96/128-bit tag).
• It consists of Verilog RTL modules, testbenches, a Python reference model for the Galois multiplication (gcm_gmult.py), and a Makefile driving builds, linting, and simulation.
File structure
• src/rtl: contains the Verilog source
• gcm.v ← top-level wrapper for GCM
• gcm_core.v ← core datapath + control, instantiates an AES submodule
• gcm_ghash.v ← GHASH multiplier and accumulator
• src/model: Python golden-reference for the Galois multiplication
• src/tb: testbenches for each module (tb_gcm.v, tb_gcm_core.v, tb_gcm_ghash.v)
• toolruns/Makefile: build targets for simulation, linting, maybe synthesis
README for additional insights
• The GHASH module is incomplete.
• The top-level and core are under active development; AES instance is integrated in gcm_core.v.
• There is a testbench for the top level to validate basic connectivity.
• Uses standard NIST and IETF references for behavior.
Elements
• Clear labels: module names, bus widths, signal names.
• Rectangles for RTL modules
• Rounded rectangles for external models (Python)
• Clouds for toolchain (Makefile, simulator, lint)
• Clock/reset distribution: show a global clock net feeding all modules.
Detailed capture of essential architecture
• Top-level I/O (AES data interface, key load interface, IV load, start/done signals).
• Drill into gcm_core.v: separate the AES submodule block, the input counter logic, and the FSM steering rounds.
• Python gcm_gmult model to gcm_ghash for golden-model comparison in your simulation flow.
• Finally, illustrate the Makefile targets: “make sim” to run tb_gcm.v, “make lint,” etc., linked to the RTL and testbench components.