Skip to main content

mlkem_sample_matrix_w16

Function mlkem_sample_matrix_w16 

Source
pub fn mlkem_sample_matrix_w16(seed: &[u8]) -> Vec<Word16>
Expand description

Sample the full ML-KEM-768 3×3 matrix  at once (9 × 256 Word16, entry Â[r][c] at slot (r·3+c)·256), batching four rejection-sampling streams per 4-way AVX2 SHAKE128 permutation. Bit-identical to nine mlkem_sample_a_w16 calls; falls back to scalar without AVX2. This is the matrix-expansion keystone — sampleA is ~60% of keygen and is ×9 again in encaps.