feat(mlkem_top): parameterize K in {2,3,4} (ML-KEM 512/768/1024)
Generalize KeyGen from K=2-hardcoded to compile-time parameter K:
- eta1 derived (3 for K=2, else 2); slot layout SLOT_S/E/T = K*K+{0,K,2K},
NUM_SLOTS = K*K+3K; SAW=5 slot-addr width.
- A-stage: explicit a_i/a_j row-major counters (slot = i*K+j) instead of
K=2 bit-tricks. C/N stages: parametric slot bases, 2K polys.
- M-stage: m_i/m_j widened to 3-bit (must reach K=4); slots i*K+j etc.
- E-stage: 2K polys, e_is_dk split, rho offset 384*K.
- H(ek): H_NBLK=ceil((EK_BYTES+1)/136), H_LAST padding generalized;
h_blk 4-bit. Byte mems sized EK_BYTES/DK_BYTES.
- Widen dbg_byte_idx_i to [10:0] (ek up to 1568B for K=4).
Parametric TB (tb_mlkem_kg_katK, KP generic + CASE plusarg). Verified
byte-exact vs NIST KAT:
K=2 (512): cases 0..4 ek 800B / dk 1632B
K=3 (768): cases 0..2 ek 1184B / dk 2400B (~36k cyc)
K=4 (1024): cases 0..2 ek 1568B / dk 3168B (~54k cyc)
run_tb.sh top runs all three parameter sets.
This commit is contained in:
1
sync_rtl/top/TB/vectors/kat_k3_c0_d.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k3_c0_d.hex
Normal file
@@ -0,0 +1 @@
|
||||
2426f1941779574d3f1b163bd57f7e173e229e630ec7f7073bdf365137c4bb6d
|
||||
2400
sync_rtl/top/TB/vectors/kat_k3_c0_dk.hex
Normal file
2400
sync_rtl/top/TB/vectors/kat_k3_c0_dk.hex
Normal file
File diff suppressed because it is too large
Load Diff
1184
sync_rtl/top/TB/vectors/kat_k3_c0_ek.hex
Normal file
1184
sync_rtl/top/TB/vectors/kat_k3_c0_ek.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
sync_rtl/top/TB/vectors/kat_k3_c0_z.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k3_c0_z.hex
Normal file
@@ -0,0 +1 @@
|
||||
687acf9406694974d383032f7579378f449c75d0560af56cf921ec48404896f6
|
||||
1
sync_rtl/top/TB/vectors/kat_k3_c1_d.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k3_c1_d.hex
Normal file
@@ -0,0 +1 @@
|
||||
9b68d9d2390fa18739b239a58649393a28f97f6b164ec5e4334f4df864fc9cd6
|
||||
2400
sync_rtl/top/TB/vectors/kat_k3_c1_dk.hex
Normal file
2400
sync_rtl/top/TB/vectors/kat_k3_c1_dk.hex
Normal file
File diff suppressed because it is too large
Load Diff
1184
sync_rtl/top/TB/vectors/kat_k3_c1_ek.hex
Normal file
1184
sync_rtl/top/TB/vectors/kat_k3_c1_ek.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
sync_rtl/top/TB/vectors/kat_k3_c1_z.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k3_c1_z.hex
Normal file
@@ -0,0 +1 @@
|
||||
a02e20d538b412ff074d121a80b0583e0b54e85b267da0789c5ca565342ee66d
|
||||
1
sync_rtl/top/TB/vectors/kat_k3_c2_d.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k3_c2_d.hex
Normal file
@@ -0,0 +1 @@
|
||||
905eb1f02ade542733c35132f5a998d3ec80d20ec8ed235bf228081157034763
|
||||
2400
sync_rtl/top/TB/vectors/kat_k3_c2_dk.hex
Normal file
2400
sync_rtl/top/TB/vectors/kat_k3_c2_dk.hex
Normal file
File diff suppressed because it is too large
Load Diff
1184
sync_rtl/top/TB/vectors/kat_k3_c2_ek.hex
Normal file
1184
sync_rtl/top/TB/vectors/kat_k3_c2_ek.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
sync_rtl/top/TB/vectors/kat_k3_c2_z.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k3_c2_z.hex
Normal file
@@ -0,0 +1 @@
|
||||
d026bb15f52e8df87779ff953ccf42a9d5401111c402c448d77cb291bbe6aa1e
|
||||
1
sync_rtl/top/TB/vectors/kat_k4_c0_d.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k4_c0_d.hex
Normal file
@@ -0,0 +1 @@
|
||||
2426f1941779574d3f1b163bd57f7e173e229e630ec7f7073bdf365137c4bb6d
|
||||
3168
sync_rtl/top/TB/vectors/kat_k4_c0_dk.hex
Normal file
3168
sync_rtl/top/TB/vectors/kat_k4_c0_dk.hex
Normal file
File diff suppressed because it is too large
Load Diff
1568
sync_rtl/top/TB/vectors/kat_k4_c0_ek.hex
Normal file
1568
sync_rtl/top/TB/vectors/kat_k4_c0_ek.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
sync_rtl/top/TB/vectors/kat_k4_c0_z.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k4_c0_z.hex
Normal file
@@ -0,0 +1 @@
|
||||
687acf9406694974d383032f7579378f449c75d0560af56cf921ec48404896f6
|
||||
1
sync_rtl/top/TB/vectors/kat_k4_c1_d.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k4_c1_d.hex
Normal file
@@ -0,0 +1 @@
|
||||
9b68d9d2390fa18739b239a58649393a28f97f6b164ec5e4334f4df864fc9cd6
|
||||
3168
sync_rtl/top/TB/vectors/kat_k4_c1_dk.hex
Normal file
3168
sync_rtl/top/TB/vectors/kat_k4_c1_dk.hex
Normal file
File diff suppressed because it is too large
Load Diff
1568
sync_rtl/top/TB/vectors/kat_k4_c1_ek.hex
Normal file
1568
sync_rtl/top/TB/vectors/kat_k4_c1_ek.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
sync_rtl/top/TB/vectors/kat_k4_c1_z.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k4_c1_z.hex
Normal file
@@ -0,0 +1 @@
|
||||
a02e20d538b412ff074d121a80b0583e0b54e85b267da0789c5ca565342ee66d
|
||||
1
sync_rtl/top/TB/vectors/kat_k4_c2_d.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k4_c2_d.hex
Normal file
@@ -0,0 +1 @@
|
||||
905eb1f02ade542733c35132f5a998d3ec80d20ec8ed235bf228081157034763
|
||||
3168
sync_rtl/top/TB/vectors/kat_k4_c2_dk.hex
Normal file
3168
sync_rtl/top/TB/vectors/kat_k4_c2_dk.hex
Normal file
File diff suppressed because it is too large
Load Diff
1568
sync_rtl/top/TB/vectors/kat_k4_c2_ek.hex
Normal file
1568
sync_rtl/top/TB/vectors/kat_k4_c2_ek.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
sync_rtl/top/TB/vectors/kat_k4_c2_z.hex
Normal file
1
sync_rtl/top/TB/vectors/kat_k4_c2_z.hex
Normal file
@@ -0,0 +1 @@
|
||||
d026bb15f52e8df87779ff953ccf42a9d5401111c402c448d77cb291bbe6aa1e
|
||||
Reference in New Issue
Block a user