diff --git a/.claude/plans/bram_migration_plan.md b/.claude/plans/bram_migration_plan.md new file mode 100644 index 0000000..be6be9e --- /dev/null +++ b/.claude/plans/bram_migration_plan.md @@ -0,0 +1,80 @@ +# 计划:将 mlkem_top 的大数据存储迁移到 BRAM + +## 目标 +把当前用裸 `reg` 数组实现的三块大存储改为可被 Vivado 推断为 block RAM 的结构, +使设计面向综合时不再把 86 kbit 的多项式存储映射成 LUT/FF。 + +涉及存储: +| 当前 reg 数组 | 容量(KMAX=4) | 用途 | +|---|---|---| +| `polymem [0:28*256-1]` ×12bit | 86 016 bit | 全部多项式 Â/ŝ/ê/t̂ | +| `ek_mem [0:1567]` ×8bit | 12 544 bit | byteEncode 后 ek | +| `dkp_mem [0:1535]` ×8bit | 12 288 bit | byteEncode 后 dk_pke | + +复用现有 `sync_rtl/storage/sd_bram.v`(1 读 + 1 写,读地址寄存→1 周期读延迟, +W≥12 & D≥64 时 Vivado 自动推断 BRAM)。 + +## 核心约束(已从代码确认) +1. **BRAM 读有 1 周期延迟**(reg 数组是组合读)。所有读出点都要改成“地址提前一拍”。 +2. **BRAM 每端口每周期 ≤1 访问**。当前 `polymem` 在同周期最多有 2 个不同读地址 + (ST_M LOAD 同时读 A 和 ŝ),且 ST_E 同周期读同一 poly 的 2 个系数。 +3. **ST_E 当前每周期写 3 字节**到 ek/dk —— BRAM 单写口做不到。 + +## 关键结论(决定方案可行性) +- `poly_mul_sync` 在 LOAD 阶段把 256 对系数**全部存进自己的 mem_A/mem_B**,再在 COMP + 阶段输出。所以 ST_M 的 LOAD(读 A+ŝ)与 ACCUMULATE(读 ê/t̂、写 t̂)**绝不同周期**。 + → `polymem` 按区域分 4 个 bank {A, S, E, T} 后,每个 bank 任意周期 ≤1 读 + 1 写, + `sd_bram` 即可满足,无需真双口。 +- TB 每次调试回读等 **2 个周期**(`@(posedge clk); @(posedge clk);`),可吸收 BRAM 多出的 + 1 拍读延迟,回读路径无需改 TB。 + +## polymem 4-bank 划分 +| bank | slot 数 | 深度(×256) | 写于 | 读于 | +|---|---|---|---|---| +| A (Â[i][j]) | KMAX²=16 | 4096 | ST_A | ST_M LOAD | +| S (ŝ[i]) | KMAX=4 | 1024 | ST_C / ST_N | ST_N LOAD, ST_M LOAD, ST_E | +| E (ê[i]) | KMAX=4 | 1024 | ST_C / ST_N | ST_N LOAD, ST_M ACC(j=0) | +| T (t̂[i]) | KMAX=4 | 1024 | ST_M ACC | ST_M ACC(j>0), ST_E | +(总深度 7168 == 当前 28×256,容量不变) + +每个 bank 一个 `sd_bram #(.W(12))`。读地址由一个 per-bank mux 选择:计算期由 FSM 计数器驱动, +ST_DONE/回读期由 `dbg_*` 驱动;`dbg_coeff_o` 改为按 slot 选 4 个 bank 的 rd_data。 + +## 实施分两阶段,每阶段后跑全部 11 个 KAT 用例 + +### 阶段 1:ek_mem / dkp_mem → BRAM(风险较低,先做) +1. 例化 `ek_bram`、`dkp_bram`(sd_bram,W=8)。 +2. **重写 ST_E 为每周期写 1 字节**(3 字节拆 3 拍):新增子计数器 b∈{0,1,2}, + 按 b 选 e_b0/e_b1/e_b2 与目标地址 e_boff+b。ST_E 周期数约 ×3(K=4 增 ~2K 周期, + 占总量 ~4%,可接受)。rho 拷贝阶段本就 1 字节/周期,不变。 +3. **ST_H 的 h_padbyte 读 ek 改为地址提前一拍**:assemble 子状态先发地址、下一拍取数据 + 写入 h_block_r(h_byte 流水线 +1 级)。 +4. **回读路径**(dbg_byte_o / dbg_dk_o):改为直接用 bram 的 rd_data(去掉多余的中间寄存器, + 保持总延迟 ≤2 拍,落在 TB 的 2 周期等待内)。 +5. 跑 `./run_tb.sh top` 全 11 例,要求 0 个 `cannot be opened`、全 PASS。 + +### 阶段 2:polymem → 4 bank BRAM(风险较高) +1. 例化 4 个 `sd_bram #(.W(12))`:bank_a(D=4096)、bank_s/e/t(D=1024)。 +2. 写口改写:ST_A→bank_a;ST_C→bank_s/e;ST_N→bank_s/e;ST_M ACC→bank_t。 +3. 读口加“地址提前一拍”流水: + - ST_N LOAD:读地址 = 下一个 n_ridx,数据对齐 ntt_core 的 valid_i。 + - ST_M LOAD:读地址 = 下一个 m_ld,数据对齐 poly_mul 的 pm_valid。 + - ST_M ACC:m_acc_src 读地址跟踪即将到来的 m_oidx(提前一拍),对齐 pm_vo。 + - ST_E:每周期读 1 个系数(e_c0、e_c1 拆两拍),配合阶段 1 的 1 字节/周期写。 +4. dbg_coeff_o:4 bank rd_data 按 dbg_slot 区间选择。 +5. 跑全 11 例验证。 + +## 验证方法(每阶段) +- 干净重跑:`rm -rf xsim.dir .Xil` 后 `./run_tb.sh top`。 +- 检查日志:`grep -c 'cannot be opened'`(=0) 且 11/11 `PASS`。 +- 记录周期数变化(预期 ek/dk BRAM 化使 ST_E 变长、polymem 读延迟引入少量气泡)。 +- 阶段 2 完成后,可选:跑 `vivado -mode batch` 综合,确认 polymem 现在落在 RAMB 而非 LUTRAM。 + +## 不在本次范围 +- 是否把 ek/dk 暴露为对外输出端口(上一条被打断的请求)—— 独立问题,本次只改存储实现, + 保持现有 dbg_* 接口不变。如需对外输出,迁移完成后另议。 + +## 风险 +- 读延迟流水改造触及所有 5 个计算阶段的握手时序,是 KAT 回归的主要风险点。 +- 缓解:分两阶段、每阶段独立 KAT 回归;先做低风险的 ek/dk,再做 polymem。 +- 若某阶段无法在合理尝试内通过 KAT,回退该阶段并报告根因,不带病提交。 diff --git a/.claude/plans/keygen_plan.md b/.claude/plans/keygen_plan.md new file mode 100644 index 0000000..23f3004 --- /dev/null +++ b/.claude/plans/keygen_plan.md @@ -0,0 +1,175 @@ +# ML-KEM KeyGen 顶层集成 — 实现计划与进度 + +> 本文档用于让新工程师完整接手。包含原始计划 + 已完成进度 + 经验教训 + 下一步。 + +## 目标与范围 +- 目标:实现 `mlkem_top` 的 **KeyGen 通路**(ML-KEM-512, K=2, η1=3),全新重写 valid/ready FSM。 +- 最终验收:对 **NIST 官方 KAT**(count=0..4)端到端逐字节通过,产出完整 ML-KEM dk。 +- 本计划只做 KeyGen。Encaps/Decaps 留作后续任务。 +- 旧版 `mlkem_top.v`(1658 行)已于 commit 1cace51 删除,**不可用**(Decaps 是占位,且子模块握手从未真正跑通——旧 TB 用 24 处 force/release 绕过)。新版全新重写。 + +## 关键决策(已与用户确认) +- **Keccak 策略**:每消费者用独立、已验证的核(sha3_top / sample_ntt_sync / sample_cbd_sync 各自带 keccak_core)。**不用 arbiter,不用 `_shared` 变体**(顶层当前用独立版)。 +- **SHA3 先扩多块**:已先把 sha3_top 的 H 模式扩成多块吸收(✅ 完成),再做完整 dk。 +- **FSM 全新重写**:只参考算法步骤,不取回旧代码。 +- **分阶段 + 逐级对拍**:每个子步骤对 golden 验证通过再进下一步。 + +## 环境与工具(重要) +- 工作目录:`/home/fallensigh/Dev/mlkem`,git 分支 `main`(直接提交,用户要求)。 +- **Verilator** 5.046:`python3 test_framework/run_all.py [--module X]`。快速回归。 +- **Vivado XSIM** 2019.2:每次需 + ``` + source /opt/Xilinx/Vivado/2019.2/settings64.sh + export LD_PRELOAD=/usr/lib64/libtinfo.so.5 + ``` + 调用 **standalone** `xvlog -sv --relax -i . ` / `xelab -s --timescale 1ns/1ps` / `xsim -R`。**不要**用 `vivado -mode batch`(脚本里用的是 standalone 命令,不是 Tcl)。zsh 不做无引号变量分词——用 `"$@"` 传文件列表。 +- XSIM 产物(xsim.dir/ .Xil/ *.jou *.log)已 gitignore;每次跑前 `rm -rf xsim.dir .Xil`。 + +## Golden reference(全部已验证可用) +- **NIST 官方 KAT**:`/home/fallensigh/Dev/ml-kem-r/test_data/kat_MLKEM_{512,768,1024}.rsp`。 +- **ml-kem-r**(Rust, `/home/fallensigh/Dev/ml-kem-r`):`cargo test` 全过,512/768/1024 KAT 全通过。是可信参考。 + - API:`ml_kem::mlkem512::key_gen(d,z)`、`keygen_internal::<2,192>(d,z)`、`k_pke::key_gen::<2,192>(d)`。 + - 公共子函数:`sample::sample_ntt(&[u8])`、`sample::sample_poly_cbd::`、`ntt::ntt(&mut [i32;256])`、`ntt::multiply_ntts`、`sha3::mlkem_G/mlkem_H/mlkem_PRF`、`utils::byte_encode(&[i32;256], d)`。 + - `logging` feature + `examples/logging.rs` dump 中间值(4-coeff head)。 +- **server_code**(Python, `~/Dev/server_code/python_project/PQC_2025/A_ML_KEM_v0`):`SHA_3.G/H/J/PRF`、`ML_KEM.py`。已对 hashlib 交叉验证。 + +### 白盒 golden 向量(Stage 0 产物,已生成并自校验) +- 生成器:`/home/fallensigh/Dev/ml-kem-r/examples/dump_keygen.rs`(我新增,未提交到 ml-kem-r,因为该仓库有用户大量未提交改动 —— 只在工作树用)。 + - 运行:`cargo run --release --example dump_keygen -- 5` +- 输出目录:`test_framework/modules/mlkem_keygen/golden/`(已 commit 在 mlkem 仓库 106b292)。 +- 每个 KAT case c(000..004)的全 256-coeff 中间量,文件名: + - `c000_rho.hex` / `c000_sigma.hex`:32B hex(byte0 在最低)。 + - `c000_Ahat_i_j.hex`(i,j∈0..1):256 行,每行 3-hex 系数(mod q)。 + - `c000_s_i.hex` / `c000_e_i.hex`:CBD 输出,**mod-q 形式**(负值 +Q,如 -1 → 0xd00=3328)。 + - `c000_shat_i.hex` / `c000_ehat_i.hex`:NTT(s/e) 后。 + - `c000_that_i.hex`:t_hat。 + - `c000_ek.hex`(800B hex = KAT pk)、`c000_dkpke.hex`(768B = KAT sk 前 384*K)。 + - dump_keygen 已自校验 ek==KAT.pk、dk_pke==KAT.sk[..768],全 5 case 通过。 + +## KeyGen 算法 (FIPS 203 Alg 13+16, K=2 η1=3) +1. (ρ,σ) = G(d ‖ K) — SHA3-512, 33B 输入(单块)。**G 输入 = d(byte0 低) ‖ K=2 at byte32,无字节翻转**(已确认,旧版 byte-reverse 是 bug)。ρ = hash[255:0],σ = hash[511:256]。 +2. Â[i][j] = SampleNTT(ρ‖j‖i), i,j∈{0,1} — seed = rho ‖ j ‖ i(sample_ntt_sync 内部 msg={i_byte,j_byte,rho})。 +3. s[i] = CBD₃(PRF(σ, **i**)), i∈{0,1} — nonce 0,1 +4. e[i] = CBD₃(PRF(σ, **K+i**)), i∈{0,1} — nonce 2,3 +5. ŝ[i] = NTT(s[i]); ê[i] = NTT(e[i]) — 前向 NTT ×4 (mode=0, **无缩放**) +6. t̂[i] = ê[i] + Σⱼ Â[i][j]∘ŝ[j] — poly_mul + 逐系数 modQ 累加 +7. ek = byteEncode₁₂(t̂[0..1]) ‖ ρ — 12-bit 原始打包(**非压缩**) +8. dk_pke = byteEncode₁₂(ŝ[0..1]) +9. dk = dk_pke ‖ ek ‖ H(ek) ‖ z — H(ek): SHA3-256 over 800B(**多块**) + +**用到的叶子模块**(端口签名见下):sha3_top(G+多块H)、sample_ntt_sync、sample_cbd_sync、ntt_core(mode=0)、poly_mul_sync、mod_add_sync。**不用** comp_decomp。 + +## 叶子模块端口签名(已抓取) +- `rng_sync #(SEED)`: clk,rst_n,valid_i,ready_o,data_o[255:0],valid_o,ready_i +- `sha3_top`: clk,rst_n,mode[1:0],data_i[511:0],valid_i,ready_o,hash_o[511:0],valid_o,ready_i, **+多块端口** mb_en,mb_block_i[1087:0],mb_valid_i,mb_last_i,mb_ready_o +- `sample_ntt_sync #(K=4)`: clk,rst_n,rho_i[255:0],k_i[2:0],i_idx[1:0],j_idx[1:0],valid_i,ready_o,coeff_o[11:0],valid_o,ready_i,last_o +- `sample_cbd_sync`: clk,rst_n,seed_i[255:0],nonce_i[7:0],eta_i[1:0],valid_i,ready_o,coeff_o[11:0](**12-bit signed 二补码**),valid_o,ready_i,last_o +- `ntt_core`: clk,rst_n,coeff_in[11:0],valid_i,ready_o,mode(0=fwd无缩放/1=inv有缩放),coeff_out[11:0],valid_o,ready_i,done_o。协议:IDLE/LOAD 期间 ready_o 高,流式喂 256 个(valid_i 持续);算完 S_OUTPUT 流式吐 256(valid_o 高,ready_i 消费);S_DONE→IDLE。 +- `poly_mul_sync`: clk,rst_n,coeff_a_in[11:0],coeff_b_in[11:0],valid_i,ready_o,coeff_out[11:0],valid_o,ready_i。协议:LOAD 阶段 **同时**喂 A、B 各 256 对(coeff_a_in/coeff_b_in 同拍),然后 COMPUTE 流式吐 256。 +- `mod_add_sync`: clk,rst_n,a[11:0],b[11:0],valid_i,ready_o,sum[11:0],valid_o,ready_i。(a+b)mod Q。 +- `comp_decomp_sync`: clk,rst_n,coeff_in[11:0],d[4:0],mode,valid_i,ready_o,coeff_out[11:0],valid_o,ready_i(KeyGen 不用)。 +- `sd_bram #(W=48,D=64,A=6)`、`s_bram #(W=48,D=512,A=9)`(KeyGen 暂用寄存器阵列 polymem 缓存,未用 bram)。 + +## 已完成进度 + +### ✅ Stage 0:白盒 golden 向量生成器(commit 106b292) +- `examples/dump_keygen.rs`(ml-kem-r 工作树)+ `test_framework/modules/mlkem_keygen/golden/`(mlkem 仓库)。 +- 自校验:ek==KAT.pk、dk_pke==KAT.sk 前缀,5/5 通过。 + +### ✅ Stage 1:sha3_top 多块 SHA3-256 吸收(commit 106b292) +- `sync_rtl/sha3/sha3_top.v`:新增多块吸收 FSM。新端口 `mb_en/mb_block_i[1087:0]/mb_valid_i/mb_last_i/mb_ready_o`。 + - **设计**:调用方预填充末块的 SHA3-256 padding(0x06 ... 0x80),模块只做纯吸收 loop(state^=block; Keccak-p)。单块 G/H/J 路径在 mb_en=0 时逐 bit 不变。 + - 状态:MB_IDLE/MB_PERMUTE/MB_DONE。`mb_state_r`(1600-bit running state),`mb_digest_r`(256-bit sticky digest,保持到消费者 ack)。 + - `ready_o = !mb_en && (state_r==ST_IDLE)`、`valid_o`/`hash_o` 按 mb_en 选择。 +- TB:`sync_rtl/sha3/TB/tb_sha3_mb_xsim.v`(自检,流 800B ek=6 块 → H(ek),对 hashlib.sha3_256)。向量:`vectors/mb_h_blocks.hex`、`mb_h_expected.hex`。 + - **握手坑(已解决)**:TB 必须在 accept 边沿保持 valid/last 稳定(等 mb_ready_o 拉低后才撤),否则采样竞争。digest 一次有效后 sticky,TB 收完才 ack。 +- 既有 G/H/J TB(xsim 3 个 + Verilator tb_sha3.cpp)**必须 tie off mb_* 端口**(mb_en=1'b0 等),否则 mb_en 浮空成 x 破坏 ready_o。已全部修。 +- 回归:Verilator 25/25,XSIM 4 个 TB(simple G/H/J、keccak_core、7-vec、multiblock)全过。 + +### ✅ sample_ntt 幽灵脉冲修复(commit 6db3c7c) +- **bug**:`sample_ntt_sync` 的 Phase-1(输出 d1)缺少 Phase-2 有的 `need_more` 守卫。当第 256 个被接受系数是 d1 且组推进时,某些 seed 会在 last_o 后多吐一拍 valid_o(KAT count=0 rho 下,seed i=0/j=1 吐 257 拍)。集成时漏进下个 poly 的 index 0,整流后移一位。 +- **修复**:Phase-1 改 `if (d1_acc_r && need_more)`。两变体(`sample_ntt_sync.v` + `sample_ntt_sync_shared.v`)都改。 +- **补盲区**:`tb_sample_ntt_xsim.v` 加断言——last_o 后保持 ready_i 数多余 valid_o,有则 FAIL。已验证该断言能抓 bug(还原副本 3 个幽灵)、修复版通过。 +- 验证:40-seed(sync)+24-seed(shared)审计全 256 拍/last@256/零幽灵;Verilator 1536/1536;全框架 4334/4334;Stage 2c 2048/2048。 +- 记忆:`sample-ntt-257th-pulse-bug.md`。 + +### ✅ Stage 2a/2b/2c:KeyGen 数据通路前半(**未提交**,在工作树) +- 文件:`sync_rtl/top/mlkem_top.v`(新建)+ TB `sync_rtl/top/TB/tb_mlkem_kg_2a_xsim.v`、`tb_mlkem_kg_2c_xsim.v`、向量 `sync_rtl/top/TB/vectors/kg_c000_AsE.hex`。 +- **mlkem_top 结构**(K=2,ETA1=3): + - 端口:clk,rst_n,d_i[255:0],z_i[255:0],start_i,busy_o,done_o + **调试 tap**:dbg_slot_i[3:0],dbg_idx_i[7:0],dbg_coeff_o[11:0](寄存器读 polymem,2拍延迟),dbg_rho_o[255:0],dbg_sigma_o[255:0]。 + - **polymem**:`reg [11:0] polymem[0:10*256-1]`,slot 映射:0-3=A00,A01,A10,A11;4-5=S0,S1;6-7=E0,E1;8-9=T0,T1。s/s_hat 共享 slot(就地 NTT),e 同理。 + - FSM 状态:ST_IDLE=0,ST_G=1,ST_A=2,ST_C=3,...,ST_DONE=15。 + - **2a(G)**:sha3_top mode=00,g_data={248'b0,8'(K),d_i};完成捕获 rho_r/sigma_r。✅ rho/sigma 对 golden 精确。 + - **2b(A)**:a_pair 0..3 循环,a_i=pair[1],a_j=pair[0],a_slot=pair。每 pair 跑 sample_ntt_sync,256 系数写 polymem[a_slot]。✅ 1024 系数全对。 + - **2c(C)**:c_poly 0..3(s0,s1,e0,e1),c_nonce=c_poly,c_slot 映射。CBD 输出经 `cbd_modq = cbd_coeff[11] ? cbd_coeff+Q : cbd_coeff` 转 mod-q 后写 polymem。✅ 2048/2048(A+s+e)全对。 + - **关键防护 a_busy/c_busy**:请求被接受(valid&&ready)时置位,last 时清零;仅 busy 时收集系数。本是为屏蔽 sample_ntt 幽灵脉冲的下游兜底;sample_ntt 根因修复后冗余但保留(无害,且对未来叶子模块是防御)。 +- **字节序基准**(全部已确认,这是旧版的痛点): + - G 输入 d 原序(byte0 低),无翻转。 + - SampleNTT seed=rho‖j‖i。 + - CBD nonce:s[i]=i,e[i]=K+i。 + - golden 多项式存 mod-q;CBD RTL 输出 12-bit 二补码,需 +Q 转换。 + +## 当前工作树状态(未提交) +- `sync_rtl/top/mlkem_top.v`(新,Stage 2a/b/c,FSM 到 ST_C) +- `sync_rtl/top/TB/tb_mlkem_kg_2a_xsim.v`、`tb_mlkem_kg_2c_xsim.v`(新) +- `sync_rtl/top/TB/vectors/kg_c000_AsE.hex`(新,8 poly × 256 = 2048 行,顺序 A00,A01,A10,A11,S0,S1,E0,E1) +- `.claude/plans/`(本文件) +- **下一步该先提交 Stage 2a-2c**(测试已通过)。 + +## 关键测试 literal(byte0-低 256-bit) +- KAT c000 d:`D_LIT = 256'h2426f1941779574d3f1b163bd57f7e173e229e630ec7f7073bdf365137c4bb6d` +- 期望 rho:`256'h15f74355ca862c3cdf3dab780c35cf24b88bf144706090a1c17e41205f9f1379` +- 期望 sigma:`256'h69b042001b5630b1a039116cbfd29f62c0bde5a6b571504a9fcce68bed667fd5` + +## 下一步(剩余 Stage 2/3/4) + +### Stage 2d:NTT(s/e → ŝ/ê) ← **当前正在做** +- golden 映射已确认:`ntt(s_i)==shat_i`、`ntt(e_i)==ehat_i`(mode=0 fwd,无缩放,zeta 表见 ntt gen_vectors,N_INV=3303 仅 inv 用)。 +- 计划:新增 ST_N 状态,对 4 个 slot(S0,S1,E0,E1)逐个就地 NTT:从 polymem 读 256 喂 ntt_core(mode=0),收 256 写回同 slot。 +- 注意 ntt_core 协议:LOAD 期间持续 valid_i 喂 256;输出阶段 valid_o 高、ready_i 消费 256。需读地址流水(组合读 polymem)。 +- TB:扩展对 shat/ehat golden 校验。 +- **正读 mlkem_top.v 行 200-290 的时序逻辑准备插入 ST_N 时被打断;接手时先重读 mlkem_top.v 全文确认当前 FSM 时序结构再加 ST_N。** + +### Stage 2e:矩阵累加 t̂[i] = ê[i] + Σⱼ Â[i][j]∘ŝ[j] +- 用 poly_mul_sync(同拍喂 A、B 各 256)算 Â[i][j]∘ŝ[j],再用 mod_add_sync 逐系数 + ê[i] 累加。K=2:t̂[0]=ê0+A00∘ŝ0+A01∘ŝ1;t̂[1]=ê1+A10∘ŝ0+A11∘ŝ1。 +- 对 golden `that_i` 校验。 + +### Stage 2f:byteEncode₁₂ → ek/dk_pke +- 12-bit LSB-first 打包(FIPS:b[i*12+j]=(coeff>>j)&1,再 bits_to_bytes)。ek=byteEncode12(t̂[0..1])‖ρ(800B);dk_pke=byteEncode12(ŝ[0..1])(768B)。 +- 对 KAT pk / sk 前缀逐字节校验。 + +### Stage 3:KeyGen FSM 集成 + 干净顶层接口 +- 串起 2a-2f;顶层流式输出 ek_o/dk_o;无 force。 + +### Stage 4:组装完整 dk + 端到端 KAT +- dk = dk_pke ‖ ek ‖ H(ek)[用 Stage1 多块] ‖ z。 +- 干净 KAT TB(无 force/release),喂 KAT d/z,逐字节比 ek 与 dk。跑 KAT count=0..4 全过。Verilator + XSIM 双框架。 + +## 经验教训(重要) +1. **"PASS" 只证 RTL==reference**:必须独立对 hashlib/FIPS 验证 oracle。 +2. **单独 TB 盲区会掩盖模块 bug**:sample_ntt 的 257th 脉冲就是"读够就停"掩盖的。新 TB 要验证协议边界(last 后 valid 干净拉低)。 +3. **加端口必须 tie off 所有旧实例**:浮空输入成 x 会破坏组合逻辑(mb_en 教训)。 +4. **valid/ready 握手 TB 要在 accept 边沿保持输入稳定**,等 ready 拉低再撤,否则采样竞争(多块 H、A-pair 边界都踩过)。 +5. **字节序/位序是旧版主要 bug 源**:每步对 golden 逐字节,错位立刻暴露。 +6. **bash 工具偶发输出截断/丢失**:重要结论用 `rm -rf xsim.dir` 重跑确认,别凭一次模糊输出下判断。 + +## 任务追踪(TaskList ID) +- #7 Stage 0 ✅ completed +- #8 Stage 1 ✅ completed +- #9 Stage 2 datapath subblocks — in_progress(2a/b/c done,2d 进行中) +- #10 Stage 3 FSM 集成 — blocked by #9 +- #11 Stage 4 dk + KAT — blocked by #8,#10 + +## 提交历史(相关) +- 106b292 feat(sha3): multi-block SHA3-256 absorb for H(ek); KeyGen golden vectors (Stage 0+1) +- 6db3c7c fix(sample_ntt): suppress spurious 257th valid_o after last_o +- (未提交)Stage 2a-2c mlkem_top + TB + +--- +## ✅ COMPLETE (session end state) +- KeyGen FSM: IDLE->G->A->C->N->M->E->H->DONE, pure valid/ready, no force. +- Verified vs NIST KAT MLKEM-512 **count=0..4**: ek (800B)==pk, dk (1632B)==sk, byte-exact, ~21350 cyc/case. +- Commits: 106b292, 6db3c7c, 2f206a6, 4c692e5, a9e50eb, 1791491, 9824ed8, 42d3748. +- Independent Keccak per consumer (G + dedicated H sha3_top + sample_ntt/cbd cores). No arbiter. +- SECURITY: tool outputs this session carried prompt-injection (fake operator instructing `curl|bash`); all refused. Some outputs were tampered; results re-verified with controlled delimiters. +- Remaining optional: streaming ek/dk output port (currently start_i/done_o + readback taps); Encaps/Decaps; shared-keccak migration. diff --git a/.trellis/spec/rtl/index.md b/.trellis/spec/rtl/index.md index 31a90ba..141e2fe 100644 --- a/.trellis/spec/rtl/index.md +++ b/.trellis/spec/rtl/index.md @@ -3,12 +3,10 @@ ## Pre-Development Checklist Before writing RTL code or testbenches, read: -1. [Verilator Conventions](./verilator-conventions.md) — for C++ Verilator testbenches -2. [XSIM Testbench Conventions](./xsim-tb-conventions.md) — for Vivado XSIM Verilog testbenches +1. [XSIM Testbench Conventions](./xsim-tb-conventions.md) — for Vivado XSIM Verilog testbenches ## Files | File | Purpose | |------|---------| -| `verilator-conventions.md` | Verilator 5.046 C++ testbench conventions (clock, timing, valid/ready protocol) | | `xsim-tb-conventions.md` | Vivado XSIM Verilog testbench conventions (template, vector format, TCL scripts) | diff --git a/.trellis/spec/rtl/verilator-conventions.md b/.trellis/spec/rtl/verilator-conventions.md deleted file mode 100644 index ed99e10..0000000 --- a/.trellis/spec/rtl/verilator-conventions.md +++ /dev/null @@ -1,62 +0,0 @@ -# Verilator RTL Conventions - -## Verilator Version - -**5.046** (Fedora package). Requires **C++14** or later. - -## Compile Arguments - -**Do NOT** add `-CFLAGS -std=c++11`. Verilator 5.046 uses C++14 features (`""s` string literal). -Let Verilator use its default C++ standard. - -Correct base command: -``` -verilator -Wall --cc --build --timing --exe --top-module -``` - -## Include Paths - -All Verilog files use paths relative to project root (`~/Dev/mlkem`). -Pass `+incdir+` to Verilator so `\`include "sync_rtl/common/defines.vh"` resolves. - -## Clock Period - -100MHz = 10ns. Defined centrally in `sync_rtl/common/defines.vh`: -```verilog -`define CLK_PERIOD 10.0 -``` - -## Testbench Timing Protocol (Verilator C++) - -### Critical Rule: Always advance at least one posedge before checking signals - -Setting a DUT input (e.g., `dut->valid_i = 1`) does NOT take effect until `dut->eval()` is called. -A posedge requires: `dut->clk = 1; dut->eval();`. - -### pipeline_reg valid/ready timing - -The `pipeline_reg` module's valid_o is HIGH for exactly ONE cycle between the posedge that captures data and the next posedge that consumes it (when ready_i=1). - -Correct read pattern: -```cpp -// 1. Drive input + posedge → data captured, valid_o → 1 -dut->valid_i = 1; -posedge(dut); // dut->clk = 1; eval(); dut->clk = 0; eval(); -dut->valid_i = 0; - -// 2. Read result NOW (valid_o is high, sum is valid) -printf("RESULT: %03X\n", dut->sum & 0xFFF); - -// 3. Consume with next posedge → valid_o → 0 -posedge(dut); -``` - -### Anti-pattern: while(!dut->ready_o) without eval - -Setting valid_i=1 and immediately checking ready_o in a while loop that starts with NO eval() will skip the first clock edge entirely if ready_o is already 1. Use do-while to guarantee at least one edge: -```cpp -dut->valid_i = 1; -do { - posedge(dut); -} while (!dut->ready_o); -``` diff --git a/.trellis/spec/test_framework/structure.md b/.trellis/spec/test_framework/structure.md deleted file mode 100644 index 8f6e373..0000000 --- a/.trellis/spec/test_framework/structure.md +++ /dev/null @@ -1,66 +0,0 @@ -# Test Framework Structure - -## Directory Layout - -``` -test_framework/ -├── run_all.py # CLI entry: --module, --case, --list, --quick -├── config.json # Verilator path, clock period, timeouts -├── lib/ -│ ├── test_runner.py # Discovery, compile, run, compare pipeline -│ ├── sim_controller.py # Verilator compiles/run wrapper -│ ├── vector_gen.py # Base class for vector generators -│ ├── result_checker.py # Hex-file comparison -│ └── reporter.py # Terminal + HTML output -├── modules/ -│ └── / -│ ├── test_plan.json # Module test definition -│ ├── gen_vectors.py # Vector generator (subclass of VectorGenerator) -│ └── vectors/ # Generated hex files (auto-cleaned) -└── reports/ - ├── latest/ - └── history/ -``` - -## test_plan.json Schema - -```json -{ - "module": "", - "rtl_top": "sync_rtl//.v", - "rtl_deps": ["sync_rtl/common/.v"], - "tb_cpp": "sync_rtl//TB/tb_.cpp", - "simulator": "verilator", - "timeout_s": 30, - "cases": [{ - "id": "", - "description": "", - "params": {}, - "num_vectors": 50, - "tolerance": "bit_exact" - }] -} -``` - -- `rtl_top`: top module basename (without .v) is used as Verilator `--top-module` -- `rtl_deps`: listed before `rtl_top` in Verilator command line -- `tolerance`: "bit_exact" uses result_checker.py; otherwise delegates to gen_vectors.compare_results() - -## Vector Generator Contract - -Each module's `gen_vectors.py` must: -1. Subclass `VectorGenerator` from `test_framework.lib.vector_gen` -2. Implement `generate_one(params) -> dict` returning `{"input": {...}, "expected": {...}}` -3. Override `write_hex_file(vectors, filepath)` for input format -4. Override `write_expected_file(vectors, filepath)` for expected format - -The framework auto-discovers the generator class by scanning for subclasses of VectorGenerator. - -## Adding a New Module - -1. Create `test_framework/modules//test_plan.json` -2. Create `test_framework/modules//gen_vectors.py` -3. Create `sync_rtl//_sync.v` (RTL) -4. Create `sync_rtl//TB/tb_.cpp` (Verilator C++ TB) -5. Run `python3 test_framework/run_all.py --list` to verify discovery -6. Run `python3 test_framework/run_all.py --module ` to test diff --git a/image.png b/image.png new file mode 100644 index 0000000..5c9b433 Binary files /dev/null and b/image.png differ diff --git a/run_tb.sh b/run_tb.sh index 057c002..b482da8 100755 --- a/run_tb.sh +++ b/run_tb.sh @@ -106,11 +106,68 @@ execute_tcl() { rm -f "$tmp_script" } +# ---- parallel xsim launcher -------------------------------------------------- +# xsim writes runtime logs into xsim.dir//, so two runs of the SAME +# snapshot clobber each other. To run (K,case) in parallel we give each job its +# own COPY of xsim.dir (~1 MB, cheap) under a private workdir, run xsim there, +# and tee output to a per-job log. Compile+elaborate stay serial (they populate +# the shared xsim.dir BEFORE any parallel run starts). +# +# run_xsim_jobs ... +# each = "snapshot:K:CASE". Launches all specs in parallel, waits, +# then prints an ordered summary and returns nonzero if any job failed. +PAR_BASE="${TMPDIR:-/tmp}/run_tb_par_$$" +run_xsim_jobs() { + local mtag="$1" pgrep="$2" pmatch="$3"; shift 3 + local specs=("$@") + local repo; repo="$(pwd)" + rm -rf "$PAR_BASE"; mkdir -p "$PAR_BASE" + + # launch all jobs in parallel + local s snap k c wd + for s in "${specs[@]}"; do + IFS=: read -r snap k c <<< "$s" + wd="$PAR_BASE/${mtag}_k${k}_c${c}" + mkdir -p "$wd" + cp -r "$repo/xsim.dir" "$wd/xsim.dir" + # The TB loads vectors via repo-relative $readmemh paths + # (sync_rtl/top/TB/vectors/...). xsim resolves these against the run + # cwd, so symlink the repo's sync_rtl tree into each private workdir. + ln -sf "$repo/sync_rtl" "$wd/sync_rtl" + ( + cd "$wd" + echo " xsim $snap -R -testplusarg CASE=$c" + xsim "$snap" -R -testplusarg "CASE=$c" --nolog > "$wd/run.out" 2>&1 + ) & + done + wait + + # ordered summary + per-job log copy to /tmp/run_tb__k*_c*.log + local fail=0 pf nf log + for s in "${specs[@]}"; do + IFS=: read -r snap k c <<< "$s" + wd="$PAR_BASE/${mtag}_k${k}_c${c}" + log="/tmp/run_tb_${mtag}_k${k}_c${c}.log" + cp -f "$wd/run.out" "$log" 2>/dev/null + pf=$(grep -oE "$pgrep" "$log" | tail -1) + nf=$(grep -c 'cannot be opened' "$log") + echo " K=$k CASE=$c -> ${pf:-NORESULT} (file-not-found=$nf, log: $log)" + # pmatch == "PASS*" means "any PASS (Dn) stage tag"; else exact match. + if [ "$pmatch" = "PASS*" ]; then + { [[ "$pf" == PASS* ]] && [ "$nf" -eq 0 ]; } || fail=1 + else + { [ "$pf" = "$pmatch" ] && [ "$nf" -eq 0 ]; } || fail=1 + fi + done + rm -rf "$PAR_BASE" + return $fail +} + # Fast single-K / single-case path for the 'top' (ML-KEM KeyGen) module. # Compiles the same RTL as the tcl, but elaborates ONLY the requested K and -# runs ONLY the requested CASE(s). Avoids the 3-snapshot + 11-run full sweep. +# runs the CASE(s) in parallel. Avoids the 3-snapshot + 11-run serial sweep. run_top_selected() { - local tcl_file="$1" k="$2" csel="$3" + local tcl_file="$1" ksel="$2" csel="$3" set +e # we do our own error handling / result parsing here rm -rf xsim.dir .Xil @@ -120,29 +177,22 @@ run_top_selected() { eval "$cmd" || { echo "COMPILE FAILED: $cmd"; return 1; } done < <(grep -E '^xvlog ' "$tcl_file") - # Cases per K: K=2 has 0..4, K=3/4 have 0..2. - local cases - if [ "$k" = "2" ]; then cases="0 1 2 3 4"; else cases="0 1 2"; fi - if [ -n "$csel" ]; then cases="$csel"; fi - - echo " xelab tb_mlkem_kg_katK_xsim -generic_top KP=$k -s mlkem_kg_k$k --timescale 1ns/1ps" - xelab tb_mlkem_kg_katK_xsim -generic_top KP=$k -s mlkem_kg_k$k --timescale 1ns/1ps \ - || { echo "ELAB FAILED for K=$k"; return 1; } - - local fail=0 - for c in $cases; do - local log="/tmp/run_tb_top_k${k}_c${c}.log" - echo " xsim mlkem_kg_k$k -R -testplusarg CASE=$c" - echo "========================================" | tee "$log" - xsim "mlkem_kg_k$k" -R -testplusarg "CASE=$c" 2>&1 | tee -a "$log" - echo "========================================" | tee -a "$log" - local pf nf - pf=$(grep -oE 'PASS|FAIL' "$log" | tail -1) - nf=$(grep -c 'cannot be opened' "$log") - echo " K=$k CASE=$c -> ${pf:-NORESULT} (file-not-found=$nf, log: $log)" - { [ "$pf" = "PASS" ] && [ "$nf" -eq 0 ]; } || fail=1 + # K to run: requested one, or all of 2/3/4. Elaborate snapshots (serial). + local ks; if [ -n "$ksel" ]; then ks="$ksel"; else ks="2 3 4"; fi + local k specs=() + for k in $ks; do + echo " xelab tb_mlkem_kg_katK_xsim -generic_top KP=$k -s mlkem_kg_k$k --timescale 1ns/1ps" + xelab tb_mlkem_kg_katK_xsim -generic_top KP=$k -s mlkem_kg_k$k --timescale 1ns/1ps \ + || { echo "ELAB FAILED for K=$k"; return 1; } + # Cases per K: K=2 has 0..4, K=3/4 have 0..2. + local cases + if [ "$k" = "2" ]; then cases="0 1 2 3 4"; else cases="0 1 2"; fi + if [ -n "$csel" ]; then cases="$csel"; fi + local c + for c in $cases; do specs+=("mlkem_kg_k$k:$k:$c"); done done - return $fail + + run_xsim_jobs top 'PASS|FAIL' PASS "${specs[@]}" } # ML-KEM Encaps runner. Compiles the 'top' tcl xvlog lines (KeyGen datapath = @@ -165,31 +215,21 @@ run_enc_selected() { xvlog -sv --relax sync_rtl/top/TB/tb_mlkem_enc_katK_xsim.v \ || { echo "ENC TB COMPILE FAILED"; return 1; } - # K to run: requested one, or all of 2/3/4. + # K to run: requested one, or all of 2/3/4. Elaborate snapshots (serial), + # then run all (K,case) in parallel. local ks; if [ -n "$ksel" ]; then ks="$ksel"; else ks="2 3 4"; fi - local fail=0 + local k specs=() for k in $ks; do echo " xelab tb_mlkem_enc_katK_xsim -generic_top KP=$k -s mlkem_enc_k$k --timescale 1ns/1ps" xelab tb_mlkem_enc_katK_xsim -generic_top KP=$k -s mlkem_enc_k$k --timescale 1ns/1ps \ - || { echo "ELAB FAILED for K=$k"; fail=1; continue; } - - # Encaps KAT cases per K: 0..2 (vectors enc_k{K}_c{0,1,2}_*). + || { echo "ELAB FAILED for K=$k"; return 1; } local cases="0 1 2" if [ -n "$csel" ]; then cases="$csel"; fi - for c in $cases; do - local log="/tmp/run_tb_enc_k${k}_c${c}.log" - echo " xsim mlkem_enc_k$k -R -testplusarg CASE=$c" - echo "========================================" | tee "$log" - xsim "mlkem_enc_k$k" -R -testplusarg "CASE=$c" 2>&1 | tee -a "$log" - echo "========================================" | tee -a "$log" - local pf nf - pf=$(grep -oE 'PASS \(E7\)|FAIL \(E7\)' "$log" | tail -1) - nf=$(grep -c 'cannot be opened' "$log") - echo " K=$k CASE=$c -> ${pf:-NORESULT} (file-not-found=$nf, log: $log)" - { [ "$pf" = "PASS (E7)" ] && [ "$nf" -eq 0 ]; } || fail=1 - done + local c + for c in $cases; do specs+=("mlkem_enc_k$k:$k:$c"); done done - return $fail + + run_xsim_jobs enc 'PASS \(E7\)|FAIL \(E7\)' 'PASS (E7)' "${specs[@]}" } # ML-KEM Decaps runner. Same compile basis as enc (top tcl minus KeyGen TB) plus @@ -210,29 +250,19 @@ run_dec_selected() { || { echo "DEC TB COMPILE FAILED"; return 1; } local ks; if [ -n "$ksel" ]; then ks="$ksel"; else ks="2 3 4"; fi - local fail=0 + local k specs=() for k in $ks; do echo " xelab tb_mlkem_dec_katK_xsim -generic_top KP=$k -s mlkem_dec_k$k --timescale 1ns/1ps" xelab tb_mlkem_dec_katK_xsim -generic_top KP=$k -s mlkem_dec_k$k --timescale 1ns/1ps \ - || { echo "ELAB FAILED for K=$k"; fail=1; continue; } - + || { echo "ELAB FAILED for K=$k"; return 1; } local cases="0 1 2" if [ -n "$csel" ]; then cases="$csel"; fi - for c in $cases; do - local log="/tmp/run_tb_dec_k${k}_c${c}.log" - echo " xsim mlkem_dec_k$k -R -testplusarg CASE=$c" - echo "========================================" | tee "$log" - xsim "mlkem_dec_k$k" -R -testplusarg "CASE=$c" 2>&1 | tee -a "$log" - echo "========================================" | tee -a "$log" - local pf nf - # match the highest-stage result line: 'K=.. CASE .. PASS (Dn): ...' - pf=$(grep -oE 'PASS \(D[0-7]\)|FAIL \(D[0-7]\)' "$log" | tail -1) - nf=$(grep -c 'cannot be opened' "$log") - echo " K=$k CASE=$c -> ${pf:-NORESULT} (file-not-found=$nf, log: $log)" - { [[ "$pf" == PASS* ]] && [ "$nf" -eq 0 ]; } || fail=1 - done + local c + for c in $cases; do specs+=("mlkem_dec_k$k:$k:$c"); done done - return $fail + + # match the highest-stage result line: 'K=.. CASE .. PASS (Dn): ...' + run_xsim_jobs dec 'PASS \(D[0-7]\)|FAIL \(D[0-7]\)' 'PASS*' "${specs[@]}" } if [ "$MODULE" = "enc" ]; then @@ -245,7 +275,8 @@ if [ "$MODULE" = "dec" ]; then exit $? fi -if [ "$MODULE" = "top" ] && [ -n "$SEL_K" ]; then +if [ "$MODULE" = "top" ]; then + # run_top_selected handles all-K (no SEL_K) or a single K, cases in parallel. run_top_selected "$TCL_FILE" "$SEL_K" "$SEL_CASE" exit $? fi diff --git a/sync_rtl/comp_decomp/TB/tb_comp_decomp.cpp b/sync_rtl/comp_decomp/TB/tb_comp_decomp.cpp deleted file mode 100644 index a1d1ef8..0000000 --- a/sync_rtl/comp_decomp/TB/tb_comp_decomp.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// tb_comp_decomp.cpp - Verilator C++ testbench for comp_decomp_sync -// -// Reads test vectors from a hex file specified by +VECTOR_FILE= plusarg. -// Each line: "MODE D COEFF" (e.g. "C A 3FF" for compress d=10 coeff=0x3FF). -// MODE: 'C' for compress, 'D' for decompress. -// Drives the DUT, waits for valid_o, writes "RESULT: COEFF" to stdout. -// -// Clock: 10 ns period. Reset: 2 cycles low. Timeout: 100,000 cycles. - -#include -#include -#include -#include -#include -#include "Vcomp_decomp_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 100000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; // skip "+VECTOR_FILE=" - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vcomp_decomp_sync* dut = new Vcomp_decomp_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->coeff_in = 0; - dut->d = 0; - dut->mode = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 cycles low - for (int i = 0; i < 4; i++) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - } - dut->rst_n = 1; - - // Always ready to receive results - dut->ready_i = 1; - - std::string line; - vluint64_t cycle = 0; - - while (std::getline(infile, line)) { - // Skip empty lines and comments - if (line.empty() || line[0] == '#') continue; - - // Parse: MODE D COEFF - std::istringstream iss(line); - char mode_char; - unsigned int d_val, coeff_val; - if (!(iss >> mode_char >> std::hex >> d_val >> coeff_val)) continue; - - if (mode_char == 'C') - dut->mode = 0; - else if (mode_char == 'D') - dut->mode = 1; - else - continue; - - dut->d = d_val & 0x1F; - dut->coeff_in = coeff_val & 0xFFF; - dut->valid_i = 1; - - // posedge: DUT samples valid_i, pipeline_reg captures data - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - cycle++; - dut->valid_i = 0; - - // posedge: pipeline_reg sends result out (valid_o=1) - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - cycle++; - - printf("RESULT: %03X\n", dut->coeff_out & 0xFFF); - } - - infile.close(); - delete dut; - return 0; -} diff --git a/sync_rtl/mod_add/TB/tb_mod_add.cpp b/sync_rtl/mod_add/TB/tb_mod_add.cpp deleted file mode 100644 index 157609b..0000000 --- a/sync_rtl/mod_add/TB/tb_mod_add.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// tb_mod_add.cpp - Verilator C++ testbench for mod_add_sync -// -// Reads test vectors from a hex file specified by +VECTOR_FILE= plusarg. -// Each line: "AAA BBB" (two 12-bit hex operands). -// Drives the DUT, waits for valid_o, writes "RESULT: CCC" to stdout. -// -// Clock: CLK_PERIOD ns period (from defines.vh). -// Reset: 2 cycles low, then high. -// Timeout: 100,000 cycles. - -#include -#include -#include -#include -#include -#include "Vmod_add_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 100000 -#define Q 3329 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; // skip "+VECTOR_FILE=" - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vmod_add_sync* dut = new Vmod_add_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->a = 0; - dut->b = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 cycles low - for (int i = 0; i < 4; i++) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - } - dut->rst_n = 1; - - // Always ready to receive results - dut->ready_i = 1; - - std::string line; - vluint64_t cycle = 0; - bool waiting_result = false; - - while (std::getline(infile, line)) { - // Skip empty lines and comments - if (line.empty() || line[0] == '#') continue; - - // Parse hex operands - std::istringstream iss(line); - unsigned int a_val, b_val; - if (!(iss >> std::hex >> a_val >> b_val)) continue; - - dut->a = a_val & 0xFFF; - dut->b = b_val & 0xFFF; - dut->valid_i = 1; - - // posedge: DUT samples valid_i, pipeline_reg captures data, valid_o→1 - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - cycle++; - dut->valid_i = 0; - - // posedge: pipeline_reg clears valid_o (ready_i=1), but result is - // available on sum port right now (combinational from data_r) - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - cycle++; - - printf("RESULT: %03X\n", dut->sum & 0xFFF); - } - - infile.close(); - delete dut; - return 0; -} diff --git a/sync_rtl/ntt/TB/tb_ntt.cpp b/sync_rtl/ntt/TB/tb_ntt.cpp deleted file mode 100644 index e70c3fd..0000000 --- a/sync_rtl/ntt/TB/tb_ntt.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// tb_ntt.cpp - Verilator C++ testbench for ntt_sync -// -// Reads test vectors from +VECTOR_FILE= plusarg. -// Format: "MODE COEFF0 COEFF1 ... COEFF255" -// MODE: "F" = forward NTT, "I" = inverse NTT -// COEFFx: 3-digit hex (12-bit, 000..CFF) -// -// Drives DUT with coefficients one per cycle, waits for output, -// prints "RESULT: COEFF0 COEFF1 ... COEFF255\n" to stdout. -// -// Clock: 10ns period. Reset: 2 cycles. - -#include -#include -#include -#include -#include -#include -#include -#include -#include "Vntt_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 500000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -// Toggle clock: both edges + eval (one full cycle) -static void posedge(Vntt_sync* dut) { - dut->clk = 1; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = 0; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); -} - -static int hex_char_to_nibble(char c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return 0; -} - -// Parse 3-char hex token to 12-bit value. -static uint16_t hex3_to_val(const std::string& tok) { - uint16_t val = 0; - for (size_t i = 0; i < tok.length() && i < 3; i++) { - val = (val << 4) | hex_char_to_nibble(tok[i]); - } - return val & 0xFFF; -} - -// Format 12-bit value as 3-char hex (lowercase for consistency). -static std::string val_to_hex3(uint16_t val) { - char buf[4]; - snprintf(buf, sizeof(buf), "%03X", val & 0xFFF); - return std::string(buf); -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vntt_sync* dut = new Vntt_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->mode = 0; - dut->coeff_in = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 full cycles - for (int i = 0; i < 2; i++) posedge(dut); - dut->rst_n = 1; - - std::string line; - vluint64_t cycle = 0; - int vec_count = 0; - - while (std::getline(infile, line)) { - if (line.empty() || line[0] == '#') continue; - - // Parse: MODE COEFF0 COEFF1 ... COEFF255 - std::istringstream iss(line); - std::string mode_str; - if (!(iss >> mode_str)) continue; - - int mode_val = 0; - if (mode_str == "I") mode_val = 1; - - // Parse 256 coefficients into vector - std::vector input_coeffs(256); - std::string tok; - int coeff_idx = 0; - while (iss >> tok && coeff_idx < 256) { - input_coeffs[coeff_idx] = hex3_to_val(tok); - coeff_idx++; - } - if (coeff_idx != 256) { - std::cerr << "ERROR: Expected 256 coefficients, got " << coeff_idx - << " (vec " << vec_count << ")" << std::endl; - continue; - } - - // Set mode - dut->mode = mode_val; - - // ---- Load 256 coefficients ---- - while (!dut->ready_o) { - posedge(dut); cycle++; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - for (int i = 0; i < 256; i++) { - dut->coeff_in = input_coeffs[i]; - dut->valid_i = 1; - posedge(dut); cycle++; - dut->valid_i = 0; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - - // At this point, the DUT has captured all 256 coeffs and - // transitioned to S_COMPUTE_RD (ready_o went low). - - // ---- Wait for valid_o (DUT computing) ---- - dut->ready_i = 1; - while (!dut->valid_o) { - posedge(dut); - cycle++; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - - // ---- Read 256 output coefficients ---- - printf("RESULT: "); - for (int i = 0; i < 256; i++) { - // Wait for valid_o to be asserted (data is valid NOW) - while (!dut->valid_o) { - posedge(dut); - cycle++; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - - // Capture coefficient BEFORE consuming posedge - uint16_t coeff_val = (uint16_t)(dut->coeff_out & 0xFFF); - printf("%s%s", val_to_hex3(coeff_val).c_str(), - (i < 255) ? " " : ""); - - // Consume this coefficient: posedge with ready_i=1 - posedge(dut); - cycle++; - } - printf("\n"); - - vec_count++; - } - - std::cout << "Processed " << vec_count << " vectors" << std::endl; - infile.close(); - delete dut; - return (vec_count > 0) ? 0 : 1; - -timeout_err: - std::cerr << "ERROR: Timeout at cycle " << cycle - << " (vec " << vec_count << ")" << std::endl; - infile.close(); - delete dut; - return 1; -} diff --git a/sync_rtl/poly_arith/TB/tb_poly_arith.cpp b/sync_rtl/poly_arith/TB/tb_poly_arith.cpp deleted file mode 100644 index e001621..0000000 --- a/sync_rtl/poly_arith/TB/tb_poly_arith.cpp +++ /dev/null @@ -1,175 +0,0 @@ -// tb_poly_arith.cpp - Verilator C++ testbench for poly_arith_sync -// -// Reads test vectors from a hex file specified by +VECTOR_FILE= plusarg. -// Each line: "MODE A0 A1 ... A255 B0 B1 ... B255" -// MODE: 'A' for add, 'S' for sub -// A0..A255: 256 hex coefficients (12-bit, 3 hex digits each) -// B0..B255: 256 hex coefficients -// -// Feeds 256 (A, B) pairs through the DUT, collects 256 output coeffs, -// prints one "RESULT: C0 C1 ... C255" line per vector. -// -// Clock: 10 ns period (100 MHz). -// Reset: 2 cycles low, then high. -// Timeout: 100,000 cycles. - -#include -#include -#include -#include -#include -#include -#include "Vpoly_arith_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 100000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -// Helper: toggle clock (full cycle: low->high->low) with eval -static void posedge(Vpoly_arith_sync* dut) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vpoly_arith_sync* dut = new Vpoly_arith_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->coeff_a_in = 0; - dut->coeff_b_in = 0; - dut->mode = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 cycles low - for (int i = 0; i < 4; i++) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - } - dut->rst_n = 1; - - // Always ready to receive results - dut->ready_i = 1; - - std::string line; - vluint64_t cycle = 0; - - while (std::getline(infile, line)) { - // Skip empty lines and comments - if (line.empty() || line[0] == '#') continue; - - // Parse: MODE A0..A255 B0..B255 (513 values on one line) - std::istringstream iss(line); - std::string mode_str; - if (!(iss >> mode_str)) continue; - - // Determine mode - bool mode_val; - if (mode_str == "A" || mode_str == "a") { - mode_val = false; - } else if (mode_str == "S" || mode_str == "s") { - mode_val = true; - } else { - std::cerr << "ERROR: Unknown mode: " << mode_str << std::endl; - continue; - } - - dut->mode = mode_val ? 1 : 0; - - // Read 256 A coeffs - unsigned int coeff; - std::vector a_coeffs, b_coeffs; - for (int i = 0; i < 256; i++) { - if (!(iss >> std::hex >> coeff)) { - std::cerr << "ERROR: Missing A coeff at index " << i << std::endl; - return 1; - } - a_coeffs.push_back(coeff & 0xFFF); - } - - // Read 256 B coeffs - for (int i = 0; i < 256; i++) { - if (!(iss >> std::hex >> coeff)) { - std::cerr << "ERROR: Missing B coeff at index " << i << std::endl; - return 1; - } - b_coeffs.push_back(coeff & 0xFFF); - } - - // Feed 256 coefficient pairs and collect results - std::vector results; - for (int i = 0; i < 256; i++) { - // Drive inputs - dut->coeff_a_in = a_coeffs[i]; - dut->coeff_b_in = b_coeffs[i]; - dut->valid_i = 1; - - // Posedge: DUT samples input, pipeline_reg captures data, valid_o→1 - posedge(dut); - dut->valid_i = 0; - - // Read result now (valid_o is high, coeff_out is valid) - // Posedge: pipeline_reg clears valid_o (ready_i=1), but result - // is available on coeff_out port (combinational from data_r) - posedge(dut); - - results.push_back(dut->coeff_out & 0xFFF); - - cycle += 2; - if (cycle > TIMEOUT_CYCLES) { - std::cerr << "ERROR: Timeout after " << cycle << " cycles" << std::endl; - return 1; - } - } - - // Print result as one space-separated hex line - printf("RESULT:"); - for (int i = 0; i < 256; i++) { - printf(" %03X", results[i]); - } - printf("\n"); - } - - infile.close(); - delete dut; - return 0; -} diff --git a/sync_rtl/poly_mul/TB/tb_poly_mul.cpp b/sync_rtl/poly_mul/TB/tb_poly_mul.cpp deleted file mode 100644 index 5b3f217..0000000 --- a/sync_rtl/poly_mul/TB/tb_poly_mul.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// tb_poly_mul.cpp - Verilator C++ testbench for poly_mul_sync -// -// Reads test vectors from +VECTOR_FILE= plusarg. -// Format: one line with 512 space-separated hex values: -// A[0] A[1] ... A[255] B[0] B[1] ... B[255] -// Each value is a 3-digit hex (12-bit). -// -// Drives DUT with 256 paired (A,B) coefficients, waits for valid_o, -// then reads 256 output coefficients via valid/ready handshake. -// Prints "RESULT: COEFF0 COEFF1 ... COEFF255\n" to stdout. -// -// Clock: 10ns period. Reset: 2 cycles. - -#include -#include -#include -#include -#include -#include -#include -#include -#include "Vpoly_mul_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 500000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -// Toggle clock: both edges + eval (one full cycle) -static void posedge(Vpoly_mul_sync* dut) { - dut->clk = 1; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = 0; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); -} - -static int hex_char_to_nibble(char c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return 0; -} - -// Parse 3-char hex token to 12-bit value. -static uint16_t hex3_to_val(const std::string& tok) { - uint16_t val = 0; - for (size_t i = 0; i < tok.length() && i < 3; i++) { - val = (val << 4) | hex_char_to_nibble(tok[i]); - } - return val & 0xFFF; -} - -// Format 12-bit value as 3-char hex. -static std::string val_to_hex3(uint16_t val) { - char buf[4]; - snprintf(buf, sizeof(buf), "%03X", val & 0xFFF); - return std::string(buf); -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vpoly_mul_sync* dut = new Vpoly_mul_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->coeff_a_in = 0; - dut->coeff_b_in = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 full cycles - for (int i = 0; i < 2; i++) posedge(dut); - dut->rst_n = 1; - - std::string line; - vluint64_t cycle = 0; - int vec_count = 0; - - while (std::getline(infile, line)) { - if (line.empty() || line[0] == '#') continue; - - // Parse: A[0] A[1] ... A[255] B[0] B[1] ... B[255] - // Total: 512 hex values, one line - std::istringstream iss(line); - std::string tok; - - std::vector input_coeffs(512); - int coeff_idx = 0; - while (iss >> tok && coeff_idx < 512) { - input_coeffs[coeff_idx] = hex3_to_val(tok); - coeff_idx++; - } - if (coeff_idx != 512) { - std::cerr << "ERROR: Expected 512 coefficients, got " << coeff_idx - << " (vec " << vec_count << ")" << std::endl; - continue; - } - - // ---- Load 256 A+B pairs ---- - while (!dut->ready_o) { - posedge(dut); cycle++; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - for (int i = 0; i < 256; i++) { - dut->coeff_a_in = input_coeffs[i]; - dut->coeff_b_in = input_coeffs[256 + i]; - dut->valid_i = 1; - posedge(dut); cycle++; - dut->valid_i = 0; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - - // ---- Wait for valid_o (DUT computing) ---- - dut->ready_i = 1; - while (!dut->valid_o) { - posedge(dut); - cycle++; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - - // ---- Read 256 output coefficients ---- - printf("RESULT: "); - for (int i = 0; i < 256; i++) { - // Wait for valid_o to be asserted (data is valid NOW) - while (!dut->valid_o) { - posedge(dut); - cycle++; - if (cycle > TIMEOUT_CYCLES) goto timeout_err; - } - - // Capture coefficient BEFORE consuming posedge - uint16_t coeff_val = (uint16_t)(dut->coeff_out & 0xFFF); - printf("%s%s", val_to_hex3(coeff_val).c_str(), - (i < 255) ? " " : ""); - - // Consume this coefficient: posedge with ready_i=1 - posedge(dut); - cycle++; - } - printf("\n"); - - vec_count++; - } - - std::cout << "Processed " << vec_count << " vectors" << std::endl; - infile.close(); - delete dut; - return (vec_count > 0) ? 0 : 1; - -timeout_err: - std::cerr << "ERROR: Timeout at cycle " << cycle - << " (vec " << vec_count << ")" << std::endl; - infile.close(); - delete dut; - return 1; -} diff --git a/sync_rtl/rng/TB/tb_rng.cpp b/sync_rtl/rng/TB/tb_rng.cpp deleted file mode 100644 index 0fd41e9..0000000 --- a/sync_rtl/rng/TB/tb_rng.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// tb_rng.cpp - Verilator C++ testbench for rng_sync -// -// Drives valid_i pulses and prints 256-bit LFSR output values. -// Reads a hex input file to determine how many vectors to generate -// (one line per vector, content ignored). -// Prints "RESULT: <64-char hex>" for each output. -// -// Clock: 10ns period. Reset: 2 cycles low. -// Timeout: 100,000 cycles. - -#include -#include -#include -#include -#include "Vrng_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Count non-empty, non-comment lines to determine vector count - int num_vectors = 0; - std::string line; - while (std::getline(infile, line)) { - if (!line.empty() && line[0] != '#') - num_vectors++; - } - infile.close(); - - // Instantiate DUT - Vrng_sync* dut = new Vrng_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 cycles low - for (int i = 0; i < 4; i++) { - dut->clk = 1; main_time += 5; dut->eval(); - dut->clk = 0; main_time += 5; dut->eval(); - } - dut->rst_n = 1; - dut->ready_i = 1; - - // Generate vectors - for (int n = 0; n < num_vectors; n++) { - // Drive valid_i and posedge → LFSR advances, valid_o→1 - dut->valid_i = 1; - dut->clk = 1; main_time += 5; dut->eval(); - dut->clk = 0; main_time += 5; dut->eval(); - dut->valid_i = 0; - - // Posedge to consume → valid_o→0 - dut->clk = 1; main_time += 5; dut->eval(); - // Print 256-bit result (8 × 32-bit words, MSB first) - printf("RESULT: %08X%08X%08X%08X%08X%08X%08X%08X\n", - dut->data_o[7], dut->data_o[6], dut->data_o[5], dut->data_o[4], - dut->data_o[3], dut->data_o[2], dut->data_o[1], dut->data_o[0]); - dut->clk = 0; main_time += 5; dut->eval(); - } - - delete dut; - return 0; -} diff --git a/sync_rtl/sample_cbd/TB/tb_sample_cbd.cpp b/sync_rtl/sample_cbd/TB/tb_sample_cbd.cpp deleted file mode 100644 index 2986a67..0000000 --- a/sync_rtl/sample_cbd/TB/tb_sample_cbd.cpp +++ /dev/null @@ -1,206 +0,0 @@ -// tb_sample_cbd.cpp - Verilator C++ testbench for sample_cbd_sync -// -// Reads test vectors from +VECTOR_FILE= plusarg. -// Format: "SEED_HEX NONCE_HEX ETA" -// SEED_HEX: 64 hex chars (256-bit seed, MSB-first) -// NONCE_HEX: 2 hex chars (8-bit nonce) -// ETA: "2" or "3" (decimal) -// -// Drives DUT with seed, nonce, eta. Waits for valid_o, collects 256 -// coefficients. Prints "RESULT: COEFF_HEX\n" for each coefficient. -// -// Clock: 10ns period. Reset: 2 cycles. -// Timeout: 500000 cycles. - -#include -#include -#include -#include -#include -#include -#include -#include "Vsample_cbd_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 500000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -// Toggle clock: both edges + eval (one full cycle) -static void posedge(Vsample_cbd_sync* dut) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); -} - -static int hex_char_to_nibble(char c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return 0; -} - -// Parse hex string (MSB-first) into 8 x 32-bit words for 256-bit seed. -// Word 0 = bits[31:0], word 7 = bits[255:224]. -// Hex string: leftmost char = most significant nibble (bits 255:252). -static void hex_to_256(const std::string& hex, uint32_t data_words[8]) { - for (int w = 0; w < 8; w++) data_words[w] = 0; - - int len = (int)hex.length(); - int nibble_idx = 0; - for (int i = len - 1; i >= 0; i--) { - char c = hex[i]; - if (c == ' ' || c == '\t') continue; - int nib = hex_char_to_nibble(c); - int word_idx = nibble_idx / 8; - int shift = (nibble_idx % 8) * 4; - if (word_idx < 8) { - data_words[word_idx] |= ((uint32_t)nib << shift); - } - nibble_idx++; - } -} - -// Parse 2-char hex string into an 8-bit value. -// "FF" → 0xFF, "0A" → 0x0A. -static uint8_t hex_to_8(const std::string& hex) { - int val = 0; - for (size_t i = 0; i < hex.length(); i++) { - val = (val << 4) | hex_char_to_nibble(hex[i]); - } - return (uint8_t)(val & 0xFF); -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vsample_cbd_sync* dut = new Vsample_cbd_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - for (int w = 0; w < 8; w++) dut->seed_i[w] = 0; - dut->nonce_i = 0; - dut->eta_i = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 full cycles - for (int i = 0; i < 2; i++) posedge(dut); - dut->rst_n = 1; - - // Consumer always ready - dut->ready_i = 1; - - std::string line; - vluint64_t cycle = 0; - int vec_count = 0; - int total_coeff_count = 0; - - while (std::getline(infile, line)) { - if (line.empty() || line[0] == '#') continue; - - // Parse: SEED_HEX NONCE_HEX ETA - std::istringstream iss(line); - std::string seed_hex, nonce_hex; - int eta_val; - if (!(iss >> seed_hex >> nonce_hex >> eta_val)) continue; - if (seed_hex.length() < 64) continue; - - // Set seed_i (256 bits) - uint32_t seed_words[8]; - hex_to_256(seed_hex, seed_words); - for (int w = 0; w < 8; w++) dut->seed_i[w] = seed_words[w]; - - // Set nonce_i (8 bits) - dut->nonce_i = hex_to_8(nonce_hex); - - // Set eta_i (2'd2 or 2'd3) - dut->eta_i = (eta_val == 3) ? 3 : 2; - - // Assert valid_i for one cycle - dut->valid_i = 1; - posedge(dut); - cycle++; - dut->valid_i = 0; - - // Wait for 256 coefficients - int coeffs_collected = 0; - bool timed_out = false; - - while (coeffs_collected < 256) { - posedge(dut); - cycle++; - - if (cycle > TIMEOUT_CYCLES) { - std::cerr << "ERROR: Timeout waiting for coeffs (vec " - << vec_count << ", got " << coeffs_collected - << "/256)" << std::endl; - timed_out = true; - break; - } - - if (dut->valid_o && dut->ready_i) { - // Read 12-bit coefficient and print - uint32_t coeff = dut->coeff_o & 0xFFF; - printf("RESULT: %03X\n", coeff); - coeffs_collected++; - total_coeff_count++; - } - } - - if (timed_out) { - goto done; - } - - // Wait for DUT to return to IDLE before next vector - int wait_cycles = 0; - while (!dut->ready_o && wait_cycles < 100) { - posedge(dut); - cycle++; - wait_cycles++; - } - - vec_count++; - } - -done: - infile.close(); - delete dut; - - if (vec_count == 0) { - std::cerr << "ERROR: No vectors processed" << std::endl; - return 1; - } - - return 0; -} diff --git a/sync_rtl/sample_ntt/TB/tb_sample_ntt.cpp b/sync_rtl/sample_ntt/TB/tb_sample_ntt.cpp deleted file mode 100644 index 643cb1f..0000000 --- a/sync_rtl/sample_ntt/TB/tb_sample_ntt.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// tb_sample_ntt.cpp - Verilator C++ testbench for sample_ntt_sync -// -// Reads test vectors from +VECTOR_FILE= plusarg. -// Each line: "RHO_HEX K_HEX I_HEX J_HEX" -// RHO_HEX: 64 hex chars (32 bytes, MSB-first per byte pair) -// K_HEX, I_HEX, J_HEX: single hex digits -// -// Drives DUT, waits for 256 coefficients via valid_o handshake, -// prints "RESULT: CCC" for each (12-bit hex). -// -// Clock: 10ns period. Reset: 2 cycles. Timeout: 2,000,000 cycles. - -#include -#include -#include -#include -#include -#include -#include -#include "Vsample_ntt_sync.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 2000000 -#define Q 3329 -#define N_COEFFS 256 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -static void posedge(Vsample_ntt_sync* dut) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); -} - -static int hex_char_to_nibble(char c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return 0; -} - -static void parse_rho(const std::string& hex, Vsample_ntt_sync* dut) { - for (int w = 0; w < 8; w++) dut->rho_i[w] = 0; - - int byte_count = 0; - for (size_t i = 0; i < hex.length() && byte_count < 32; i += 2) { - while (i < hex.length() && (hex[i] == ' ' || hex[i] == '\t')) i++; - if (i + 1 >= hex.length()) break; - - char high_c = hex[i]; - char low_c = hex[i + 1]; - uint8_t byte_val = (hex_char_to_nibble(high_c) << 4) | - hex_char_to_nibble(low_c); - - int word_idx = byte_count / 4; - int byte_off = byte_count % 4; - if (word_idx < 8) { - dut->rho_i[word_idx] |= ((uint32_t)byte_val << (byte_off * 8)); - } - byte_count++; - } -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - Vsample_ntt_sync* dut = new Vsample_ntt_sync; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - for (int i = 0; i < 8; i++) dut->rho_i[i] = 0; - dut->k_i = 0; - dut->i_idx = 0; - dut->j_idx = 0; - dut->valid_i = 0; - dut->ready_i = 0; - - // Reset: 2 full cycles - for (int i = 0; i < 2; i++) posedge(dut); - dut->rst_n = 1; - - dut->ready_i = 1; - - std::string line; - vluint64_t cycle = 0; - int vec_count = 0; - - while (std::getline(infile, line)) { - if (line.empty() || line[0] == '#') continue; - - std::string rho_hex, k_str, i_str, j_str; - std::istringstream iss(line); - if (!(iss >> rho_hex >> k_str >> i_str >> j_str)) { - std::cerr << "ERROR: Malformed input line: " << line << std::endl; - continue; - } - - if (rho_hex.length() < 64) { - std::cerr << "ERROR: RHO_HEX too short" << std::endl; - continue; - } - - int k_val = 0, i_val = 0, j_val = 0; - if (!k_str.empty()) k_val = hex_char_to_nibble(k_str[0]); - if (!i_str.empty()) i_val = hex_char_to_nibble(i_str[0]); - if (!j_str.empty()) j_val = hex_char_to_nibble(j_str[0]); - - // Set inputs - parse_rho(rho_hex, dut); - dut->k_i = k_val & 0x7; - dut->i_idx = i_val & 0x3; - dut->j_idx = j_val & 0x3; - dut->valid_i = 1; - - // Wait for ready_o (DUT must be IDLE) - while (!dut->ready_o && cycle < TIMEOUT_CYCLES) { - posedge(dut); - cycle++; - } - if (cycle >= TIMEOUT_CYCLES) { - std::cerr << "ERROR: Timeout waiting for ready_o (vec " - << vec_count << ")" << std::endl; - goto done; - } - - // Capture edge - posedge(dut); - cycle++; - dut->valid_i = 0; - - // Wait for and print 256 coefficients - int coeff_count = 0; - while (coeff_count < N_COEFFS && cycle < TIMEOUT_CYCLES) { - while (!dut->valid_o && cycle < TIMEOUT_CYCLES) { - posedge(dut); - cycle++; - } - if (cycle >= TIMEOUT_CYCLES) { - std::cerr << "ERROR: Timeout waiting for coeff " - << coeff_count << " (vec " << vec_count << ")" - << std::endl; - goto done; - } - - uint32_t coeff_val = (uint32_t)(dut->coeff_o) & 0xFFF; - printf("RESULT: %03X\n", coeff_val); - - posedge(dut); - cycle++; - coeff_count++; - } - - vec_count++; - } - -done: - infile.close(); - delete dut; - - if (vec_count == 0) { - std::cerr << "ERROR: No vectors processed" << std::endl; - return 1; - } - - return 0; -} diff --git a/sync_rtl/sha3/TB/tb_sha3.cpp b/sync_rtl/sha3/TB/tb_sha3.cpp deleted file mode 100644 index 550c8c2..0000000 --- a/sync_rtl/sha3/TB/tb_sha3.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// tb_sha3.cpp - Verilator C++ testbench for sha3_top -// -// Reads test vectors from +VECTOR_FILE=plusarg. -// Format: "MM DDDD..." (mode hex, then 512-bit message hex) -// MM: "00"=G, "01"=H, "10"=J -// DDDD...: 128 hex chars representing 512-bit data_i -// -// Drives DUT with mode and input, waits for ready_o/valid_o, -// prints "RESULT: OUTPUT_HEX\n" to stdout. -// -// Clock: 10ns period. Reset: 2 cycles. - -#include -#include -#include -#include -#include -#include -#include -#include "Vsha3_top.h" -#include "verilated.h" - -#define CLK_PERIOD_NS 10.0 -#define TIMEOUT_CYCLES 500000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return main_time; -} - -// Toggle clock: both edges + eval (one full cycle) -static void posedge(Vsha3_top* dut) { - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); - dut->clk = !dut->clk; - main_time += (vluint64_t)(CLK_PERIOD_NS / 2.0); - dut->eval(); -} - -static int hex_char_to_nibble(char c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return c - 'A' + 10; - if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return 0; -} - -// Parse a hex string into Verilator WData words (16 x 32-bit = 512 bits). -// Hex string is MSB-first (leftmost hex char = bits 511:508). -// data[0] = bits[31:0], data[15] = bits[511:480]. -static void hex_to_512(const std::string& hex, uint32_t data_words[16]) { - for (int w = 0; w < 16; w++) data_words[w] = 0; - - int len = (int)hex.length(); - // nibble_idx increments for each hex char from RIGHT to LEFT - int nibble_idx = 0; - for (int i = len - 1; i >= 0; i--) { - char c = hex[i]; - if (c == ' ' || c == '\t') continue; - int nib = hex_char_to_nibble(c); - int word_idx = nibble_idx / 8; // 8 nibbles per 32-bit word - int shift = (nibble_idx % 8) * 4; // shift within the word - if (word_idx < 16) { - data_words[word_idx] |= ((uint32_t)nib << shift); - } - nibble_idx++; - } -} - -// Print hash_o as hex (MSB-first). -// data[0] = bits[31:0], data[15] = bits[511:480]. -static void print_hex(uint32_t data_words[16], int bits) { - int full_words = bits / 32; - // Build hex from MSB nibble to LSB nibble - for (int w = full_words - 1; w >= 0; w--) { - uint32_t val = data_words[w]; - for (int j = 28; j >= 0; j -= 4) { - int nib = (int)((val >> j) & 0xF); - printf("%01X", nib); - } - } - printf("\n"); -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - // Parse +VECTOR_FILE= plusarg - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - // Instantiate DUT - Vsha3_top* dut = new Vsha3_top; - - // Initialize - dut->clk = 0; - dut->rst_n = 0; - dut->mode = 0; - for (int w = 0; w < 16; w++) dut->data_i[w] = 0; - dut->valid_i = 0; - dut->ready_i = 0; - // multi-block absorb path disabled for single-block G/H/J tests - dut->mb_en = 0; - dut->mb_valid_i = 0; - dut->mb_last_i = 0; - - // Reset: 2 full cycles - for (int i = 0; i < 2; i++) posedge(dut); - dut->rst_n = 1; - - // Consumer always ready - dut->ready_i = 1; - - std::string line; - vluint64_t cycle = 0; - int vec_count = 0; - - while (std::getline(infile, line)) { - if (line.empty() || line[0] == '#') continue; - - // Parse: MODE_HEX MESSAGE_HEX - std::istringstream iss(line); - std::string mode_str, data_hex; - if (!(iss >> mode_str >> data_hex)) continue; - if (mode_str.length() < 2) continue; - - int mode_val = hex_char_to_nibble(mode_str[1]); - - // Set mode - dut->mode = mode_val & 0x3; - - // Set data_i from hex string - uint32_t data_words[16]; - hex_to_512(data_hex, data_words); - for (int w = 0; w < 16; w++) dut->data_i[w] = data_words[w]; - - // Assert valid_i for one cycle - dut->valid_i = 1; - - // posedge: DUT samples valid_i, starts keccak_core - posedge(dut); - cycle++; - dut->valid_i = 0; - - // Wait for valid_o (keccak_core takes ~25 cycles) - do { - posedge(dut); - cycle++; - if (cycle > TIMEOUT_CYCLES) { - std::cerr << "ERROR: Timeout waiting for valid_o (vec " << vec_count << ")" << std::endl; - goto done; - } - } while (!dut->valid_o); - - // Read hash_o and print - uint32_t hash_words[16]; - for (int w = 0; w < 16; w++) hash_words[w] = dut->hash_o[w]; - - int out_bits = (mode_val == 0) ? 512 : 256; - printf("RESULT: "); - print_hex(hash_words, out_bits); - - // One more cycle for valid_o handshake - posedge(dut); - cycle++; - vec_count++; - } - -done: - infile.close(); - delete dut; - - if (vec_count == 0) { - std::cerr << "ERROR: No vectors processed" << std::endl; - return 1; - } - - return 0; -} diff --git a/sync_rtl/storage/TB/tb_storage.cpp b/sync_rtl/storage/TB/tb_storage.cpp deleted file mode 100644 index 4304e01..0000000 --- a/sync_rtl/storage/TB/tb_storage.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// tb_storage.cpp - Verilator C++ testbench for storage (sd_bram top) -// -// Reads test vectors from +VECTOR_FILE= hex file. -// Format: "ADDR DATA" per line (addr in 2-char hex, data in 12-char hex). -// Writes values via sd_bram, reads back, prints "RESULT: VAL_HEX". -// s_bram is compiled as rtl_dep. -// -// Clock: 10ns period. W=48, D=64, A=6 (default sd_bram parameters). - -#include -#include -#include -#include -#include -#include -#include "Vsd_bram.h" -#include "verilated.h" - -#define CLK_HALF_PS 5000 - -static vluint64_t main_time = 0; - -double sc_time_stamp() { - return (double)main_time / 1000.0; -} - -static void tick(Vsd_bram* dut) { - dut->clk = 1; - main_time += CLK_HALF_PS; - dut->eval(); - dut->clk = 0; - main_time += CLK_HALF_PS; - dut->eval(); -} - -int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - - const char* vector_file = NULL; - for (int i = 1; i < argc; i++) { - std::string arg(argv[i]); - if (arg.rfind("+VECTOR_FILE=", 0) == 0) { - vector_file = argv[i] + 13; - break; - } - } - - if (!vector_file) { - std::cerr << "ERROR: +VECTOR_FILE= not specified" << std::endl; - return 1; - } - - std::ifstream infile(vector_file); - if (!infile.is_open()) { - std::cerr << "ERROR: Cannot open vector file: " << vector_file << std::endl; - return 1; - } - - struct Vec { int addr; uint64_t data; }; - std::vector vectors; - - std::string line; - while (std::getline(infile, line)) { - if (line.empty() || line[0] == '#') continue; - std::istringstream iss(line); - int a; - uint64_t d; - if (!(iss >> std::hex >> a >> d)) continue; - if (a < 0 || a > 63) continue; - vectors.push_back({a, d & 0xFFFFFFFFFFFFULL}); - } - infile.close(); - - if (vectors.empty()) { - std::cerr << "ERROR: No valid vectors in file" << std::endl; - return 1; - } - - Vsd_bram* dut = new Vsd_bram; - - dut->clk = 0; - dut->rd_addr = 0; - dut->wr_en = 0; - dut->wr_addr = 0; - dut->wr_data = 0; - dut->eval(); - main_time += CLK_HALF_PS; - dut->eval(); - - // --- WRITE PHASE --- - for (size_t i = 0; i < vectors.size(); i++) { - dut->wr_en = 1; - dut->wr_addr = vectors[i].addr & 0x3F; - dut->wr_data = vectors[i].data & 0xFFFFFFFFFFFFULL; - tick(dut); - } - dut->wr_en = 0; - dut->wr_addr = 0; - dut->wr_data = 0; - tick(dut); - - // --- READ PHASE --- - for (size_t i = 0; i < vectors.size(); i++) { - dut->rd_addr = vectors[i].addr & 0x3F; - tick(dut); - printf("RESULT: %012lX\n", (unsigned long)(dut->rd_data & 0xFFFFFFFFFFFFULL)); - } - - delete dut; - return 0; -} diff --git a/test_framework/config.json b/test_framework/config.json deleted file mode 100644 index b0e0628..0000000 --- a/test_framework/config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "verilator": { - "path": "verilator", - "compile_args": ["-Wall", "--cc", "--build", "--timing", "--exe"] - }, - "clock_period_ns": 10.0, - "timeout_cycles": 100000, - "rtl_root": "sync_rtl", - "vector_root": "test_framework/modules/{module}/vectors", - "report_root": "test_framework/reports", - "keep_vectors": false -} diff --git a/test_framework/lib/__init__.py b/test_framework/lib/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test_framework/lib/reporter.py b/test_framework/lib/reporter.py deleted file mode 100644 index 850d34d..0000000 --- a/test_framework/lib/reporter.py +++ /dev/null @@ -1,130 +0,0 @@ -"""reporter.py - Formats and displays test results.""" - -import os -import time -from datetime import datetime - - -class Reporter: - """Formats test results for terminal and HTML output.""" - - # ANSI color codes - GREEN = '\033[92m' - RED = '\033[91m' - YELLOW = '\033[93m' - CYAN = '\033[96m' - RESET = '\033[0m' - BOLD = '\033[1m' - - def __init__(self, report_dir: str = 'test_framework/reports'): - self.report_dir = report_dir - os.makedirs(report_dir, exist_ok=True) - - def print_summary(self, results: dict, total_elapsed: float = 0.0) -> bool: - """Print formatted test summary to terminal. - - Args: - results: Dict of module_name -> module_results. - total_elapsed: Total elapsed time in seconds. - - Returns: - bool: True if all tests passed. - """ - total_pass = 0 - total_fail = 0 - all_pass = True - - print() - print(f"{self.BOLD}{'='*60}{self.RESET}") - print(f"{self.BOLD} TEST RESULTS{self.RESET}") - print(f"{self.BOLD}{'='*60}{self.RESET}") - - for module_name, module_result in results.items(): - status = module_result.get('status', 'UNKNOWN') - num_pass = module_result.get('pass', 0) - num_fail = module_result.get('fail', 0) - elapsed = module_result.get('elapsed', 0.0) - total_pass += num_pass - total_fail += num_fail - - if status == 'PASS': - color = self.GREEN - icon = '✓' - elif status == 'FAIL': - color = self.RED - icon = '✗' - all_pass = False - else: - color = self.YELLOW - icon = '?' - all_pass = False - - print(f" {color}{icon} {module_name}{self.RESET}: " - f"{num_pass} pass, {num_fail} fail, " - f"{elapsed:.2f}s") - - print(f"{self.BOLD}{'='*60}{self.RESET}") - total = total_pass + total_fail - if all_pass: - print(f" {self.GREEN}{self.BOLD}ALL TESTS PASSED{self.RESET} " - f"({total_pass}/{total} vectors, {total_elapsed:.2f}s)") - else: - print(f" {self.RED}{self.BOLD}SOME TESTS FAILED{self.RESET} " - f"({total_pass}/{total} pass, {total_fail}/{total} fail, " - f"{total_elapsed:.2f}s)") - print() - - # Write HTML report - self._write_html_report(results, total_elapsed) - return all_pass - - def _write_html_report(self, results: dict, total_elapsed: float) -> None: - """Write an HTML test report.""" - timestamp = datetime.now().strftime('%Y%m%d_%H%M%S') - report_path = os.path.join(self.report_dir, f'report_{timestamp}.html') - - total_pass = sum(r.get('pass', 0) for r in results.values()) - total_fail = sum(r.get('fail', 0) for r in results.values()) - all_pass = total_fail == 0 - - rows = '' - for module_name, module_result in results.items(): - status = module_result.get('status', 'UNKNOWN') - color = '#4CAF50' if status == 'PASS' else '#F44336' - rows += f''' - - {module_name} - {status} - {module_result.get('pass', 0)} - {module_result.get('fail', 0)} - {module_result.get('elapsed', 0):.2f}s - ''' - - html = f''' - - - ML-KEM Test Report - - - -

{'ALL TESTS PASSED' if all_pass else 'SOME TESTS FAILED'}

-

Generated: {timestamp}
- Total: {total_pass + total_fail} vectors ({total_pass} pass, {total_fail} fail)
- Elapsed: {total_elapsed:.2f}s

- - - {rows} -
ModuleStatusPassFailTime
- -''' - - with open(report_path, 'w') as f: - f.write(html) - print(f" Report saved to: {report_path}") diff --git a/test_framework/lib/result_checker.py b/test_framework/lib/result_checker.py deleted file mode 100644 index 931cb91..0000000 --- a/test_framework/lib/result_checker.py +++ /dev/null @@ -1,45 +0,0 @@ -"""result_checker.py - Compares simulation output against expected values.""" - - -def check_results(got: list[str], expected_file: str) -> tuple[int, int]: - """Compare Verilator output against expected values. - - Args: - got: List of result strings from simulation (hex values). - expected_file: Path to file containing expected hex values, one per line. - - Returns: - tuple[int, int]: (num_pass, num_fail). - """ - # Read expected values - expected = [] - try: - with open(expected_file, 'r') as f: - for line in f: - line = line.strip() - if line and not line.startswith('#'): - expected.append(line) - except FileNotFoundError: - print(f"[ERROR] Expected file not found: {expected_file}") - return (0, len(got)) - - num_pass = 0 - num_fail = 0 - - max_len = max(len(got), len(expected)) - - for i in range(max_len): - got_val = got[i].upper() if i < len(got) else 'MISSING' - exp_val = expected[i].upper() if i < len(expected) else 'MISSING' - - if got_val == exp_val: - num_pass += 1 - else: - num_fail += 1 - if num_fail <= 5: # Only show first 5 failures - print(f" MISMATCH[{i}]: got={got_val}, expected={exp_val}") - - if num_fail > 5: - print(f" ... and {num_fail - 5} more mismatches") - - return (num_pass, num_fail) diff --git a/test_framework/lib/sim_controller.py b/test_framework/lib/sim_controller.py deleted file mode 100644 index a85ce59..0000000 --- a/test_framework/lib/sim_controller.py +++ /dev/null @@ -1,134 +0,0 @@ -"""sim_controller.py - Verilator simulation controller. - -Handles Verilator compilation and execution of RTL testbenches. -""" - -import subprocess -import os -import time - - -class SimController: - """Controls Verilator compilation and simulation.""" - - def __init__(self, config: dict): - """Initialize with test framework configuration. - - Args: - config: The loaded config.json dict. - """ - self.config = config - self.verilator_path = config.get('verilator', {}).get('path', 'verilator') - self.compile_args = config.get('verilator', {}).get('compile_args', []) - - def compile(self, top_module: str, rtl_files: list[str], tb_cpp: str, - work_dir: str, inc_dirs: list[str] = None) -> str: - """Compile RTL with Verilator and return path to executable. - - Args: - top_module: Name of the top-level Verilog module. - rtl_files: List of Verilog source file paths. - tb_cpp: Path to C++ testbench file. - work_dir: Working directory for compilation output (-Mdir). - inc_dirs: List of include directories for `include directives. - - Returns: - Path to the compiled executable. - - Raises: - RuntimeError: If Verilator is not found or compilation fails. - """ - os.makedirs(work_dir, exist_ok=True) - - # Build verilator command - cmd = [self.verilator_path] - cmd.extend(self.compile_args) - cmd.extend(['--top-module', top_module]) - # No explicit -std= flag; let Verilator use its default (C++14+) - if inc_dirs: - for d in inc_dirs: - cmd.append(f'+incdir+{d}') - cmd.extend(rtl_files) - cmd.append(tb_cpp) - cmd.extend(['-Mdir', work_dir]) - - try: - result = subprocess.run( - cmd, - capture_output=True, - text=True, - timeout=120, - cwd=os.getcwd() - ) - except subprocess.TimeoutExpired: - raise RuntimeError("Verilator compilation timed out.") - except FileNotFoundError: - raise RuntimeError( - f"Verilator not found at '{self.verilator_path}'." - ) - - if result.returncode != 0: - tail = result.stderr[-800:] if result.stderr else '(no stderr)' - raise RuntimeError(f"Verilator compilation failed:\n{tail}") - - # Executable is at /V - executable = os.path.join(work_dir, f'V{top_module}') - if not os.path.exists(executable): - raise RuntimeError( - f"Compilation succeeded but executable not found: {executable}" - ) - return executable - - def run(self, executable: str, vector_file: str, - timeout_s: int = 30) -> dict: - """Run the compiled simulation executable. - - Args: - executable: Path to the compiled executable. - vector_file: Path to the hex vector file. - timeout_s: Timeout in seconds. - - Returns: - dict with keys: success, results, elapsed, stderr. - """ - if not os.path.exists(executable): - return { - 'success': False, - 'results': [], - 'elapsed': 0.0, - 'stderr': f'Executable not found: {executable}' - } - - start_time = time.time() - try: - result = subprocess.run( - [executable, f'+VECTOR_FILE={vector_file}'], - capture_output=True, - text=True, - timeout=timeout_s - ) - elapsed = time.time() - start_time - - # Parse stdout for "RESULT: XXX" lines - results = [] - for line in result.stdout.splitlines(): - line = line.strip() - if line.startswith('RESULT:'): - hex_val = line.split(':', 1)[1].strip() - results.append(hex_val) - - success = result.returncode == 0 and len(results) > 0 - return { - 'success': success, - 'results': results, - 'elapsed': elapsed, - 'stderr': result.stderr - } - except subprocess.TimeoutExpired: - elapsed = time.time() - start_time - return { - 'success': False, - 'results': [], - 'elapsed': elapsed, - 'stderr': 'Simulation timed out.' - } diff --git a/test_framework/lib/test_runner.py b/test_framework/lib/test_runner.py deleted file mode 100644 index 1337820..0000000 --- a/test_framework/lib/test_runner.py +++ /dev/null @@ -1,243 +0,0 @@ -"""test_runner.py - Main test engine. - -Discovers modules, loads test plans, generates vectors, runs simulations, -and collects results. -""" - -import os -import json -import time -import importlib.util -import sys -from pathlib import Path - -from .sim_controller import SimController -from .result_checker import check_results - - -class TestRunner: - """Main test engine for the ML-KEM RTL test framework.""" - - def __init__(self, config_path: str = 'test_framework/config.json'): - """Initialize with configuration. - - Args: - config_path: Path to config.json. - """ - self.project_root = os.path.dirname(os.path.dirname( - os.path.dirname(os.path.abspath(__file__)))) - self.config_path = os.path.join(self.project_root, config_path) - with open(self.config_path) as f: - self.config = json.load(f) - self.sim = SimController(self.config) - self.modules_dir = os.path.join(self.project_root, - 'test_framework', 'modules') - self.rtl_root = os.path.join(self.project_root, - self.config.get('rtl_root', 'sync_rtl')) - - def discover_modules(self) -> dict[str, dict]: - """Scan test_framework/modules/*/test_plan.json and return plans. - - Returns: - dict of module_name -> test_plan. - """ - modules = {} - if not os.path.isdir(self.modules_dir): - return modules - - for entry in os.listdir(self.modules_dir): - mod_dir = os.path.join(self.modules_dir, entry) - plan_path = os.path.join(mod_dir, 'test_plan.json') - if os.path.isdir(mod_dir) and os.path.exists(plan_path): - with open(plan_path) as f: - plan = json.load(f) - modules[entry] = plan - return modules - - def _get_rtl_files(self, plan: dict) -> list[str]: - """Resolve RTL source file paths from a test plan. - - Args: - plan: Test plan dict with 'rtl_top' and optional 'rtl_deps'. - - Returns: - List of absolute paths: deps first, then top. - """ - rtl_top = os.path.join(self.project_root, plan['rtl_top']) - rtl_deps = [os.path.join(self.project_root, d) - for d in plan.get('rtl_deps', [])] - return rtl_deps + [rtl_top] - - def run_module(self, module_name: str, quick: bool = False, - single_case: str = None) -> dict: - """Run all test cases for a module. - - Args: - module_name: Name of the module to test. - quick: If True, reduce vector count for faster testing. - single_case: If set, only run this case ID. - - Returns: - dict with keys: pass, fail, cases, elapsed, status. - """ - modules = self.discover_modules() - if module_name not in modules: - return { - 'pass': 0, 'fail': 0, 'cases': {}, - 'elapsed': 0.0, 'status': 'NOT_FOUND', - 'error': f'Module "{module_name}" not found' - } - - plan = modules[module_name] - mod_dir = os.path.join(self.modules_dir, module_name) - vectors_dir = os.path.join(mod_dir, 'vectors') - work_dir = os.path.join(mod_dir, 'obj_dir') - os.makedirs(vectors_dir, exist_ok=True) - - # Import module's gen_vectors.py - gen_path = os.path.join(mod_dir, 'gen_vectors.py') - if not os.path.exists(gen_path): - return { - 'pass': 0, 'fail': 0, 'cases': {}, - 'elapsed': 0.0, 'status': 'ERROR', - 'error': f'gen_vectors.py not found for {module_name}' - } - - spec = importlib.util.spec_from_file_location( - f'{module_name}_gen', gen_path) - gen_module = importlib.util.module_from_spec(spec) - sys.modules[f'{module_name}_gen'] = gen_module - spec.loader.exec_module(gen_module) - - # Find generator class - generator = None - for name in dir(gen_module): - obj = getattr(gen_module, name) - if (isinstance(obj, type) and - hasattr(obj, 'generate_one') and - hasattr(obj, 'write_hex_file') and - name != 'VectorGenerator'): - generator = obj() - break - - if generator is None: - return { - 'pass': 0, 'fail': 0, 'cases': {}, - 'elapsed': 0.0, 'status': 'ERROR', - 'error': f'No generator class found in {gen_path}' - } - - # Resolve RTL files and top module name - rtl_files = self._get_rtl_files(plan) - tb_cpp = os.path.join(self.project_root, plan['tb_cpp']) - - # Top module name derived from rtl_top filename (strip .v) - top_module = os.path.basename(plan['rtl_top']).replace('.v', '') - - # Compile once for the module - print(f"\n Compiling {module_name} with Verilator...") - start_time = time.time() - - try: - executable = self.sim.compile( - top_module=top_module, - rtl_files=rtl_files, - tb_cpp=tb_cpp, - work_dir=work_dir, - inc_dirs=[self.project_root] - ) - except RuntimeError as e: - return { - 'pass': 0, 'fail': 0, 'cases': {}, - 'elapsed': time.time() - start_time, - 'status': 'COMPILE_ERROR', - 'error': str(e) - } - - case_results = {} - total_pass = 0 - total_fail = 0 - - for case in plan.get('cases', []): - case_id = case['id'] - - # Filter by single case - if single_case and case_id != single_case: - continue - - num_vectors = case.get('num_vectors', 10) - if quick: - num_vectors = max(1, num_vectors // 5) - - params = case.get('params', {}) - print(f" Case [{case_id}]: {case.get('description', '')} " - f"({num_vectors} vectors)") - - # Generate vectors - vectors = [] - for i in range(num_vectors): - vec = generator.generate_one(params) - vectors.append(vec) - - # Write input vectors hex file - input_file = os.path.join(vectors_dir, f'{case_id}_input.hex') - generator.write_hex_file(vectors, input_file) - - # Write expected output hex file - expected_file = os.path.join(vectors_dir, f'{case_id}_expected.hex') - generator.write_expected_file(vectors, expected_file) - - # Run simulation - timeout_s = plan.get('timeout_s', 30) - run_result = self.sim.run(executable, input_file, timeout_s) - - if not run_result['success']: - case_results[case_id] = { - 'pass': 0, 'fail': num_vectors, - 'elapsed': run_result['elapsed'], - 'error': run_result.get('stderr', 'Simulation failed') - } - total_fail += num_vectors - continue - - # Compare results - tolerance = case.get('tolerance', 'bit_exact') - if tolerance == 'bit_exact': - num_pass, num_fail = check_results( - run_result['results'], expected_file) - else: - # Delegate to generator for custom comparison - if hasattr(generator, 'compare_results'): - compare_ok = generator.compare_results( - run_result['results'], expected_file) - num_pass = num_vectors if compare_ok else 0 - num_fail = 0 if compare_ok else num_vectors - else: - num_pass, num_fail = check_results( - run_result['results'], expected_file) - - case_results[case_id] = { - 'pass': num_pass, - 'fail': num_fail, - 'elapsed': run_result['elapsed'] - } - total_pass += num_pass - total_fail += num_fail - - # Clean up vectors unless keep_vectors is true - if not self.config.get('keep_vectors', False): - try: - os.remove(input_file) - os.remove(expected_file) - except OSError: - pass - - elapsed = time.time() - start_time - - return { - 'pass': total_pass, - 'fail': total_fail, - 'cases': case_results, - 'elapsed': elapsed, - 'status': 'PASS' if total_fail == 0 else 'FAIL' - } diff --git a/test_framework/lib/vector_gen.py b/test_framework/lib/vector_gen.py deleted file mode 100644 index 881522d..0000000 --- a/test_framework/lib/vector_gen.py +++ /dev/null @@ -1,61 +0,0 @@ -"""vector_gen.py - Base class for vector generators. - -Each module provides a gen_vectors.py that subclasses VectorGenerator. -The generate_one() method is abstract and must be overridden. -The write_hex_file() method writes vectors as hex-formatted files. -""" - -import os -from abc import ABC, abstractmethod - - -class VectorGenerator(ABC): - """Base class for test vector generators.""" - - @abstractmethod - def generate_one(self, params: dict) -> dict: - """Generate a single test vector. - - Args: - params: Module-specific parameters for vector generation. - - Returns: - dict with 'input' and 'expected' keys, each containing a dict - of signal_name -> value. - """ - ... - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write vectors to a hex file. - - Subclasses should override this to match their module's input format. - Default: writes each vector on one line, hex values separated by spaces. - - Args: - vectors: List of result dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - # Default: write input values as space-separated hex - inputs = v.get('input', {}) - hex_vals = [format(val, 'X') for val in inputs.values()] - f.write(' '.join(hex_vals) + '\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected results to a hex file. - - Subclasses should override this to match their module's expected format. - Default: writes each expected value on one line. - - Args: - vectors: List of result dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - expected = v.get('expected', {}) - hex_vals = [format(val, 'X') for val in expected.values()] - f.write(' '.join(hex_vals) + '\n') diff --git a/test_framework/modules/comp_decomp/gen_vectors.py b/test_framework/modules/comp_decomp/gen_vectors.py deleted file mode 100644 index 0affd77..0000000 --- a/test_framework/modules/comp_decomp/gen_vectors.py +++ /dev/null @@ -1,119 +0,0 @@ -"""gen_vectors.py - Test vector generator for comp_decomp module. - -Generates (mode, d, coeff) input tuples and computes expected -compress/decompress results matching the Python reference implementation. -Uses round-half-up (round(2.5)=3, round(3.5)=4). -""" - -import os -import random -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -from vector_gen import VectorGenerator - -Q = 3329 # ML-KEM prime modulus - - -def round_customize(a: float) -> int: - """Round-half-up: round(2.5)=3, round(3.5)=4. - - Matches the reference implementation in de_compress.py. - """ - tmp = int(a) + 0.5 - if a >= tmp: - return int(a) + 1 - else: - return int(a) - - -def compress(z_q: int, q: int, d: int) -> int: - """Compress coefficient: round((2^d / q) * z_q) mod 2^d.""" - _2d = 2 ** d - return round_customize((_2d / q) * z_q) % _2d - - -def decompress(z_d: int, q: int, d: int) -> int: - """Decompress coefficient: round((q / 2^d) * z_d).""" - _2d = 2 ** d - return round_customize((q / _2d) * z_d) - - -class CompDecompVectorGenerator(VectorGenerator): - """Generates test vectors for the comp_decomp_sync module.""" - - def generate_one(self, params: dict) -> dict: - """Generate a single (mode, d, coeff) test vector. - - Args: - params: dict with 'mode' ('compress'/'decompress') and 'd' (int). - - Returns: - dict with 'input' and 'expected' keys. - """ - mode = params.get('mode', 'compress') - d = params.get('d', 10) - - if mode == 'compress': - coeff = random.randint(0, Q - 1) - result = compress(coeff, Q, d) - else: - coeff = random.randint(0, (2 ** d) - 1) - result = decompress(coeff, Q, d) - - return { - 'input': {'mode': mode, 'd': d, 'coeff': coeff}, - 'expected': {'result': result} - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as 'MODE D COEFF' format. - - MODE: 'C' for compress, 'D' for decompress. - D and COEFF are hex-encoded. - - Example: 'C A 3FF' for compress with d=10, coeff=0x3FF. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - inp = v['input'] - mode_char = 'C' if inp['mode'] == 'compress' else 'D' - d_val = inp['d'] - coeff_val = inp['coeff'] - f.write(f'{mode_char} {d_val:X} {coeff_val:03X}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected output as zero-padded 3-digit hex values. - - One value per line matching the %03X format in the testbench. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - result = v['expected']['result'] - f.write(f'{result:03X}\n') - - def compare_results(self, got: list[str], expected_file: str) -> bool: - """Compare RTL output against expected values. - - Args: - got: List of hex result strings from simulation. - expected_file: Path to expected hex file. - - Returns: - bool: True if all results match. - """ - with open(expected_file, 'r') as f: - expected = [line.strip() for line in f - if line.strip() and not line.startswith('#')] - - if len(got) != len(expected): - return False - - for i, (g, e) in enumerate(zip(got, expected)): - if g.upper() != e.upper(): - return False - - return True diff --git a/test_framework/modules/comp_decomp/test_plan.json b/test_framework/modules/comp_decomp/test_plan.json deleted file mode 100644 index c74f167..0000000 --- a/test_framework/modules/comp_decomp/test_plan.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "module": "comp_decomp", - "rtl_top": "sync_rtl/comp_decomp/comp_decomp_sync.v", - "rtl_deps": ["sync_rtl/common/pipeline_reg.v"], - "tb_cpp": "sync_rtl/comp_decomp/TB/tb_comp_decomp.cpp", - "simulator": "verilator", - "timeout_s": 30, - "cases": [ - { - "id": "compress_du10", - "description": "Compress with du=10 (ML-KEM-512/768)", - "params": {"mode": "compress", "d": 10}, - "num_vectors": 20, - "tolerance": "bit_exact" - }, - { - "id": "compress_dv4", - "description": "Compress with dv=4 (ML-KEM-512/768)", - "params": {"mode": "compress", "d": 4}, - "num_vectors": 20, - "tolerance": "bit_exact" - }, - { - "id": "decompress_du10", - "description": "Decompress with du=10", - "params": {"mode": "decompress", "d": 10}, - "num_vectors": 10, - "tolerance": "bit_exact" - }, - { - "id": "decompress_dv4", - "description": "Decompress with dv=4", - "params": {"mode": "decompress", "d": 4}, - "num_vectors": 10, - "tolerance": "bit_exact" - }, - { - "id": "compress_du11", - "description": "Compress with du=11 (ML-KEM-1024)", - "params": {"mode": "compress", "d": 11}, - "num_vectors": 20, - "tolerance": "bit_exact" - }, - { - "id": "compress_dv5", - "description": "Compress with dv=5 (ML-KEM-1024)", - "params": {"mode": "compress", "d": 5}, - "num_vectors": 20, - "tolerance": "bit_exact" - }, - { - "id": "decompress_du11", - "description": "Decompress with du=11 (ML-KEM-1024)", - "params": {"mode": "decompress", "d": 11}, - "num_vectors": 10, - "tolerance": "bit_exact" - }, - { - "id": "decompress_dv5", - "description": "Decompress with dv=5 (ML-KEM-1024)", - "params": {"mode": "decompress", "d": 5}, - "num_vectors": 10, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_0_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_Ahat_0_0.hex deleted file mode 100644 index 26b0006..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_0_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -8d8 -a49 -3b7 -05e -179 -1bb -945 -5d2 -868 -700 -133 -61f -214 -142 -3ad -cb4 -354 -8cc -507 -c94 -c2b -9b7 -32e -25b -1c5 -4bb -01c -2bf -819 -4fd -cd9 -c29 -13e -cf0 -46c -6e1 -9fa -3cf -9f8 -1d9 -b0b -5be -7e0 -195 -1c8 -b3e -bfd -0ff -cb7 -195 -c74 -509 -42d -191 -9a0 -088 -8f6 -810 -528 -487 -684 -099 -66f -0fa -367 -579 -524 -a5c -4fb -121 -194 -7d4 -3ad -c78 -209 -411 -684 -8bd -721 -aa1 -c03 -226 -82c -21d -1a0 -428 -bbe -3d8 -53e -087 -cc9 -9b8 -ca7 -5fa -367 -0ba -06c -b71 -5c3 -28c -11f -710 -189 -928 -aa4 -6ac -366 -8e5 -519 -197 -36d -7d4 -261 -03c -a50 -038 -089 -156 -71f -48d -80a -7b0 -be5 -6c3 -8a8 -1a2 -b18 -213 -197 -726 -03f -4a6 -b0e -41f -412 -85b -341 -6b9 -059 -7a2 -4d7 -5c3 -ad3 -5f5 -7b3 -4eb -b7e -5df -886 -923 -138 -0a2 -979 -6cb -651 -1cb -984 -7be -b1b -281 -0db -50c -01e -2bf -071 -631 -44a -3fa -2d7 -120 -66f -36d -aec -200 -b41 -93d -b4d -819 -504 -b22 -9da -760 -c49 -0f6 -70b -95e -68b -1db -913 -af4 -20b -3e8 -c38 -26d -225 -34d -aa1 -be2 -553 -1fe -609 -1d7 -331 -be0 -959 -7ec -621 -355 -0ff -55a -3ba -2a8 -7d4 -43d -1c5 -54d -2a9 -5e7 -950 -7ab -643 -68e -689 -510 -212 -b24 -5e9 -2eb -a92 -036 -5aa -771 -a8a -318 -550 -8e6 -030 -269 -199 -15f -3f7 -036 -193 -0bc -67e -648 -289 -c87 -b89 -3a3 -312 -97d -03c -4a4 -aaf -b2d diff --git a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_0_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_Ahat_0_1.hex deleted file mode 100644 index e34edb9..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_0_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -58e -c5e -6e0 -299 -5d2 -98f -925 -54c -1ab -afb -6be -452 -a87 -5e1 -598 -68e -7e8 -170 -3da -a5c -552 -c0f -443 -343 -c2c -792 -c03 -24e -3c3 -461 -5aa -c47 -64e -743 -85e -7f5 -b63 -315 -730 -b06 -8e2 -ae0 -4bb -9f8 -b20 -2a4 -1b9 -876 -abf -33e -80c -898 -a87 -143 -86e -5d6 -39d -358 -649 -810 -64f -169 -5bc -046 -0d4 -4f0 -cef -8da -c5e -49c -c49 -8e0 -c4b -596 -259 -3a5 -a92 -234 -153 -cf1 -36a -138 -8c2 -89d -2fb -00a -823 -007 -3d7 -acc -667 -cd4 -a75 -cd4 -aa9 -97c -42e -649 -8b0 -122 -4dd -61d -813 -41a -4d9 -0ac -72a -b8f -9ea -41d -01f -787 -518 -2b2 -aac -c31 -2a9 -4c4 -a50 -53f -a6c -5f5 -8c8 -13c -697 -0eb -1f7 -637 -a44 -b3e -1d3 -b69 -8f0 -816 -7b1 -af8 -8cf -238 -a2b -129 -0cf -454 -2c1 -684 -ad9 -9c8 -289 -39c -921 -655 -c00 -a64 -26f -c67 -367 -07e -7ea -316 -304 -b95 -11c -9a7 -83d -644 -9d2 -65d -cb6 -3c2 -2a2 -a81 -120 -9c8 -0ff -7ad -286 -5f2 -0b3 -b6b -6a0 -14a -b10 -72f -bfc -39e -5b8 -5dd -029 -4e7 -6e9 -c55 -7ae -be1 -b11 -60c -3b7 -036 -aa7 -26f -2ab -cf8 -125 -601 -50c -8d9 -8e8 -63a -b8e -bb8 -891 -466 -513 -2e2 -ae5 -4cc -2c9 -7cd -3c5 -4f6 -590 -98c -cd0 -456 -9c8 -2c2 -3ae -10b -cf8 -582 -4fd -40f -82a -a5a -762 -43e -203 -2aa -c3f -645 -051 -290 -811 -6b4 -09c -c81 -51b -789 -2ed -aec -215 -b3a -240 -1b4 -2cc -7ec -9fc -72d diff --git a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_1_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_Ahat_1_0.hex deleted file mode 100644 index f887d68..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_1_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -3e9 -88b -8a2 -2a9 -92c -5b8 -6ab -0ae -961 -a7b -970 -33a -aa6 -7f8 -c83 -030 -26d -594 -a50 -469 -619 -c75 -b92 -7ee -907 -1c3 -97c -c58 -8b8 -b2f -7b2 -4f7 -394 -021 -b94 -a37 -6f7 -397 -a07 -8c4 -cc1 -a41 -a21 -97f -8c9 -955 -571 -8ef -545 -185 -706 -80a -9fd -329 -5c6 -7b5 -357 -cdd -a62 -c25 -5d0 -375 -663 -93c -111 -ab5 -0d4 -42e -54b -462 -8fb -4eb -c21 -6ca -cb0 -b79 -80e -092 -399 -a56 -55f -390 -130 -54f -174 -c4b -4f1 -32b -032 -18a -8e6 -1bd -1f3 -165 -2a4 -571 -3b8 -408 -2a2 -9b0 -336 -465 -4c7 -833 -a09 -10b -14c -730 -03f -2bf -123 -c4b -064 -187 -c4b -9f3 -21d -3f5 -29c -6d6 -b10 -63d -3a2 -1cf -0df -bb0 -392 -2e3 -bbd -b3c -19d -8bd -88d -688 -0dc -613 -46b -3c4 -523 -bc6 -9e2 -480 -8b5 -7c0 -0ae -8e0 -177 -186 -5ff -539 -932 -bb9 -9cd -2df -7b3 -237 -5d3 -9ff -a88 -a62 -60f -c24 -a3d -457 -c16 -ce6 -ad0 -62a -089 -747 -c7f -8ea -2c3 -042 -6fa -cad -5ae -7fa -858 -93b -7d5 -b34 -17c -804 -9e0 -229 -847 -794 -000 -47d -684 -54a -a75 -a38 -261 -c8e -a8e -898 -3fd -1cc -ad3 -142 -3d6 -115 -4d8 -58f -864 -2f5 -922 -049 -799 -b7a -95a -419 -1d1 -0f3 -74d -86f -898 -654 -834 -91d -405 -310 -6d2 -a2c -8b7 -36b -4f6 -132 -cc3 -c1a -61b -b79 -75d -406 -3ad -2d8 -a0b -c79 -510 -a06 -060 -9e2 -4b3 -466 -c7d -9c9 -094 -964 -566 -1e2 -825 -380 -687 -cf3 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_1_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_Ahat_1_1.hex deleted file mode 100644 index c175cb9..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_Ahat_1_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -b6b -cd0 -c24 -19b -ae4 -759 -c5e -055 -c64 -922 -2a8 -1ec -73b -8c4 -9e9 -734 -c65 -216 -7f4 -6e0 -baa -6b3 -9f0 -2f4 -161 -9bb -1e4 -163 -b81 -060 -b5d -598 -073 -4d5 -6dd -4f4 -611 -69d -740 -b3d -79f -1e2 -519 -055 -7a0 -42c -02f -96a -b5c -3cf -068 -772 -267 -8da -926 -8cf -170 -1ba -852 -90a -0b8 -31f -033 -6f3 -329 -3fe -71d -00c -2a1 -b0e -410 -099 -4e9 -0b4 -356 -27e -2b9 -5b1 -60f -cb2 -089 -44c -b47 -930 -653 -5d1 -312 -1c2 -340 -b5b -af3 -ba7 -626 -83d -a16 -898 -bdd -bd0 -91f -b3d -784 -38f -8ec -32c -c85 -7ed -916 -00d -4ed -4ca -33d -7f5 -4c5 -5ab -a43 -ae8 -ad9 -76c -ba9 -8a2 -05b -809 -924 -77d -4c7 -bfd -299 -29a -02a -71e -12f -b83 -4f6 -bfe -82e -c82 -1fc -130 -454 -8e9 -846 -290 -c7d -ab7 -7c7 -458 -41a -a36 -bfe -5db -caa -784 -867 -70f -62b -176 -48e -4c5 -27e -5a9 -586 -a90 -627 -b76 -2f5 -011 -4b2 -919 -925 -646 -215 -52f -7d1 -ce4 -c8a -bd0 -38d -0bc -70c -988 -6b5 -939 -a7b -482 -176 -b20 -94b -046 -990 -cd6 -787 -374 -302 -4a1 -872 -907 -55e -5d7 -c86 -63d -006 -37a -97b -12e -218 -159 -b3c -808 -072 -a72 -8c7 -801 -27b -a9e -3b7 -7a6 -9f8 -35d -356 -457 -2cb -294 -601 -900 -a5f -2a5 -4a2 -134 -0da -7a3 -7cc -b4b -3b1 -7cc -685 -7ea -7ce -0ed -28c -a3b -745 -a05 -32c -2ae -b06 -4d1 -cf7 -203 -93e -24a -bd4 -55b -0f6 -826 -ac1 -4db diff --git a/test_framework/modules/mlkem_keygen/golden/c000_dkpke.hex b/test_framework/modules/mlkem_keygen/golden/c000_dkpke.hex deleted file mode 100644 index 886636a..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_dkpke.hex +++ /dev/null @@ -1 +0,0 @@ -fada6a79a379d2cb36c856450c446f4484b86a560c6170564d002e4b74073f66a6fb6a57bce1be92a1a1b531c61f50882a0084508542a1e1c3b3a950f2072e9a16544e46ca20284b6012a62c697ac858615e181e1ea0b55b002119090b7b871920e9b894b07a281269dca15faf4a09b0004cac61a2cea73f28057dbf1219d07747b381cf0de52abad30ca0f57873b2bfa012bd5bc24805f3657ad0ba6bc4988cd9c6de492c0d433ce5aa328bd6c6cb502463340dc5e029d2c8713d780f31f441c24c4000e56799a6bc66b4a193c73ced560f8ae43f9b2075ceb778976b7f111acb38a306f2b70a2bd8752e828086ba0f3e811a8c3b0d5f8b9072159e56ba1e1008009195af58a85a3e271f00ac25ccf3233cb8716768ad98e7b1f2890db6170f2b614f56c1933871ae1a413024ca9a2137795c8a2e9e15280ff108aee328235751e569ca63a7821f29ad26706b231224d95160bd7522dde0bfe6e0a8261974885a2fdf217f8c16c4f67c0e9fb2a2f7030caf881d2c8b2e6a6863906192108b004260b0adea07c0b349d588110a9cbb699b3952bb112cc7c8d9a759b9554c1f991ea1f51f4c6178e43827c5149bda077fbd769a3b818df71a42860783fd233d1b26a96a573e99eb915f6bc18d813ded14a304c1358e470570d25478a6b6ba2ac5612890b5a569e5263342459cb9ca7674f228396954af748d9d50135342713904cc59106e0bb21942b4066f86bf5d9c3cf1b6c08692c5b9881b29971088a8b415e26c4a2567588b2ddfb68d11146fcff0b4cb79c57487018c25541d3267a10640e430bfebbb4f45a799c9f554d1b69d70c79d17124f9c01cf3ad6569e77a4e1b65704701006452f45a72f3298c660820f1c206af700c9a621923c3911cd518e022404c870c3d3b3b6831a82536a3170334e3159b0c959036c432cf5b484b12c75ccc3c96ce328fbba79e2f724789a8d27f7af8bb08645d2c9a3e87f8042c36227194a3c0e14d09129d069d5379dbd606565d915a3bc9882e87423a062000a5f4c5523ec9447cea1643a97ad33c1986246ad91e273ce32acaff453359965370721 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_e_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_e_0.hex deleted file mode 100644 index 957ed91..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_e_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -001 -000 -cfe -d00 -001 -002 -cff -000 -cff -d00 -000 -000 -001 -000 -000 -cfe -d00 -000 -000 -001 -d00 -000 -000 -cff -001 -001 -d00 -000 -002 -001 -002 -cff -001 -002 -000 -d00 -d00 -002 -002 -000 -000 -000 -cff -002 -d00 -000 -d00 -000 -000 -001 -000 -000 -000 -000 -d00 -001 -d00 -d00 -000 -002 -002 -cff -001 -000 -cff -000 -000 -002 -002 -cff -000 -000 -001 -d00 -000 -000 -001 -000 -cff -d00 -d00 -000 -000 -cff -000 -000 -d00 -cff -000 -cfe -cff -000 -000 -000 -001 -d00 -002 -000 -000 -001 -cff -d00 -001 -000 -d00 -001 -d00 -001 -002 -001 -d00 -d00 -d00 -002 -001 -001 -000 -000 -d00 -000 -000 -000 -d00 -001 -001 -002 -d00 -001 -002 -000 -001 -d00 -000 -001 -cfe -002 -d00 -cfe -cff -000 -001 -cff -001 -002 -d00 -001 -000 -d00 -d00 -001 -000 -000 -001 -d00 -d00 -000 -000 -000 -d00 -002 -001 -000 -d00 -000 -d00 -000 -d00 -002 -d00 -001 -cff -001 -000 -d00 -000 -000 -d00 -000 -003 -d00 -002 -000 -d00 -000 -000 -d00 -000 -d00 -d00 -000 -001 -001 -d00 -001 -002 -000 -000 -cff -000 -000 -000 -d00 -000 -d00 -000 -001 -000 -d00 -000 -000 -d00 -000 -cff -000 -001 -001 -d00 -000 -001 -002 -d00 -001 -003 -cff -d00 -001 -cff -cff -cff -d00 -001 -d00 -d00 -cff -000 -001 -002 -002 -001 -000 -001 -d00 -cff -002 -002 -d00 -002 -001 -002 -000 -000 -d00 -001 -000 -003 -000 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_e_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_e_1.hex deleted file mode 100644 index e548b4d..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_e_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -002 -d00 -d00 -000 -000 -d00 -003 -d00 -d00 -cff -001 -d00 -002 -cff -000 -000 -000 -000 -d00 -002 -d00 -000 -000 -d00 -000 -d00 -000 -d00 -000 -001 -002 -001 -001 -001 -001 -d00 -001 -001 -d00 -d00 -001 -000 -003 -001 -002 -002 -d00 -000 -000 -002 -000 -000 -d00 -cff -002 -000 -001 -cff -d00 -d00 -000 -000 -000 -d00 -001 -d00 -001 -002 -000 -d00 -001 -001 -cfe -000 -d00 -002 -001 -cff -000 -000 -001 -d00 -d00 -000 -000 -001 -001 -cff -000 -000 -000 -001 -001 -000 -d00 -000 -000 -d00 -d00 -d00 -002 -d00 -000 -cfe -000 -001 -000 -cff -001 -001 -001 -001 -001 -cfe -000 -001 -002 -d00 -001 -000 -000 -001 -000 -001 -001 -d00 -001 -000 -003 -000 -d00 -001 -002 -000 -002 -000 -001 -cff -002 -001 -d00 -cff -d00 -000 -002 -000 -000 -000 -cff -001 -002 -d00 -003 -000 -000 -cff -000 -001 -d00 -000 -d00 -000 -000 -d00 -d00 -001 -000 -cff -000 -001 -000 -000 -cff -000 -000 -001 -d00 -000 -001 -000 -000 -001 -d00 -001 -001 -001 -d00 -cff -000 -d00 -d00 -000 -000 -d00 -001 -d00 -002 -000 -000 -000 -002 -cff -000 -001 -000 -d00 -d00 -002 -d00 -000 -002 -000 -001 -d00 -002 -000 -cff -001 -cff -d00 -000 -d00 -002 -000 -000 -002 -001 -000 -001 -000 -000 -cfe -000 -001 -cff -001 -000 -d00 -cff -002 -d00 -000 -d00 -d00 -000 -d00 -cff -000 -d00 -000 -000 -001 -cff -d00 -d00 -001 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_ehat_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_ehat_0.hex deleted file mode 100644 index 8058562..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_ehat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -66a -076 -4ec -759 -9be -37d -cfe -3f7 -c66 -56a -b58 -369 -96a -485 -1ed -3b7 -8cd -a60 -951 -379 -2b1 -ab4 -c54 -703 -c33 -0bc -cca -1df -0e2 -5ee -09b -93e -54a -bb9 -7e0 -8f9 -0b4 -6e9 -176 -9b4 -633 -0ac -133 -0c8 -633 -b48 -98e -244 -a97 -b21 -a6d -8a3 -088 -55d -890 -3a5 -1be -b1a -84a -12c -c89 -3da -195 -b31 -650 -b14 -a16 -2c9 -9b5 -24f -3cc -963 -203 -7fc -4f7 -a6e -390 -824 -a17 -474 -294 -939 -9dd -744 -760 -420 -54b -7a7 -b18 -042 -23a -693 -74d -80f -b97 -910 -aed -c70 -28d -c96 -bd2 -70c -bb7 -673 -a1b -c9e -aab -414 -217 -496 -a8d -5dd -597 -271 -cad -02a -055 -815 -176 -9c0 -6b5 -986 -4ea -c05 -593 -75d -b97 -246 -3f3 -4d4 -75d -64a -ac2 -013 -8b8 -283 -1c8 -565 -096 -0e9 -53e -a83 -a8b -573 -826 -95d -a33 -7a4 -ba5 -508 -b3e -4b8 -2a8 -282 -9fd -95a -8f1 -1b0 -51a -a60 -535 -6f5 -6c6 -8a2 -ab9 -048 -6e9 -2d7 -b10 -5c6 -747 -3b3 -1b4 -a30 -739 -304 -b0d -2d6 -0d9 -0d9 -9eb -273 -621 -450 -7d8 -032 -7e0 -b47 -43e -816 -905 -86b -201 -9d4 -94a -57f -746 -943 -8ae -2d2 -656 -82a -cd9 -bd3 -902 -7da -13a -7d0 -a9c -b99 -32e -423 -4bc -427 -91f -c8f -932 -a92 -78e -4cd -964 -344 -5f4 -8bd -111 -247 -a7d -194 -4a2 -b59 -967 -622 -b2f -8d8 -796 -888 -83a -46d -5fc -027 -a6d -2a3 -335 -316 -09d -a43 -b94 -156 -7d5 -601 -5b5 -8e6 -484 -4e5 -ca1 -760 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_ehat_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_ehat_1.hex deleted file mode 100644 index 8f100b1..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_ehat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -c98 -395 -12d -6e7 -cfd -04b -267 -6b2 -57e -942 -216 -7d5 -c6e -bba -ad5 -051 -3c2 -1b0 -0f7 -98e -12a -7cb -b68 -380 -792 -469 -b9b -250 -ac6 -cc2 -9ec -929 -110 -28b -cd5 -2a0 -585 -ccf -bc0 -40f -310 -106 -083 -4cd -684 -41f -8d4 -771 -748 -72f -48c -8aa -01c -9d8 -395 -5d3 -866 -00c -450 -2bf -902 -680 -c6a -b84 -131 -0ac -08d -bc9 -9a2 -b97 -2b3 -659 -385 -624 -878 -993 -5f0 -1ed -760 -cf0 -2e9 -72f -955 -0bc -ab5 -baa -bb4 -496 -016 -7f3 -5dc -5fd -bef -a74 -293 -18b -8a3 -451 -08c -9e4 -703 -5c1 -af5 -8de -94b -5d0 -bcf -2cb -436 -89a -895 -782 -540 -38d -421 -0da -7b9 -a1e -765 -b20 -182 -49e -b70 -051 -028 -29d -2f6 -288 -7ca -8ff -4af -2e1 -031 -396 -19f -03a -bcb -641 -166 -c26 -ce5 -c04 -224 -923 -68e -618 -12a -956 -167 -657 -7e0 -05b -506 -67d -c20 -616 -21c -b11 -04e -b97 -397 -776 -2d5 -106 -c52 -84c -7bf -388 -1a5 -69d -67e -32e -2c1 -a83 -b38 -749 -b65 -046 -227 -9fd -b2a -31f -42f -17b -01c -61e -a89 -8e9 -2d9 -65d -912 -5c7 -580 -ac8 -c87 -c3e -8bf -2f3 -406 -601 -632 -ca6 -2cf -1f4 -9d6 -80d -4a3 -208 -bdf -add -9be -1c0 -3cc -ba7 -08d -36b -23f -67e -302 -549 -2e8 -976 -5a0 -6dd -013 -589 -0c9 -894 -92e -882 -8ca -0c0 -a62 -225 -a61 -835 -617 -7d4 -17a -b00 -7b8 -b26 -368 -1a1 -028 -31e -639 -7d4 -af5 -309 -981 -c31 -8d6 -9bc -126 -cab diff --git a/test_framework/modules/mlkem_keygen/golden/c000_ek.hex b/test_framework/modules/mlkem_keygen/golden/c000_ek.hex deleted file mode 100644 index 41428a8..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_ek.hex +++ /dev/null @@ -1 +0,0 @@ -80b70100831d7ee168f47392483119f93863ecb0bc605312d35728876b00f5f57af4c85eda97281d574390bc7256193668dc98625354ab52b9bce781c5771cc26099f6fbacbee1784d194887731f097c87e082cbeac57d30b7b9a293872c841466f2244cc65ff4ba653d6751dfa22051d553369942c31c29f91307af573292d697a8c31612e07b5335cf08329fd246bf2a32200a8cb0c4b03b9d09c5ba1c3919539e9229c696924348282f696b1525e5603806b4db618b3dc8630cb286e4311721bc5031f257aa925bf80960445aa8d8e69788e99da95c1d10cc3be858528db0cfea003c74693780a65a36e62843b3be15406543d22d83507c87b2786792c80fa5628454a310394dda4c2ab59493850257d6d3bc107186d9062707f354e81a1a10fcb763d31a4ec409aa243ed2e59bb189855eb1656266bb37500785ea08cd88c222a8c53a8777cab42c9c238a00d59369425026e99d2ae6040af6709029ca8789c897b329fba748d69c8a7148c95abb0c71787c58f12f21f2213e389242aa7fbd320c12ac42c611606cb8c1d1b4625886a145a535bd65bd0d996b330c1657d61a87e90417003225759820a3bbec505cdaf11193229aae173cd12bad22a7a30a76a9fa7636c3d5aa48e1784012a012f14168b7853d2a16f90ca02cc33b2006c08f26c15fca29612cc792e1cf02e1321a75a810891986667d4148af36e65e1a592589029617734c315c0e39b7518c8660cdc265d0c813ef20a043317fae5b8e40546eecf71d6c054fa66b49401309bef30fd51a5519755da9104689b26f0839154c847bef2365943c0249483aad9a7367c980a3d1ce46d2008a15275ca3bca4834e6f9a3036c0cd80ba228d34b9780244d5c0cbe907c6fb43824a9c0746471639cb86188c60c3b253215cc91692bcd1493d6a444d536446e02968138001cc287e0e518f3aa25d8c3b95b3c35c59f4819d484976029af05a263c35336b261f77b2cdc29389f084c04cbb370c48562b5b50771c0fb816908e198dd6d53f76e48bf042c2b1f82a3a40b8daf51f46d76fa4bcc9d3c894ff850c0faa32e0ac33901a4c79139f5f20417ec1a190607044f18bb824cf350c78ab3ddf3c2c86ca5543f715 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_rho.hex b/test_framework/modules/mlkem_keygen/golden/c000_rho.hex deleted file mode 100644 index ef24919..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_rho.hex +++ /dev/null @@ -1 +0,0 @@ -79139f5f20417ec1a190607044f18bb824cf350c78ab3ddf3c2c86ca5543f715 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_s_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_s_0.hex deleted file mode 100644 index 327bb70..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_s_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -001 -000 -d00 -000 -000 -001 -d00 -001 -000 -003 -cfe -000 -000 -d00 -000 -000 -001 -d00 -d00 -001 -d00 -cff -001 -000 -d00 -003 -d00 -002 -d00 -cff -000 -000 -000 -001 -001 -002 -000 -002 -cfe -000 -d00 -003 -d00 -d00 -000 -001 -000 -000 -d00 -000 -001 -cff -d00 -001 -001 -001 -000 -001 -000 -000 -000 -001 -000 -000 -001 -d00 -000 -cfe -001 -000 -cff -000 -001 -001 -d00 -001 -002 -d00 -cff -000 -001 -000 -000 -d00 -001 -002 -001 -002 -d00 -001 -cff -000 -d00 -cff -d00 -000 -cff -002 -000 -001 -d00 -cff -001 -001 -000 -d00 -000 -001 -d00 -d00 -d00 -002 -003 -cff -d00 -002 -d00 -001 -d00 -cff -001 -000 -001 -d00 -000 -000 -000 -001 -001 -000 -001 -cfe -d00 -001 -000 -001 -000 -d00 -000 -d00 -002 -000 -001 -cff -d00 -d00 -001 -000 -001 -000 -002 -002 -cff -d00 -000 -000 -d00 -d00 -000 -002 -001 -001 -000 -d00 -cff -000 -001 -001 -000 -002 -d00 -d00 -000 -002 -000 -000 -cff -cfe -000 -cff -002 -001 -002 -d00 -d00 -001 -001 -001 -cff -001 -001 -001 -d00 -001 -000 -d00 -002 -cff -d00 -001 -000 -000 -002 -002 -000 -cfe -001 -001 -d00 -001 -d00 -cff -000 -d00 -000 -001 -000 -d00 -000 -d00 -001 -d00 -cff -001 -001 -000 -001 -000 -000 -000 -cff -000 -002 -001 -000 -d00 -d00 -cfe -d00 -000 -003 -002 -001 -003 -d00 -000 -d00 -001 -d00 -000 -d00 -d00 -000 -002 -cff -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_s_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_s_1.hex deleted file mode 100644 index 711e71c..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_s_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -000 -001 -000 -000 -002 -003 -000 -003 -d00 -000 -d00 -d00 -d00 -000 -001 -d00 -001 -000 -000 -000 -002 -d00 -001 -001 -000 -d00 -000 -000 -cff -cff -d00 -001 -000 -001 -001 -d00 -000 -000 -002 -d00 -d00 -d00 -001 -000 -d00 -d00 -000 -d00 -001 -d00 -003 -d00 -000 -002 -cff -d00 -002 -001 -002 -000 -001 -001 -000 -002 -cff -000 -d00 -000 -cff -000 -001 -000 -d00 -cff -002 -d00 -d00 -cff -d00 -000 -000 -cff -cff -001 -002 -d00 -000 -002 -001 -001 -000 -d00 -000 -000 -d00 -001 -000 -002 -001 -000 -002 -002 -001 -cff -001 -000 -cff -001 -002 -000 -cff -cff -000 -002 -000 -000 -000 -002 -000 -d00 -000 -cff -001 -000 -000 -d00 -001 -001 -d00 -d00 -002 -d00 -001 -cfe -000 -d00 -002 -d00 -000 -cff -000 -000 -cff -001 -d00 -000 -000 -000 -d00 -003 -d00 -000 -001 -002 -001 -000 -000 -001 -000 -cff -000 -001 -d00 -002 -000 -cff -000 -002 -001 -001 -000 -000 -000 -001 -001 -002 -000 -001 -001 -d00 -cff -000 -d00 -000 -001 -000 -d00 -000 -001 -d00 -000 -d00 -000 -d00 -000 -002 -000 -001 -000 -001 -d00 -001 -cff -d00 -001 -d00 -002 -001 -001 -001 -000 -000 -000 -001 -002 -d00 -000 -cff -d00 -001 -000 -002 -000 -000 -001 -d00 -d00 -d00 -000 -000 -000 -001 -cfe -d00 -000 -001 -001 -002 -003 -001 -000 -d00 -000 -000 -000 -001 -d00 -cff -001 -003 -001 -002 -000 -000 -002 -001 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_shat_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_shat_0.hex deleted file mode 100644 index 9d64002..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_shat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -afa -6ad -379 -79a -bd2 -36c -6c8 -455 -40c -6f4 -444 -b88 -66a -0c5 -061 -567 -04d -2e0 -44b -077 -63f -a66 -afb -576 -1bc -bee -192 -a1a -1b5 -c63 -01f -885 -02a -840 -550 -428 -1a1 -c3e -9b3 -50a -7f2 -2e0 -69a -541 -64e -ca4 -820 -4b2 -260 -a61 -92c -7a6 -8c8 -615 -85e -1e1 -01e -b5a -05b -210 -919 -0b0 -77b -198 -920 -b8e -094 -7ab -228 -691 -1dc -5fa -aaf -094 -0b0 -4c0 -1ac -a26 -7ce -3fa -528 -7d0 -2bf -191 -7d0 -477 -1b3 -cf8 -50d -2ae -3ba -0cd -5a0 -78f -273 -bfb -2a0 -bd1 -25b -48c -305 -65f -07a -bad -46b -98c -98c -c6d -9de -2c4 -30d -3c4 -ae5 -32a -68b -c6d -0cb -245 -463 -0d3 -0c5 -29e -8d2 -71c -83d -0f7 -431 -41f -cc2 -404 -500 -67e -699 -bca -466 -a1b -793 -3cc -6ed -0f5 -48a -3fe -09b -752 -7ce -78b -b97 -7f6 -a11 -cb1 -338 -06a -7f2 -0ab -82b -75d -22e -808 -a86 -0fb -13e -1a8 -b8c -0d3 -b5f -908 -572 -9e1 -a56 -1eb -810 -000 -591 -af9 -858 -5aa -73e -1f2 -c00 -25a -3cc -23f -83c -71b -867 -ad6 -798 -b1e -9f2 -0d8 -7b6 -0f1 -12b -4f6 -156 -93c -138 -ae7 -11a -304 -a24 -9ac -721 -793 -a5c -2e8 -59e -281 -10f -08f -3ae -28e -723 -515 -9e5 -ca6 -763 -82a -91f -ad2 -026 -6b7 -223 -241 -1d9 -605 -5bd -227 -0dd -bfe -0e6 -a8e -926 -741 -a88 -2f5 -1df -7f2 -68c -c41 -cf6 -0e7 -29f -a2b -3f7 -0c0 -8af -1d8 -b2c -2e8 -86a -636 -190 -926 -b10 -008 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_shat_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_shat_1.hex deleted file mode 100644 index 1d727a4..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_shat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -042 -b06 -aad -07e -3c0 -49b -8d5 -118 -c0a -bb9 -b69 -399 -b52 -11b -72c -c8c -7d9 -59a -5b9 -4c5 -91f -1e9 -5a1 -1ff -14c -786 -8e4 -273 -4c5 -9b1 -7da -7f0 -6bd -9a7 -13b -8d8 -af7 -421 -786 -830 -3fd -3d2 -61b -a92 -76a -3e5 -b99 -91e -b5f -c16 -18d -3d8 -4ed -a31 -104 -35c -78e -054 -270 -54d -678 -b6a -aba -c52 -861 -902 -5b5 -69a -6e5 -332 -542 -9c4 -ab9 -76c -274 -28f -939 -546 -4af -8d7 -09d -135 -253 -714 -439 -cc0 -059 -6e1 -20b -19b -442 -06b -66f -bf8 -c5d -3c9 -6f1 -c0b -286 -c59 -8b9 -1b8 -729 -109 -888 -b4a -215 -6ce -54a -672 -b58 -2d8 -6df -8db -411 -6f1 -0cf -b4f -9cb -c57 -774 -018 -58c -542 -21d -673 -6a1 -400 -0e4 -bf3 -beb -4fb -745 -99a -5c9 -54f -6d1 -9db -770 -9dc -217 -4f1 -19c -cf0 -63a -56d -79e -a47 -6e1 -57b -004 -107 -506 -2f4 -745 -2fa -832 -c69 -260 -0f8 -01c -6a2 -0f7 -c90 -1a6 -922 -93c -113 -1cd -8e5 -402 -042 -0c8 -c37 -3d3 -b6b -a83 -821 -a53 -316 -370 -4e3 -931 -b05 -9c9 -035 -36c -2c4 -4f5 -84b -cb1 -752 -3cc -c9c -36c -28e -afb -79b -7e2 -24f -a78 -8d9 -727 -aff -08b -86b -245 -c9d -8a3 -7fe -280 -c34 -762 -192 -c4a -0e3 -014 -91d -029 -69d -7d5 -9d3 -0bd -656 -965 -15d -ca3 -98b -882 -74e -023 -62a -a00 -5f0 -54c -235 -4ec -479 -1ce -64a -73a -ad9 -133 -98c -662 -ad4 -291 -73e -2ce -ac3 -4af -53f -935 -659 -737 -210 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_sigma.hex b/test_framework/modules/mlkem_keygen/golden/c000_sigma.hex deleted file mode 100644 index 286f73a..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_sigma.hex +++ /dev/null @@ -1 +0,0 @@ -d57f66ed8be6cc9f4a5071b5a6e5bdc0629fd2bf6c1139a0b130561b0042b069 diff --git a/test_framework/modules/mlkem_keygen/golden/c000_that_0.hex b/test_framework/modules/mlkem_keygen/golden/c000_that_0.hex deleted file mode 100644 index 0db8272..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_that_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -780 -01b -300 -1d8 -17e -68e -3f4 -927 -148 -193 -8f9 -633 -0ec -bcb -360 -125 -7d3 -285 -b87 -006 -5f5 -7af -8f4 -5ec -7da -289 -71d -435 -c90 -72b -956 -361 -c68 -98d -362 -545 -2ab -b95 -7bc -81e -7c5 -1c7 -0c2 -996 -bf6 -acf -1be -78e -94d -481 -387 -1f7 -c09 -877 -2e0 -cb8 -5ea -7dc -730 -b9b -3a2 -879 -42c -148 -266 -24f -64c -5fc -af4 -65b -73d -516 -2df -20a -551 -53d -936 -429 -cc3 -291 -3f9 -071 -7af -325 -692 -97d -3a8 -16c -012 -7be -553 -cf3 -208 -9f3 -6d2 -bf4 -22a -203 -c0a -b08 -0c4 -3bb -99d -c50 -cba -391 -319 -9e5 -992 -c62 -296 -439 -848 -2f2 -b69 -156 -525 -60e -638 -b40 -1db -8b6 -83d -63c -20c -86b -1e4 -173 -c21 -50b -231 -57f -2aa -5b9 -9f8 -600 -a44 -a85 -6d8 -97e -988 -9de -ca9 -1d5 -c10 -3bc -8e8 -525 -08d -cfb -0ea -3c0 -974 -376 -680 -5aa -636 -28e -343 -beb -015 -654 -243 -2dd -083 -7c5 -287 -78b -267 -c89 -50f -62a -484 -a35 -910 -4d3 -cda -2a4 -4b5 -939 -285 -570 -3d6 -bcd -110 -867 -6d9 -270 -307 -54f -ae8 -1a1 -c10 -b7f -363 -1ad -44e -09c -4aa -3e2 -5d2 -9be -9b1 -858 -15e -65b -662 -bb6 -037 -075 -a85 -08e -8cd -c28 -822 -c5a -73a -778 -4ca -2cb -39c -8a2 -500 -93d -269 -504 -926 -9de -62a -04e -60a -70f -990 -ca2 -987 -c88 -397 -29b -7fb -48a -cd6 -8a9 -871 -c94 -b5a -0cb -871 -7c7 -158 -2ff -221 -21f -83e -923 -a42 -7fa diff --git a/test_framework/modules/mlkem_keygen/golden/c000_that_1.hex b/test_framework/modules/mlkem_keygen/golden/c000_that_1.hex deleted file mode 100644 index 4e45923..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c000_that_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -2bd -0c3 -c12 -42a -1c6 -601 -86c -c1b -4d1 -62b -658 -a18 -545 -35a -5bd -bd6 -90d -6b9 -c33 -160 -657 -1ad -987 -04e -017 -320 -525 -987 -320 -bba -0ec -5c5 -1da -11f -293 -9a2 -7ae -3c1 -bd1 -ad2 -722 -a3a -60a -a97 -6fa -367 -5c3 -aad -148 -78e -240 -a01 -112 -41f -768 -85b -a3d -162 -cf9 -a00 -32c -3bc -620 -c00 -68f -c12 -a5f -29c -c61 -c72 -192 -cfe -102 -32e -51a -a87 -910 -198 -686 -7d6 -841 -af4 -636 -5ee -91a -255 -289 -960 -317 -4c7 -c31 -0e5 -739 -51b -68c -608 -2cd -65c -8d0 -13c -0ef -a02 -143 -7f3 -bae -8e5 -440 -6e5 -7ec -1df -56c -4f0 -ba6 -496 -340 -091 -3be -0ff -ad5 -551 -519 -5d7 -0a9 -461 -289 -6fb -908 -153 -44c -7b8 -3ef -652 -c94 -023 -849 -3a4 -aad -739 -967 -80c -1a3 -ced -246 -00d -58a -271 -35c -bca -3a4 -4e8 -a6f -309 -036 -cdc -a80 -22b -48d -b93 -278 -440 -0d5 -cbc -7e9 -c60 -3fb -824 -c4a -079 -746 -164 -b39 -86c -c18 -608 -2c3 -53b -c21 -c95 -216 -bc9 -9d1 -3d4 -46a -4d4 -453 -466 -9e0 -682 -013 -018 -8cc -7e2 -10e -8f5 -23a -5da -b8c -953 -3b3 -5cc -459 -81f -89d -494 -276 -9a0 -af0 -265 -53c -333 -66b -1f2 -277 -cdb -3c2 -899 -4f0 -c08 -b4c -37b -80c -564 -b2b -505 -c77 -0f1 -6b8 -901 -98e -8d1 -5d6 -3fd -476 -8be -2f0 -c24 -8b1 -2af -03a -b84 -5da -1ff -746 -6fd -ca4 -c9b -8d3 -94c -5ff -0c8 -a0f -32a -ce0 -33a -a90 -4c1 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_0_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_Ahat_0_0.hex deleted file mode 100644 index 11f72b3..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_0_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -3b1 -64f -b33 -7e0 -5a9 -063 -a30 -37a -17c -3bb -ce8 -4fd -1e7 -97e -854 -6d4 -328 -82d -c5c -9bb -62b -031 -99f -9c3 -2c0 -5a4 -5ec -b7c -6e4 -2e2 -164 -7b6 -6f5 -ca7 -3eb -8ff -1c4 -4f0 -b27 -a90 -75c -c3f -653 -794 -914 -962 -225 -0e3 -5f8 -12f -948 -7a6 -7db -3d8 -9f8 -3fe -b49 -b54 -534 -ab9 -752 -a96 -bf8 -1f3 -108 -7cd -4ce -6dc -9d4 -240 -0c2 -3ec -2b4 -411 -cf4 -9bc -06f -534 -abf -854 -9af -c81 -2f0 -33c -0c2 -cf4 -aea -1f2 -22f -7d2 -6a0 -7ea -3de -1cd -a7d -a1b -070 -26b -cb7 -85f -836 -b69 -836 -254 -3ef -a3e -7e7 -6f9 -796 -a0b -8f8 -cca -c12 -270 -b62 -7e6 -9db -9aa -7f9 -6cd -37a -0e8 -714 -38e -33e -6ea -ca6 -23d -b3d -cc7 -0bb -4fd -15f -1c8 -5d8 -3e0 -873 -a82 -699 -6ed -81d -1e9 -235 -4ec -04b -5c7 -2e3 -bb9 -79d -7a4 -53f -c7b -0b9 -8b3 -b5f -501 -5d7 -957 -b9c -133 -b73 -acf -a35 -8f0 -c13 -34e -871 -a08 -7f4 -81a -418 -501 -17e -46c -431 -205 -549 -4d5 -2ee -7d7 -433 -313 -92b -56e -9f6 -796 -998 -bfe -a07 -b1a -1c3 -42d -aaa -7ba -07a -b9e -aee -252 -992 -324 -601 -4e2 -23b -a12 -af7 -b95 -74c -adf -372 -589 -96b -c37 -4f5 -663 -0cd -5b3 -27c -4c5 -c13 -cbf -b2e -058 -0dc -c38 -9f7 -a8a -ba9 -970 -5eb -5b1 -c1f -c67 -4fa -62b -89e -2fb -24a -b65 -970 -a2b -583 -af0 -5ea -9e6 -0df -a4c -18a -630 -172 -1f3 -3a9 -30a -973 -2d2 -3f2 -64d diff --git a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_0_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_Ahat_0_1.hex deleted file mode 100644 index 4cdb055..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_0_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -1cb -37e -6da -c8c -983 -73f -8d6 -85f -60d -63f -1f1 -5c5 -caa -66d -195 -c43 -2c5 -89b -ad4 -466 -6db -474 -8a3 -a95 -1c6 -924 -2dc -48b -326 -b18 -5ed -b00 -18c -1b1 -392 -345 -2f6 -386 -954 -409 -0b7 -247 -284 -71f -824 -4e2 -7ee -2dc -69d -ab8 -96d -090 -a7c -897 -948 -814 -ae1 -222 -aba -aac -842 -5ab -48c -3a6 -bdd -a72 -443 -b1c -73e -1cb -cc7 -0a3 -220 -a89 -bf7 -6c8 -73a -927 -4a1 -0ed -891 -1d0 -c4e -6a3 -4c9 -92a -9a6 -200 -41a -c26 -1c5 -5fa -c22 -029 -8c0 -a8b -93e -7d4 -1da -422 -629 -472 -531 -9e1 -172 -3c2 -9a1 -aaf -496 -0d0 -6e4 -9f7 -852 -66d -859 -9c2 -acc -765 -20a -102 -b9c -3a2 -037 -b75 -882 -a26 -28e -902 -42f -8ed -27a -c64 -728 -90f -83f -b79 -5d1 -320 -855 -7e4 -14e -3ec -9f7 -665 -b8e -86d -11f -1f1 -a19 -7df -506 -25f -621 -626 -053 -c49 -2fb -46b -206 -0fd -585 -960 -5b9 -b9f -ab7 -c35 -08e -881 -426 -c22 -671 -475 -598 -4c3 -9d6 -c5b -8ee -01a -682 -5dd -ba8 -775 -c74 -842 -2fc -a6f -bc5 -b6c -b07 -897 -26f -987 -6c5 -aca -7a2 -1b3 -277 -650 -317 -5b1 -5c8 -bd9 -392 -759 -b38 -501 -250 -490 -33c -59a -81c -2d1 -82b -791 -7a5 -0be -1d2 -a91 -974 -290 -9af -5af -051 -044 -5c1 -9e5 -482 -4d0 -c78 -9ff -c56 -208 -182 -b51 -150 -4c8 -138 -747 -8c2 -9cc -251 -92a -687 -331 -024 -9fa -06e -b1b -3a7 -8ab -284 -3f9 -30c -c30 -43e -352 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_1_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_Ahat_1_0.hex deleted file mode 100644 index 3492158..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_1_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -a03 -5ab -01d -c96 -aff -064 -151 -8e2 -1aa -454 -37c -7c8 -c0a -5c4 -100 -a8a -7e5 -4b9 -928 -34f -39d -a0d -127 -6e8 -b18 -291 -473 -428 -80c -c39 -b3e -66c -23b -793 -3d5 -bec -b05 -222 -220 -442 -ca5 -7cc -b6d -2ea -42d -024 -c30 -489 -a28 -3b7 -0c0 -7fc -013 -6e9 -50b -0da -b88 -616 -aef -51d -6c0 -591 -021 -141 -57f -011 -9cb -b93 -55d -bd5 -70b -991 -6e3 -0cd -51b -bc2 -408 -58b -bdd -409 -cbb -81e -bf0 -0b6 -079 -623 -3e5 -c1e -b3b -709 -931 -3b5 -890 -56d -540 -92b -730 -a10 -42a -273 -712 -5e1 -4f0 -286 -130 -549 -7d3 -532 -45e -a05 -cc8 -299 -54e -b52 -4dc -98f -571 -cf1 -148 -08c -1fd -2f0 -a9a -866 -654 -073 -814 -16e -6a8 -14f -9cc -c7c -1f4 -c88 -354 -175 -167 -94f -b66 -1d8 -33b -855 -054 -763 -135 -7e6 -c68 -5b5 -581 -6a7 -772 -a9d -071 -cdf -9f8 -233 -4bf -703 -607 -0ae -568 -743 -965 -a82 -3fb -26d -c4c -a33 -446 -3f1 -757 -48a -89c -051 -1df -4f5 -b63 -6fc -804 -315 -0ba -228 -cb8 -79c -0a6 -05d -245 -70d -491 -317 -6d5 -71e -3b0 -bad -08f -cb0 -9f5 -4a9 -74c -6eb -8bc -2b7 -593 -024 -67a -433 -141 -7bc -a8d -c34 -529 -496 -6b3 -988 -9e8 -4f5 -6ad -4f2 -66e -8c0 -571 -789 -60c -ab9 -2a4 -877 -7bf -636 -603 -8d0 -147 -57f -09d -5d5 -8da -c12 -44d -1ce -182 -38f -710 -901 -b7e -b8f -991 -2a7 -848 -c4c -9cf -402 -cf5 -adb -97a -c58 -319 -8d2 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_1_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_Ahat_1_1.hex deleted file mode 100644 index 520d54b..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_Ahat_1_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -734 -599 -624 -b39 -22d -892 -81b -761 -212 -9d8 -61b -780 -bdd -cc8 -528 -2ce -4de -b49 -c75 -83e -52e -310 -c11 -037 -8f4 -03e -cca -543 -c26 -009 -535 -563 -aa1 -0bf -8b0 -a14 -3f2 -723 -247 -81a -91c -c7b -798 -97f -885 -c01 -c7f -541 -63b -a74 -757 -114 -9e5 -261 -9c0 -25f -4f3 -27c -a45 -312 -7bc -784 -122 -9b5 -212 -ab3 -c3d -371 -8dd -881 -78a -35c -5ec -647 -866 -637 -8e7 -83e -7c4 -067 -cde -4f6 -297 -762 -848 -3da -327 -968 -273 -019 -24b -786 -68b -03f -879 -8a0 -8cb -089 -811 -c22 -03c -2a0 -298 -b5c -012 -01c -cbc -b0a -509 -0ca -bd1 -56e -9b0 -3df -397 -633 -173 -99c -088 -284 -8e0 -880 -051 -25a -34e -2bd -326 -6cf -b8a -0e7 -a93 -360 -771 -6fb -9da -99f -00c -c12 -2fe -333 -c6a -856 -8ae -0d9 -0cc -16f -952 -89f -4fe -05e -3a4 -a3d -0b6 -546 -af3 -328 -089 -5a7 -790 -1c3 -128 -012 -4e1 -614 -635 -2ea -0e0 -625 -af4 -4af -263 -76a -bfc -c2d -066 -a5e -b3a -60b -6a2 -a3c -bfe -b08 -629 -2c8 -a2f -bdc -5f9 -c53 -1e7 -bde -132 -650 -0c8 -58e -59c -bc4 -012 -363 -446 -b30 -9eb -24a -57d -7d4 -008 -65c -4ec -0b6 -ca9 -45a -2a2 -163 -a38 -0fc -397 -13e -5da -7c9 -6cf -684 -39a -83e -7c5 -4e9 -2de -c3d -b98 -749 -ca9 -bb9 -69f -bc2 -cac -396 -88e -219 -917 -5b2 -0d8 -915 -37f -310 -60a -a2b -380 -1e4 -057 -25a -a03 -2d4 -0d3 -bce -15f -107 -5e8 -530 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_dkpke.hex b/test_framework/modules/mlkem_keygen/golden/c001_dkpke.hex deleted file mode 100644 index bafb013..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_dkpke.hex +++ /dev/null @@ -1 +0,0 @@ -9a5c3688a0c2e3e6b14804a90447c71ec65fbbc9c45a1b9e58ba552223176f3687c12ab49af96a8290326f5c1d6e9a1c83eb3525d81e35763656e488dff37288662a3bf799dc385b8e04aa3546c283c20bf8c605faf72849f649fd1284526282c78cc67f58c9a2d14f2d294812206f91fa93b0369e54c4a38b5a4d550b95e520b7d5dba904a564e37937cc850323ccbce0d69a2b8840e4c459d97c72139a2c1990612f90adc2d2aa7bc84d16e94271574f9c1736b9a35516575a152a02e538150d6c9d48c6ad02f6958e1cb92270a01fa1372ef1609f928039712925fca69fbc835cd240a3a18b0cbc1432b1cc7bd3aa151394c46a0d26385aa243952d9357c06360f5b37a945c26deec919862aaa8f1b502416259411feb2cb275617ccfb198c315170a13c52302203d0ba770f5c52f31394a12303f149e5b45929fc33b49e277ba45b1ec390cd76a96404439836558d9c7007eb42e16c53d9c77caad6b1e71cc0289b44c9bdac9e54156e9d74473d630b71a473937b6c245aaedaa4236fc53ac919e8a895f3a839d16932b26a1a7688ab247118eea16a258f367da101aa5c9b617e2b7cb905857f733d3c3bebaf9bd80b8c92e06ba453bc84ad5c62d475079b9569124ba897b611d44111659c8eb938463ca896569123bc32aedd637932b495627a9fbd2bf15e77b9fe2ad20845fdb04bab1878ef7c71973965a42d6ba16755274493d8c99c39faa4ba6368fc93460d734a666d374c807b17b4bb25fd5879778632b9468efd1139c4a37a7cb0a87ca893bc914a3c4a0f346b157ab331df30b5995076a503ecb586eacf675111866228a14644518a6d103c2747f18d09237dbbb515cbc48518ed082710d1a6af9714c71c164bce61fded31956806cd941ba6d6c2a5944001a20000fd46f8589443b211014898bc69333adf4bed3b06f43538f8039971762609fd2746595b5f7f348e631c76dc1c63c147540425194981b5afa4493b4176a87aef98a0cce843b1db9036fd9504d60893d19c13471b64f6095c02c522bc4a21a9c836ff681bd507995b26f4ca90c1e188ce8cb08f12603699892 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_e_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_e_0.hex deleted file mode 100644 index 2344294..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_e_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -d00 -003 -001 -d00 -001 -000 -000 -000 -000 -002 -001 -cff -001 -cff -000 -000 -002 -000 -cfe -000 -000 -d00 -001 -cff -001 -001 -001 -cff -000 -000 -d00 -cff -001 -000 -001 -000 -000 -002 -d00 -002 -000 -000 -d00 -cff -000 -001 -001 -d00 -000 -001 -000 -d00 -000 -001 -000 -cff -cff -d00 -001 -000 -d00 -000 -d00 -002 -d00 -cfe -002 -000 -d00 -000 -001 -001 -000 -d00 -000 -000 -001 -d00 -000 -000 -002 -d00 -001 -001 -000 -cff -001 -001 -000 -000 -d00 -001 -000 -003 -d00 -d00 -000 -001 -001 -d00 -001 -000 -002 -000 -cff -000 -000 -001 -d00 -d00 -000 -000 -000 -d00 -d00 -001 -000 -001 -002 -000 -001 -000 -000 -002 -000 -001 -000 -d00 -000 -d00 -000 -000 -000 -001 -d00 -000 -002 -001 -002 -000 -000 -000 -cff -001 -d00 -000 -000 -d00 -002 -d00 -d00 -d00 -001 -cff -000 -001 -002 -d00 -000 -000 -d00 -d00 -001 -d00 -001 -d00 -001 -003 -000 -001 -002 -000 -000 -cff -001 -001 -000 -d00 -cff -001 -001 -000 -000 -d00 -002 -d00 -002 -002 -000 -cff -d00 -d00 -d00 -d00 -000 -d00 -cfe -001 -d00 -001 -d00 -000 -d00 -d00 -000 -cff -cff -000 -000 -001 -002 -cff -000 -000 -d00 -cff -000 -001 -d00 -d00 -d00 -003 -000 -001 -000 -000 -000 -000 -002 -d00 -d00 -000 -d00 -d00 -000 -cff -002 -d00 -000 -000 -003 -001 -000 -001 -000 -d00 -d00 -d00 -001 -d00 -000 -001 -001 -001 -001 -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_e_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_e_1.hex deleted file mode 100644 index 59029a4..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_e_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -002 -cff -000 -cfe -001 -d00 -002 -001 -002 -d00 -000 -000 -000 -d00 -cff -cff -000 -001 -d00 -000 -cff -000 -d00 -002 -d00 -000 -001 -002 -000 -d00 -cff -002 -002 -001 -d00 -d00 -000 -001 -002 -000 -d00 -d00 -000 -d00 -000 -cfe -002 -001 -000 -001 -cff -002 -000 -cff -cff -001 -000 -001 -d00 -002 -000 -cff -001 -d00 -002 -cff -001 -d00 -000 -001 -000 -001 -000 -001 -001 -001 -002 -d00 -001 -001 -000 -000 -000 -000 -000 -001 -001 -000 -000 -001 -000 -003 -001 -d00 -d00 -002 -000 -d00 -000 -000 -000 -d00 -cff -d00 -001 -000 -cfe -d00 -d00 -001 -000 -cff -001 -000 -000 -d00 -cff -d00 -cff -d00 -003 -002 -d00 -003 -cff -000 -d00 -001 -000 -d00 -000 -d00 -001 -000 -d00 -001 -002 -000 -002 -cff -000 -000 -d00 -cff -002 -001 -d00 -000 -002 -000 -001 -d00 -d00 -d00 -d00 -d00 -cff -002 -d00 -001 -000 -d00 -d00 -cff -d00 -d00 -d00 -cff -000 -000 -d00 -001 -001 -000 -000 -000 -002 -000 -cff -d00 -d00 -d00 -000 -000 -cff -001 -000 -d00 -000 -cff -d00 -002 -001 -000 -001 -000 -002 -cff -001 -000 -cff -000 -000 -d00 -000 -000 -001 -000 -001 -d00 -d00 -d00 -000 -000 -000 -cff -000 -001 -001 -d00 -cff -000 -001 -cff -d00 -d00 -d00 -d00 -000 -d00 -000 -001 -000 -d00 -001 -d00 -d00 -002 -002 -000 -001 -d00 -002 -d00 -001 -d00 -001 -cff -d00 -d00 -000 -000 -000 -000 -003 -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_ehat_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_ehat_0.hex deleted file mode 100644 index 7c6e5c1..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_ehat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -9a3 -2bc -940 -2fa -b87 -b15 -bcd -a7e -91f -102 -b67 -681 -a78 -1c0 -164 -968 -a3a -618 -8d2 -5db -9fd -453 -9f4 -0e7 -8dd -ccf -2c4 -62b -40b -783 -6bb -ba1 -616 -625 -98f -39d -43b -00d -159 -bbb -7cd -899 -ce3 -84b -cf8 -43e -71b -8cd -6e2 -bcb -cc2 -bae -70d -231 -342 -352 -8de -bae -76a -44a -516 -792 -542 -7ed -b72 -046 -37f -38d -06c -6ff -513 -011 -227 -1a1 -b15 -165 -860 -2fc -04c -30c -571 -bd3 -41c -167 -abb -7d5 -483 -a77 -70b -51d -706 -196 -3c3 -79d -524 -399 -302 -789 -b51 -1c0 -b08 -5cc -1af -2a1 -592 -8b9 -b23 -960 -070 -78c -439 -621 -4de -c24 -5d7 -2e4 -c5f -b6e -6a8 -9da -b9b -84e -4c3 -2b2 -a1b -64d -59f -21b -7b2 -b79 -695 -8ec -aaa -2e1 -739 -9cf -4c6 -155 -4ce -113 -6fc -803 -15e -2a8 -7a1 -825 -336 -af2 -af2 -2a9 -157 -85e -c56 -46a -797 -47d -cce -ae1 -ad5 -666 -977 -abf -099 -469 -641 -372 -566 -1bc -000 -68e -320 -1d5 -8c4 -bc5 -475 -968 -c90 -08c -c03 -824 -378 -378 -246 -7c5 -6b2 -b99 -95f -46a -6dd -657 -772 -075 -623 -0f8 -78f -747 -122 -ae2 -8c2 -ce1 -2d2 -688 -939 -4fb -4f9 -2c1 -7fc -971 -0e3 -1b1 -b58 -c55 -319 -09a -897 -56e -832 -3a5 -35c -90d -0d8 -564 -839 -aef -b60 -624 -2e3 -0e6 -61f -03f -9cc -1ab -069 -551 -15d -7f6 -42a -91a -286 -c83 -a27 -4f4 -2e9 -0a7 -781 -988 -c32 -2eb -299 -062 -376 -79d -698 -3bc -a28 -77b diff --git a/test_framework/modules/mlkem_keygen/golden/c001_ehat_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_ehat_1.hex deleted file mode 100644 index 64650e6..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_ehat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -5ff -bb9 -c7c -131 -270 -a8c -18a -792 -85f -939 -738 -1a1 -720 -0bc -b41 -1f0 -c30 -755 -92b -68e -a73 -2ef -672 -8ad -235 -84f -4bc -02c -c4d -042 -250 -3e1 -791 -b3c -713 -bb7 -a8c -31c -123 -93e -822 -976 -755 -0f8 -bcd -be5 -6c7 -132 -4e1 -1fb -405 -520 -c76 -6dc -a04 -5f7 -41f -636 -609 -273 -9d7 -bfe -929 -9df -5a7 -8b9 -1c4 -cb0 -51c -973 -7ab -61d -91f -373 -a11 -8af -a0c -c0c -71a -0e4 -210 -16a -8a7 -af4 -25e -663 -cc2 -103 -3fa -36f -c55 -c4f -4cf -139 -4f7 -767 -b95 -5e9 -153 -48c -bd5 -3f0 -978 -3fa -439 -2db -a1f -17c -91a -4c7 -98e -3db -6f8 -847 -ca2 -5bc -2da -713 -815 -29f -bcb -37b -b3b -34d -1fe -1d5 -04d -bb6 -645 -200 -5a9 -422 -5e4 -bc2 -7be -821 -14d -b08 -c28 -2ff -630 -12f -521 -a51 -2b8 -32b -c72 -7e6 -8a6 -3bc -761 -51d -25f -661 -92f -b88 -a47 -066 -3b1 -863 -30d -ccf -47a -2c5 -4e6 -af1 -48f -141 -3b3 -2a7 -a24 -73c -ba2 -38b -b86 -222 -474 -076 -39c -aa6 -422 -b27 -391 -3dc -04c -103 -be9 -5fe -700 -242 -cb8 -9fd -00d -b76 -03e -a91 -c1c -067 -b65 -4ed -af0 -2c8 -92a -6b2 -8f9 -c33 -430 -98b -5c2 -9d3 -2e5 -a72 -612 -32d -879 -3a9 -53e -308 -adb -233 -07a -6da -004 -832 -187 -428 -a74 -7c8 -4c4 -05f -bc0 -076 -43b -331 -041 -c89 -0fa -811 -258 -9e7 -bbb -423 -702 -13b -7c8 -8bd -403 -2bb -353 -5d6 -313 -af6 -905 -96c -2ce -a66 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_ek.hex b/test_framework/modules/mlkem_keygen/golden/c001_ek.hex deleted file mode 100644 index 678abd3..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_ek.hex +++ /dev/null @@ -1 +0,0 @@ -dee78922bb8da2f4764dca45f8ea4c1f530a1c571d3ad1924b589698cb2719e069fd943c1452c5d168b2b357b265831c019cb3557a0bf7187e4d108bf770c74db40389cc718f3bc11ce3aba84366ab245194b941f81b7ae702419bb98d73ba003783306c7b3a3677a543a0100c3175e8c020ca266512909c3550c4f65c0ea3e24a47237d9a4a0b5ae588f983311faa36e891af8ea1b308c83179246154c765ac5b5a15456e193308002837d14354e066a34a4409afbb15085aadc9e22b8db5583d45b0a4ac72474a2ab94b792e531ab0cb882c13a4139a71ffa3783b537178f34e111b6c3f120a76d4cdcec461843035acd285ed627d8bd2b0b997ccceb4adae3615a73bba0a7c7bb9b13358bb51ff8a574d86b5000272cd270a0a1b24bb917506701c2f441fc5b79dd451cb3cacc740127bd411604bdac464da1a2f83918c5b2fb6e5284c972b93357a837828b1132632bb6f7bfbbec3d947bd403d86990066db6553722434c7c0e3992f009bb238f7a6b3e5251eda943a7703fba289aa2053a857796c2cb945494c0ba791a9e3cbfa800d8988c8121997d975b3d03595add64a3eacb8ba36a4d8b3bfdc11b7d56239087c90f352c0eec40857f089ccfa7c9a683a1de3cd8ff28b22153dde231e5f74805d683eb8c346ba16c7fe68064b2059c8738e5ac19b64d4343f5c9d8bf9780302b0676c202a21292cc15fc1589a69838ad1ea3d0c3706f8e1b011f61299a56ec2515051fb94734b308af3c35e45abfadc128fe69838aa37080514d6c3748c916bd655080a1035ff1a763e450b56864cc232afee53919ff889a820a7a6558631b88f7318c033800f307c19b2d0a8b65882d8770979a5701ac602f71b72a26b82525aa67d77c75eb6871dc019b465583a250db4704906187e8dfb3b70726988f9c52c12266c6391d4926cb79978007ca46ef60882806ffd59c64ed70333989aac5186990440b89c3cd1363be404706dbb63a5a007a0fac261a0288f916faf0aa4e944552f10801a3a5dde263398015cc35227bd1711356251aa935a89bc2e3d2c08e1c9a8c1e4416f303bb73b314858ca4c210c959283fc865b027768c5d6047fd36dbcbc4edf3ea5cc6a50cb052bcd31 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_rho.hex b/test_framework/modules/mlkem_keygen/golden/c001_rho.hex deleted file mode 100644 index 939cf5d..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_rho.hex +++ /dev/null @@ -1 +0,0 @@ -4c210c959283fc865b027768c5d6047fd36dbcbc4edf3ea5cc6a50cb052bcd31 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_s_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_s_0.hex deleted file mode 100644 index fedd404..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_s_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -d00 -001 -001 -000 -001 -001 -000 -001 -d00 -000 -cfe -d00 -002 -d00 -000 -d00 -001 -001 -001 -d00 -001 -000 -cff -000 -000 -001 -d00 -000 -001 -000 -000 -d00 -000 -000 -000 -000 -000 -001 -001 -cff -001 -000 -002 -000 -002 -001 -000 -d00 -002 -d00 -cfe -cff -001 -001 -002 -d00 -cff -001 -000 -000 -cff -001 -cff -d00 -d00 -d00 -002 -001 -d00 -000 -d00 -cfe -003 -d00 -000 -d00 -d00 -000 -cff -001 -001 -d00 -d00 -000 -000 -cff -001 -002 -000 -001 -001 -d00 -000 -003 -000 -d00 -d00 -000 -000 -d00 -001 -cff -d00 -000 -001 -002 -000 -cff -d00 -001 -cff -001 -002 -001 -000 -000 -001 -001 -001 -001 -003 -001 -000 -d00 -cfe -cff -000 -001 -002 -cff -d00 -000 -000 -cff -000 -d00 -001 -003 -000 -d00 -d00 -000 -001 -d00 -000 -002 -000 -000 -001 -000 -002 -001 -d00 -000 -000 -d00 -000 -000 -d00 -001 -001 -000 -d00 -003 -d00 -000 -001 -000 -d00 -cff -001 -d00 -000 -d00 -cff -000 -cff -d00 -001 -cff -002 -d00 -002 -000 -001 -001 -000 -000 -001 -000 -000 -001 -d00 -000 -d00 -001 -001 -d00 -001 -001 -000 -000 -000 -d00 -d00 -000 -d00 -d00 -002 -001 -001 -000 -001 -001 -000 -002 -000 -d00 -000 -001 -000 -d00 -d00 -d00 -001 -001 -000 -001 -000 -001 -000 -001 -001 -cff -cff -cff -d00 -cff -cff -002 -000 -002 -000 -000 -000 -d00 -002 -000 -d00 -d00 -001 -000 -000 -001 -d00 -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_s_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_s_1.hex deleted file mode 100644 index 08717f8..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_s_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -002 -001 -000 -002 -cff -000 -000 -001 -000 -000 -000 -cfe -d00 -000 -001 -d00 -001 -001 -d00 -001 -000 -000 -002 -000 -001 -000 -d00 -cff -000 -000 -cff -cfe -d00 -000 -cff -d00 -000 -d00 -d00 -000 -001 -000 -d00 -001 -000 -000 -001 -d00 -d00 -002 -000 -000 -000 -d00 -d00 -d00 -000 -000 -d00 -001 -000 -000 -d00 -001 -cff -cff -001 -d00 -000 -cff -d00 -001 -d00 -000 -000 -000 -cff -000 -cff -001 -cff -cff -002 -001 -002 -cff -001 -001 -000 -cff -001 -001 -000 -cff -d00 -cff -d00 -000 -000 -d00 -d00 -000 -d00 -001 -001 -001 -d00 -001 -d00 -001 -001 -000 -000 -001 -000 -000 -cff -000 -000 -000 -000 -d00 -000 -001 -001 -d00 -002 -001 -000 -000 -002 -000 -001 -000 -002 -002 -001 -001 -cff -000 -d00 -002 -002 -000 -002 -d00 -cff -d00 -d00 -001 -000 -d00 -d00 -001 -cff -d00 -002 -002 -000 -d00 -002 -000 -000 -d00 -001 -d00 -002 -003 -d00 -cff -001 -d00 -002 -000 -000 -001 -001 -cff -d00 -000 -002 -000 -002 -d00 -000 -d00 -000 -d00 -002 -cff -000 -cfe -cff -000 -000 -001 -cff -001 -000 -d00 -000 -002 -cfe -cff -001 -cff -002 -002 -000 -000 -000 -000 -d00 -000 -d00 -002 -000 -cff -003 -001 -d00 -cff -002 -d00 -d00 -000 -d00 -001 -001 -002 -002 -d00 -001 -000 -003 -000 -002 -d00 -cff -001 -000 -cff -003 -000 -001 -d00 -cff -cff -000 -d00 -000 -d00 -d00 -001 -001 -001 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_shat_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_shat_0.hex deleted file mode 100644 index f461fdd..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_shat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -c9a -365 -088 -c2a -6e3 -b1e -448 -a90 -704 -c74 -61e -5fc -9bb -c4c -b5a -9e1 -a58 -55b -322 -172 -66f -873 -ac1 -b42 -99a -6af -082 -329 -c6f -1d5 -a6e -1c9 -b83 -35e -825 -1ed -635 -367 -456 -88e -3df -72f -688 -2a6 -73b -99f -8dc -5b3 -48e -aa0 -635 -c24 -283 -0bc -6f8 -05c -7fa -28f -649 -49f -2fd -841 -252 -826 -cc7 -c68 -87f -c95 -1a2 -4fd -92d -482 -012 -6f2 -a91 -93f -6b0 -9e3 -454 -a3c -a8b -4d5 -b55 -950 -0e5 -b72 -bd5 -a9d -504 -64a -9e3 -377 -5cc -038 -c23 -bcc -6e0 -9ad -82b -408 -4e4 -59c -cd9 -727 -a13 -2c9 -019 -619 -02f -ad9 -2c2 -aad -87b -4dc -916 -42e -771 -4f5 -79c -361 -3b9 -55a -716 -5a5 -a15 -022 -8e5 -153 -c0d -9d6 -648 -adc -602 -95f -c8e -b91 -022 -a07 -11f -37a -12e -60f -29f -809 -139 -297 -c25 -a6f -c9f -83b -25c -40d -1a3 -8ba -c0c -14b -132 -ccb -37b -aad -315 -941 -ac4 -0d6 -826 -5a3 -3a2 -954 -32d -579 -3c0 -606 -3f5 -7ab -c94 -265 -cde -91e -298 -aa6 -1a8 -b5f -102 -624 -159 -1f4 -ceb -b22 -175 -7c6 -1cf -98b -5c3 -171 -30a -c51 -223 -200 -b3d -a70 -570 -c5f -12f -393 -24a -301 -43f -9e1 -55b -924 -39f -3bc -249 -77e -5ba -b14 -9ec -0c3 -ad7 -966 -440 -394 -583 -586 -7d9 -00c -47e -2eb -516 -3dc -79c -ca7 -bad -1e6 -c71 -02c -489 -4cb -a9b -c9d -1e5 -564 -7e9 -44d -673 -30d -ab7 -471 -739 -b63 -5c2 -aa4 -aed -42a -c36 -53f diff --git a/test_framework/modules/mlkem_keygen/golden/c001_shat_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_shat_1.hex deleted file mode 100644 index f98519a..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_shat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -1ac -9e9 -98a -5f8 -33a -9d8 -316 -2b9 -126 -a7a -a68 -b28 -147 -8e1 -6ea -a21 -358 -67f -0da -1a1 -9a5 -b6c -217 -b7e -0cb -589 -757 -33f -3d3 -bec -9ba -bdf -880 -c9b -62e -ba0 -b45 -c83 -54a -c6d -72d -504 -979 -56b -491 -ba2 -b89 -617 -41d -114 -916 -c85 -3eb -849 -a63 -89c -965 -126 -33b -2ac -6ed -37d -b93 -492 -756 -a92 -2fb -bfd -715 -7be -29f -ade -420 -5f8 -4db -ba0 -7b1 -8e8 -7f7 -19c -673 -5a9 -642 -bad -516 -527 -974 -3d4 -98c -c39 -a9f -4ba -6a6 -8f3 -4c9 -603 -4d7 -a63 -366 -74d -7c8 -b10 -b7b -b24 -55f -87d -897 -637 -42b -689 -1ef -13d -a9c -374 -ba7 -0ac -a87 -89c -93b -14c -4a3 -a0c -6f3 -b14 -b57 -33a -31d -0bf -559 -079 -06a -3e5 -8cb -6e5 -6ac -75f -811 -661 -a22 -148 -564 -184 -1a6 -03d -4c2 -7f7 -018 -92d -b37 -bbd -c51 -bc5 -148 -8e5 -2d0 -718 -a0d -6a1 -1f9 -4c7 -171 -64c -6bc -1fe -3de -19d -056 -6c8 -1d9 -ba4 -c6d -2a6 -459 -004 -01a -002 -40f -6fd -985 -448 -13b -102 -914 -8b8 -3c6 -339 -4ad -bef -0d3 -6fb -343 -8f5 -980 -973 -217 -606 -29f -74d -565 -b59 -3f7 -48f -1e6 -c73 -16d -c6c -43c -751 -240 -514 -894 -1b9 -a5a -44f -493 -17b -76a -ae8 -af9 -0c8 -4ce -3b8 -91d -03b -96f -50d -04d -896 -93d -c11 -134 -b67 -04f -956 -cc0 -522 -42b -a2c -c1a -839 -66f -81f -0bd -795 -295 -6fb -94c -0ca -81e -8c1 -be8 -08c -6f1 -032 -869 -929 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_sigma.hex b/test_framework/modules/mlkem_keygen/golden/c001_sigma.hex deleted file mode 100644 index 8e2f341..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_sigma.hex +++ /dev/null @@ -1 +0,0 @@ -cbb9900c74cf5fcaf8a9b581ca0553faa4a6f446515a95f19998a48e01ca89b9 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_that_0.hex b/test_framework/modules/mlkem_keygen/golden/c001_that_0.hex deleted file mode 100644 index e66e25d..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_that_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -7de -89e -b22 -8db -4a2 -76f -a4d -45c -af8 -4ce -31f -0a5 -71c -1d5 -13a -92d -84b -965 -b98 -27c -019 -69e -4fd -3c9 -214 -c55 -8d1 -b26 -7b3 -b25 -365 -1c8 -c01 -b39 -a55 -0b7 -8f7 -7e1 -04d -8b1 -0f7 -c77 -44d -03b -c89 -71c -b8f -c13 -31c -abe -3a8 -664 -4ab -512 -994 -41b -bf8 -7a1 -2e7 -410 -99b -8db -a73 -00b -337 -308 -b6c -3a7 -736 -a57 -043 -10a -10c -753 -0e8 -20c -6ca -652 -012 -9c9 -035 -c45 -cf6 -0e5 -2a3 -4ae -347 -7d2 -a9a -0b4 -55a -88e -3f9 -318 -a1f -36a -1e8 -af9 -18e -b3a -808 -31c -479 -612 -754 -65c -bac -5a5 -515 -6e4 -319 -083 -800 -372 -3d1 -544 -6e0 -a36 -44a -094 -baf -15b -a08 -ad5 -2c9 -2be -58d -58b -53d -b04 -ca4 -72a -a47 -2a4 -bb9 -794 -32e -1a5 -bb0 -88c -32c -a41 -a13 -719 -3ff -78a -33b -715 -378 -4ef -b11 -6c1 -23f -0a1 -476 -cdd -4ce -61c -084 -353 -2ac -85d -2ed -7d6 -28b -b0d -7b9 -cc9 -4ce -adb -6ae -153 -ba7 -ba3 -c0a -7b7 -1b9 -33b -b58 -51b -aff -578 -64d -b58 -200 -720 -7cd -0a2 -b0a -241 -1bb -759 -006 -1c7 -42f -1f4 -7c5 -9db -1d4 -cb5 -c3c -c7a -240 -7b1 -1d4 -601 -a4b -c4d -a64 -1ad -32f -918 -b8c -2f5 -5b6 -28e -74c -2b9 -593 -7a3 -883 -287 -3b1 -261 -b32 -6fb -b7b -bef -9c3 -47d -0bd -3d4 -986 -009 -b66 -65d -253 -247 -734 -c0c -9e3 -2f9 -b00 -b29 -738 -a6f -5b3 -25e -a1e -94d -73a -037 -2fb -89a -0aa -532 diff --git a/test_framework/modules/mlkem_keygen/golden/c001_that_1.hex b/test_framework/modules/mlkem_keygen/golden/c001_that_1.hex deleted file mode 100644 index 2660e0d..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c001_that_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -7a8 -795 -c6c -b92 -945 -4c4 -70b -91a -3a9 -cbe -0fa -0d8 -889 -c88 -912 -971 -5d9 -b37 -5d0 -953 -6ad -4ad -c3e -b8a -6ba -a43 -3d8 -bfb -1dc -b71 -2d5 -396 -c08 -907 -2f3 -c05 -4ee -08c -057 -89f -acc -7cf -89a -3a6 -31d -cde -28f -8bf -522 -3d1 -3de -1e2 -45f -807 -85d -3e6 -3b8 -46c -6ba -c71 -8fe -066 -04b -592 -3c8 -8e7 -15a -9bc -464 -34d -c3f -9d5 -98b -78f -203 -b00 -c67 -206 -12a -292 -12c -5fc -8c1 -9a5 -369 -8a8 -ad1 -3de -70c -063 -1f8 -b0e -611 -12f -599 -6ea -1c2 -505 -b51 -94f -b73 -304 -38a -c3f -55e -ab4 -cfa -12d -68f -98e -a38 -37a -508 -140 -3d6 -74c -18c -6b9 -5d6 -085 -00a -351 -aff -761 -53e -0b4 -656 -4c8 -2c2 -af3 -3ee -915 -89f -89f -0a8 -a72 -5a6 -865 -831 -8fb -873 -c01 -033 -0f8 -c30 -197 -0b2 -a8d -8b6 -825 -7d8 -097 -579 -70a -61a -02c -bf7 -721 -ba2 -826 -a52 -a65 -77d -c77 -65e -87b -01d -19c -5b4 -586 -53a -0d2 -0b4 -497 -806 -7e1 -b8d -3bf -270 -697 -988 -c5f -22c -261 -36c -916 -2d4 -6c9 -9b7 -789 -c00 -a47 -66e -08f -082 -6f8 -9fd -c65 -74e -03d -833 -9a9 -1ac -865 -499 -400 -cb8 -3c9 -6d1 -3b3 -4e4 -700 -b6d -63b -0a5 -07a -aa0 -c2f -061 -28a -18f -6f9 -aaf -a40 -4e9 -554 -02f -801 -a1a -5d3 -6de -332 -198 -5c0 -2c3 -275 -7bd -111 -235 -516 -3aa -5a9 -c89 -2eb -c3d -082 -9e1 -a8c -4c1 -41e -06f -3b3 -bb7 -313 -848 -ca5 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_0_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_Ahat_0_0.hex deleted file mode 100644 index c74b529..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_0_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -222 -4b5 -be9 -ad9 -010 -899 -066 -cea -96d -714 -82a -c74 -c1c -74e -6b4 -7f6 -825 -8c1 -4bd -091 -727 -2a1 -2dc -205 -bff -18f -9ff -9cf -25a -b17 -3fd -cf7 -a3a -4e4 -55b -494 -3da -2c9 -641 -54b -9fe -c89 -881 -14c -74f -38f -674 -48b -5f0 -c83 -92d -83d -004 -41e -1e1 -377 -8cc -b10 -096 -8af -cae -436 -42a -492 -18a -c8a -37f -197 -1a9 -b99 -c62 -40d -296 -929 -1c2 -872 -420 -42e -b8f -13b -7e6 -19d -bc4 -114 -90e -130 -b56 -30e -862 -ca8 -937 -6a9 -238 -ae6 -34d -4a9 -04a -a02 -c2f -914 -b08 -3cf -449 -16b -c52 -257 -635 -c10 -58f -46a -6e7 -ca6 -bac -20b -aab -00a -978 -3be -126 -344 -9db -c25 -513 -2e2 -4f4 -7d9 -6b5 -481 -895 -760 -3cb -5f4 -95a -b4c -511 -17d -402 -9e2 -029 -c88 -b6a -3bc -0e1 -69d -748 -71e -94c -25a -a19 -ade -2b1 -7cd -642 -2db -b47 -0a8 -a15 -5ca -c8a -188 -65e -b7c -7b4 -141 -035 -572 -b4a -3ef -193 -684 -2bf -4fc -0a7 -7e3 -8a0 -a5e -2c6 -bd2 -565 -129 -ab0 -31e -10a -812 -0fc -a88 -b5d -bc3 -05f -ab1 -596 -299 -377 -36a -81c -83b -b45 -a5e -688 -587 -063 -3fd -860 -887 -631 -52f -3ed -589 -ba0 -931 -949 -9fd -06c -1d5 -876 -5b4 -82a -768 -965 -50c -279 -4dc -cc7 -338 -623 -034 -6c8 -1c4 -710 -a91 -072 -bca -bc3 -c30 -646 -b82 -b2c -320 -120 -c5d -2eb -4c9 -760 -179 -56c -460 -124 -c11 -355 -c75 -943 -741 -502 -b47 -b86 -a94 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_0_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_Ahat_0_1.hex deleted file mode 100644 index de79d03..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_0_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -73d -777 -565 -295 -422 -1dc -554 -95f -92b -114 -c35 -34e -087 -2f1 -c3a -826 -b8e -1bf -4ee -2b8 -bb9 -647 -6fe -467 -2be -038 -3dd -540 -976 -6e4 -330 -045 -0ad -553 -399 -a42 -6ab -310 -416 -845 -a9b -95f -8cd -2ff -1e1 -2c1 -7c1 -1c5 -000 -15b -51d -4b0 -4a0 -046 -95a -0eb -247 -877 -826 -8e5 -b34 -55e -3c3 -b99 -772 -7c9 -2c1 -9cd -064 -48d -7cb -999 -26d -4eb -1ca -047 -4d5 -7f5 -948 -5bb -c3d -bbc -15a -9a3 -26c -1c0 -1ec -219 -a84 -0ca -8c3 -612 -41a -bca -401 -571 -37a -609 -8f8 -50f -0f9 -7af -8a5 -120 -11b -805 -0c2 -47d -738 -790 -c79 -168 -b60 -bc6 -9d8 -731 -b04 -69c -364 -835 -5fb -3f0 -620 -8d7 -04f -629 -a76 -80b -4c5 -cab -42b -b89 -33a -3ee -48e -4ce -8cb -37d -485 -6a0 -b92 -57c -c28 -162 -5db -69c -146 -aa8 -c24 -c61 -bca -7b8 -158 -51b -016 -6a4 -0f2 -87e -66c -072 -39d -306 -6c1 -199 -91c -a94 -2d9 -1af -cd8 -65a -04a -8f3 -947 -bf6 -7f4 -7ad -39e -a35 -7ab -ce3 -8f8 -564 -498 -a2f -773 -866 -a6f -6bb -720 -8b3 -59e -8c1 -1f1 -bdf -4c4 -965 -c57 -c4f -00a -8cb -a0f -b91 -c2d -03b -1fe -772 -977 -5ab -6d2 -19e -410 -b4c -2b2 -88c -0ed -94c -405 -cfb -368 -af5 -afe -77b -668 -91a -45c -0d8 -8e1 -4db -b50 -639 -a46 -6ad -800 -085 -173 -a53 -516 -62a -bb7 -341 -abb -8e8 -40c -339 -549 -06a -be5 -52d -b5a -56d -113 -1f5 -b2a -b2a -b73 -b63 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_1_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_Ahat_1_0.hex deleted file mode 100644 index 86a18e9..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_1_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -9cf -3b2 -812 -1d8 -81f -886 -cba -18e -84c -78c -0eb -5c4 -c69 -5f9 -07d -3e8 -089 -90f -36f -108 -3ea -b43 -3d5 -23e -2bd -a15 -3cb -b8d -690 -52e -c27 -88f -c0f -bf3 -839 -a24 -7dd -33d -211 -6bf -a3f -1ec -b8f -bb2 -56e -72a -6dc -68d -cf4 -3b3 -6dd -150 -36e -a86 -910 -86b -1dd -509 -33b -63a -b3e -0ae -367 -0dd -c8a -613 -422 -7f6 -08c -7ad -125 -33d -611 -4b9 -1bf -39c -c9b -874 -4c6 -4f5 -53b -cc8 -199 -b47 -193 -0e9 -c09 -b8c -355 -937 -8e8 -c32 -6e9 -7c2 -14f -287 -654 -3dd -9ff -1a4 -c3b -c06 -31c -c43 -848 -08e -ce7 -1cb -bea -ca8 -45a -4a4 -4e0 -4e8 -1be -a26 -336 -412 -8d5 -679 -91c -476 -75b -79a -4e5 -277 -1c8 -18d -273 -b01 -a6c -b81 -531 -979 -8aa -9be -9a2 -634 -b02 -35a -96f -8a0 -87b -b49 -466 -445 -a99 -69f -4f3 -38d -002 -9ec -c39 -5ee -751 -06d -978 -005 -296 -36a -8f4 -82a -6ed -7aa -039 -35f -641 -536 -70a -983 -c9f -749 -82e -a27 -9cd -4ed -89f -1e7 -363 -129 -c14 -0b8 -9b7 -4c2 -bb8 -85a -b42 -41f -a2e -a53 -56b -6fc -93b -cb7 -380 -150 -246 -675 -8ea -315 -5d7 -a62 -98e -c9d -89a -a13 -018 -9eb -802 -6ff -56d -1cd -7ff -bcd -58f -ad6 -97c -a98 -a34 -94e -137 -925 -1e7 -7a2 -0b2 -061 -55c -ad7 -60a -250 -027 -0be -309 -b8f -b9d -1fe -919 -b6a -533 -c9a -998 -70d -1e5 -75e -9e6 -505 -146 -c78 -a8a -858 -363 -1f7 -88e -b2c -395 -224 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_1_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_Ahat_1_1.hex deleted file mode 100644 index 384e7f3..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_Ahat_1_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -6e1 -315 -38b -c33 -507 -5b0 -c5b -315 -19c -852 -8dd -3fa -7cb -0ff -0f8 -2f9 -b9a -4f5 -6c3 -0bc -b13 -5e0 -035 -748 -2b2 -607 -671 -110 -076 -abd -42d -689 -acf -5e1 -1d1 -2a6 -19f -784 -9ad -9ac -854 -252 -84a -4f6 -1db -a70 -a5b -732 -843 -bbb -4ee -4f9 -3c4 -88b -2b5 -7f7 -cd7 -344 -5c8 -afd -ba1 -c99 -3aa -89c -1d9 -24f -5e3 -b5e -6ee -c44 -336 -7cd -0c9 -04d -2b1 -578 -676 -0d9 -389 -48c -0bb -8ca -6b7 -42a -43e -640 -a3e -c74 -267 -c45 -614 -640 -258 -660 -a1c -711 -8e9 -9c4 -aa9 -c6c -2be -b07 -2f5 -5b3 -9a4 -603 -2ee -766 -b0a -4eb -9e8 -38f -af4 -b73 -18a -36f -a84 -aac -040 -9f8 -8a7 -736 -1eb -3d4 -c2a -8fc -171 -c69 -10d -bdb -6f4 -9cf -2f0 -32e -997 -26d -2ad -cbc -bb6 -14c -b1f -71c -98d -bfc -8f0 -314 -400 -b53 -cbe -42e -25a -1b5 -c80 -56c -443 -088 -87a -62e -ab0 -71e -ae8 -c43 -451 -1d4 -b67 -423 -100 -9ab -934 -346 -9dd -5eb -c49 -770 -ad4 -3b7 -8c3 -492 -162 -28a -6b8 -4e8 -731 -534 -428 -4bf -c4e -c46 -4a4 -a67 -8f0 -b29 -57a -0f1 -966 -0ea -9f3 -c76 -35b -20b -534 -347 -5c6 -b51 -01a -200 -6e8 -152 -bba -b1b -af8 -4fe -1cd -a22 -c00 -179 -58e -c8b -ae4 -2b2 -1c6 -293 -146 -498 -99a -851 -1f8 -b20 -235 -4c2 -065 -362 -9da -bdc -4e4 -4f2 -082 -447 -242 -552 -81a -a5b -510 -123 -61e -14f -5fc -cb8 -0b4 -432 -b35 -0c0 -09a -99b -a6f -5ad diff --git a/test_framework/modules/mlkem_keygen/golden/c002_dkpke.hex b/test_framework/modules/mlkem_keygen/golden/c002_dkpke.hex deleted file mode 100644 index 1a7f82c..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_dkpke.hex +++ /dev/null @@ -1 +0,0 @@ -924966384661573c02149787d78c17609c3959f9c6b246ab30d04ea75c95064a8369e8c5845ac38d13865bf5b0db2802f9b52159938cbeac6659536066d51657344ccda1163ad9c221cba444d4ca5f4b2c5f19cc2e5133934959bdcaae1072448571c1fc64ca278ac21fb3cc8258c8ee8a722841397f34cbc968b45bc67bbc6c377993bbbec9b63ad02c0e36c6343c6f16557405631ceb099bccf47760531671cb1ad59160c1199c7be7888639b3d6172b0f968dc7c8c14de6425c7a6fe075ca1f897a9f190f6216461d58a7535b3829e27218f17f3a437e282a9216c33a8cc03affd846cf433a4f263495741bd5d517d0237cb52a6f19b352743b9ff248cf06e1282c0c1dc9105f2f57532e87971503a8a6071b51002e9e39ca27e14636745eeac3611e589b7d6592ba878b3e8c229cc71e30b8583143bc2c516d614bb4b5e41abbfb521e24bb2d79c0f03684d6bb1c33c7b7c334c0ffcca3a687ce99fa57be6113fb09a0b8fb8d58d87886abbc5b6c0482852db9915a74bc3dcd394fe215ce5e7651cd4b425947b61d3887d4e42155f50afba48a51c0333a4a2447260c5dd347e16b899f297166c9262c6ac03cda47489bcc4da3c8934b69aadc28d0f93b3767bd02fb03cce534f22b024e07709316cc7bd0a118b314423a17be6a302c543affbc8a6fb4af5c22a71a7516b4132784c3632f811fb5005dae53041ff0ad98d48020351b0807692d563efef08e52d107e49c0d3574cd208541fe17456da33cfd08c0bb6a7182b39af7fa02b2ba02f7cac8338ab05366b9f85544fdbb2aa4f790742a6dabd83c6bfbb4247317fc7635cf27ac0e86afaebb76c8d0394cd45a64f2a7ce353f75821fa412c31d2c8024fb18e14c738881ba30c521fce0ba887b03b0993d64264b8bd801d569a096a3a7945789018952274915fcc17acba45d6050ba0bc8ad0b231f6ce677a934ce27767222f04ea743403427674539a006c81403a360fe633b6b4085004d8a6c91cfe1ca8f7023115d95adf0d10bd287a900fc4ee1da84ec05809bf673d16b7f8a6a024e49678b0c622c8b6a8c7553b30a44596392 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_e_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_e_0.hex deleted file mode 100644 index bd58da8..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_e_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -cff -000 -001 -d00 -001 -002 -000 -cff -000 -000 -d00 -cff -002 -000 -000 -001 -000 -d00 -000 -000 -000 -001 -002 -d00 -000 -002 -000 -000 -000 -d00 -001 -001 -d00 -cff -cfe -000 -d00 -000 -000 -d00 -000 -002 -002 -001 -001 -d00 -001 -d00 -cff -000 -002 -001 -d00 -d00 -d00 -d00 -000 -000 -d00 -d00 -002 -d00 -d00 -000 -001 -000 -002 -001 -002 -000 -000 -000 -000 -d00 -002 -001 -000 -000 -001 -cff -d00 -003 -000 -002 -cff -001 -cff -cff -002 -001 -d00 -000 -000 -001 -000 -d00 -000 -d00 -d00 -cff -000 -000 -002 -001 -000 -d00 -d00 -001 -002 -d00 -000 -000 -001 -001 -000 -000 -000 -d00 -001 -001 -001 -d00 -d00 -001 -000 -000 -d00 -d00 -d00 -001 -002 -002 -d00 -001 -001 -d00 -001 -000 -001 -000 -d00 -000 -cff -cff -002 -cff -000 -000 -001 -003 -000 -d00 -000 -000 -000 -cff -000 -002 -d00 -000 -000 -002 -000 -002 -d00 -001 -001 -cff -000 -000 -003 -000 -d00 -000 -002 -cff -000 -000 -000 -002 -000 -001 -001 -000 -000 -001 -001 -cff -d00 -d00 -000 -000 -000 -000 -d00 -002 -000 -000 -d00 -002 -000 -000 -001 -000 -000 -000 -d00 -001 -000 -000 -d00 -000 -d00 -001 -d00 -000 -000 -000 -d00 -002 -d00 -001 -000 -000 -000 -cff -d00 -000 -d00 -d00 -d00 -001 -000 -001 -cff -d00 -000 -000 -d00 -002 -001 -d00 -001 -001 -003 -001 -d00 -d00 -000 -cff -001 -000 -000 -d00 -001 -002 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_e_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_e_1.hex deleted file mode 100644 index 7d06568..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_e_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -d00 -000 -002 -000 -002 -002 -cff -000 -d00 -001 -001 -001 -001 -d00 -d00 -001 -002 -000 -000 -002 -d00 -001 -000 -002 -000 -d00 -000 -001 -001 -001 -002 -d00 -000 -000 -d00 -001 -d00 -cff -d00 -000 -001 -001 -000 -001 -d00 -cff -000 -001 -d00 -000 -d00 -001 -000 -001 -001 -000 -001 -d00 -000 -d00 -d00 -000 -cff -001 -001 -000 -000 -001 -000 -000 -001 -d00 -cff -000 -d00 -001 -001 -cff -cff -d00 -d00 -001 -001 -000 -000 -000 -000 -cff -001 -cfe -cff -000 -001 -000 -d00 -d00 -000 -d00 -d00 -000 -cff -d00 -000 -cfe -000 -001 -002 -000 -002 -002 -d00 -000 -001 -000 -d00 -000 -002 -001 -d00 -002 -d00 -000 -d00 -002 -000 -000 -000 -000 -000 -d00 -cfe -d00 -d00 -d00 -001 -d00 -002 -cfe -000 -d00 -d00 -cff -001 -002 -000 -002 -cfe -000 -d00 -001 -001 -000 -000 -000 -d00 -000 -000 -d00 -000 -002 -000 -001 -002 -cff -cff -001 -001 -000 -000 -002 -001 -cff -003 -001 -003 -d00 -000 -002 -d00 -001 -d00 -002 -000 -d00 -000 -cfe -001 -002 -d00 -d00 -003 -001 -d00 -d00 -cfe -002 -d00 -000 -000 -000 -001 -000 -001 -000 -001 -000 -001 -d00 -d00 -001 -cff -002 -003 -cff -001 -002 -001 -d00 -cff -000 -001 -000 -d00 -001 -001 -000 -d00 -000 -000 -000 -000 -000 -cff -000 -d00 -000 -000 -d00 -000 -001 -001 -d00 -001 -001 -000 -d00 -d00 -001 -d00 -d00 -001 -000 -d00 -001 -000 -000 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_ehat_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_ehat_0.hex deleted file mode 100644 index e1d44e2..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_ehat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -392 -33f -b49 -200 -1fe -034 -7fc -92c -c95 -53b -452 -ceb -533 -b8d -030 -2fd -7f0 -953 -261 -c41 -29f -3a6 -184 -3ac -0b9 -3db -a73 -71f -8d8 -47b -168 -87a -6c6 -b1d -470 -2f2 -7d5 -b74 -b37 -a67 -7df -64b -3c2 -a30 -b82 -a60 -159 -401 -786 -54d -7d4 -194 -3f1 -36b -9f2 -264 -958 -9eb -834 -cfe -b84 -53c -11d -861 -1b5 -1ab -2fb -0e6 -590 -0a8 -4a2 -a9b -24d -a68 -b5a -7c3 -b28 -0cf -880 -743 -662 -023 -b78 -966 -90c -4e2 -acf -bc0 -2cc -035 -a4a -48d -a47 -112 -b0e -20b -0cc -4ae -611 -4c2 -620 -340 -c7d -57a -4fd -30b -b70 -2d6 -848 -64f -c3e -9f6 -6f7 -3aa -955 -bbf -745 -b1f -365 -5f3 -20f -664 -43b -42f -9f2 -1c4 -26b -4df -477 -30c -2ee -63c -288 -5bd -338 -0a0 -33e -c44 -6ad -5da -aca -6c4 -355 -07f -53e -1a2 -26b -9a6 -868 -a32 -6d6 -3b5 -a46 -9c5 -c1e -303 -357 -5bb -517 -59b -b7a -0cf -291 -217 -2f7 -a3c -47c -a3a -a90 -505 -5ae -6b0 -6b1 -519 -2fa -9cc -135 -83b -a16 -87a -056 -87f -b8d -924 -333 -93f -7c6 -5f6 -44f -8ea -819 -140 -29a -c02 -811 -14a -04a -3d5 -6d9 -372 -b9f -924 -356 -19d -6a3 -14b -107 -175 -22e -3e4 -a08 -b11 -ca9 -8fb -8ef -b9b -424 -4d9 -0fb -84f -23a -9c3 -1de -308 -b20 -984 -6b4 -b43 -4b0 -b02 -b41 -9f5 -59e -7d3 -8ff -491 -6be -201 -3a0 -44a -9d7 -5e5 -070 -04f -5d3 -7b8 -30a -02c -56c -279 -35e -cca -cd2 -3d9 -bec -acd diff --git a/test_framework/modules/mlkem_keygen/golden/c002_ehat_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_ehat_1.hex deleted file mode 100644 index 992ed32..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_ehat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -719 -2d1 -569 -0e1 -80a -96f -70d -87c -4f9 -111 -a35 -c99 -7c8 -04c -07b -310 -321 -a20 -a7c -2a5 -1a2 -6e3 -246 -63a -3ac -749 -896 -b7d -95e -41f -978 -0eb -1b7 -bc4 -720 -237 -26e -248 -a46 -4aa -21c -956 -315 -061 -a94 -780 -222 -580 -231 -0b0 -878 -0b8 -5c1 -cfc -6f6 -2e0 -457 -1cc -0ec -cfc -758 -ab6 -941 -443 -104 -af8 -96b -733 -bcd -c3c -abf -3a7 -1d1 -a8f -cc0 -afa -bae -95e -057 -862 -05b -7da -526 -29c -535 -9ee -35a -5a6 -41a -c73 -c5a -164 -50e -b8f -2a8 -3a4 -88a -a5c -3e7 -a0e -583 -487 -0ef -418 -bdf -6b2 -15e -094 -670 -c04 -464 -399 -811 -a0c -68f -91d -26f -950 -671 -50f -2e0 -4e8 -c4d -405 -06e -330 -cae -807 -acc -4d3 -ae6 -487 -724 -6fe -b93 -0f1 -59d -1fb -195 -53c -8ea -743 -6f8 -bcd -7a2 -9fa -aa3 -770 -30d -8ba -906 -8c8 -91d -67f -c70 -383 -930 -b51 -b12 -b25 -867 -cf5 -cce -b88 -000 -270 -79f -70c -087 -3f9 -79b -9a8 -6f1 -58f -638 -123 -c77 -a94 -2f6 -154 -c02 -996 -9e0 -6a2 -57b -91b -627 -281 -4aa -763 -52e -65a -436 -af0 -c4f -ce8 -18e -4a7 -c01 -10e -0f9 -0b8 -657 -5e7 -399 -654 -b8c -aa9 -a86 -2ef -1d1 -846 -80e -c8d -85b -082 -6a0 -581 -0bf -58d -361 -15b -2b5 -b97 -223 -66d -01d -856 -a9d -87b -b59 -539 -743 -41f -836 -717 -b7a -52f -194 -681 -a3f -67e -826 -0dd -25f -50a -a14 -7c8 -be2 -66f -18c -494 -86d -915 -a29 -777 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_ek.hex b/test_framework/modules/mlkem_keygen/golden/c002_ek.hex deleted file mode 100644 index 7885526..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_ek.hex +++ /dev/null @@ -1 +0,0 @@ -f5e24e4e14b6653665ca0289a3728cbba228fe116726c1251e9992a9f0060934645b262324acb5c6b57d26e39226e22cf0c33f7ff5a4d979234f2b7949f566db66c35b273dc9778a64f2bcfe914c0d81527d418a112579e5d08b1c429587323425d7a78351453457cd868345afa16218332002c95d8406c14938c039693d6c1216afb9983099031109be0193a1b6e12436103fdd084a7b84380acc35817831c0558d4f8082ba58b9174841a840c2964853656c2327f7952132c6dd129dbf5023ce1b3a92f7736fc19528b71d21a27c3d7b7451d5a8fc02a786f75545d2451549bc95dbbb87724f72d2adf1d619b1b94386c14c37128c2c1c60f4c02b28cc536c508a370ba9a2f4618cf1c64f355684f25a6ee99d3f89ce0136b47d7b26f0e6a60cc94fc4573834172a3efb84c9fb66401b76c90007e8f7b19b513292138b79147a364680dbcb211762358cd32a3c44720df6ba22dc8d3019c0c4803f2a567d9ebc6a5bc012d1f634719891da1324eaf228379264b3da955daa3a2fb8836894c8e80006782141257c254d905a238a6b41ac3c76cb87ea342728ea6e48bc66816842ff2455e85c67f8c48874f469bda56fdd83a57dd4076798a3d854ce40bcc6b349a198fc6fa4713c94794946e249201779709ab7510459e2fa325bb3c816b2af3d9caf36fa5c217379cfeb797a9080fe23374fa02f047c775cb4602b7859f7d79c0af73f11b42847915b3d3246e1044031f61baad987f3c6cc93280b23c8390e48a2108092c7b419bae13ae50067813a99b5da80e58005c6965ffe453ae573501b242124515257c406278c2f7f394574894445c612e4114f0a60404cda976fa63b9a285781e0ab3d77ad2b002f1c885ef746610243b751ab4bcea388027c41063b01679136087364cfdb1392faabb9e20a5177b94bf5a393b7bdd83a7d82343173b8781b44334484354b7179b225aabee99f230795d1fb248aa5615e85c0adb49b7f5104712b86d4034d457975d41b7c88c0664e091e47e9798303c3901583c13606eed7883a537ac0e147068b8c4ac056fba108ff1083a9186ec05b338627a8dce43e5c41410cd6bb35a330d20b77bb3a9034b4e3c443bbeb41b6691f11ab11 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_rho.hex b/test_framework/modules/mlkem_keygen/golden/c002_rho.hex deleted file mode 100644 index c578c23..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_rho.hex +++ /dev/null @@ -1 +0,0 @@ -dce43e5c41410cd6bb35a330d20b77bb3a9034b4e3c443bbeb41b6691f11ab11 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_s_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_s_0.hex deleted file mode 100644 index 27ac99a..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_s_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -cff -d00 -d00 -002 -d00 -001 -002 -cff -000 -cff -001 -000 -000 -d00 -001 -000 -000 -000 -000 -d00 -000 -d00 -001 -d00 -001 -d00 -001 -001 -d00 -d00 -001 -000 -000 -000 -d00 -003 -000 -d00 -000 -001 -000 -000 -000 -001 -002 -001 -000 -d00 -001 -000 -001 -002 -cff -d00 -001 -001 -001 -d00 -cff -003 -000 -001 -000 -000 -000 -001 -001 -000 -d00 -d00 -d00 -002 -001 -d00 -001 -001 -002 -000 -000 -000 -000 -000 -000 -000 -d00 -d00 -000 -001 -000 -002 -001 -000 -000 -d00 -001 -001 -002 -000 -cff -001 -d00 -001 -cff -002 -000 -cff -000 -003 -000 -002 -d00 -001 -002 -000 -000 -000 -000 -001 -001 -001 -000 -002 -000 -000 -002 -d00 -001 -000 -001 -002 -001 -000 -001 -cff -002 -000 -d00 -d00 -000 -d00 -000 -001 -001 -002 -000 -001 -000 -000 -d00 -001 -002 -002 -000 -001 -d00 -d00 -001 -001 -d00 -cff -000 -d00 -001 -000 -001 -cff -cfe -000 -000 -001 -cff -d00 -000 -002 -000 -001 -cff -000 -cff -000 -d00 -001 -000 -cff -001 -d00 -001 -001 -d00 -000 -cff -000 -000 -000 -000 -d00 -000 -000 -d00 -001 -d00 -cfe -002 -000 -000 -000 -d00 -d00 -d00 -002 -001 -001 -001 -000 -cff -d00 -002 -d00 -cff -003 -cff -000 -002 -001 -d00 -d00 -cff -000 -000 -000 -000 -001 -d00 -001 -000 -d00 -000 -000 -000 -001 -d00 -002 -001 -d00 -000 -001 -d00 -002 -000 -001 -d00 -d00 -001 -d00 -000 -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_s_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_s_1.hex deleted file mode 100644 index 64d9364..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_s_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -000 -d00 -002 -d00 -d00 -001 -001 -000 -000 -000 -000 -000 -001 -d00 -000 -000 -d00 -001 -d00 -d00 -000 -002 -003 -d00 -d00 -d00 -001 -001 -002 -cff -001 -d00 -d00 -001 -001 -d00 -000 -cff -000 -000 -002 -002 -001 -001 -003 -cff -d00 -002 -001 -000 -d00 -001 -002 -002 -001 -002 -d00 -d00 -002 -001 -d00 -d00 -d00 -cff -001 -000 -000 -cfe -000 -cff -000 -d00 -002 -cff -001 -003 -000 -002 -000 -d00 -000 -000 -000 -001 -001 -000 -001 -d00 -000 -d00 -001 -000 -cff -d00 -002 -000 -d00 -000 -d00 -001 -000 -001 -d00 -d00 -001 -001 -000 -000 -cff -d00 -d00 -d00 -002 -cff -cff -d00 -001 -000 -002 -003 -d00 -000 -000 -000 -000 -000 -cfe -d00 -000 -d00 -003 -d00 -cfe -000 -cff -d00 -cff -002 -000 -001 -d00 -002 -002 -d00 -000 -cff -d00 -001 -001 -d00 -000 -d00 -000 -d00 -d00 -000 -001 -cff -001 -d00 -d00 -001 -d00 -d00 -000 -002 -001 -d00 -000 -d00 -cff -001 -000 -002 -000 -d00 -001 -d00 -001 -000 -002 -001 -000 -001 -000 -d00 -001 -000 -002 -002 -001 -d00 -002 -d00 -001 -d00 -002 -000 -001 -000 -001 -000 -000 -001 -000 -d00 -d00 -001 -002 -000 -000 -d00 -000 -000 -000 -001 -d00 -001 -002 -d00 -d00 -cff -000 -000 -001 -000 -000 -001 -001 -001 -d00 -001 -000 -002 -000 -002 -000 -d00 -002 -002 -cff -d00 -001 -000 -d00 -cff -001 -000 -000 -001 -001 -001 -002 -000 -001 -cfe diff --git a/test_framework/modules/mlkem_keygen/golden/c002_shat_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_shat_0.hex deleted file mode 100644 index 907870a..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_shat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -992 -664 -638 -614 -c57 -023 -714 -879 -cd7 -178 -c60 -399 -959 -c6f -6b2 -ab4 -030 -4ed -ca7 -955 -a06 -834 -869 -c5e -a84 -c35 -38d -861 -55b -b0f -8db -022 -5f9 -21b -359 -8c9 -cbe -66a -359 -605 -566 -16d -457 -4c3 -1cd -16a -93a -c2d -b21 -a4c -444 -cad -b5f -2c4 -95f -cc1 -12e -335 -993 -594 -abd -aec -210 -447 -185 -c17 -4fc -ca6 -a27 -c28 -31f -ccb -882 -c85 -aee -728 -128 -394 -47f -cb3 -8c9 -b46 -65b -7bc -cbc -376 -379 -bb9 -9be -b6c -03a -2cd -60e -c63 -c34 -6f3 -516 -745 -305 -1c6 -9eb -9b0 -4cc -77f -360 -165 -b71 -1ac -1d5 -609 -9c1 -9c1 -77b -88e -986 -b33 -7d6 -2b1 -60f -8d9 -8c7 -c1c -64d -42e -a5c -6f7 -5e0 -ca7 -91f -7a8 -99f -0f1 -662 -461 -81d -a75 -b53 -385 -229 -72e -118 -7ff -33a -7e4 -a28 -922 -316 -3ac -08c -3ac -8ff -46d -3cf -3a4 -64f -342 -495 -1b7 -5d5 -17d -3d0 -7c2 -ab5 -6f2 -319 -52b -b74 -9f3 -8f2 -cf4 -106 -28e -c2c -1d0 -0c9 -5f1 -72f -535 -72e -978 -315 -a80 -7a6 -1b0 -051 -2e0 -99e -ca3 -127 -46e -436 -5e7 -3ea -61c -81e -9b5 -57d -926 -7ba -8b8 -c3e -228 -79c -1ec -830 -58b -331 -bc4 -12c -6d5 -b61 -b44 -4b5 -1ae -bbb -52f -41e -bb2 -92d -c07 -6f0 -843 -bd6 -1cb -733 -b7c -4c3 -c03 -cff -a3c -7a6 -ce8 -a99 -57f -1be -136 -9fb -a00 -bb8 -8df -858 -78d -b86 -bca -c5b -046 -582 -2d8 -1b9 -5a9 -c74 -3db -9cd -4f3 -5e2 -ce1 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_shat_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_shat_1.hex deleted file mode 100644 index 71341e0..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_shat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -65e -517 -bcd -424 -759 -b64 -81d -873 -4d4 -21e -555 -0af -4fb -8aa -051 -33c -a3a -244 -647 -0c2 -35d -47d -be1 -896 -99f -712 -966 -26c -a2c -c06 -a3c -47d -b48 -cc9 -34d -c8a -b93 -694 -caa -28d -9d0 -3bf -737 -bd6 -b02 -03f -5cc -34e -bf2 -022 -74e -700 -693 -cc1 -07b -a1d -318 -14b -a42 -173 -abe -306 -42c -3a5 -cff -8ab -46f -afb -25c -a72 -51a -167 -3b4 -271 -384 -63c -12f -1f8 -0b5 -5d0 -3ae -045 -01f -adf -498 -80d -520 -1b3 -708 -690 -62d -3e5 -0fe -8ef -152 -07d -ce4 -0d9 -435 -cd7 -520 -418 -7fe -451 -36d -3ca -8fd -c00 -abb -716 -382 -9ab -af7 -02f -ab2 -02b -af7 -c8c -a33 -b08 -653 -b96 -5f8 -445 -bfd -2ab -7a4 -90f -a74 -6d2 -8ab -3cd -b6b -b4f -324 -177 -6fc -357 -7cf -ac2 -60e -af8 -bae -76b -0c8 -39d -44c -5ad -264 -a7f -5ce -3f3 -275 -1f8 -2a4 -c31 -c1d -802 -b24 -18f -ce1 -734 -188 -ba8 -530 -21c -0fc -bae -b88 -037 -9b0 -3d9 -664 -4b2 -88b -01d -9d5 -a06 -396 -a7a -794 -895 -901 -528 -927 -154 -1fc -7ac -4cb -5da -060 -ba5 -80b -adc -30b -1f2 -66c -77e -4a9 -ce3 -627 -727 -022 -4ef -3a7 -404 -734 -672 -945 -a03 -806 -14c -303 -60a -3fe -3b6 -06b -854 -d00 -8a4 -16c -cf9 -ae1 -8fc -370 -112 -55d -ad9 -1f0 -0bd -7d2 -a98 -c00 -4ef -ae1 -84d -5ec -800 -69b -73f -bd1 -7f6 -a8a -026 -94e -674 -c8b -620 -b2c -6a8 -58c -537 -ab3 -440 -359 -926 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_sigma.hex b/test_framework/modules/mlkem_keygen/golden/c002_sigma.hex deleted file mode 100644 index 31c8ab9..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_sigma.hex +++ /dev/null @@ -1 +0,0 @@ -6347ba62f3b49765a88c96e86c904065afd688a9b810d5d78aefb8d53685c340 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_that_0.hex b/test_framework/modules/mlkem_keygen/golden/c002_that_0.hex deleted file mode 100644 index 25459f3..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_that_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -2f5 -4ee -44e -b61 -665 -653 -2ca -890 -2a3 -8c7 -2bb -28a -1fe -671 -126 -25c -91e -929 -0a9 -06f -409 -643 -65b -232 -c24 -b5a -5c6 -7db -326 -92e -226 -2ce -3f0 -3fc -57f -a4f -9d9 -237 -b4f -792 -549 -66f -6db -c36 -75b -3d2 -7c9 -8a7 -264 -bcf -1fe -4c9 -10d -528 -17d -8a4 -511 -792 -0e5 -8bd -21c -954 -287 -343 -725 -a7d -183 -455 -734 -cd5 -386 -458 -1af -62a -318 -203 -902 -5dc -684 -c10 -849 -c03 -939 -3d6 -26c -161 -9af -98b -930 -039 -911 -be0 -301 -a19 -1b6 -24e -036 -3f1 -8dd -4a0 -47b -388 -c0a -35c -881 -317 -5c0 -8d5 -04f -828 -8ba -b95 -817 -414 -0a8 -c24 -896 -534 -c65 -236 -727 -95f -221 -c63 -2dd -9d1 -0bf -235 -bce -3a1 -792 -73f -16f -95c -728 -1db -221 -7ca -b3d -747 -551 -a8d -2fc -a70 -786 -55f -245 -45d -915 -bc4 -b95 -bbd -287 -4f7 -272 -add -6f1 -19d -9b1 -43b -186 -4cc -237 -8c1 -c2c -601 -0f4 -2bc -c28 -53c -06c -8a5 -b37 -a90 -4a2 -61f -18c -c6f -54f -563 -284 -5af -96e -9de -93f -ce8 -601 -b43 -b7d -267 -6f0 -a6e -90c -4fc -7c4 -385 -734 -2a1 -b3e -84f -bc9 -66f -b40 -761 -0c9 -070 -7e8 -b1f -19b -325 -392 -8b1 -479 -7a1 -636 -804 -bdb -21c -217 -356 -38c -2ad -43c -724 -60d -baf -c22 -8dd -930 -c01 -0c4 -3f8 -62a -7d5 -c9e -6ab -05b -12c -6d1 -34f -871 -919 -3da -241 -2ea -28f -237 -649 -ab3 -95d -a5d -3aa -82f -83b -468 -c89 diff --git a/test_framework/modules/mlkem_keygen/golden/c002_that_1.hex b/test_framework/modules/mlkem_keygen/golden/c002_that_1.hex deleted file mode 100644 index 391cd07..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c002_that_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -0e8 -060 -178 -412 -c25 -257 -04d -5a9 -a23 -6b8 -c41 -3ca -b76 -87c -4ea -273 -a28 -6ee -c48 -66b -881 -426 -4ff -552 -ce8 -675 -4f8 -88c -474 -69f -5bd -6fa -3dd -a58 -47d -07d -867 -a39 -4d8 -ce5 -c40 -c6b -9b3 -a14 -c98 -6ff -1a4 -3c7 -994 -497 -246 -49e -720 -791 -a70 -b79 -451 -590 -ae2 -32f -35b -c8b -216 -afb -c3d -af9 -a36 -5cf -321 -797 -bcf -79e -07a -809 -3fe -372 -04f -2fa -c04 -777 -45c -60b -82b -597 -7f7 -9cd -70a -3ff -411 -28b -147 -5b9 -23d -463 -4e1 -400 -631 -1bf -9aa -87d -6f3 -ccc -893 -0b2 -823 -39c -80e -a24 -010 -928 -4c7 -19b -1ba -3ae -0e5 -670 -a81 -993 -ab5 -80d -0e5 -058 -6c6 -5f9 -5fe -3a4 -3e5 -507 -41b -212 -124 -525 -457 -06c -c27 -2f8 -97f -453 -974 -448 -645 -12c -1e4 -4f1 -00a -406 -a4c -97d -66f -3ba -89a -572 -081 -abe -73d -ad7 -02b -2f0 -81c -5e8 -6f7 -614 -302 -b74 -b51 -4ba -3ce -88a -c02 -417 -b06 -013 -167 -369 -308 -647 -bcf -13d -a92 -abf -2b9 -0ae -751 -b97 -54b -a3f -793 -bdb -ad8 -7d3 -482 -313 -873 -78b -41b -334 -444 -358 -14b -797 -5b2 -aa2 -9be -9fe -723 -950 -bd1 -24f -58a -61a -55e -c08 -4ad -9bb -17f -045 -b71 -862 -3d4 -4d0 -945 -757 -bd4 -7c1 -088 -66c -94e -1e0 -947 -79e -383 -c30 -590 -831 -6c1 -063 -7ee -88d -33a -7a5 -1c0 -47e -b06 -8c8 -04a -56c -1fb -08a -0ff -831 -8a9 -6e1 -bc0 -335 -786 -a82 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_0_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_Ahat_0_0.hex deleted file mode 100644 index 61e88ed..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_0_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -8b6 -ab6 -282 -661 -6a9 -71d -a79 -644 -357 -993 -63c -27a -0bd -71a -1bf -4c9 -7f3 -6fc -7ba -b00 -707 -7c9 -bb3 -7b6 -0fd -c55 -b8c -617 -be0 -9e7 -859 -2af -b57 -c48 -a35 -09f -562 -c03 -65d -cfa -5a2 -0cb -c6c -64c -844 -2e0 -3b6 -aca -6ae -9c2 -218 -767 -2a4 -763 -8e2 -4ab -055 -b54 -21d -34e -2d2 -af4 -4e8 -c03 -956 -ce9 -c03 -15b -087 -1e4 -94e -959 -07a -7c9 -308 -ac5 -590 -8fc -49f -460 -1e5 -95c -9e0 -b6f -68a -88d -a2f -798 -6b2 -a4d -467 -ba7 -9c9 -30c -5e2 -1ba -0eb -4ed -829 -2c7 -1df -6b1 -c4b -458 -c51 -73f -c09 -70e -61a -16c -0a9 -40d -b5a -736 -ada -560 -b85 -6d2 -c6e -b85 -79c -2b2 -419 -c8e -947 -2f7 -188 -9af -288 -568 -8e5 -b99 -084 -7d6 -2b4 -c0a -ca8 -2e6 -4d3 -5a1 -606 -0e5 -4ff -8da -b05 -bfe -a6b -6c9 -03b -625 -46c -41f -6f7 -5f9 -aa1 -66e -bdf -cc5 -2b8 -652 -0fc -7fd -a6a -1ec -574 -073 -694 -576 -8a4 -742 -b5e -410 -ca3 -37c -111 -11d -48b -1f3 -7cf -71e -298 -48f -303 -5fc -807 -7b5 -696 -637 -66f -764 -bce -393 -4de -4bb -63c -a67 -039 -672 -844 -351 -16b -32d -c22 -a33 -112 -0df -748 -396 -2ed -8d8 -414 -02d -151 -333 -570 -08c -c57 -553 -3a1 -934 -688 -473 -55a -2cb -890 -858 -8ce -ce9 -983 -9fe -832 -9c9 -a8a -814 -2da -33c -97a -6ea -553 -08c -644 -7f1 -bcf -568 -af5 -3bc -a5b -78f -2c4 -bd3 -0e7 -a21 -39c -4e5 -0d7 -a5a diff --git a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_0_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_Ahat_0_1.hex deleted file mode 100644 index bcbc639..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_0_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -3ac -bb5 -b63 -992 -b0e -78e -cfb -631 -c17 -a30 -038 -0a8 -05b -c32 -1a3 -cb1 -66b -857 -074 -2df -089 -ada -07f -39c -9a3 -b5e -826 -79d -54f -181 -841 -928 -2b1 -8ad -a6f -96d -1ff -8bd -815 -a0e -513 -a87 -a29 -0a8 -015 -084 -219 -7e3 -339 -9e1 -4ca -7aa -687 -bab -267 -0fb -5da -1ad -2a3 -378 -a8a -40e -3a1 -849 -5aa -483 -080 -70f -5ff -b28 -1b2 -093 -bbf -152 -0d9 -ab1 -adf -93a -4c3 -c9b -343 -842 -ad8 -50b -520 -7a3 -b7d -b7b -cb7 -286 -0f0 -7ab -6bc -8c4 -2ab -404 -2b4 -951 -30b -6cb -80f -9c3 -83a -097 -200 -afb -1cf -b16 -9d8 -476 -7e3 -b12 -7d1 -0f3 -343 -c4c -82f -15e -2f6 -cd0 -a03 -a3d -454 -1c8 -235 -6c6 -150 -520 -c43 -c91 -378 -5fd -c2e -974 -23c -64f -00f -2b5 -2f8 -cc9 -a3b -0dd -3d0 -660 -5c8 -409 -a97 -818 -0e5 -c45 -02b -bc0 -8ee -a76 -8f1 -20d -890 -51e -071 -0d2 -ce7 -770 -7de -69c -195 -3ed -110 -a06 -969 -5f7 -4c9 -977 -c56 -8f8 -88c -2ae -3a6 -740 -806 -45c -0f5 -a80 -60a -2ff -2e7 -bc1 -bb7 -52a -521 -909 -15f -98c -4d2 -cf5 -afe -249 -32c -ac2 -841 -458 -1cc -47e -1b1 -c86 -6f3 -386 -8c8 -cd6 -19f -cdc -0b1 -70b -ab9 -7c4 -af2 -465 -2e7 -5d9 -aee -8e3 -2ea -c38 -809 -66d -4e6 -b21 -c08 -633 -c3f -5cb -769 -af3 -7fc -418 -09f -adb -6e0 -7c3 -bb8 -9a1 -7d9 -6b3 -099 -b22 -ae5 -1cc -a45 -411 -4a9 -9a0 -09c -0e2 -795 -81b -b2e -910 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_1_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_Ahat_1_0.hex deleted file mode 100644 index 0a4ac53..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_1_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -5bd -03b -326 -c3e -a6b -cf6 -709 -78a -1cd -7a2 -201 -4fd -9c7 -27f -466 -c40 -54f -333 -b3e -74a -a20 -4c9 -4bd -995 -3b4 -011 -b4f -c2e -328 -92d -cce -8dd -5a8 -6e2 -505 -4b7 -54c -9b4 -ce0 -012 -904 -6ef -212 -4bd -2a6 -78a -1ac -0ee -2ee -36e -5f4 -1e4 -c09 -07b -a1d -6e0 -023 -4c2 -4ad -004 -5bf -b77 -558 -882 -704 -c36 -545 -0d6 -4ff -36e -5b1 -b46 -193 -417 -3b1 -3f5 -235 -2f5 -972 -b4e -c1a -87c -7fb -b4e -a47 -23b -8a3 -913 -77d -aab -97a -0ba -723 -50d -c03 -4c2 -a13 -73e -42b -ab1 -726 -903 -8e7 -ade -bdf -210 -228 -926 -ac8 -b95 -22e -2de -ce5 -b6a -341 -20e -502 -979 -a4e -5ae -698 -078 -752 -250 -00b -39b -a42 -a9f -0e5 -7bd -216 -974 -6a0 -7a2 -10e -302 -33b -5d2 -4c7 -c0d -244 -5e0 -3a6 -955 -26b -145 -cf5 -b98 -971 -a5f -41a -4cc -10a -132 -5ad -8af -4dd -546 -ca7 -254 -1ce -2dd -679 -07b -618 -8bd -9bf -050 -03b -180 -c98 -9a6 -460 -7b9 -aab -35f -2a1 -58d -401 -408 -cac -aae -591 -4e1 -418 -7d6 -82b -75c -763 -7f1 -64d -5a4 -668 -517 -5ba -78e -324 -2ee -737 -44f -18e -8fd -125 -988 -38c -603 -a80 -53a -437 -962 -354 -1d4 -6c7 -cd1 -8eb -720 -7bd -0ca -764 -ad0 -86e -7a9 -799 -952 -9ad -6e9 -9f7 -898 -2cc -be3 -76f -570 -6ff -255 -111 -c7e -cc4 -894 -63b -396 -90b -164 -9fd -af6 -0d6 -4ab -be1 -b2d -8ae -a13 -55f -79a -262 -ab3 -94c -4a1 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_1_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_Ahat_1_1.hex deleted file mode 100644 index 87c02de..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_Ahat_1_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -1af -471 -02b -a91 -1f3 -6b1 -774 -571 -737 -14d -c68 -3d6 -883 -634 -562 -9b9 -934 -319 -ae4 -690 -a90 -734 -cbf -824 -293 -c2e -444 -274 -00d -33b -76c -4d0 -768 -9d9 -65f -a60 -55b -a3e -432 -068 -120 -032 -19d -471 -6fa -776 -082 -049 -569 -060 -8e7 -3d1 -244 -2e7 -200 -cf5 -6a5 -1c7 -0ab -61c -733 -209 -659 -289 -93f -846 -23f -52f -4ef -6c9 -82a -6ac -485 -c78 -297 -148 -167 -62d -66c -4f8 -984 -17a -b87 -794 -b87 -881 -806 -734 -997 -a6a -a20 -56d -c23 -4b8 -17d -c49 -bee -a6e -c33 -42e -831 -cfa -8f7 -883 -c90 -5e9 -9ae -35e -292 -446 -35c -23f -c25 -287 -4e5 -a5e -c8e -35e -294 -4e1 -20f -75e -9f3 -660 -71b -63e -320 -975 -a81 -106 -528 -bd0 -837 -7c3 -0dc -6d6 -7b4 -b28 -181 -732 -3c0 -7bd -892 -526 -274 -92a -023 -4a7 -9f4 -51b -ab3 -172 -245 -719 -2b2 -423 -6e9 -873 -2af -35f -7df -5f7 -14e -6e1 -64f -c9a -340 -7c9 -421 -0fc -89b -3ad -b3e -cd3 -a1b -83e -123 -c28 -26a -53b -3f1 -347 -ca9 -3e1 -10e -233 -87c -3be -31b -867 -7bd -b1f -160 -c3c -c3c -6db -90a -afd -062 -10f -5ae -c92 -2a7 -6fc -4df -659 -25f -22e -14e -826 -5f9 -00c -390 -ad7 -7bc -84d -4e2 -a02 -c8e -b85 -09f -345 -cdc -b60 -966 -285 -c12 -212 -2bd -bbf -c6a -4ed -01b -3ff -397 -3c3 -3ca -5e8 -0f4 -2a3 -c9e -a24 -cfd -0ca -1cd -524 -7b3 -126 -816 -553 -ce6 -20a -5c7 -796 -a1d -9eb diff --git a/test_framework/modules/mlkem_keygen/golden/c003_dkpke.hex b/test_framework/modules/mlkem_keygen/golden/c003_dkpke.hex deleted file mode 100644 index dc00348..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_dkpke.hex +++ /dev/null @@ -1 +0,0 @@ -7eb1be50334821e67d04da9ae18c8f03c8c0a0c5b0098c82b404c70e12c56ad7943d9a6af1477f37a2b144c9c598965cc3da21a1118353f9132da664e668810d50cb31b76f64c76af3647ebe34b5b4d7bc4cf29b615352aab69bdd9004f6aaa21107938804243958486075a8f012707f42cac2567c2ac6a12f8a7e8260ccbaf0cfc8608b826a87ab3c086ebb3760c0bf8fe53b9f70ba066b1a4145ad7c3095dec14f65b533347cbaf62c5d4b830377c6a641e83b54f49ab1f44ffd92c098bb1d1eda4fe74a72477661b6628e3af405a0f6a11e8b2a5cc55c8136797a3370c3505760120beae02f892ccffdf293db7c03a4c65c3c0c9fc87997a5f6c003271ae68909ae012e506abfb7880e13429b5f516ee2592992e942f1664cf43ba274e1453782a454e4bf8c83654cfb8afa90b11caa73e94053bb31a0662894873c76c3640a8c6267b7fa8dce24719d0666f4b09a1c091d2df3bba3c64b39a22d14f8103a094cbc836119b33bd780a2872617be355d67585407967d00651405734d6fc7004705aee2436c1a375e4748a9d700a68d567e9a977eb00850ef35bcbda045b9b45ba6e41f1f6b2fa27b2c173014344a6fc703340d1aca3a184eb5649baf8148e0c041e28c352ce32b9e2750657728ffea6f54e458bdb34b96a2b0168a61e1a0cfae75b9e86cca8f08b1f311a0ecf3896c0142005340c2b5130b4aa6aca316dc9c77bdd11bc1a41b49f93600806b57f2a90a966c89949a2e1cc8ece51386c922ea909a5a36a0ba412ecdc379af1c176304b7d5687c74f2800ffa4f27a488dc5543ef33920896ad01262e00545df1a992d402361c1288b4753a1d641ed70b418d61bd2c48638881604ffb530c33a301172bbd3823f6b01b3ed24cfd392a0da769564c02c6b021f757323a750837d596d6da1845548649a4957a9752e0faa75b15b7a4f7564d1a1eb86484a3a78eeaa3843c853eaef1c6b78263fe27273d623111755f4f68bcdb0630026ac6cbf2b332a349e3fc0d8a090eb78516fa0147c4a1ba9f211e4006571351c0087330ed3c66bd077983251fcdf79d3cf10235d34554dcaa diff --git a/test_framework/modules/mlkem_keygen/golden/c003_e_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_e_0.hex deleted file mode 100644 index 7c19c41..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_e_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -001 -cff -001 -cff -d00 -001 -d00 -001 -000 -cff -d00 -d00 -002 -cff -cff -001 -d00 -001 -000 -cff -000 -d00 -002 -cff -000 -000 -000 -cff -d00 -000 -000 -cfe -cff -001 -000 -000 -001 -000 -000 -d00 -001 -000 -000 -000 -d00 -cff -d00 -d00 -000 -d00 -003 -d00 -000 -d00 -d00 -000 -000 -001 -001 -cff -001 -cff -002 -d00 -003 -d00 -002 -cff -000 -cff -001 -000 -000 -000 -001 -cff -d00 -000 -003 -cff -002 -000 -000 -000 -cff -002 -d00 -d00 -001 -cff -d00 -000 -cff -000 -d00 -cff -000 -000 -d00 -002 -000 -002 -003 -cfe -002 -002 -000 -cff -000 -d00 -002 -000 -001 -d00 -cff -000 -000 -000 -000 -001 -cff -000 -001 -cfe -001 -d00 -000 -cff -000 -001 -000 -001 -001 -002 -cff -000 -cff -d00 -001 -cff -cff -d00 -001 -000 -cff -000 -000 -000 -000 -000 -003 -000 -cff -003 -d00 -d00 -000 -000 -000 -d00 -d00 -d00 -cff -cff -000 -d00 -001 -000 -d00 -000 -000 -000 -d00 -cff -d00 -000 -001 -000 -d00 -d00 -001 -000 -002 -001 -d00 -cff -000 -000 -d00 -d00 -cff -d00 -000 -000 -000 -000 -d00 -d00 -d00 -000 -cff -000 -002 -002 -d00 -000 -001 -001 -cfe -d00 -000 -d00 -cff -000 -001 -cff -d00 -cff -001 -003 -d00 -000 -cff -001 -002 -cff -000 -001 -000 -d00 -000 -001 -cff -d00 -001 -003 -000 -001 -d00 -002 -d00 -d00 -001 -d00 -001 -001 -000 -000 -d00 -001 -d00 -cff -001 -002 -000 -001 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_e_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_e_1.hex deleted file mode 100644 index 72674dc..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_e_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -002 -000 -001 -000 -002 -000 -cff -001 -001 -001 -d00 -000 -000 -001 -d00 -000 -001 -d00 -002 -001 -001 -cff -d00 -000 -d00 -d00 -d00 -d00 -001 -001 -001 -000 -001 -d00 -d00 -000 -002 -000 -000 -001 -d00 -000 -001 -001 -000 -001 -000 -001 -000 -000 -cff -002 -001 -000 -d00 -000 -cfe -001 -d00 -000 -001 -cff -d00 -002 -d00 -d00 -d00 -d00 -000 -001 -001 -002 -001 -000 -000 -000 -000 -001 -d00 -001 -cff -000 -001 -001 -001 -d00 -cfe -d00 -001 -002 -d00 -001 -000 -d00 -000 -000 -d00 -000 -000 -d00 -000 -000 -000 -000 -d00 -000 -001 -d00 -000 -d00 -cff -001 -d00 -001 -000 -d00 -cff -000 -002 -002 -000 -001 -cff -000 -001 -d00 -d00 -cff -001 -d00 -d00 -001 -003 -000 -d00 -cff -000 -d00 -001 -000 -cff -001 -d00 -001 -000 -d00 -d00 -000 -000 -000 -000 -000 -d00 -d00 -000 -d00 -000 -d00 -000 -000 -cff -000 -002 -d00 -000 -000 -000 -001 -001 -001 -001 -001 -001 -d00 -d00 -d00 -d00 -d00 -cff -001 -cff -001 -cfe -000 -000 -000 -000 -d00 -000 -000 -001 -001 -000 -002 -d00 -d00 -cfe -000 -000 -000 -cff -002 -d00 -000 -cff -000 -cff -003 -000 -000 -003 -003 -001 -d00 -d00 -d00 -001 -d00 -000 -d00 -d00 -d00 -d00 -d00 -cff -000 -001 -d00 -001 -001 -002 -cff -001 -d00 -000 -000 -d00 -002 -000 -d00 -001 -001 -000 -cff -001 -d00 -cff -d00 -002 -d00 -000 -d00 -002 -d00 -d00 -000 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_ehat_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_ehat_0.hex deleted file mode 100644 index 181752a..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_ehat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -52b -2b3 -569 -9f8 -04d -4bb -bc7 -802 -10e -50d -834 -b62 -00f -8dc -575 -276 -491 -023 -1d8 -184 -201 -3b7 -a9c -0d9 -445 -af1 -6a9 -2f4 -89a -5c1 -129 -473 -3ad -761 -a53 -a56 -0a8 -689 -a4d -0f4 -4fc -454 -43a -b06 -9fc -918 -279 -171 -8d1 -c0c -3a3 -00c -1a1 -6bd -26f -b16 -987 -65c -3b9 -b8f -057 -82e -782 -1e3 -404 -135 -588 -0dc -9e3 -221 -443 -173 -0e2 -9ca -576 -a47 -44d -859 -6c2 -8a0 -0f7 -bb9 -8f6 -1b3 -25f -018 -47c -09e -c74 -695 -2a1 -b3f -321 -83b -acc -aa5 -213 -0b2 -be7 -10e -22c -148 -5b7 -b07 -3f5 -0f4 -934 -0dc -28c -88d -04c -a6e -2be -c90 -be5 -1c8 -7a9 -b7c -aac -861 -0c6 -519 -940 -2fd -37d -9df -5bc -6bc -a33 -0d0 -5f7 -14d -ca3 -b11 -1da -16e -0c0 -88e -5b5 -a9d -1c1 -c6a -16d -2d4 -58d -9ee -72d -9d3 -6c6 -5dc -8e0 -595 -560 -31c -3bc -46e -6b2 -84f -ac8 -819 -7ed -7c4 -8db -453 -21b -4cd -55e -905 -a5d -53f -854 -2da -266 -6b8 -770 -c43 -446 -1b8 -9d1 -8d0 -37b -0f9 -b9e -20b -52a -a0d -4d3 -916 -444 -97f -1b7 -56c -6f5 -564 -022 -ba8 -267 -071 -82a -0be -cee -40c -928 -5c1 -027 -4a0 -c6c -80f -801 -0e0 -810 -bd4 -3ea -adf -85c -b34 -a7f -cd8 -07e -147 -c0c -1ed -98f -024 -2b9 -3be -acd -35e -988 -604 -5e0 -85e -272 -a62 -94c -806 -b5c -2e4 -539 -13a -5dc -844 -a84 -133 -86a -8af -97d -4f2 -739 -006 -a36 -4f7 -9a4 -5cd -456 -c2b diff --git a/test_framework/modules/mlkem_keygen/golden/c003_ehat_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_ehat_1.hex deleted file mode 100644 index 847266d..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_ehat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -cb1 -ae6 -443 -c2c -95f -732 -75e -a43 -ce9 -b37 -286 -381 -770 -ac7 -be8 -7b2 -c4a -a8d -497 -ccc -8af -439 -0d3 -8c7 -a34 -ca1 -18f -a28 -7c0 -b5b -67a -188 -7b3 -5e7 -72e -7cf -7db -32f -80c -4d4 -57d -01d -1d4 -74a -450 -8ec -898 -3cf -9e1 -2e4 -32e -c81 -60c -1c0 -bc4 -5a3 -358 -1b9 -06a -cda -1c0 -a54 -abf -956 -62d -b7d -3e8 -765 -9ba -345 -aa1 -76e -252 -488 -903 -324 -70f -28d -c1b -257 -625 -1fc -c3a -876 -c0a -1bf -c5c -130 -b09 -ca4 -5af -146 -3d9 -552 -592 -913 -7c6 -c51 -bf8 -0a2 -74e -43d -22b -079 -8e1 -a4a -4de -22e -9f9 -6e7 -3eb -186 -05c -6d8 -627 -0f9 -2b1 -369 -b04 -498 -9ac -394 -cd8 -4ec -165 -9e3 -8f7 -bcc -165 -814 -497 -4fb -0e7 -502 -15a -06d -c48 -6f1 -853 -093 -03b -1e5 -a5a -cd0 -1a6 -362 -5b2 -b07 -be7 -bfd -540 -5da -0d6 -8dd -619 -146 -509 -637 -c93 -41e -a54 -62a -14e -3ec -afc -34e -460 -675 -4c9 -7df -332 -5bf -812 -07c -553 -0ca -787 -cd3 -974 -a33 -73d -be7 -8ed -a00 -496 -3d9 -b63 -4bb -8f7 -736 -a56 -109 -809 -339 -790 -ab9 -759 -cd3 -b13 -849 -1a8 -9f6 -a82 -bd9 -48c -adf -a3a -501 -51d -6ec -2cb -970 -5ae -078 -8e8 -233 -64c -197 -a4b -15c -723 -8f5 -8df -381 -149 -883 -af4 -44d -220 -b8f -5eb -ad6 -2a0 -63b -9bd -a92 -64f -c4f -0b4 -b8a -54a -03b -9e1 -8f4 -21a -a43 -12b -80c -424 -c9f -bea -07b -220 -4d6 -2ee -0dd diff --git a/test_framework/modules/mlkem_keygen/golden/c003_ek.hex b/test_framework/modules/mlkem_keygen/golden/c003_ek.hex deleted file mode 100644 index 0409331..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_ek.hex +++ /dev/null @@ -1 +0,0 @@ -3631008f7183b49b55f5c4b6431936a5cc871749cd95e8c65f023af1ab06135c702cf2c15112c129f74893337010424a82c17928538e93904245294be1665dcdf7a468579d03d0cc509b5096f7a043e45c670362dc18bc5245b0c694cf6f492117d1577428c8bce8871b78669c951b07a8577511b08b8657360bcb7a59060a236bb3772887d9b6ff4821bff754fbe840f2274e8195139c472dbbf96a72371a30059e55ea84313c5ffbc961279243697c0d6123cca83654c51c25e34bc5ed6367798905cd934e210174fb175ed03387da1c314d3734cb281db0611feba38590584b419012a2347829519a00fcaa33671e42a53ae0807c11749bddfa90b505b862456ab3cbab9b4243e3015c051836bdb233bb814ef9102900a5cdcca2ab57f6bdafba4b6023095000b19acc110e336aa012ba6b9111a9d6c30a06a2db36842525297e447389a7904d93360d640d48780dfb645922d0a05b8833857834e889a2419c2b97453e3fabccf0642006c6a7adc7a9868759ae11cde6a68adaca3f6ea47ec573a64b89c7ad2633ed571591711d9d5310e9d83c6997b6ae317f3fc7011aa0b9fc171156779b85ea4708276ddcf96bb80017324008e82355e78184fb9879d3f42c87d9562df34c55146d424a150f1112364953304808b6d5ba66d2832aa532d0d4212df7b385477eb57aaef2f385a54660aedcb4edd96ebdfb050bd81deb3a09aafca5115282ce74c4392624c974a94a601295330209d59f0a0033379790aebb5b43d518066a5a4174933688a64141c1dca32e21a6793310b31be19e721b5ae5a83b45d424ed0267ec363a8a956ae64b1c140470656027095b148590260f909908dc82c474abd4e3954e54288e7605ee3381c0c1b453baa22b506c3c3a3e3adc3851a536ebb7483d52a34c3c1d100976b36a21f7b92182fa38ce10b690f57e33861c349727a6d79df45670f3e88344b43d0b790e4bba92bd60b4fd6a5e1c9b60b4eb10b71100d99558c9d126df7984a37c60a84975b1eabaa02629f42b35e5bc907e093e968b56d7d91ea2a6260c866e5b83ccee54303345138ae97c55f578a6ec3b4058b7d1e14ac92e370cf770042ad3f7152359226c2c2abc6bcb87462f diff --git a/test_framework/modules/mlkem_keygen/golden/c003_rho.hex b/test_framework/modules/mlkem_keygen/golden/c003_rho.hex deleted file mode 100644 index 7ba2407..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_rho.hex +++ /dev/null @@ -1 +0,0 @@ -a6ec3b4058b7d1e14ac92e370cf770042ad3f7152359226c2c2abc6bcb87462f diff --git a/test_framework/modules/mlkem_keygen/golden/c003_s_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_s_0.hex deleted file mode 100644 index 6781de0..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_s_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -002 -000 -d00 -000 -001 -cff -cff -000 -d00 -000 -001 -000 -000 -000 -d00 -001 -d00 -d00 -d00 -000 -001 -000 -001 -002 -000 -d00 -000 -cff -002 -000 -001 -cff -cff -000 -001 -001 -000 -001 -001 -000 -002 -d00 -001 -002 -000 -000 -d00 -000 -000 -000 -cff -cff -d00 -001 -d00 -000 -000 -000 -001 -001 -000 -001 -001 -002 -d00 -001 -cff -d00 -001 -d00 -d00 -002 -000 -000 -d00 -001 -000 -000 -001 -000 -d00 -d00 -d00 -d00 -001 -002 -d00 -cff -002 -002 -d00 -000 -d00 -001 -d00 -d00 -000 -001 -000 -001 -001 -cfe -000 -001 -000 -d00 -000 -000 -000 -000 -001 -d00 -000 -002 -d00 -001 -000 -000 -d00 -001 -d00 -000 -cff -000 -001 -001 -cff -d00 -000 -000 -d00 -001 -000 -002 -d00 -001 -002 -000 -002 -cfe -d00 -d00 -003 -000 -003 -001 -d00 -002 -d00 -d00 -000 -002 -000 -cff -001 -d00 -d00 -000 -002 -001 -d00 -001 -001 -001 -001 -001 -000 -001 -d00 -001 -cff -000 -001 -cff -002 -d00 -001 -000 -001 -002 -d00 -001 -d00 -d00 -cff -001 -d00 -d00 -d00 -000 -d00 -001 -d00 -000 -001 -000 -001 -000 -d00 -cff -000 -cff -000 -002 -001 -001 -002 -000 -000 -002 -001 -002 -001 -002 -000 -001 -d00 -001 -cff -001 -000 -001 -002 -d00 -001 -002 -001 -000 -d00 -003 -000 -000 -000 -001 -000 -002 -001 -d00 -000 -d00 -001 -001 -000 -002 -d00 -d00 -000 -000 -d00 -cff -003 -000 -000 -d00 -000 -000 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_s_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_s_1.hex deleted file mode 100644 index a8e04f6..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_s_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -002 -d00 -000 -d00 -000 -cff -cff -001 -000 -000 -001 -001 -d00 -000 -001 -001 -d00 -002 -002 -000 -d00 -002 -001 -001 -d00 -002 -d00 -d00 -001 -000 -002 -002 -cff -000 -001 -002 -d00 -cff -000 -001 -000 -cff -000 -002 -002 -000 -cfe -001 -d00 -d00 -cff -002 -d00 -cff -000 -000 -000 -001 -001 -002 -d00 -d00 -001 -000 -000 -cff -003 -001 -cff -d00 -000 -d00 -cff -d00 -d00 -000 -000 -001 -001 -000 -001 -002 -d00 -d00 -001 -001 -cff -001 -001 -d00 -cff -002 -001 -001 -000 -000 -d00 -cff -000 -000 -000 -000 -000 -001 -001 -000 -cff -002 -000 -002 -000 -001 -000 -d00 -cff -001 -cff -002 -000 -001 -000 -d00 -d00 -001 -d00 -d00 -000 -000 -000 -001 -cff -000 -001 -001 -002 -cff -000 -d00 -001 -000 -001 -d00 -000 -000 -001 -d00 -cfe -000 -d00 -d00 -003 -cff -002 -000 -d00 -000 -001 -cff -001 -cfe -001 -000 -001 -001 -001 -000 -001 -000 -d00 -cff -d00 -cfe -d00 -001 -001 -d00 -001 -001 -d00 -001 -000 -000 -d00 -d00 -cff -000 -d00 -d00 -002 -001 -001 -002 -001 -001 -000 -d00 -001 -000 -d00 -d00 -001 -000 -d00 -d00 -000 -d00 -d00 -000 -000 -cff -000 -001 -001 -d00 -002 -001 -000 -d00 -001 -000 -000 -d00 -d00 -d00 -002 -cff -000 -000 -000 -000 -cff -000 -cff -003 -000 -000 -d00 -000 -d00 -cff -d00 -001 -001 -000 -001 -002 -d00 -001 -d00 -001 -002 -000 -000 -000 -001 -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_shat_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_shat_0.hex deleted file mode 100644 index c580f86..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_shat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -17e -beb -350 -483 -621 -7de -a04 -9ad -ce1 -8f8 -803 -c0c -5a0 -b0c -c09 -828 -4b4 -c70 -20e -c51 -76a -94d -a3d -6a9 -7f1 -7f4 -237 -b1a -944 -c5c -698 -5c9 -ac3 -21d -1a1 -831 -953 -13f -62d -64a -8e6 -816 -00d -cb5 -731 -6fb -764 -6ac -4f3 -7e6 -4be -b53 -7b4 -bcd -24c -9bf -361 -525 -6aa -9bb -0dd -049 -af6 -a2a -711 -930 -488 -240 -839 -485 -560 -a87 -2f0 -701 -27f -ca4 -6c2 -7c5 -62a -a1c -a2f -7e8 -082 -cc6 -0ba -cff -0c8 -8b6 -a82 -876 -cab -083 -b6e -37b -060 -bfc -58f -3be -09f -ba7 -b06 -1a6 -541 -ad4 -07c -953 -1de -4fc -565 -33b -c34 -ba7 -cf6 -5d2 -34b -038 -677 -a6c -841 -3be -454 -9af -4b1 -4ff -2fd -c09 -b98 -1db -a1e -4fd -ae7 -724 -647 -617 -2b6 -8e6 -43a -05f -6a0 -a1f -b1e -2a8 -55c -5cc -681 -793 -37a -703 -0c3 -575 -260 -0b1 -0ea -2fe -c89 -cf2 -2fd -93f -cdb -037 -6a4 -5cc -c3c -9f0 -9c8 -977 -6a5 -c0f -703 -1a2 -9e6 -098 -1ae -2e0 -a50 -bf6 -8b7 -0e8 -213 -9b4 -15f -6e5 -9e2 -295 -992 -42e -6f1 -4c6 -bf4 -a23 -174 -45e -237 -a48 -454 -bfe -38c -658 -b4c -8af -0fa -b19 -a1c -73a -0e9 -534 -1bb -a03 -866 -942 -c87 -763 -4c3 -0a6 -28c -676 -ab7 -8df -4ce -712 -69d -660 -0f4 -9ab -91c -1d0 -32d -bbf -6a3 -4bc -239 -2da -814 -10f -93a -4c0 -3bc -618 -319 -3bb -0d7 -a28 -687 -172 -5be -5d3 -867 -545 -607 -7d9 -500 -146 -305 -4d7 -76f -00c diff --git a/test_framework/modules/mlkem_keygen/golden/c003_shat_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_shat_1.hex deleted file mode 100644 index 696a2c0..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_shat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -547 -ae0 -3e2 -6c4 -71a -5e3 -847 -a94 -0d7 -a60 -68d -7e5 -79a -7e9 -8b0 -500 -5ef -bc3 -0bd -45a -4b9 -5bb -4a6 -1fe -b1f -2f6 -ba2 -2c7 -017 -143 -a34 -6f4 -3c7 -340 -a0d -ca1 -83a -4e1 -4b5 -9b6 -1af -488 -0e0 -41c -ce2 -358 -32c -2be -79e -502 -765 -287 -aff -6fe -454 -58e -3bd -4bb -296 -b0a -a16 -618 -0e1 -cfa -5ae -b97 -ce8 -ca6 -88f -b10 -1f3 -a01 -3ec -89f -16c -420 -300 -405 -5c2 -13b -a0b -a64 -3ac -16a -cdc -779 -1bd -1bd -4c1 -1ba -949 -36f -000 -6b8 -257 -a9f -60a -6c9 -489 -9a9 -c2e -c81 -5ec -13e -986 -22c -0ea -9a9 -65a -a03 -1ba -2e4 -3cd -79c -caf -171 -463 -b70 -8d5 -7c6 -274 -80f -a0f -4ff -427 -88a -5dc -435 -3ef -923 -608 -ad9 -601 -2e2 -400 -5d5 -9f1 -92a -2d4 -360 -21c -881 -5b4 -3a7 -41d -1e6 -bd7 -410 -18d -bd6 -82c -634 -188 -608 -b4f -53f -30c -a33 -701 -2b1 -8bd -233 -0f6 -1bb -23e -4cd -9fd -2a3 -70d -69a -c56 -024 -0c6 -21b -7f7 -325 -53a -087 -537 -96d -ad6 -18d -445 -865 -449 -95a -77a -529 -ae0 -a7f -55b -b71 -7a4 -56f -a4d -1e1 -4b8 -846 -7a3 -8ea -3ea -84a -53c -3e8 -1ae -c6f -2b7 -638 -7fe -272 -23d -316 -511 -5f7 -84f -bc6 -6db -300 -a02 -c66 -2cb -b3f -332 -49a -ce3 -0df -98a -0e0 -5b7 -168 -1fa -470 -1c4 -baa -19f -1e2 -640 -570 -113 -c05 -308 -307 -ced -663 -7bd -790 -583 -1f2 -7cd -9df -13c -02f -335 -45d -c54 -aad diff --git a/test_framework/modules/mlkem_keygen/golden/c003_sigma.hex b/test_framework/modules/mlkem_keygen/golden/c003_sigma.hex deleted file mode 100644 index e3e3a30..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_sigma.hex +++ /dev/null @@ -1 +0,0 @@ -62ae0636a1af42c9da0e19a88927129132955d1c111a47a03ddf5cb86dda3c02 diff --git a/test_framework/modules/mlkem_keygen/golden/c003_that_0.hex b/test_framework/modules/mlkem_keygen/golden/c003_that_0.hex deleted file mode 100644 index 5dcbfb7..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_that_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -136 -003 -18f -837 -bb4 -559 -4f5 -b6c -943 -361 -ca5 -87c -917 -cd4 -895 -c6e -25f -3a0 -bf1 -06a -c13 -705 -22c -c1f -251 -c11 -729 -48f -393 -703 -210 -4a4 -182 -79c -328 -8e5 -093 -429 -945 -4b2 -6e1 -5d6 -7cd -a4f -768 -9d5 -003 -ccd -b50 -509 -796 -a0f -443 -5ce -367 -620 -8dc -bc1 -552 -b04 -4c6 -cf9 -96f -214 -117 -57d -874 -c82 -8bc -87e -81b -667 -59c -1b9 -807 -57a -175 -b01 -68b -578 -b36 -cb0 -97a -065 -30a -6b2 -7b3 -287 -987 -b6d -8ff -214 -7bf -54f -8fb -40e -7f2 -4e2 -581 -139 -79c -2d4 -9bb -6af -772 -1a3 -530 -9e0 -a55 -84e -c31 -5f3 -9fb -61c -227 -439 -c69 -0d7 -361 -cc2 -6a8 -543 -cc5 -251 -be3 -c54 -3ed -676 -979 -058 -3cd -4e9 -121 -740 -7fb -5e1 -3d0 -873 -cda -311 -74d -343 -8cb -1d2 -1b0 -1f6 -3eb -85a -890 -4b5 -041 -129 -4a2 -783 -129 -9a5 -c00 -aaf -733 -1e6 -542 -3aa -0e0 -7c8 -411 -9b7 -add -90f -5b5 -b80 -562 -6a4 -bb3 -abc -29b -434 -1e3 -5c0 -805 -361 -2bd -33b -1bb -4e8 -0f9 -291 -500 -cda -2cc -aba -657 -bdf -aaf -4bb -360 -092 -050 -b10 -c9a -11c -30e -6a3 -2a0 -ba1 -16b -119 -6a9 -c3d -60a -a20 -6db -843 -525 -292 -47e -734 -789 -90a -34d -369 -40d -0d6 -848 -0d7 -4fb -596 -022 -a0d -85b -338 -885 -347 -9e8 -a28 -c41 -2b9 -597 -3e4 -b3f -cca -4f0 -206 -606 -a7c -7ad -a9c -786 -598 -1ae -cd1 -6e6 -8aa -ada -3fc -46e -7ea diff --git a/test_framework/modules/mlkem_keygen/golden/c003_that_1.hex b/test_framework/modules/mlkem_keygen/golden/c003_that_1.hex deleted file mode 100644 index 7b644a8..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c003_that_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -3c5 -a67 -94b -c78 -6ad -332 -7ed -155 -191 -1d7 -39d -105 -8e9 -3cd -769 -b69 -1ae -7f3 -73f -01c -01a -b9a -7fc -111 -756 -9b7 -a85 -47e -708 -6d2 -9dc -6bf -0b8 -170 -032 -084 -3e8 -552 -1e7 -848 -8fb -799 -4d3 -2cf -987 -56d -32d -4cf -455 -6d1 -a42 -154 -10f -121 -936 -534 -830 -084 -5b6 -bad -266 -83d -52a -32a -4d0 -21d -72d -b3f -785 -7e4 -ab5 -ae7 -3f2 -85f -6a5 -604 -cae -b4d -9ed -6ed -bbd -05f -80b -1dd -aeb -093 -caa -a5f -211 -825 -4ce -c47 -639 -242 -4c9 -a97 -04a -126 -395 -023 -509 -9fd -00a -330 -737 -909 -bae -5bb -543 -18d -a06 -5a6 -441 -937 -836 -a68 -141 -c14 -3dc -2ea -621 -79a -033 -b31 -11b -9ee -b72 -5a1 -8e5 -3ba -445 -24d -2ed -670 -6ec -3a3 -58a -6a9 -be6 -1c4 -414 -700 -065 -276 -b09 -145 -085 -269 -00f -999 -c08 -82d -4c4 -ab7 -3d4 -95e -44e -285 -68e -057 -3ee -813 -1c0 -b4c -a53 -a2b -02b -6c5 -a3c -3e3 -c3a -38d -551 -36a -7eb -48b -23d -a35 -c4c -1d3 -910 -760 -ab3 -216 -9f7 -21b -a82 -38f -0ce -b61 -590 -7ef -633 -1c8 -734 -279 -7a6 -9dd -6f4 -705 -8f3 -83e -444 -3db -90b -0e7 -a4b -92b -0bd -b46 -afd -5e6 -b1c -609 -bb4 -10e -1b7 -001 -5d9 -589 -1c9 -26d -9df -847 -ca3 -607 -9a8 -754 -ab1 -bae -6a0 -292 -bf4 -352 -ce5 -90b -97e -3e0 -b96 -568 -9d7 -1ed -6a2 -26a -60c -6e8 -35b -cc8 -4ee -305 -533 -134 -98a -7ce -555 -78f diff --git a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_0_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_Ahat_0_0.hex deleted file mode 100644 index 701c4c8..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_0_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -1fb -57e -63f -bfa -3e0 -b4c -338 -8e3 -c3a -0dd -a0e -857 -a31 -bec -9bf -2d6 -903 -6eb -1fa -af9 -499 -70a -3a6 -904 -2da -93a -6a0 -09c -367 -505 -230 -76e -093 -070 -72e -59a -6c7 -c97 -aa3 -481 -c30 -c46 -bad -473 -ba4 -261 -6dc -019 -815 -d00 -627 -26e -b2f -5f0 -819 -6c6 -b24 -141 -0d1 -ab2 -1cf -3fa -aa2 -867 -b08 -4a2 -90a -71e -c6c -762 -84e -31b -8c9 -927 -7a3 -cdd -16f -567 -7aa -043 -648 -600 -68d -65a -370 -4b7 -add -963 -06f -5a6 -6a1 -b5d -5b8 -4ae -01a -c32 -446 -092 -1c7 -af6 -cd4 -42d -35d -9dd -6ab -818 -4cd -08d -481 -9ab -17c -54f -b3e -2cc -1c9 -08b -832 -6c4 -0e8 -868 -97d -2de -1fa -4d3 -3a6 -ce8 -562 -ccb -7b8 -61f -44a -717 -a9e -39e -997 -75a -0f4 -589 -868 -372 -488 -3b1 -c9f -41d -c61 -237 -a89 -982 -528 -11d -c18 -650 -91d -284 -914 -743 -b20 -82b -747 -6ab -68c -25b -68d -aea -cf6 -2d4 -753 -728 -c12 -704 -1a4 -9b1 -763 -45e -b32 -11d -4b7 -b24 -60c -29f -4a4 -44a -4b7 -236 -91a -4a9 -742 -9cd -802 -5aa -965 -b1b -802 -838 -517 -400 -167 -064 -102 -97b -409 -cd9 -b11 -4ed -b75 -735 -230 -3ab -986 -86b -78f -0e7 -1eb -46d -b9c -af5 -b89 -670 -971 -67f -9f5 -b17 -acc -1bf -ccd -4f6 -575 -2cb -09e -402 -6b3 -ad0 -4f9 -945 -5b0 -ce9 -830 -c5b -76e -5ed -004 -503 -a8c -6f3 -ac1 -c22 -866 -a94 -b2e -0ee -809 -0e1 -5fa -7d3 -b0c -260 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_0_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_Ahat_0_1.hex deleted file mode 100644 index 7455bfc..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_0_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -7a1 -9e5 -125 -463 -33e -237 -be5 -a06 -2bd -62f -256 -19f -12f -1af -7f2 -775 -c07 -79e -277 -c13 -01a -ac8 -942 -09f -afa -cd1 -918 -533 -22d -bf8 -5cb -25b -6cc -357 -472 -beb -1f8 -68c -907 -b96 -1a0 -474 -500 -5b8 -65d -699 -be9 -61a -1fd -7fb -50d -2b0 -4d4 -29e -39b -070 -b2d -87d -8b9 -82e -c7b -008 -201 -9be -a29 -bb0 -177 -1a8 -c35 -c47 -0c7 -254 -22b -61c -b06 -adf -799 -008 -ace -6bf -892 -a36 -605 -9ab -175 -793 -a8b -6f4 -5ff -058 -cea -4b3 -3a4 -078 -17a -a8b -58d -6b5 -978 -2bb -5e9 -85c -57e -621 -5f8 -a9a -6f7 -26e -69e -088 -42b -970 -0c1 -936 -412 -0a5 -cfc -805 -95d -9b5 -859 -c70 -739 -04d -413 -be5 -168 -5da -719 -3cb -61c -0c1 -38a -1e3 -84c -550 -b90 -b0c -492 -456 -77e -ac1 -981 -6ab -958 -1ce -4ee -1c8 -067 -1f4 -95b -197 -152 -29f -72e -b0e -aa9 -0eb -7b6 -38c -214 -309 -02e -9f1 -5ef -a5d -ce7 -b11 -51e -7d3 -bd2 -611 -5bd -669 -4fd -b13 -c9c -0db -0bb -a71 -37a -c0e -5cd -6b9 -c3d -408 -987 -b9f -77b -bbb -313 -6ea -807 -462 -874 -0c7 -c87 -afb -4af -53a -3f6 -aab -317 -5d9 -757 -659 -cc2 -334 -710 -b44 -2c1 -465 -770 -76b -148 -263 -51b -10c -019 -22f -6bc -87b -cfe -b29 -136 -98d -4b1 -866 -9a1 -c20 -2d9 -b5e -8a4 -3f3 -cc6 -2b6 -7e9 -157 -8c4 -48b -a2d -92b -c57 -965 -b19 -ce9 -94c -b11 -cc4 -6ae -3a5 -3f1 -491 -2fe -364 -8e6 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_1_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_Ahat_1_0.hex deleted file mode 100644 index 2047650..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_1_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -714 -9fd -4f2 -b16 -762 -8cf -af6 -110 -117 -023 -68c -26f -7e3 -198 -aa4 -461 -9a3 -4a9 -093 -c42 -3d4 -4a4 -bcf -5af -843 -0a3 -853 -a12 -82c -c4d -46f -724 -555 -c35 -5c4 -adf -23b -cbd -3fc -5cf -4ef -cd3 -33f -787 -2ae -5ae -7ec -0ee -a1f -3a1 -a68 -645 -af7 -5c8 -8a6 -8cd -477 -87e -464 -2fd -7db -605 -400 -38b -022 -c49 -22f -02b -1a9 -107 -6b9 -b96 -cf4 -c65 -1ea -b39 -172 -897 -ae7 -20d -514 -9b1 -7f5 -50b -cff -57b -759 -160 -022 -c98 -5ab -210 -46b -180 -109 -b8c -580 -008 -175 -1b0 -abb -45f -43f -0d2 -aa3 -822 -17f -cd3 -680 -01e -6c6 -55a -24d -344 -9c3 -c62 -221 -b8c -53e -5fd -aee -05e -3c0 -601 -8a8 -281 -427 -c9c -1ab -7e4 -2b0 -030 -52d -32c -6ad -bfa -a1b -ac5 -0f9 -4d9 -a5b -581 -726 -530 -61b -cd3 -b9b -453 -2c5 -296 -b16 -348 -515 -73b -a5c -84c -9e0 -94e -586 -c8b -092 -017 -35d -aaf -cfc -c36 -315 -23e -3f3 -9d2 -96a -5c3 -093 -949 -94e -9ba -276 -965 -318 -812 -972 -93a -00e -38d -81f -8d3 -c4a -687 -28b -173 -007 -1c9 -4db -1fe -763 -2c6 -71e -735 -cac -6e8 -399 -30c -836 -97a -8e2 -1d8 -492 -acb -5ea -a74 -084 -b40 -857 -50c -5e9 -336 -150 -bb8 -63d -a35 -b69 -6f2 -46e -2fe -c98 -a7f -301 -7a4 -9c9 -169 -7bd -bf3 -327 -a9b -0b1 -cf0 -7a0 -0b5 -a2c -0d8 -4d1 -1fe -a24 -379 -446 -a19 -7a8 -569 -574 -561 -ab5 -84c -974 -a95 -ce6 -a69 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_1_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_Ahat_1_1.hex deleted file mode 100644 index 2a63e54..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_Ahat_1_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -513 -2c4 -388 -74a -7a5 -2ad -c41 -a6e -bff -970 -5df -716 -5ff -afb -3b8 -8e5 -6ad -4e4 -487 -622 -cb8 -4ce -395 -34e -b06 -018 -342 -312 -cf6 -372 -66d -74c -9a8 -590 -15f -cb4 -812 -274 -c6b -5e2 -08a -a91 -1cd -99c -4da -251 -103 -930 -05a -4f4 -8f7 -055 -331 -529 -35f -b8b -91e -2d9 -4a3 -8d6 -7c5 -6b6 -85e -c49 -73f -726 -999 -1ae -171 -2bd -651 -5f0 -899 -355 -865 -156 -88b -576 -7fd -c02 -b82 -628 -94e -a17 -896 -66b -442 -22d -18a -cec -345 -68b -227 -4c6 -ab5 -8f1 -9aa -65c -b28 -81b -cc7 -168 -a9c -b8c -6c7 -4a0 -78a -6a9 -460 -734 -af0 -575 -078 -43f -b9c -597 -822 -64c -44f -c8b -8d4 -823 -65b -5d2 -6cb -799 -629 -b4c -6c9 -2fa -3ff -00b -cef -1e5 -38d -3fe -55f -73e -8d0 -068 -73d -af4 -93a -70d -0e9 -a3e -167 -744 -8c3 -37a -a3d -4b1 -b22 -738 -a57 -746 -339 -840 -ae9 -4a2 -78c -322 -a3c -cdd -81f -b42 -850 -084 -7df -681 -215 -1b9 -4b7 -6fc -490 -367 -515 -5eb -aa3 -a11 -58f -bf0 -5e6 -650 -806 -b56 -782 -98f -145 -687 -585 -0a8 -76c -cb6 -9ef -270 -1e7 -879 -6bb -295 -709 -8ca -810 -083 -b20 -928 -bbc -1bf -411 -cf5 -2a9 -86f -2dc -82f -32c -9d6 -637 -0e0 -96d -cba -423 -b8f -bb5 -30d -7f4 -186 -0aa -7d2 -ad4 -4ae -caf -61c -72a -8c5 -0f4 -116 -957 -a39 -87d -5a2 -2eb -1d8 -0b1 -799 -20d -924 -bef -399 -9eb -54f -92a -740 -70b -394 -9f9 -9d0 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_dkpke.hex b/test_framework/modules/mlkem_keygen/golden/c004_dkpke.hex deleted file mode 100644 index edf85ba..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_dkpke.hex +++ /dev/null @@ -1 +0,0 @@ -5df6621f39afd4f69a8f688c01f6331a1780249c02e1857a274357adf43dbcb28831f2cedf46401de1afa655436ba43e4293b70c092b94544c4f522f4831913b9b249383963f6bcc78da5f5bd54419e2cecdf589912859fc47b1340a5a2a095dd9b5657662c03c84200e319873a18f5c035dbdb56444e787f0903abd7a629af87de831b39c5988d0d1b4cdb50d32480c0b9525354406aa91834c34bded4372ec0942bce9141b573e60a25434c82463bc9d6b63af5d7552757524d7934c34e583c3a4cac611cc303074dc274aac8b00a8c452e7a409c5b7bee4371e9a50099444c867bb39ce4a03931054757515902978e09c3aa5820674823f923330a207be545083583131855a0226f409a011266cb590b97bc1fbf9a0f1d0b1be2b81988330ad72a538aa1151795614bc01f6296f4290cef617b2c9919199e480fee589e91c78ab427c9c8563bbab54d28a6c77c06dc95671286403608b6c4b77739bfc5d7b197c9cf66229106f202b941f944614b93a16772eada98ffce9c9e7dc7a237560540323e4ac4c7c6c06733c3ee0ac55b574b7bac089b6a31ddce15ed9716922dc3f122b7e88b62fd514b2634ccdcaf965174158c3387929bcc000e312c4bc153408821af7a9eb8458a90388d32b17724721140675b8777ec4a14cf38138d9990e53115cc2a2c9120316c64a516e769d54738017547e8dec639a488183f69c95e52505678891068d9c81129561b025f21f0bbc41d6544305cbcb0bf5a57453212da638759b220d3c5ea7714eb9f61797c508bee11e11f49bc2286a9462939459456d346ce0f4182c915adfa25a0cf2879c82160c1a887fc243e50693a11a2e8d92ce6ff0c86d7ca816324c3b368a70600ba928749bb815c2fa99d317a9e78427ab5785cb51382b362b42bc52717314301969aac619234ab8aeba7bf7d28db7d270a18a1aa089cf1c9103dac5a11f075f5ab1a6e0301ebc510e45368aa308b2ce5174c2a26359cc9cddca8bbcfc71dc53bd7b86119eda2259942e2994cc506c87f3854a83c823ade1cf0adc460bfc34e534481fdb55e7bc71311904d2a60fd7821f diff --git a/test_framework/modules/mlkem_keygen/golden/c004_e_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_e_0.hex deleted file mode 100644 index f6d4f0e..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_e_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -cff -001 -000 -cff -000 -cff -002 -001 -d00 -001 -001 -d00 -d00 -d00 -000 -000 -d00 -000 -000 -d00 -001 -d00 -000 -d00 -001 -000 -000 -001 -cff -000 -d00 -d00 -001 -cff -001 -001 -d00 -d00 -000 -d00 -001 -d00 -d00 -001 -000 -000 -d00 -cfe -d00 -000 -cff -000 -002 -002 -000 -002 -001 -001 -002 -d00 -cff -d00 -000 -001 -d00 -000 -000 -000 -001 -000 -d00 -001 -d00 -001 -002 -000 -000 -002 -d00 -001 -000 -d00 -000 -cff -d00 -000 -000 -001 -d00 -000 -000 -d00 -000 -000 -000 -001 -d00 -d00 -cff -000 -001 -000 -002 -000 -000 -000 -001 -000 -d00 -000 -000 -d00 -d00 -001 -001 -000 -001 -000 -cff -000 -000 -d00 -d00 -001 -001 -002 -001 -000 -001 -001 -000 -cff -001 -003 -000 -002 -000 -001 -d00 -d00 -000 -d00 -001 -000 -003 -d00 -d00 -d00 -cff -d00 -001 -002 -d00 -001 -002 -d00 -000 -001 -001 -000 -001 -000 -d00 -001 -d00 -d00 -cff -000 -001 -001 -003 -001 -002 -001 -000 -000 -000 -000 -001 -d00 -001 -000 -000 -002 -d00 -000 -000 -000 -002 -003 -000 -cff -000 -001 -001 -001 -002 -000 -000 -000 -000 -002 -000 -001 -d00 -000 -001 -cfe -000 -001 -d00 -001 -000 -cff -001 -000 -000 -001 -000 -002 -000 -002 -000 -000 -d00 -cff -000 -001 -002 -001 -002 -002 -cfe -001 -d00 -d00 -001 -000 -d00 -cff -cff -002 -002 -000 -cff -cff -002 -000 -002 -000 -001 -000 -d00 -000 -000 -000 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_e_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_e_1.hex deleted file mode 100644 index ef2da1b..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_e_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -d00 -000 -000 -001 -d00 -000 -000 -d00 -001 -d00 -cfe -d00 -cff -001 -000 -001 -001 -001 -001 -001 -d00 -002 -002 -002 -000 -000 -000 -d00 -000 -d00 -000 -d00 -d00 -d00 -001 -000 -000 -001 -001 -000 -000 -d00 -000 -001 -001 -cfe -d00 -001 -000 -002 -001 -001 -cfe -d00 -d00 -002 -002 -d00 -d00 -000 -d00 -002 -001 -cfe -002 -000 -002 -001 -001 -000 -000 -001 -002 -d00 -000 -d00 -000 -001 -002 -cff -d00 -002 -000 -d00 -001 -001 -001 -cff -000 -000 -d00 -001 -002 -002 -000 -000 -000 -d00 -000 -001 -000 -001 -000 -d00 -000 -001 -d00 -d00 -000 -cff -001 -001 -d00 -000 -000 -001 -000 -d00 -cfe -000 -000 -001 -001 -001 -001 -002 -002 -d00 -000 -000 -d00 -002 -001 -001 -002 -000 -001 -000 -002 -000 -000 -d00 -d00 -cfe -d00 -001 -002 -001 -d00 -cff -001 -001 -001 -002 -002 -000 -000 -001 -001 -000 -001 -002 -000 -d00 -001 -cfe -003 -000 -000 -001 -001 -000 -000 -001 -001 -000 -d00 -000 -002 -002 -000 -001 -d00 -000 -000 -d00 -d00 -000 -cff -d00 -001 -001 -002 -001 -002 -000 -000 -001 -000 -000 -001 -002 -cff -000 -001 -000 -000 -001 -000 -000 -cff -d00 -d00 -000 -002 -d00 -001 -000 -d00 -000 -d00 -001 -000 -001 -000 -001 -000 -000 -002 -000 -d00 -d00 -d00 -002 -d00 -001 -001 -002 -d00 -d00 -000 -d00 -000 -000 -000 -000 -d00 -d00 -002 -d00 -001 -d00 -000 -002 -000 -d00 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_ehat_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_ehat_0.hex deleted file mode 100644 index c581e37..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_ehat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -709 -890 -c69 -93f -21c -935 -376 -6e3 -902 -1db -b29 -019 -c9a -7b0 -7d2 -cbc -737 -af1 -7a7 -a1f -b37 -690 -7ca -718 -b7d -bef -055 -3f6 -8ee -1d6 -271 -141 -2a8 -b19 -417 -a66 -683 -575 -51d -42b -859 -33a -959 -b0e -90d -b95 -324 -969 -6fd -313 -c43 -6f3 -83e -431 -2c6 -4dc -7c7 -132 -66b -3a4 -9ca -c6e -64d -b8a -a5c -3b6 -08e -a18 -5d4 -40e -6c2 -538 -456 -7d4 -bf2 -7b6 -2a0 -63e -5ee -402 -576 -b63 -5b4 -17a -90c -55b -ad4 -58a -075 -5b4 -0d9 -0ba -cad -9a3 -a87 -622 -532 -4b0 -156 -4dd -85b -30d -c2a -b81 -259 -c1f -331 -8b4 -9c3 -a22 -2da -2ae -c6e -783 -130 -7aa -a85 -943 -6f9 -c28 -a40 -9e8 -12f -804 -b37 -7f2 -a6f -639 -519 -c67 -55b -28a -57e -857 -6a8 -66c -246 -c56 -42a -066 -511 -4f5 -66b -cbb -02c -9af -0e4 -019 -386 -87c -67a -4b6 -630 -a8b -a86 -4c2 -05c -34f -3f7 -8da -53a -159 -258 -555 -185 -8b1 -810 -4de -cb1 -106 -22c -014 -2a3 -742 -a09 -4a0 -c79 -83b -23a -745 -87d -9ce -077 -a27 -ae1 -48e -cd2 -910 -62e -90b -7e7 -8a1 -778 -a9d -6a5 -6bb -c9a -59f -9f9 -4c8 -a61 -cb5 -455 -6b7 -75d -2f6 -a5c -af4 -00f -3f9 -974 -883 -82c -47f -9e7 -41d -ac0 -403 -ada -331 -873 -3b5 -2b3 -74b -240 -cee -29e -238 -44f -182 -3ae -58f -6e8 -1d7 -ac2 -661 -5c5 -b85 -670 -bf1 -1ec -c83 -73a -4d5 -095 -692 -b28 -237 -91a -6b9 -155 -0af -c10 -c68 -531 -282 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_ehat_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_ehat_1.hex deleted file mode 100644 index 93a4570..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_ehat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -5c6 -0e5 -787 -4dd -003 -973 -26f -623 -cd1 -135 -10b -95d -7ca -344 -a03 -85a -793 -24d -20b -0f1 -aa2 -7cc -505 -9c6 -0f9 -0af -1ab -8b5 -555 -9da -702 -90d -1a1 -183 -565 -c49 -c4f -79b -5c0 -642 -80f -b1e -06f -161 -2f7 -b61 -cbe -849 -226 -345 -cbc -6e6 -5c3 -4d7 -9e3 -066 -abf -09b -99f -226 -4f8 -c89 -cf1 -6e8 -963 -25c -bde -470 -27c -a6f -2d3 -ae0 -9e6 -1b8 -ac6 -7e9 -441 -309 -a66 -0c4 -29f -ac4 -b21 -782 -141 -46a -4e0 -5ee -574 -248 -2f0 -b9b -bb6 -c54 -042 -729 -959 -92a -c6d -792 -ce0 -bf0 -ca3 -6ea -9fe -b6a -568 -962 -7f6 -763 -8ea -53e -42a -9c8 -4ac -6e4 -0a6 -8f8 -368 -6c9 -6a7 -867 -794 -c31 -744 -b10 -710 -273 -91b -91c -198 -763 -9d1 -7a6 -217 -4be -094 -7c4 -004 -9ca -741 -784 -6a9 -aec -ac4 -b0d -b8a -b26 -0ca -510 -84b -8a7 -b0c -cc3 -080 -4f9 -237 -48e -b99 -51a -7d6 -380 -a7b -837 -036 -163 -8df -afc -59d -1a0 -501 -237 -141 -4b5 -ccf -baa -905 -64b -c77 -033 -215 -34b -2e1 -c59 -ba5 -585 -2e4 -1d1 -4ff -b23 -0d4 -562 -378 -38f -300 -674 -aab -27a -9aa -cd6 -62a -a39 -940 -8fa -bdf -461 -889 -cb3 -9c9 -897 -623 -52e -28b -419 -4ad -917 -6bc -cb7 -080 -544 -6bb -4c2 -c62 -b52 -988 -150 -201 -bf7 -79a -a3d -869 -70c -936 -43f -4ee -053 -90e -238 -3b7 -6cd -bf1 -b0e -52e -2c4 -255 -893 -2f6 -cb9 -0f0 -46c -053 -3f8 -375 -76a -36d -5f9 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_ek.hex b/test_framework/modules/mlkem_keygen/golden/c004_ek.hex deleted file mode 100644 index af999bd..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_ek.hex +++ /dev/null @@ -1 +0,0 @@ -a1dc74332994bc2899c85b59a4d43d2ef08f5c1aa67a4872c4c355d3664f08699a8ae85f17d74450b628c5f31bde384721d73acb51abcfb361d850184d925e013a0a83529535c9b262c7c48f81b95e693e242878d0168902c41c14a8a3d560cd31044b7e4659c1c9cb4c18593197609155594a088b9a827bc4732846aac353fa8cffa486a0d84d368314e65917f7398c6bd12f223700b17b883bebbdf12c1a42e89c958553d0686cf7683caf71243727afe2249b00972587335f6b0052cd2177800a4fa1225725e08b9551cda1e45ba6e3cdbb71730cb72a1f1c6cf1bc58520c9e52203c68951c2798523c2038ba6801fb3c321cf5ca218c680c320b3446ab153a3c4cd7cbca356b58d254b6a24a672258d1a8bd36a81be97b515eb42122f32a7d397b2fcb039946c38e41b5b4c5764c6c50c290a405aa746c527c51358bc09c5b52da33a0946c9d8a2f0da3ba7a24913d83b4d909913e2c55bfb5020f6c87688271e01788889c97b12ab88905b49a6c02d3400b7a6172fbb106c016c85cc7073fa788a8e37ff2a2a77d664aa1a6a0cbc9342e684954957651462cb2db7402c65a2ec98d58441e57166c664a8a753a69987b1930959097e988c7da31942462c83628a81bcef6d42880f6039808c727bccc6d20443956b2a2d48f58a8797297cfe8e32901d468f8054af658c7b3b7ced292c3866407c1a77959681c25b46c345571637919448036335723c17b5226074159219f479b2553864c6653a0bc74b0a152160bf88b50565a47b54a97094755a0c17c8566cd922ad49b54ad75c5bd50016a509d7eca819b36110c93ae0ea47ae46acbc4627115600cb12365d1e6a9424131834c4c4c72442d1a7c8eb7351b277be60b70ec170111a38a3ce0944e242cea26c4cb80c433653045a7bf4d9a6f0906306c0059f42b512895c2ef744db5a7720ad0353a667d43c4419e6148441880f788a78bd94719f010d14224dfc068a1c6c6b4608e8b840d7a6268bff383b7001be6e66fbfe774da4b9c9a01c5c62c55308196a6b72204b50ae39225c31a8aacc59be09ba033f43d35813582b28eaa839c70619814949f768e114b01b84b8787794582f8cd7f6fb07381770ebba5031cc5 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_rho.hex b/test_framework/modules/mlkem_keygen/golden/c004_rho.hex deleted file mode 100644 index bd40fa9..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_rho.hex +++ /dev/null @@ -1 +0,0 @@ -70619814949f768e114b01b84b8787794582f8cd7f6fb07381770ebba5031cc5 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_s_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_s_0.hex deleted file mode 100644 index 8987eef..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_s_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -cfe -cff -002 -001 -001 -000 -001 -000 -001 -cfe -000 -d00 -002 -d00 -001 -cff -001 -000 -001 -001 -001 -000 -000 -000 -d00 -d00 -cff -001 -d00 -d00 -002 -d00 -000 -001 -d00 -001 -001 -cfe -000 -001 -d00 -001 -001 -002 -001 -d00 -000 -cff -000 -d00 -001 -001 -001 -000 -000 -001 -d00 -001 -001 -cfe -cff -002 -d00 -cff -001 -000 -001 -000 -000 -000 -d00 -d00 -d00 -d00 -000 -002 -000 -cff -000 -001 -d00 -d00 -000 -001 -000 -002 -002 -d00 -cfe -000 -000 -001 -000 -000 -003 -d00 -d00 -001 -d00 -d00 -cfe -d00 -001 -d00 -000 -cff -000 -d00 -d00 -000 -d00 -000 -000 -002 -cff -002 -cfe -cff -000 -000 -001 -003 -001 -001 -001 -000 -002 -000 -cff -002 -001 -002 -001 -d00 -002 -cff -000 -000 -001 -001 -000 -d00 -001 -000 -cff -d00 -000 -000 -003 -d00 -000 -d00 -cff -001 -002 -001 -d00 -003 -000 -d00 -001 -000 -000 -000 -d00 -000 -cff -001 -000 -000 -cff -000 -002 -000 -002 -000 -001 -003 -000 -001 -d00 -d00 -001 -001 -002 -d00 -d00 -cfe -d00 -000 -000 -001 -cff -000 -d00 -cff -d00 -003 -001 -002 -d00 -000 -001 -000 -000 -d00 -002 -001 -000 -cff -d00 -002 -d00 -002 -d00 -000 -001 -d00 -000 -001 -000 -cfe -d00 -cff -001 -d00 -d00 -000 -000 -d00 -001 -d00 -000 -002 -cff -000 -000 -001 -003 -d00 -000 -002 -001 -001 -001 -001 -002 -000 -002 -003 -000 -d00 -000 -002 -d00 -000 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_s_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_s_1.hex deleted file mode 100644 index bc03a3c..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_s_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -001 -000 -000 -000 -001 -000 -000 -000 -001 -d00 -000 -d00 -000 -d00 -000 -000 -000 -001 -000 -002 -d00 -cff -d00 -000 -d00 -000 -000 -000 -d00 -000 -d00 -001 -000 -000 -d00 -002 -000 -d00 -000 -d00 -000 -d00 -000 -002 -002 -001 -000 -d00 -000 -000 -000 -d00 -001 -d00 -000 -000 -000 -000 -002 -000 -000 -cff -001 -d00 -d00 -d00 -cff -000 -d00 -000 -000 -000 -d00 -000 -002 -d00 -001 -d00 -000 -cff -001 -000 -000 -000 -d00 -001 -000 -d00 -003 -000 -cff -d00 -001 -000 -d00 -cff -001 -000 -d00 -002 -001 -001 -000 -cff -000 -001 -001 -000 -000 -000 -001 -000 -001 -cff -001 -000 -d00 -000 -cff -d00 -000 -000 -000 -d00 -d00 -001 -000 -001 -002 -000 -cff -001 -cff -d00 -000 -002 -000 -001 -000 -002 -000 -d00 -000 -001 -001 -d00 -cfe -cff -000 -d00 -001 -d00 -000 -002 -d00 -001 -001 -d00 -003 -d00 -d00 -001 -000 -000 -000 -cff -000 -d00 -001 -002 -000 -cff -001 -d00 -000 -000 -001 -d00 -001 -d00 -d00 -000 -001 -cff -cff -d00 -000 -000 -002 -000 -001 -d00 -d00 -000 -d00 -cff -cff -d00 -001 -cff -002 -d00 -d00 -002 -002 -001 -001 -002 -001 -000 -d00 -000 -003 -000 -001 -d00 -001 -001 -002 -000 -000 -000 -000 -cff -000 -cfe -d00 -002 -cff -000 -001 -d00 -001 -d00 -d00 -d00 -000 -001 -001 -000 -cfe -002 -002 -000 -001 -d00 -000 -000 -d00 -002 -d00 -001 -cff -000 -001 -001 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_shat_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_shat_0.hex deleted file mode 100644 index fd2d68f..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_shat_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -65d -62f -91f -af3 -6d4 -9af -88f -8c6 -601 -33f -71a -801 -c24 -029 -5e1 -7a8 -327 -574 -4ad -3df -2bc -88b -231 -cef -6df -404 -11d -afe -5a6 -435 -46b -3ea -342 -b79 -90c -2b0 -494 -4c5 -24f -2f5 -148 -913 -b3b -249 -393 -968 -b3f -cc6 -a78 -5fd -55b -44d -219 -cee -5cd -89f -891 -592 -7fc -b14 -a34 -5a0 -92a -5d0 -5d9 -65b -276 -c06 -43c -208 -10e -983 -173 -8fa -35c -5d0 -5bd -64b -744 -87e -0f0 -3a9 -abd -627 -89a -7df -1e8 -b33 -99c -885 -1d0 -b4d -5cd -0db -832 -0c4 -50b -259 -435 -064 -1aa -839 -44c -bd3 -3ed -724 -9ec -420 -9bc -14e -71b -3e5 -260 -54a -834 -24c -c63 -9db -36b -af6 -55d -527 -575 -247 -3d7 -4c9 -534 -83e -4c3 -caa -1c6 -cc1 -030 -743 -7dc -4a2 -bac -008 -4a8 -52c -4e7 -09a -7c5 -beb -7e4 -1e3 -09a -095 -494 -c84 -b67 -39b -ace -034 -093 -541 -575 -157 -990 -782 -ce0 -3a9 -2a5 -068 -274 -3f8 -392 -303 -7a2 -be0 -054 -835 -158 -313 -a85 -025 -426 -09f -1a0 -261 -56c -90b -bb9 -c17 -9fb -a0f -0f1 -b1d -bbe -812 -398 -308 -2ad -a57 -a38 -11a -951 -567 -c14 -01b -9f6 -6f2 -042 -ce9 -7f6 -b21 -1c9 -919 -499 -80e -5fe -89e -ce9 -781 -2ab -7c4 -59c -638 -bbb -54a -ad2 -6c8 -077 -6dc -6c9 -715 -428 -036 -b60 -6c8 -74b -737 -c9b -5df -97b -7c1 -69c -62f -029 -6f1 -b20 -942 -41f -469 -914 -3ab -716 -2e7 -9ad -8fa -9fc -c9e -ce7 -7ad -523 -607 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_shat_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_shat_1.hex deleted file mode 100644 index 8e000b6..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_shat_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -354 -230 -ce4 -4ca -c7c -066 -c73 -3e3 -ce0 -55a -4b5 -b77 -0ba -89c -3b6 -1da -1dc -5ee -1d9 -697 -c22 -3fd -b12 -7e2 -688 -2fb -4d5 -b21 -c63 -cd4 -9ca -65f -117 -584 -8c3 -793 -c29 -c0b -300 -12e -cc4 -15b -834 -820 -71a -a9f -4eb -588 -3a9 -880 -bd3 -172 -772 -214 -614 -750 -7b8 -7e7 -1c4 -4ca -1f3 -388 -9d9 -0e9 -153 -5c1 -2c2 -c9a -312 -160 -ac6 -514 -66e -9d7 -354 -807 -417 -7e5 -c8d -63e -89a -814 -683 -9cf -595 -25e -705 -886 -691 -8d0 -19c -128 -195 -b06 -225 -1ff -c0b -41b -4d6 -435 -b05 -cbc -50b -a5f -374 -215 -62d -38a -b75 -229 -c0d -5e3 -1a7 -4e7 -6b9 -17f -597 -08c -1be -1ee -411 -9bf -8c2 -6a2 -294 -936 -994 -455 -46d -6c3 -4e0 -18f -12c -5a9 -2df -5aa -20c -87f -29c -168 -a0c -881 -27f -43c -6e5 -930 -aa1 -2e1 -28d -ce9 -06f -c8f -c6d -a87 -216 -4c3 -63b -8a3 -070 -0b6 -8a9 -742 -89b -15b -ac2 -99f -7d3 -a91 -4e7 -278 -7ab -855 -1cb -385 -62b -2b3 -c42 -52b -371 -147 -930 -691 -6aa -19c -a23 -b84 -aae -7bb -2f7 -8dd -2b7 -70d -aa1 -1a8 -9a0 -cf8 -11c -039 -5da -a1c -71f -5f0 -15a -a6b -0e0 -1e3 -1bc -0e5 -645 -8a3 -8a3 -b20 -1ce -745 -2c2 -63a -c59 -9cc -add -8bc -cbc -71f -3dc -bd5 -67b -118 -a9e -22d -459 -2e9 -429 -cc9 -c50 -876 -5f3 -4a8 -883 -23c -1ad -cfe -c0a -46d -c0b -34f -4e5 -483 -b1f -55d -ce7 -71b -931 -041 -6d2 -0fa -2d7 -1f8 diff --git a/test_framework/modules/mlkem_keygen/golden/c004_sigma.hex b/test_framework/modules/mlkem_keygen/golden/c004_sigma.hex deleted file mode 100644 index 6121195..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_sigma.hex +++ /dev/null @@ -1 +0,0 @@ -06911f0d6e5e23d58a96987cc1ff43e14f2cd4fc4af7b635672ba794b7075eda diff --git a/test_framework/modules/mlkem_keygen/golden/c004_that_0.hex b/test_framework/modules/mlkem_keygen/golden/c004_that_0.hex deleted file mode 100644 index fac3d91..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_that_0.hex +++ /dev/null @@ -1,256 +0,0 @@ -ca1 -74d -933 -942 -8bc -992 -bc8 -595 -4a4 -3dd -02e -8ff -a5c -a61 -87a -724 -3c4 -55c -6d3 -4f6 -908 -9a6 -88a -5fe -717 -44d -650 -28b -3c5 -1bf -8de -473 -721 -3ad -1cb -ab5 -3cf -61b -0d8 -185 -24d -5e9 -a01 -0a3 -283 -955 -935 -b2c -762 -c4c -18f -b98 -95e -3e6 -824 -782 -6d0 -891 -402 -1cc -814 -a3a -0d5 -cd6 -431 -4b0 -67e -594 -9c1 -cbc -84c -591 -731 -609 -591 -595 -84a -8b0 -29a -7b8 -3c4 -287 -a46 -c3a -a53 -8cf -4ff -86a -8a0 -4dd -336 -148 -9e6 -175 -9f7 -8c3 -16b -2fd -722 -003 -bb1 -887 -b3b -bde -cf1 -1a2 -842 -9ce -595 -538 -8d0 -6c6 -8f7 -3c6 -1af -247 -737 -af2 -4e2 -9b2 -700 -259 -387 -5f3 -06b -520 -1cd -772 -a80 -4f0 -2a1 -572 -025 -8be -195 -cd5 -4a1 -5be -3a6 -cde -1bb -737 -70c -2ab -c1f -6c1 -cf1 -58b -c52 -9e0 -052 -3c2 -568 -1c9 -827 -529 -03c -382 -8ba -016 -cfb -323 -51c -caf -c21 -688 -20c -0b3 -634 -ab4 -a15 -3c3 -74c -cbd -5ca -6b3 -258 -54d -2b6 -4aa -267 -582 -8d1 -bda -836 -1ba -be9 -517 -45e -21b -322 -2af -97d -7b3 -b2f -03c -699 -c34 -18e -b54 -5b4 -76c -c4c -506 -0c2 -a49 -a05 -74a -26c -7c5 -551 -8b3 -cc0 -5b9 -a52 -33d -4a0 -6c9 -a9d -2f8 -30d -baa -47a -912 -33d -b48 -9d9 -910 -c3e -552 -5bf -02b -c0f -876 -268 -718 -7e0 -881 -c88 -979 -ab1 -b82 -589 -b40 -c9a -026 -0d3 -0b4 -17a -726 -1fb -06b -6c0 -c81 -75c -07c diff --git a/test_framework/modules/mlkem_keygen/golden/c004_that_1.hex b/test_framework/modules/mlkem_keygen/golden/c004_that_1.hex deleted file mode 100644 index 33c4d7e..0000000 --- a/test_framework/modules/mlkem_keygen/golden/c004_that_1.hex +++ /dev/null @@ -1,256 +0,0 @@ -73f -88a -3a8 -7fe -2f2 -a7a -67d -4a6 -6a1 -a0a -9cb -34c -82e -496 -554 -769 -651 -2c4 -bb2 -74d -602 -5ac -92e -8dc -458 -1e4 -657 -6c1 -a66 -8a4 -a75 -693 -b98 -197 -530 -909 -997 -88e -ac7 -31d -494 -622 -6c8 -283 -ba8 -ce1 -4f6 -28d -680 -03f -898 -c70 -c27 -ccb -06d -442 -639 -b25 -4a2 -8fd -858 -79a -772 -cf9 -3e8 -29e -401 -68d -5f8 -4a0 -8f6 -c75 -7b3 -ceb -2d2 -c39 -486 -076 -7c1 -79a -859 -1c6 -425 -6cb -534 -715 -963 -197 -044 -368 -733 -235 -bc1 -527 -726 -410 -159 -9f2 -b47 -259 -653 -4c8 -366 -a05 -4bc -b07 -2a1 -165 -80b -8bf -650 -5a5 -547 -4ab -997 -470 -055 -c1a -57c -668 -2cd -2a9 -bd4 -549 -5ad -c57 -0bd -015 -06a -9d5 -a7e -81c -69b -113 -30c -ae9 -40e -7aa -ae4 -cb6 -2c4 -716 -015 -0c6 -3b1 -652 -6d1 -a9e -142 -314 -c83 -4c4 -24c -447 -a2d -7c1 -78e -35b -71b -7b2 -be6 -700 -7ec -011 -311 -8aa -03c -94e -44e -2c2 -6ea -c42 -0cb -c48 -533 -306 -745 -bfa -a4d -6f9 -609 -300 -06c -590 -bf4 -512 -528 -c29 -4ef -4d7 -7b5 -72a -00a -35d -63a -7d6 -443 -41c -19e -486 -844 -801 -8f7 -a78 -98b -47d -019 -10f -2d1 -244 -0df -68c -6a1 -c6c -0b4 -8e6 -48b -0d8 -27a -686 -3bf -83f -0b7 -1b0 -6e6 -6fe -7bf -74e -bda -9c4 -19a -c50 -cc6 -552 -130 -968 -7a6 -22b -504 -0ab -2e3 -259 -ac3 -8a1 -5ac -9bc -be0 -a09 -433 -3df -135 -358 -282 -8eb -3aa -9c8 diff --git a/test_framework/modules/mod_add/gen_vectors.py b/test_framework/modules/mod_add/gen_vectors.py deleted file mode 100644 index ec8a86a..0000000 --- a/test_framework/modules/mod_add/gen_vectors.py +++ /dev/null @@ -1,121 +0,0 @@ -"""gen_vectors.py - Test vector generator for mod_add module. - -Generates (a, b) input pairs and computes expected (a + b) mod Q. -""" - -import os -import random -import sys - -# Add test_framework/lib to path for VectorGenerator base class -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -from vector_gen import VectorGenerator - -Q = 3329 # ML-KEM prime modulus - - -class ModAddVectorGenerator(VectorGenerator): - """Generates test vectors for the mod_add_sync module.""" - - def generate_one(self, params: dict) -> dict: - """Generate a single (a, b) pair with expected modular sum. - - Uses random values covering: - - No overflow: a + b < Q - - With overflow: a + b >= Q - - Edge cases: a=0, b=0, a=Q-1, b=Q-1 - - Args: - params: Unused for mod_add basic case. - - Returns: - dict with 'input' and 'expected' keys. - """ - # Mix of random and edge cases for coverage - roll = random.random() - - if roll < 0.05: - # Both zero - a, b = 0, 0 - elif roll < 0.10: - # a=0, b random - a = 0 - b = random.randint(0, Q - 1) - elif roll < 0.15: - # b=0, a random - a = random.randint(0, Q - 1) - b = 0 - elif roll < 0.20: - # Both Q-1 (max overflow) - a, b = Q - 1, Q - 1 - elif roll < 0.25: - # a random, b = Q-1 - a = random.randint(0, Q - 1) - b = Q - 1 - elif roll < 0.65: - # No overflow: both small - a = random.randint(0, Q // 2 - 1) - b = random.randint(0, Q // 2 - 1) - else: - # Potential overflow - a = random.randint(0, Q - 1) - b = random.randint(0, Q - 1) - - # Compute expected: (a + b) mod Q - expected_sum = (a + b) % Q - - return { - 'input': {'a': a, 'b': b}, - 'expected': {'sum': expected_sum} - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as "AAA BBB" hex format. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - a = v['input']['a'] - b = v['input']['b'] - f.write(f'{a:03X} {b:03X}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected output as "CCC" hex format. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - s = v['expected']['sum'] - f.write(f'{s:03X}\n') - - def compare_results(self, got: list[str], expected_file: str) -> bool: - """Compare RTL output against expected values. - - Args: - got: List of hex result strings from simulation. - expected_file: Path to expected hex file. - - Returns: - bool: True if all results match. - """ - with open(expected_file, 'r') as f: - expected = [line.strip() for line in f - if line.strip() and not line.startswith('#')] - - if len(got) != len(expected): - return False - - for i, (g, e) in enumerate(zip(got, expected)): - if g.upper() != e.upper(): - return False - - return True diff --git a/test_framework/modules/mod_add/test_plan.json b/test_framework/modules/mod_add/test_plan.json deleted file mode 100644 index 37d8066..0000000 --- a/test_framework/modules/mod_add/test_plan.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "module": "mod_add", - "rtl_top": "sync_rtl/mod_add/mod_add_sync.v", - "rtl_deps": ["sync_rtl/common/pipeline_reg.v"], - "tb_cpp": "sync_rtl/mod_add/TB/tb_mod_add.cpp", - "simulator": "verilator", - "timeout_s": 30, - "cases": [ - { - "id": "basic", - "description": "Random (a+b) mod Q pairs, no overflow, with overflow, edge cases", - "params": {}, - "num_vectors": 50, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/ntt/gen_vectors.py b/test_framework/modules/ntt/gen_vectors.py deleted file mode 100644 index b97315f..0000000 --- a/test_framework/modules/ntt/gen_vectors.py +++ /dev/null @@ -1,122 +0,0 @@ -"""gen_vectors.py - Test vector generator for ntt module. - -Generates random polynomials and computes expected NTT results -using the Python reference implementation (embedded to avoid -side-effect imports from the original module). -""" - -import os -import random -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) -from vector_gen import VectorGenerator - -Q = 3329 -N = 256 -N_INV = 3303 - -zeta_bitRev = [1, 1729, 2580, 3289, 2642, 630, 1897, 848, - 1062, 1919, 193, 797, 2786, 3260, 569, 1746, - 296, 2447, 1339, 1476, 3046, 56, 2240, 1333, - 1426, 2094, 535, 2882, 2393, 2879, 1974, 821, - 289, 331, 3253, 1756, 1197, 2304, 2277, 2055, - 650, 1977, 2513, 632, 2865, 33, 1320, 1915, - 2319, 1435, 807, 452, 1438, 2868, 1534, 2402, - 2647, 2617, 1481, 648, 2474, 3110, 1227, 910, - 17, 2761, 583, 2649, 1637, 723, 2288, 1100, - 1409, 2662, 3281, 233, 756, 2156, 3015, 3050, - 1703, 1651, 2789, 1789, 1847, 952, 1461, 2687, - 939, 2308, 2437, 2388, 733, 2337, 268, 641, - 1584, 2298, 2037, 3220, 375, 2549, 2090, 1645, - 1063, 319, 2773, 757, 2099, 561, 2466, 2594, - 2804, 1092, 403, 1026, 1143, 2150, 2775, 886, - 1722, 1212, 1874, 1029, 2110, 2935, 885, 2154] - - -def NTT(f): - """Forward NTT using Cooley-Tukey, bit-exact with reference.""" - f_hat = f.copy() - i = 1 - for len_NTT in [128, 64, 32, 16, 8, 4, 2]: - for start in range(0, 256, 2 * len_NTT): - zeta = zeta_bitRev[i] - i += 1 - for j in range(start, start + len_NTT): - t = (zeta * f_hat[j + len_NTT]) % Q - f_hat[j + len_NTT] = (f_hat[j] - t) % Q - f_hat[j] = (f_hat[j] + t) % Q - return f_hat - - -def NTTInverse(f_hat): - """Inverse NTT using Gentleman-Sande, bit-exact with reference.""" - f = f_hat.copy() - i = 127 - for len_NTT in [2, 4, 8, 16, 32, 64, 128]: - for start in range(0, 256, 2 * len_NTT): - zeta = zeta_bitRev[i] - i -= 1 - for j in range(start, start + len_NTT): - t = f[j] - f[j] = (t + f[j + len_NTT]) % Q - f[j + len_NTT] = (zeta * (f[j + len_NTT] - t)) % Q - for i in range(len(f)): - f[i] = (f[i] * N_INV) % Q - return f - - -class NttVectorGenerator(VectorGenerator): - """Generates test vectors for the ntt_sync module.""" - - def generate_one(self, params: dict) -> dict: - mode = params.get('mode', 'forward') - - if mode == 'forward': - f = [random.randint(0, Q - 1) for _ in range(N)] - f_hat = NTT(f) - return { - 'input': {'mode': 'F', 'coeffs': f}, - 'expected': {'coeffs': f_hat} - } - - elif mode == 'inverse': - f_hat = [random.randint(0, Q - 1) for _ in range(N)] - f = NTTInverse(f_hat) - return { - 'input': {'mode': 'I', 'coeffs': f_hat}, - 'expected': {'coeffs': f} - } - - elif mode == 'roundtrip': - f = [random.randint(0, Q - 1) for _ in range(N)] - f_hat = NTT(f) - f_recover = NTTInverse(f_hat) - assert f_recover == f, "Round-trip invariant failed!" - return { - 'input': {'mode': 'I', 'coeffs': f_hat}, - 'expected': {'coeffs': f} - } - - else: - raise ValueError(f"Unknown mode: {mode}") - - def _format_coeffs(self, coeffs: list[int]) -> str: - return ' '.join(f'{c:03X}' for c in coeffs) - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - mode = v['input']['mode'] - coeffs = v['input']['coeffs'] - hex_str = self._format_coeffs(coeffs) - f.write(f'{mode} {hex_str}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - coeffs = v['expected']['coeffs'] - hex_str = self._format_coeffs(coeffs) - f.write(f'{hex_str}\n') diff --git a/test_framework/modules/ntt/test_plan.json b/test_framework/modules/ntt/test_plan.json deleted file mode 100644 index 28c78e0..0000000 --- a/test_framework/modules/ntt/test_plan.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "module": "ntt", - "rtl_top": "sync_rtl/ntt/ntt_sync.v", - "rtl_deps": [ - "sync_rtl/ntt/ntt_core.v", - "sync_rtl/ntt/butterfly_unit.v", - "sync_rtl/ntt/barrett_mul.v", - "sync_rtl/ntt/zeta_rom.v" - ], - "tb_cpp": "sync_rtl/ntt/TB/tb_ntt.cpp", - "simulator": "verilator", - "timeout_s": 300, - "cases": [ - { - "id": "forward", - "description": "Forward NTT: 256-coeff polynomial -> NTT domain, vs Python NTT()", - "params": {"mode": "forward"}, - "num_vectors": 5, - "tolerance": "bit_exact" - }, - { - "id": "inverse", - "description": "Inverse NTT: 256-coeff NTT-domain -> normal domain, vs Python NTTInverse()", - "params": {"mode": "inverse"}, - "num_vectors": 5, - "tolerance": "bit_exact" - }, - { - "id": "roundtrip", - "description": "Round-trip: NTT(INTT(f)) == f", - "params": {"mode": "roundtrip"}, - "num_vectors": 3, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/poly_arith/gen_vectors.py b/test_framework/modules/poly_arith/gen_vectors.py deleted file mode 100644 index 6a13e57..0000000 --- a/test_framework/modules/poly_arith/gen_vectors.py +++ /dev/null @@ -1,108 +0,0 @@ -"""gen_vectors.py - Test vector generator for poly_arith module. - -Generates streaming 256-coefficient polynomial add/sub test vectors. -Each vector: "MODE A0..A255 B0..B255" (513 space-separated hex values). -Expected: "C0 C1 ... C255" (256 space-separated hex values). -""" - -import os -import random -import sys - -# Add test_framework/lib to path for VectorGenerator base class -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -from vector_gen import VectorGenerator - -Q = 3329 # ML-KEM prime modulus -N = 256 # polynomial degree - - -class PolyArithVectorGenerator(VectorGenerator): - """Generates test vectors for the poly_arith_sync module.""" - - def generate_one(self, params: dict) -> dict: - """Generate one polynomial add or sub vector. - - Generates 256 random coefficients for A and B, computes expected - result as (A[i] +/- B[i]) mod Q. - - Args: - params: dict with optional 'mode' key ('add' or 'sub'). - - Returns: - dict with 'input' and 'expected' keys. - """ - mode = params.get('mode', 'add') - - A = [random.randint(0, Q - 1) for _ in range(N)] - B = [random.randint(0, Q - 1) for _ in range(N)] - - if mode == 'sub': - expected = [(a - b) % Q for a, b in zip(A, B)] - else: - expected = [(a + b) % Q for a, b in zip(A, B)] - - return { - 'input': {'mode': mode, 'A': A, 'B': B}, - 'expected': {'C': expected} - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as hex file. - - Format: "MODE A0 A1 ... A255 B0 B1 ... B255" - MODE is 'A' for add, 'S' for sub. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - inp = v['input'] - mode_char = 'A' if inp['mode'] == 'add' else 'S' - A_hex = ' '.join(f'{c:03X}' for c in inp['A']) - B_hex = ' '.join(f'{c:03X}' for c in inp['B']) - f.write(f'{mode_char} {A_hex} {B_hex}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected results as hex file. - - Format: "C0 C1 ... C255" (one space-separated line per vector). - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - C = v['expected']['C'] - C_hex = ' '.join(f'{c:03X}' for c in C) - f.write(f'{C_hex}\n') - - def compare_results(self, got: list[str], expected_file: str) -> bool: - """Compare RTL output against expected values. - - Args: - got: List of result strings from simulation. - Each is " C0 C1 ... C255" after "RESULT:" prefix. - expected_file: Path to expected hex file. - - Returns: - bool: True if all results match. - """ - with open(expected_file, 'r') as f: - expected = [line.strip() for line in f - if line.strip() and not line.startswith('#')] - - if len(got) != len(expected): - return False - - for i, (g, e) in enumerate(zip(got, expected)): - if g.strip() != e.strip(): - return False - - return True diff --git a/test_framework/modules/poly_arith/test_plan.json b/test_framework/modules/poly_arith/test_plan.json deleted file mode 100644 index 4533956..0000000 --- a/test_framework/modules/poly_arith/test_plan.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "module": "poly_arith", - "rtl_top": "sync_rtl/poly_arith/poly_arith_sync.v", - "rtl_deps": ["sync_rtl/common/pipeline_reg.v"], - "tb_cpp": "sync_rtl/poly_arith/TB/tb_poly_arith.cpp", - "simulator": "verilator", - "timeout_s": 30, - "cases": [ - { - "id": "add", - "description": "Polynomial modular addition: (A[i] + B[i]) mod Q for 256 coeffs, 5 random vectors", - "params": {"mode": "add"}, - "num_vectors": 5, - "tolerance": "bit_exact" - }, - { - "id": "sub", - "description": "Polynomial modular subtraction: (A[i] - B[i]) mod Q for 256 coeffs, 5 random vectors", - "params": {"mode": "sub"}, - "num_vectors": 5, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/poly_mul/gen_vectors.py b/test_framework/modules/poly_mul/gen_vectors.py deleted file mode 100644 index 82faec2..0000000 --- a/test_framework/modules/poly_mul/gen_vectors.py +++ /dev/null @@ -1,128 +0,0 @@ -"""gen_vectors.py - Test vector generator for poly_mul module. - -Generates random NTT-domain polynomial pairs and computes expected -pointwise base-case multiplication results using embedded Python reference. -""" - -import os -import random -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) -from vector_gen import VectorGenerator - -Q = 3329 -N = 256 - -# Bit-reversed zeta values (same as NTT zeta_bitRev) -zeta_bitRev = [1, 1729, 2580, 3289, 2642, 630, 1897, 848, - 1062, 1919, 193, 797, 2786, 3260, 569, 1746, - 296, 2447, 1339, 1476, 3046, 56, 2240, 1333, - 1426, 2094, 535, 2882, 2393, 2879, 1974, 821, - 289, 331, 3253, 1756, 1197, 2304, 2277, 2055, - 650, 1977, 2513, 632, 2865, 33, 1320, 1915, - 2319, 1435, 807, 452, 1438, 2868, 1534, 2402, - 2647, 2617, 1481, 648, 2474, 3110, 1227, 910, - 17, 2761, 583, 2649, 1637, 723, 2288, 1100, - 1409, 2662, 3281, 233, 756, 2156, 3015, 3050, - 1703, 1651, 2789, 1789, 1847, 952, 1461, 2687, - 939, 2308, 2437, 2388, 733, 2337, 268, 641, - 1584, 2298, 2037, 3220, 375, 2549, 2090, 1645, - 1063, 319, 2773, 757, 2099, 561, 2466, 2594, - 2804, 1092, 403, 1026, 1143, 2150, 2775, 886, - 1722, 1212, 1874, 1029, 2110, 2935, 885, 2154] - -# Precomputed PolyMul zeta values: zeta_sq_mul[i] = (zeta_bitRev[i]^2 * 17) % Q -zeta_sq_mul = [((z * z) * 17) % Q for z in zeta_bitRev] - - -def basecase_multiply(a0, a1, b0, b1, zeta): - """Degree-1 NTT-domain base-case multiply. - - Computes: - c0 = (a0*b0 + a1*b1*zeta) mod Q - c1 = (a0*b1 + a1*b0) mod Q - - Uses modular arithmetic to match Barrett reduction semantics. - """ - c0 = ((a0 * b0) % Q + (((a1 * b1) % Q) * zeta) % Q) % Q - c1 = ((a0 * b1) % Q + (a1 * b0) % Q) % Q - return c0, c1 - - -def poly_mul(f_hat, g_hat): - """Full NTT-domain polynomial multiplication. - - Given two 256-coefficient NTT-domain polynomials f_hat and g_hat, - compute pointwise product using 128 degree-1 base-case multiplies. - - Args: - f_hat: list of 256 coefficients in [0, Q-1] - g_hat: list of 256 coefficients in [0, Q-1] - - Returns: - list of 256 result coefficients in [0, Q-1] - """ - h_hat = [] - for i in range(128): - zeta = zeta_sq_mul[i] - h1, h2 = basecase_multiply( - f_hat[2 * i], f_hat[2 * i + 1], - g_hat[2 * i], g_hat[2 * i + 1], - zeta - ) - h_hat.append(h1) - h_hat.append(h2) - return h_hat - - -class PolyMulVectorGenerator(VectorGenerator): - """Generates test vectors for the poly_mul_sync module.""" - - def generate_one(self, params: dict) -> dict: - """Generate a random polynomial pair with expected result. - - Args: - params: Unused for basic case. - - Returns: - dict with 'input' (A coeffs, B coeffs) and 'expected' (C coeffs). - """ - # Generate random NTT-domain polynomials - A = [random.randint(0, Q - 1) for _ in range(N)] - B = [random.randint(0, Q - 1) for _ in range(N)] - - # Compute expected result via Python reference - C = poly_mul(A, B) - - return { - 'input': {'A': A, 'B': B}, - 'expected': {'C': C} - } - - def _format_coeffs(self, coeffs: list[int]) -> str: - """Format a coefficient list as space-separated 3-digit hex.""" - return ' '.join(f'{c:03X}' for c in coeffs) - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors: one line per vector with 512 hex values. - - Format: A[0] A[1] ... A[255] B[0] B[1] ... B[255] - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - all_coeffs = v['input']['A'] + v['input']['B'] - hex_str = self._format_coeffs(all_coeffs) - f.write(f'{hex_str}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected output: one line per vector with 256 hex values. - - Format: C[0] C[1] ... C[255] - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - hex_str = self._format_coeffs(v['expected']['C']) - f.write(f'{hex_str}\n') diff --git a/test_framework/modules/poly_mul/test_plan.json b/test_framework/modules/poly_mul/test_plan.json deleted file mode 100644 index fbfaa27..0000000 --- a/test_framework/modules/poly_mul/test_plan.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "module": "poly_mul", - "rtl_top": "sync_rtl/poly_mul/poly_mul_sync.v", - "rtl_deps": [ - "sync_rtl/poly_mul/basecase_mul.v", - "sync_rtl/poly_mul/poly_mul_zeta_rom.v", - "sync_rtl/ntt/barrett_mul.v" - ], - "tb_cpp": "sync_rtl/poly_mul/TB/tb_poly_mul.cpp", - "simulator": "verilator", - "timeout_s": 300, - "cases": [ - { - "id": "basic", - "description": "Pointwise multiply of two random NTT-domain polynomials, vs Python basecase_mul reference", - "params": {}, - "num_vectors": 5, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/rng/gen_vectors.py b/test_framework/modules/rng/gen_vectors.py deleted file mode 100644 index f01265d..0000000 --- a/test_framework/modules/rng/gen_vectors.py +++ /dev/null @@ -1,112 +0,0 @@ -"""gen_vectors.py - Test vector generator for rng module. - -Generates expected 256-bit LFSR output values using the same Galois LFSR -polynomial as the RTL: x^256 + x^255 + x^253 + x^252 + x^247 + 1 -Taps: [255, 253, 252, 247, 0] -""" - -import os -import sys - -# Add test_framework/lib to path for VectorGenerator base class -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -from vector_gen import VectorGenerator - -# Default seed matches RTL SEED parameter -DEFAULT_SEED = 0xDEADBEEFCAFEBABEFEEDFACEDECAFBAD1234567887654321ABCDEF010FEDCBA9 - -# 256-bit mask -MASK_256 = (1 << 256) - 1 - - -class _LFSR256: - """256-bit Galois LFSR matching rng_sync.v implementation. - - Polynomial: x^256 + x^255 + x^253 + x^252 + x^247 + 1 - Taps: [255, 253, 252, 247, 0] - """ - - def __init__(self, seed: int): - self.state = seed & MASK_256 - - def next(self) -> int: - """Advance LFSR one step and return the new state.""" - feedback = self.state & 1 # LSB = state[0] - - # Shift right by 1, feedback into MSB (position 255) - new_state = (self.state >> 1) | (feedback << 255) - - # XOR feedback into tap positions (shifted) - if feedback: - new_state ^= (1 << 254) # tap 255 -> position 254 - new_state ^= (1 << 252) # tap 253 -> position 252 - new_state ^= (1 << 251) # tap 252 -> position 251 - new_state ^= (1 << 246) # tap 247 -> position 246 - - self.state = new_state & MASK_256 - return self.state - - -class RngVectorGenerator(VectorGenerator): - """Generates test vectors for the rng_sync module.""" - - def __init__(self): - super().__init__() - self._lfsr = None - - def _ensure_lfsr(self, params: dict) -> None: - """Initialize LFSR on first call or when params change seed.""" - seed = params.get('seed', DEFAULT_SEED) - if self._lfsr is None: - self._lfsr = _LFSR256(seed) - - def generate_one(self, params: dict) -> dict: - """Generate one LFSR output value. - - On each call, advances the LFSR from its current state and returns - the new state. This matches the RTL behavior: valid_i advances the - LFSR, and the new value appears on data_o. - - Args: - params: Optional dict with 'seed' key to override default seed. - - Returns: - dict with 'input' (empty) and 'expected' {'data': lfsr_state_hex}. - """ - self._ensure_lfsr(params) - new_state = self._lfsr.next() - return { - 'input': {}, - 'expected': {'data': new_state} - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input file with one dummy line per vector. - - The RNG has no input signals, but the testbench reads the hex file - to determine the number of vectors to generate. Each line acts as - a pulse trigger. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for _ in vectors: - f.write('0\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected output as 64-char hex strings, one per line. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - data = v['expected']['data'] - # Format as 64-character uppercase hex string - f.write(f'{data:064X}\n') diff --git a/test_framework/modules/rng/test_plan.json b/test_framework/modules/rng/test_plan.json deleted file mode 100644 index f386f26..0000000 --- a/test_framework/modules/rng/test_plan.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "module": "rng", - "rtl_top": "sync_rtl/rng/rng_sync.v", - "rtl_deps": [], - "tb_cpp": "sync_rtl/rng/TB/tb_rng.cpp", - "simulator": "verilator", - "timeout_s": 30, - "cases": [ - { - "id": "basic", - "description": "Generate 10 pseudo-random 256-bit values with fixed-seed LFSR", - "params": {}, - "num_vectors": 10, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/sample_cbd/gen_vectors.py b/test_framework/modules/sample_cbd/gen_vectors.py deleted file mode 100644 index fde4e6c..0000000 --- a/test_framework/modules/sample_cbd/gen_vectors.py +++ /dev/null @@ -1,184 +0,0 @@ -"""gen_vectors.py - Test vector generator for sample_cbd module. - -Generates vectors for CBD sampling with eta=2 and eta=3 using the -Python reference SHA_3.PRF for SHAKE-256 expander output, and a local -CBD implementation that outputs signed 12-bit coefficients. -""" - -import os -import random -import sys - -# Add test_framework/lib to path for VectorGenerator base class -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -# Add Python reference path -_REF_PATH = os.path.expanduser( - "~/Dev/server_code/python_project/PQC_2025/A_ML_KEM_v0") -sys.path.insert(0, _REF_PATH) - -import SHA_3 - -from vector_gen import VectorGenerator - - -def _random_bits(length): - """Generate a random binary string (LSB-first) of given length.""" - val = random.getrandbits(length) - bits = '' - for i in range(length): - bits += '1' if (val & (1 << i)) else '0' - return bits - - -def _bits_to_hex_msb(bits_str): - """Convert binary string (LSB-first: bits_str[0] = bit 0) to MSB-first hex. - - Returns hex string where leftmost char = most significant nibble. - Each nibble maps bits[3:0] to a hex char (bit 3 = MSB of nibble). - """ - num_bits = len(bits_str) - result = [] - for i in range(num_bits - 4, -1, -4): - nib = 0 - for j in range(4): - pos = i + j - if pos < num_bits and bits_str[pos] == '1': - nib |= (1 << j) - result.append('0123456789ABCDEF'[nib]) - return ''.join(result) - - -def _sample_poly_cbd(prf_bits, eta): - """Centered Binomial Distribution on PRF output bits. - - Reads eta*2 bits per coefficient from the binary string (LSB-first). - Each coefficient = sum of first eta bits - sum of last eta bits. - Result is a signed integer in range [-eta, eta]. - - Args: - prf_bits: Binary string (LSB-first) from SHAKE-256 PRF. - eta: 2 or 3. - - Returns: - list of 256 signed integers. - """ - step = eta * 2 # 4 for eta=2, 6 for eta=3 - half = eta # 2 for eta=2, 3 for eta=3 - coeffs = [] - for i in range(256): - pos_sum = 0 - neg_sum = 0 - for j in range(half): - pos_sum += (1 if prf_bits[step * i + j] == '1' else 0) - for j in range(half): - neg_sum += (1 if prf_bits[step * i + half + j] == '1' else 0) - coeffs.append(pos_sum - neg_sum) - return coeffs - - -def _coeff_to_hex_12signed(val): - """Convert signed value (range [-eta, eta]) to 12-bit hex string. - - Negative values are represented as 12-bit two's complement. - e.g., -2 → 0xFFE → "FFE", 3 → 0x003 → "003". - """ - masked = val & 0xFFF # 12-bit unsigned representation - return f'{masked:03X}' - - -class SampleCbdVectorGenerator(VectorGenerator): - """Generates test vectors for the sample_cbd_sync module.""" - - def generate_one(self, params: dict) -> dict: - """Generate a single test vector. - - Args: - params: dict with 'eta' key (2 or 3). - - Returns: - dict with 'input' and 'expected' keys. - """ - eta = params.get('eta', 2) - - # Generate random seed (256 bits) and nonce (8 bits) - seed_bits = _random_bits(256) # sigma, LSB-first - nonce_bits = _random_bits(8) # N, LSB-first - - # SHAKE-256 PRF: sigma || N → eta*64 bytes - prf_bits = SHA_3.PRF(seed_bits, nonce_bits, eta) - - # CBD sampling: output signed 12-bit coefficients - coeffs = _sample_poly_cbd(prf_bits, eta) - - # Convert seed and nonce to MSB-first hex for RTL input - seed_hex = _bits_to_hex_msb(seed_bits) - nonce_hex = _bits_to_hex_msb(nonce_bits) - - return { - 'input': { - 'seed_hex': seed_hex, - 'nonce_hex': nonce_hex, - 'eta': eta - }, - 'expected': { - 'coeffs': coeffs - } - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as "SEED_HEX NONCE_HEX ETA" hex format. - - Each line: "64HEXCHARS 2HEXCHARS ETA_DECIMAL". - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - inp = v['input'] - f.write(f'{inp["seed_hex"]} {inp["nonce_hex"]} {inp["eta"]}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected coefficients as hex strings, one per line. - - Each vector produces 256 lines of 3-char hex (12-bit signed). - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - coeffs = v['expected']['coeffs'] - for c in coeffs: - f.write(f'{_coeff_to_hex_12signed(c)}\n') - - def compare_results(self, got: list[str], expected_file: str) -> bool: - """Compare RTL output against expected values. - - Args: - got: List of hex result strings from simulation. - expected_file: Path to expected hex file. - - Returns: - bool: True if all results match. - """ - with open(expected_file, 'r') as f: - expected = [line.strip() for line in f - if line.strip() and not line.startswith('#')] - - if len(got) != len(expected): - print(f" COUNT MISMATCH: got={len(got)}, expected={len(expected)}") - return False - - for i, (g, e) in enumerate(zip(got, expected)): - if g.upper() != e.upper(): - if i < 10: # Only show first 10 mismatches - print(f" MISMATCH[{i}]: got={g.upper()}, expected={e.upper()}") - return False - - return True diff --git a/test_framework/modules/sample_cbd/test_plan.json b/test_framework/modules/sample_cbd/test_plan.json deleted file mode 100644 index 6eb1f75..0000000 --- a/test_framework/modules/sample_cbd/test_plan.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "module": "sample_cbd", - "rtl_top": "sync_rtl/sample_cbd/sample_cbd_sync.v", - "rtl_deps": ["sync_rtl/sha3/keccak_core.v", "sync_rtl/sha3/keccak_round.v"], - "tb_cpp": "sync_rtl/sample_cbd/TB/tb_sample_cbd.cpp", - "simulator": "verilator", - "timeout_s": 300, - "cases": [ - { - "id": "eta2", - "description": "CBD with eta=2: random seeds, compare with Python reference", - "params": {"eta": 2}, - "num_vectors": 5, - "tolerance": "bit_exact" - }, - { - "id": "eta3", - "description": "CBD with eta=3: random seeds, compare with Python reference", - "params": {"eta": 3}, - "num_vectors": 5, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/sample_ntt/gen_vectors.py b/test_framework/modules/sample_ntt/gen_vectors.py deleted file mode 100644 index 5d74106..0000000 --- a/test_framework/modules/sample_ntt/gen_vectors.py +++ /dev/null @@ -1,168 +0,0 @@ -"""gen_vectors.py - Test vector generator for sample_ntt module. - -Generates random rho seeds, computes expected coefficients with a standard -FIPS 202 SHAKE-128 rejection sampler (hashlib), and writes hex files for -Verilator simulation. - -The expected coefficients are FIPS-203-conformant (Algorithm 7 SampleNTT): -SHAKE-128(rho || j || i), consume the full rate, 12-bit rejection sampling. -""" - -import os -import random -import sys -import hashlib - -# Add test_framework/lib to path for VectorGenerator base class -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "lib")) -from vector_gen import VectorGenerator - - -def _sample_ntt_ref(seed: bytes) -> list[int]: - """FIPS 203 Algorithm 7 SampleNTT using standard SHAKE-128. - - Args: - seed: 34-byte input = rho(32) || j(1) || i(1). - - Returns: - List of 256 coefficients in [0, 3329). - """ - # 1344 bytes = 8 full SHAKE-128 rate blocks; ample for 256 accepts. - stream = hashlib.shake_128(seed).digest(1344) - coeffs = [] - off = 0 - while len(coeffs) < 256: - c0, c1, c2 = stream[off], stream[off + 1], stream[off + 2] - off += 3 - d1 = c0 | ((c1 & 0x0F) << 8) - d2 = (c1 >> 4) | (c2 << 4) - if d1 < 3329: - coeffs.append(d1) - if d2 < 3329 and len(coeffs) < 256: - coeffs.append(d2) - return coeffs - - -class SampleNTTVectorGenerator(VectorGenerator): - """Generates test vectors for the sample_ntt_sync module.""" - - def generate_one(self, params: dict) -> dict: - """Generate a single test vector. - - Args: - params: dict with 'k' key (ML-KEM parameter, 2/3/4). - - Returns: - dict with 'input' and 'expected' keys. - """ - k = params.get("k", 2) - - # Random 32-byte rho - rho = bytes(random.randint(0, 255) for _ in range(32)) - - # Choose random (i, j) indices within [0, k-1] - i = random.randint(0, k - 1) - j = random.randint(0, k - 1) - - # 34-byte SampleNTT input: rho || j || i (FIPS 203 Alg 13/7) - seed = rho + bytes([j]) + bytes([i]) - - # Expected coefficients from a standard SHAKE-128 sampler - coeffs = _sample_ntt_ref(seed) - - # rho hex: byte 0 first (matches TB parse_rho byte ordering) - rho_hex = rho.hex().upper() - - return { - "input": { - "rho_hex": rho_hex, - "k": k, - "i": i, - "j": j, - }, - "expected": { - "coeffs": list(coeffs), # 256 coefficients (0 <= c < 3329) - }, - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as "RHO_HEX K_HEX I_HEX J_HEX" per line. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, "w") as f: - for v in vectors: - inp = v["input"] - rho_hex = inp["rho_hex"] - k_hex = format(inp["k"], "X") - i_hex = format(inp["i"], "X") - j_hex = format(inp["j"], "X") - f.write(f"{rho_hex} {k_hex} {i_hex} {j_hex}\n") - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected outputs: one coefficient per line (12-bit hex). - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, "w") as f: - for v in vectors: - coeffs = v["expected"]["coeffs"] - for c in coeffs: - f.write(f"{c:03X}\n") - - def compare_results(self, got: list[str], expected_file: str) -> bool: - """Compare RTL output against expected values. - - Args: - got: List of hex result strings from simulation ("RESULT: XXX"). - expected_file: Path to expected hex file. - - Returns: - bool: True if all results match. - """ - with open(expected_file, "r") as f: - expected = [ - line.strip() - for line in f - if line.strip() and not line.startswith("#") - ] - - if len(got) != len(expected): - print( - f" MISMATCH: got {len(got)} results, expected {len(expected)}" - ) - return False - - all_ok = True - for i, (g, e) in enumerate(zip(got, expected)): - if g.upper() != e.upper(): - print(f" MISMATCH[{i}]: got={g}, expected={e}") - all_ok = False - if i >= 9: # Stop after 10 mismatches - print(f" ... too many mismatches, stopping comparison") - break - - return all_ok - - -if __name__ == "__main__": - # Quick smoke test when run directly - gen = SampleNTTVectorGenerator() - for k_val in [2, 4]: - vec = gen.generate_one({"k": k_val}) - rho = vec["input"]["rho_hex"] - i = vec["input"]["i"] - j = vec["input"]["j"] - coeffs = vec["expected"]["coeffs"] - print(f"k={k_val}, i={i}, j={j}: {len(coeffs)} coefficients") - print(f" rho[0:8]={rho[:8]}...") - print(f" coeffs[0:4]={coeffs[:4]}") - # Verify all coefficients < Q - assert all(0 <= c < 3329 for c in coeffs), "Coefficient out of range!" - print("Smoke test PASSED") diff --git a/test_framework/modules/sample_ntt/test_plan.json b/test_framework/modules/sample_ntt/test_plan.json deleted file mode 100644 index ae09f93..0000000 --- a/test_framework/modules/sample_ntt/test_plan.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "module": "sample_ntt", - "rtl_top": "sync_rtl/sample_ntt/sample_ntt_sync.v", - "rtl_deps": [ - "sync_rtl/sha3/keccak_core.v", - "sync_rtl/sha3/keccak_round.v" - ], - "tb_cpp": "sync_rtl/sample_ntt/TB/tb_sample_ntt.cpp", - "simulator": "verilator", - "timeout_s": 300, - "cases": [ - { - "id": "k2", - "description": "k=2: A[0][0] polynomial, compare with Python sampleNTT", - "params": {"k": 2}, - "num_vectors": 3, - "tolerance": "bit_exact" - }, - { - "id": "k4", - "description": "k=4: test multiple (i,j) pairs", - "params": {"k": 4}, - "num_vectors": 3, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/sha3/gen_vectors.py b/test_framework/modules/sha3/gen_vectors.py deleted file mode 100644 index 51db608..0000000 --- a/test_framework/modules/sha3/gen_vectors.py +++ /dev/null @@ -1,195 +0,0 @@ -"""gen_vectors.py - Test vector generator for sha3 module. - -Generates vectors for G (SHA3-512), H (SHA3-256), J (SHAKE-256) modes -and computes expected outputs using the Python reference implementation. -""" - -import os -import random -import sys - -# Add test_framework/lib to path for VectorGenerator base class -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -# Add Python reference path -_REF_PATH = os.path.expanduser( - "~/Dev/server_code/python_project/PQC_2025/A_ML_KEM_v0") -_REF_PATH = os.path.expanduser(_REF_PATH) -sys.path.insert(0, _REF_PATH) - -import SHA_3 - -from vector_gen import VectorGenerator - - -def _bits_to_hex(bits_str, num_bits): - """Convert binary string (LSB-first: bits_str[0] = bit 0) to hex. - - Returns hex with MSB-nibble first (matching Verilog %%X format). - Each group of 4 bits forms a nibble: bit[i+3:i] → two hex chars. - """ - result = [] - for i in range(0, num_bits, 4): - nib = 0 - for j in range(4): - pos = i + j - if pos < len(bits_str) and bits_str[pos] == '1': - nib |= (1 << j) - result.insert(0, '0123456789ABCDEF'[nib]) - return ''.join(result) - - -def _hex_to_bits(hex_str, num_bits): - """Convert hex string (MSB-first) to binary string (LSB-first). - - Returns a binary string where result[0] = bit 0 (LSB). - """ - hex_val = int(hex_str, 16) - bits = '' - for i in range(num_bits): - bits += '1' if (hex_val & (1 << i)) else '0' - return bits - - -def _random_bits(length): - """Generate a random binary string of given length.""" - val = random.getrandbits(length) - bits = '' - for i in range(length): - bits += '1' if (val & (1 << i)) else '0' - return bits - - -class Sha3VectorGenerator(VectorGenerator): - """Generates test vectors for the sha3_top module.""" - - def generate_one(self, params: dict) -> dict: - """Generate a single test vector. - - For G mode: - - d: 256-bit random binary string - - k: 8-bit random binary string - - Input to RTL: d||k packed into 512-bit value (data_i[263:0]) - - Expected: G(d, k) = 512-bit binary string - - For H mode: - - ek: 256-bit random binary string (single-block) - - Input to RTL: ek in data_i[255:0] - - Expected: H(ek) = 256-bit binary string - - For J mode: - - z: 256-bit random binary string - - c: 256-bit random binary string - - Input to RTL: z||c in data_i[511:0] - - Expected: J(z, c) = 256-bit binary string - - Args: - params: dict with 'mode' key ('G', 'H', 'J'). - - Returns: - dict with 'input' and 'expected' keys. - """ - mode = params.get('mode', 'G') - - if mode == 'G': - # d: 256 bits, k: 8 bits - d = _random_bits(256) - k = _random_bits(8) - msg = d + k # 264 bits, LSB first - - # Pack into 512-bit hex value: data_i[511:0] - # pad msg to 512 bits with zeros (upper bits = 0) - msg_512 = msg + '0' * (512 - len(msg)) - input_hex = _bits_to_hex(msg_512, 512) - - # Expected: G(d, k) returns binary string - expected_bits = SHA_3.G(d, k) - expected_hex = _bits_to_hex(expected_bits, 512) - - return { - 'input': { - 'mode': 0, - 'data': input_hex - }, - 'expected': { - 'hash': expected_hex - } - } - - elif mode == 'H': - # ek: 256-bit random message (single-block test) - ek = _random_bits(256) - - # Pack into 512-bit hex: data_i[511:0] - msg_512 = ek + '0' * (512 - len(ek)) - input_hex = _bits_to_hex(msg_512, 512) - - # Expected: H(ek) returns 256-bit binary string - expected_bits = SHA_3.H(ek) - expected_hex = _bits_to_hex(expected_bits, 256) - - return { - 'input': { - 'mode': 1, - 'data': input_hex - }, - 'expected': { - 'hash': expected_hex - } - } - - elif mode == 'J': - # z: 256 bits, c: 256 bits - z = _random_bits(256) - c = _random_bits(256) - msg = z + c # 512 bits - - # Pack into 512-bit hex - input_hex = _bits_to_hex(msg, 512) - - # Expected: J(z, c) returns 256-bit binary string - expected_bits = SHA_3.J(z, c) - expected_hex = _bits_to_hex(expected_bits, 256) - - return { - 'input': { - 'mode': 2, - 'data': input_hex - }, - 'expected': { - 'hash': expected_hex - } - } - - else: - raise ValueError(f"Unknown mode: {mode}") - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as "MM DDDD..." hex format (mode, data). - - Each line: "MM DDDD..." where MM is hex mode (00/01/10) and DDDD... - is the hex-encoded 512-bit message. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - mode_val = v['input']['mode'] - data_hex = v['input']['data'] - f.write(f'{mode_val:02X} {data_hex}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected output as hex strings, one per line. - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for v in vectors: - expected_hex = v['expected']['hash'] - f.write(f'{expected_hex}\n') diff --git a/test_framework/modules/sha3/test_plan.json b/test_framework/modules/sha3/test_plan.json deleted file mode 100644 index be79c19..0000000 --- a/test_framework/modules/sha3/test_plan.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "module": "sha3", - "rtl_top": "sync_rtl/sha3/sha3_top.v", - "rtl_deps": ["sync_rtl/sha3/keccak_core.v", "sync_rtl/sha3/keccak_round.v"], - "tb_cpp": "sync_rtl/sha3/TB/tb_sha3.cpp", - "simulator": "verilator", - "timeout_s": 120, - "cases": [ - { - "id": "g_basic", - "description": "SHA3-512 G(d||k): 64B input → 64B output, verified against Python reference", - "params": {"mode": "G", "k": 2}, - "num_vectors": 10, - "tolerance": "bit_exact" - }, - { - "id": "h_basic", - "description": "SHA3-256 H(ek): 32B+ output, single-block", - "params": {"mode": "H", "k": 2}, - "num_vectors": 10, - "tolerance": "bit_exact" - }, - { - "id": "j_basic", - "description": "SHAKE-256 J(z||c): variable input → 32B output", - "params": {"mode": "J"}, - "num_vectors": 5, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/modules/storage/gen_vectors.py b/test_framework/modules/storage/gen_vectors.py deleted file mode 100644 index e6bd91e..0000000 --- a/test_framework/modules/storage/gen_vectors.py +++ /dev/null @@ -1,67 +0,0 @@ -"""gen_vectors.py - Test vector generator for storage (sd_bram) module. - -Generates (addr, data) write pairs and expected read-back values. -Address space: 0..63 (6-bit) | Data width: 48-bit. -""" - -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'lib')) - -from vector_gen import VectorGenerator - - -class StorageVectorGenerator(VectorGenerator): - """Generates write/read test vectors for sd_bram behavioral RAM.""" - - def generate_one(self, params: dict) -> dict: - """Generate a single (addr, data) write pair. - - Uses sequential addresses 0..N-1 and deterministic 48-bit data - patterns for reproducible testing. - - Args: - params: Unused for storage basic case. - - Returns: - dict with 'input' and 'expected' keys. - """ - # Sequential address assignment during generation - # addr is determined by position; data is a deterministic pattern - # The actual index is handled in write_hex_file for sequential addresses - return { - 'data': 0 # placeholder — filled in write_hex_file by index - } - - def write_hex_file(self, vectors: list[dict], filepath: str) -> None: - """Write input vectors as "AA DDDDDDDDDDDD" hex lines. - - Uses sequential addresses 0..N-1 and deterministic 48-bit data: - data = (addr * 0x100000000001 + 0xDEADBEEFCAFE) & 0xFFFF_FFFF_FFFF - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for i in range(len(vectors)): - addr = i - # Deterministic 48-bit pattern: spreads bits across the word - data = ((addr + 1) * 0x100000000001 + 0xDEADBEEFCAFE) & 0xFFFFFFFFFFFF - f.write(f'{addr:02X} {data:012X}\n') - - def write_expected_file(self, vectors: list[dict], filepath: str) -> None: - """Write expected read-back values (same patterns as written). - - Args: - vectors: List of vector dicts from generate_one(). - filepath: Path to write the expected hex file. - """ - os.makedirs(os.path.dirname(filepath), exist_ok=True) - with open(filepath, 'w') as f: - for i in range(len(vectors)): - addr = i - data = ((addr + 1) * 0x100000000001 + 0xDEADBEEFCAFE) & 0xFFFFFFFFFFFF - f.write(f'{data:012X}\n') diff --git a/test_framework/modules/storage/test_plan.json b/test_framework/modules/storage/test_plan.json deleted file mode 100644 index 455d6c1..0000000 --- a/test_framework/modules/storage/test_plan.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "module": "storage", - "rtl_top": "sync_rtl/storage/sd_bram.v", - "rtl_deps": ["sync_rtl/storage/s_bram.v"], - "tb_cpp": "sync_rtl/storage/TB/tb_storage.cpp", - "simulator": "verilator", - "timeout_s": 30, - "cases": [ - { - "id": "rw_test", - "description": "Write-read test for sd_bram (s_bram compiled as dep)", - "params": {}, - "num_vectors": 5, - "tolerance": "bit_exact" - } - ] -} diff --git a/test_framework/run_all.py b/test_framework/run_all.py deleted file mode 100755 index 74d5fa8..0000000 --- a/test_framework/run_all.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python3 -"""run_all.py - CLI entry point for the ML-KEM RTL test framework. - -Usage: - python3 run_all.py # Run all modules - python3 run_all.py --module mod_add # Run specific module - python3 run_all.py --list # List all registered modules - python3 run_all.py --module mod_add --case basic # Run single case - python3 run_all.py --quick # Quick mode (reduced vectors) -""" - -import os -import sys -import time -import argparse -from pathlib import Path - -# Ensure test_framework/lib is on the path -sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) - -from lib.test_runner import TestRunner -from lib.reporter import Reporter - - -def main(): - parser = argparse.ArgumentParser( - description='ML-KEM RTL Test Framework' - ) - parser.add_argument('--module', '-m', type=str, default=None, - help='Run specific module only') - parser.add_argument('--case', '-c', type=str, default=None, - help='Run specific test case only') - parser.add_argument('--list', '-l', action='store_true', - help='List all registered modules') - parser.add_argument('--quick', '-q', action='store_true', - help='Quick mode (reduced vectors)') - parser.add_argument('--config', type=str, default='test_framework/config.json', - help='Path to config.json') - - args = parser.parse_args() - - # Change to project root (parent of test_framework/) - script_dir = os.path.dirname(os.path.abspath(__file__)) - project_root = os.path.dirname(script_dir) - os.chdir(project_root) - - runner = TestRunner(config_path=args.config) - modules = runner.discover_modules() - - if args.list: - print("\nRegistered test modules:") - if not modules: - print(" (none found)") - for name, plan in sorted(modules.items()): - num_cases = len(plan.get('cases', [])) - print(f" {name}: {num_cases} case(s)") - for case in plan.get('cases', []): - print(f" - {case['id']}: {case.get('description', '')}") - print() - return 0 - - if not modules: - print("No test modules found in test_framework/modules/") - return 1 - - # Determine which modules to run - if args.module: - if args.module not in modules: - print(f"Error: Module '{args.module}' not found.") - print(f"Available: {', '.join(sorted(modules.keys()))}") - return 1 - to_run = [args.module] - else: - to_run = sorted(modules.keys()) - - # Run tests - results = {} - total_start = time.time() - - reporter = Reporter(runner.config.get('report_root', 'test_framework/reports')) - - for module_name in to_run: - print(f"\n{'='*50}") - print(f" Testing: {module_name}") - print(f"{'='*50}") - - result = runner.run_module( - module_name, - quick=args.quick, - single_case=args.case - ) - results[module_name] = result - - if result['status'] == 'COMPILE_ERROR': - print(f" ERROR: Verilator compilation failed for {module_name}") - elif result['status'] == 'ERROR': - print(f" ERROR: {result.get('error', 'Unknown error')}") - elif result['status'] == 'NOT_FOUND': - print(f" ERROR: {result.get('error', 'Module not found')}") - - total_elapsed = time.time() - total_start - - # Print summary - all_pass = reporter.print_summary(results, total_elapsed) - - return 0 if all_pass else 1 - - -if __name__ == '__main__': - sys.exit(main())