Skip to content

lowram: Eliminate y vector in REDUCE_RAM mode in sign#1031

Open
mkannwischer wants to merge 3 commits intomainfrom
lowram-sign-eliminate-y
Open

lowram: Eliminate y vector in REDUCE_RAM mode in sign#1031
mkannwischer wants to merge 3 commits intomainfrom
lowram-sign-eliminate-y

Conversation

@mkannwischer
Copy link
Copy Markdown
Contributor

Add mld_yvec following the lazy polyvec pattern: in REDUCE_RAM mode it
stores only the seed and nonce and regenerates y[i] on demand. The
fused matrix-vector helper mld_polyvec_matrix_pointwise_montgomery_yvec
samples y column-by-column in REDUCE_RAM mode.

CBMC proofs updated for the eager path; lazy variant has no proof yet.

@oqs-bot
Copy link
Copy Markdown
Contributor

oqs-bot commented Apr 8, 2026

CBMC Results (ML-DSA-65)

⚠️ Attention Required

Proof Status Current Previous Change
polymat_permute_bitrev_to_custom ⚠️ 495s 37s +1238%
Full Results (185 proofs)
Proof Status Current Previous Change
**TOTAL** 2834s 2329s +21.7%
polymat_permute_bitrev_to_custom ⚠️ 495s 37s +1238%
polyvecl_pointwise_acc_montgomery_c 341s 280s +22%
sign_verify_internal 275s 286s -4%
poly_pointwise_montgomery_c 170s 156s +9%
rej_uniform_native 155s 148s +5%
mld_invntt_layer 99s 94s +5%
polyvec_matrix_expand_eager 99s - new
mld_ct_memcmp 82s 79s +4%
mld_attempt_signature_generation 72s 107s -33%
mld_ntt_layer 59s 55s +7%
polyvec_matrix_expand_eager_serial 52s - new
sign_signature_internal 32s 25s +28%
rej_uniform 23s 22s +5%
poly_chknorm_c 21s 19s +11%
polyveck_decompose 20s 16s +25%
fqmul 19s 18s +6%
mld_compute_t0_t1_tr_from_sk_components 18s 28s -36%
poly_uniform_4x 17s 15s +13%
poly_uniform_eta_4x 17s 16s +6%
polyvecl_chknorm 17s 5s +240%
rej_uniform_c 16s 15s +7%
keccakf1600x4_permute_native 14s 13s +8%
polyt0_unpack 14s 15s -7%
mld_check_pct 13s 13s +0%
mld_ntt_butterfly_block 13s 13s +0%
polyvec_matrix_pointwise_montgomery_eager 13s - new
polyveck_power2round 13s 12s +8%
keccak_absorb_once_x4 12s 10s +20%
polyveck_invntt_tomont 12s 9s +33%
poly_add 11s 10s +10%
polyveck_add 11s 10s +10%
keccak_absorb 10s 5s +100%
polyveck_ntt 10s 7s +43%
keccakf1600_permute 9s 10s -10%
poly_invntt_tomont_c 9s 7s +29%
polyveck_caddq 9s 11s -18%
polyveck_pointwise_poly_montgomery 9s 6s +50%
polyveck_use_hint 9s 22s -59%
polyvecl_ntt 9s 5s +80%
sign 9s 7s +29%
keccakf1600_permute_native 8s 8s +0%
poly_decompose_c 8s 7s +14%
polyveck_reduce 8s 5s +60%
sign_keypair_internal 8s 6s +33%
sign_pk_from_sk 8s 9s -11%
keccak_squeezeblocks_x4 7s 6s +17%
mld_polyvecl_permute_bitrev_to_custom_native 7s 8s -12%
poly_caddq_c 7s 5s +40%
polyveck_chknorm 7s 8s -12%
mld_compute_pack_z 6s 6s +0%
mld_sample_s1_s2 6s 7s -14%
poly_uniform_gamma1_4x 6s 5s +20%
polyeta_unpack 6s 6s +0%
polyt0_pack 6s 3s +100%
polyveck_shiftl 6s 7s -14%
polyveck_sub 6s 8s -25%
polyveck_unpack_eta 6s 2s +200%
rej_eta_native 6s 5s +20%
shake128x4_squeezeblocks 6s 3s +100%
sign_open 6s 4s +50%
unpack_sk 6s 9s -33%
keccakf1600_extract_bytes (big endian) 5s 4s +25%
mld_h 5s 5s +0%
ntt_native_aarch64 5s 3s +67%
poly_caddq_native 5s 2s +150%
poly_decompose_native 5s 4s +25%
poly_ntt 5s 4s +25%
poly_ntt_native 5s 3s +67%
poly_power2round 5s 7s -29%
poly_uniform 5s 5s +0%
poly_uniform_eta 5s 3s +67%
poly_use_hint_c 5s 4s +25%
polyveck_pack_eta 5s 3s +67%
polyvecl_pointwise_acc_montgomery_native 5s 3s +67%
polyvecl_uniform_gamma1_serial 5s 2s +150%
unpack_hints 5s 5s +0%
keccak_squeeze 4s 6s -33%
keccakf1600_xor_bytes 4s 2s +100%
mld_ct_cmask_nonzero_u32 4s 3s +33%
mld_prepare_domain_separation_prefix 4s 6s -33%
mld_sample_s1_s2_serial 4s 3s +33%
pack_pk 4s 3s +33%
pack_sig_h_poly 4s 4s +0%
pointwise_native_x86_64 4s 1s +300%
poly_caddq_native_aarch64 4s 5s -20%
poly_chknorm_native 4s 3s +33%
poly_chknorm_native_aarch64 4s 4s +0%
poly_ntt_c 4s 2s +100%
poly_pointwise_montgomery_native 4s 2s +100%
poly_use_hint_native 4s 4s +0%
polyvec_matrix_pointwise_montgomery_yvec_eager 4s - new
polyvecl_pack_eta 4s 3s +33%
polyvecl_pointwise_acc_montgomery 4s 4s +0%
polyvecl_unpack_z 4s 2s +100%
polyw1_pack 4s 3s +33%
rej_eta 4s 4s +0%
shake128_init 4s 2s +100%
shake256 4s 2s +100%
shake256_squeeze 4s 5s -20%
sign_keypair 4s 2s +100%
sign_signature 4s 4s +0%
sign_signature_extmu 4s 4s +0%
sign_signature_pre_hash_internal 4s 7s -43%
decompose 3s 4s -25%
intt_native_x86_64 3s 2s +50%
keccak_f1600_x4_native_aarch64_v84a 3s 3s +0%
keccak_f1600_x4_native_aarch64_v8a_scalar_hybrid 3s 1s +200%
keccak_init 3s 2s +50%
keccakf1600_xor_bytes (big endian) 3s 3s +0%
keccakf1600x4_xor_bytes 3s 3s +0%
mld_ct_cmask_neg_i32 3s 4s -25%
mld_value_barrier_u32 3s 1s +200%
mld_value_barrier_u8 3s 4s -25%
montgomery_reduce 3s 5s -40%
ntt_native_x86_64 3s 5s -40%
pack_sig_z 3s 2s +50%
pack_sk 3s 4s -25%
poly_challenge 3s 6s -50%
poly_decompose 3s 3s +0%
poly_make_hint 3s 3s +0%
poly_pointwise_montgomery 3s 6s -50%
poly_reduce 3s 2s +50%
polyt1_pack 3s 3s +0%
polyt1_unpack 3s 5s -40%
polyveck_pack_t0 3s 4s -25%
polyveck_unpack_t0 3s 2s +50%
polyvecl_permute_bitrev_to_custom 3s 4s -25%
polyvecl_uniform_gamma1 3s 3s +0%
polyvecl_unpack_eta 3s 3s +0%
polyz_unpack 3s 4s -25%
polyz_unpack_c 3s 2s +50%
polyz_unpack_native 3s 5s -40%
power2round 3s 2s +50%
rej_eta_c 3s 3s +0%
shake128_absorb 3s 4s -25%
shake128_finalize 3s 1s +200%
shake128_release 3s 3s +0%
shake128x4_absorb_once 3s 3s +0%
shake256_finalize 3s 2s +50%
shake256_release 3s 3s +0%
shake256x4_absorb_once 3s 1s +200%
shake256x4_squeezeblocks 3s 3s +0%
sign_signature_pre_hash_shake256 3s 5s -40%
sign_verify_extmu 3s 2s +50%
sign_verify_pre_hash_internal 3s 6s -50%
sys_check_capability 3s 3s +0%
unpack_pk 3s 4s -25%
use_hint 3s 3s +0%
fqscale 2s 4s -50%
keccak_f1600_x1_native_aarch64_v84a 2s 3s -33%
keccak_f1600_x4_native_aarch64_v8a_v84a_scalar_hybrid 2s 4s -50%
keccak_finalize 2s 1s +100%
keccakf1600x4_extract_bytes 2s 1s +100%
keccakf1600x4_permute 2s 5s -60%
make_hint 2s 2s +0%
mld_ct_abs_i32 2s 2s +0%
mld_ct_cmask_nonzero_u8 2s 2s +0%
mld_ct_get_optblocker_u8 2s 2s +0%
mld_ct_sel_int32 2s 4s -50%
mld_keccakf1600_extract_bytes 2s 1s +100%
pack_sig_c 2s 2s +0%
pointwise_native_aarch64 2s 3s -33%
poly_caddq 2s 2s +0%
poly_chknorm 2s 2s +0%
poly_invntt_tomont 2s 6s -67%
poly_invntt_tomont_native 2s 3s -33%
poly_shiftl 2s 2s +0%
poly_sub 2s 3s -33%
poly_uniform_gamma1 2s 5s -60%
poly_use_hint 2s 1s +100%
polyeta_pack 2s 4s -50%
polyveck_pack_w1 2s 3s -33%
polyz_pack 2s 2s +0%
reduce32 2s 3s -33%
shake128_squeeze 2s 2s +0%
shake256_absorb 2s 3s -33%
sign_verify 2s 2s +0%
sign_verify_pre_hash_shake256 2s 5s -60%
unpack_sig 2s 2s +0%
caddq 1s 2s -50%
keccak_f1600_x1_native_aarch64 1s 2s -50%
mld_ct_get_optblocker_i64 1s 2s -50%
mld_ct_get_optblocker_u32 1s 2s -50%
mld_value_barrier_i64 1s 4s -75%
shake256_init 1s 2s -50%

@oqs-bot
Copy link
Copy Markdown
Contributor

oqs-bot commented Apr 8, 2026

CBMC Results (ML-DSA-87)

Full Results (185 proofs)
Proof Status Current Previous Change
**TOTAL** 2300s 2411s -4.6%
polyvecl_pointwise_acc_montgomery_c 229s 218s +5%
polyvec_matrix_expand_eager 191s - new
poly_pointwise_montgomery_c 169s 186s -9%
rej_uniform_native 157s 155s +1%
sign_verify_internal 149s 147s +1%
mld_attempt_signature_generation 100s 96s +4%
mld_invntt_layer 99s 104s -5%
mld_ct_memcmp 80s 89s -10%
polyvec_matrix_expand_eager_serial 65s - new
sign_signature_internal 61s 41s +49%
mld_ntt_layer 59s 59s +0%
mld_compute_t0_t1_tr_from_sk_components 29s 25s +16%
rej_uniform 23s 24s -4%
poly_chknorm_c 21s 23s -9%
polymat_permute_bitrev_to_custom 21s 27s -22%
fqmul 19s 23s -17%
poly_uniform_eta_4x 17s 16s +6%
polyeta_unpack 17s 19s -11%
rej_uniform_c 16s 19s -16%
mld_polyvecl_permute_bitrev_to_custom_native 15s 14s +7%
poly_uniform_4x 15s 17s -12%
keccak_absorb_once_x4 14s 12s +17%
mld_ntt_butterfly_block 14s 16s -12%
keccakf1600x4_permute_native 13s 14s -7%
poly_add 13s 11s +18%
polyt0_unpack 12s 20s -40%
polyveck_add 11s 11s +0%
polyveck_shiftl 11s 8s +38%
polyveck_decompose 10s 11s -9%
polyveck_power2round 10s 20s -50%
polyvecl_ntt 10s 9s +11%
sign_keypair_internal 10s 6s +67%
mld_check_pct 9s 17s -47%
mld_sample_s1_s2_serial 9s 7s +29%
polyveck_ntt 9s 8s +12%
sign_pk_from_sk 9s 7s +29%
unpack_sk 9s 8s +12%
keccak_absorb 8s 7s +14%
keccakf1600_permute_native 8s 9s -11%
poly_invntt_tomont_c 8s 7s +14%
polyvec_matrix_pointwise_montgomery_eager 8s - new
polyveck_invntt_tomont 8s 10s -20%
polyveck_pointwise_poly_montgomery 8s 6s +33%
polyveck_sub 8s 7s +14%
polyvecl_permute_bitrev_to_custom 8s 4s +100%
polyz_unpack_c 8s 12s -33%
keccakf1600_permute 7s 6s +17%
poly_caddq_c 7s 7s +0%
polyveck_reduce 7s 8s -12%
polyveck_use_hint 7s 12s -42%
sign 7s 7s +0%
sign_verify_pre_hash_internal 7s 2s +250%
keccak_squeezeblocks_x4 6s 9s -33%
mld_prepare_domain_separation_prefix 6s 4s +50%
poly_uniform_eta 6s 7s -14%
polyveck_caddq 6s 8s -25%
sign_open 6s 5s +20%
sign_signature_pre_hash_shake256 6s 4s +50%
unpack_hints 6s 6s +0%
keccak_f1600_x1_native_aarch64_v84a 5s 2s +150%
mld_h 5s 3s +67%
mld_sample_s1_s2 5s 5s +0%
pack_sk 5s 6s -17%
pointwise_native_aarch64 5s 4s +25%
poly_decompose_c 5s 7s -29%
poly_ntt_c 5s 6s -17%
polyt0_pack 5s 5s +0%
polyvec_matrix_pointwise_montgomery_yvec_eager 5s - new
polyveck_pack_w1 5s 4s +25%
polyveck_unpack_t0 5s 5s +0%
polyvecl_pointwise_acc_montgomery 5s 4s +25%
polyvecl_uniform_gamma1 5s 2s +150%
polyvecl_uniform_gamma1_serial 5s 2s +150%
polyvecl_unpack_z 5s 5s +0%
power2round 5s 2s +150%
rej_eta_native 5s 4s +25%
sign_keypair 5s 3s +67%
sign_signature_extmu 5s 6s -17%
sign_signature_pre_hash_internal 5s 4s +25%
sign_verify_pre_hash_shake256 5s 7s -29%
unpack_sig 5s 3s +67%
keccak_f1600_x1_native_aarch64 4s 1s +300%
keccakf1600x4_extract_bytes 4s 2s +100%
make_hint 4s 4s +0%
mld_compute_pack_z 4s 10s -60%
mld_ct_cmask_nonzero_u32 4s 3s +33%
mld_ct_cmask_nonzero_u8 4s 2s +100%
ntt_native_aarch64 4s 4s +0%
pack_sig_c 4s 2s +100%
pack_sig_z 4s 4s +0%
poly_caddq 4s 4s +0%
poly_caddq_native_aarch64 4s 5s -20%
poly_challenge 4s 5s -20%
poly_chknorm 4s 1s +300%
poly_chknorm_native 4s 4s +0%
poly_pointwise_montgomery 4s 1s +300%
poly_sub 4s 3s +33%
poly_uniform 4s 5s -20%
poly_use_hint 4s 3s +33%
poly_use_hint_native 4s 3s +33%
polyvecl_chknorm 4s 8s -50%
polyvecl_unpack_eta 4s 5s -20%
polyz_unpack 4s 4s +0%
polyz_unpack_native 4s 2s +100%
rej_eta 4s 3s +33%
shake128_absorb 4s 3s +33%
shake128_finalize 4s 2s +100%
shake256 4s 3s +33%
shake256_absorb 4s 4s +0%
shake256x4_squeezeblocks 4s 2s +100%
sign_signature 4s 5s -20%
sign_verify 4s 6s -33%
sys_check_capability 4s 3s +33%
unpack_pk 4s 5s -20%
caddq 3s 2s +50%
fqscale 3s 3s +0%
intt_native_x86_64 3s 1s +200%
keccak_f1600_x4_native_aarch64_v8a_scalar_hybrid 3s 1s +200%
keccak_f1600_x4_native_aarch64_v8a_v84a_scalar_hybrid 3s 1s +200%
keccakf1600_xor_bytes 3s 2s +50%
keccakf1600x4_permute 3s 2s +50%
mld_ct_cmask_neg_i32 3s 2s +50%
mld_ct_get_optblocker_i64 3s 4s -25%
mld_ct_sel_int32 3s 2s +50%
mld_value_barrier_i64 3s 2s +50%
mld_value_barrier_u8 3s 3s +0%
montgomery_reduce 3s 3s +0%
pack_sig_h_poly 3s 4s -25%
pointwise_native_x86_64 3s 2s +50%
poly_caddq_native 3s 2s +50%
poly_chknorm_native_aarch64 3s 2s +50%
poly_decompose_native 3s 7s -57%
poly_make_hint 3s 6s -50%
poly_ntt 3s 4s -25%
poly_power2round 3s 6s -50%
poly_reduce 3s 4s -25%
poly_shiftl 3s 5s -40%
poly_uniform_gamma1_4x 3s 2s +50%
polyeta_pack 3s 5s -40%
polyt1_pack 3s 3s +0%
polyveck_chknorm 3s 7s -57%
polyveck_pack_eta 3s 4s -25%
polyveck_pack_t0 3s 4s -25%
polyveck_unpack_eta 3s 6s -50%
polyvecl_pointwise_acc_montgomery_native 3s 3s +0%
polyw1_pack 3s 3s +0%
reduce32 3s 2s +50%
rej_eta_c 3s 3s +0%
shake128x4_absorb_once 3s 2s +50%
shake256_finalize 3s 6s -50%
shake256_init 3s 1s +200%
shake256_release 3s 3s +0%
shake256_squeeze 3s 4s -25%
sign_verify_extmu 3s 4s -25%
keccak_finalize 2s 2s +0%
keccak_init 2s 3s -33%
keccak_squeeze 2s 3s -33%
keccakf1600_extract_bytes (big endian) 2s 2s +0%
keccakf1600_xor_bytes (big endian) 2s 3s -33%
keccakf1600x4_xor_bytes 2s 3s -33%
mld_ct_get_optblocker_u32 2s 3s -33%
mld_ct_get_optblocker_u8 2s 2s +0%
mld_keccakf1600_extract_bytes 2s 2s +0%
mld_value_barrier_u32 2s 1s +100%
ntt_native_x86_64 2s 3s -33%
pack_pk 2s 4s -50%
poly_decompose 2s 4s -50%
poly_invntt_tomont 2s 4s -50%
poly_invntt_tomont_native 2s 3s -33%
poly_ntt_native 2s 3s -33%
poly_pointwise_montgomery_native 2s 4s -50%
poly_use_hint_c 2s 2s +0%
polyt1_unpack 2s 3s -33%
polyvecl_pack_eta 2s 3s -33%
polyz_pack 2s 2s +0%
shake128_init 2s 4s -50%
shake128_release 2s 3s -33%
shake128_squeeze 2s 2s +0%
shake256x4_absorb_once 2s 2s +0%
use_hint 2s 2s +0%
decompose 1s 2s -50%
keccak_f1600_x4_native_aarch64_v84a 1s 1s +0%
mld_ct_abs_i32 1s 3s -67%
poly_uniform_gamma1 1s 2s -50%
shake128x4_squeezeblocks 1s 2s -50%

@oqs-bot
Copy link
Copy Markdown
Contributor

oqs-bot commented Apr 8, 2026

CBMC Results (ML-DSA-44)

Full Results (185 proofs)
Proof Status Current Previous Change
**TOTAL** 1994s 2039s -2.2%
polyvecl_pointwise_acc_montgomery_c 322s 336s -4%
sign_verify_internal 228s 213s +7%
poly_pointwise_montgomery_c 152s 148s +3%
rej_uniform_native 140s 139s +1%
mld_invntt_layer 87s 85s +2%
mld_ct_memcmp 74s 72s +3%
mld_attempt_signature_generation 61s 103s -41%
mld_ntt_layer 54s 52s +4%
rej_uniform 21s 20s +5%
sign_signature_internal 20s 19s +5%
fqmul 19s 20s -5%
mld_compute_t0_t1_tr_from_sk_components 18s 11s +64%
poly_chknorm_c 18s 20s -10%
polymat_permute_bitrev_to_custom 18s 26s -31%
polyeta_unpack 17s 16s +6%
polyvec_matrix_expand_eager 17s - new
poly_uniform_4x 16s 16s +0%
polyt0_unpack 16s 14s +14%
poly_uniform_eta_4x 15s 17s -12%
keccakf1600x4_permute_native 13s 13s +0%
mld_ntt_butterfly_block 13s 11s +18%
poly_add 13s 10s +30%
rej_uniform_c 13s 15s -13%
keccak_absorb_once_x4 11s 9s +22%
polyvec_matrix_pointwise_montgomery_eager 11s - new
keccakf1600_permute 10s 8s +25%
polyvec_matrix_expand_eager_serial 10s - new
polyz_unpack_c 10s 12s -17%
keccak_absorb 9s 5s +80%
polyveck_ntt 9s 6s +50%
polyvecl_chknorm 9s 5s +80%
sign 9s 8s +12%
mld_check_pct 8s 12s -33%
sign_pk_from_sk 8s 8s +0%
unpack_sk 8s 7s +14%
keccak_squeezeblocks_x4 7s 6s +17%
mld_compute_pack_z 7s 7s +0%
mld_polyvecl_permute_bitrev_to_custom_native 7s 8s -12%
polyveck_chknorm 7s 3s +133%
polyveck_decompose 7s 6s +17%
polyveck_shiftl 7s 4s +75%
polyveck_sub 7s 4s +75%
rej_eta_native 7s 6s +17%
sign_signature 7s 5s +40%
keccakf1600_permute_native 6s 9s -33%
poly_invntt_tomont_c 6s 6s +0%
poly_make_hint 6s 5s +20%
polyveck_power2round 6s 6s +0%
polyveck_reduce 6s 4s +50%
sign_keypair_internal 6s 4s +50%
sign_open 6s 3s +100%
mld_ct_get_optblocker_i64 5s 2s +150%
mld_h 5s 4s +25%
ntt_native_x86_64 5s 4s +25%
poly_challenge 5s 7s -29%
poly_chknorm 5s 2s +150%
poly_decompose 5s 6s -17%
poly_decompose_native 5s 3s +67%
poly_uniform_gamma1_4x 5s 4s +25%
polyveck_add 5s 8s -38%
polyveck_use_hint 5s 7s -29%
polyvecl_uniform_gamma1 5s 3s +67%
polyvecl_unpack_eta 5s 3s +67%
sign_verify_pre_hash_internal 5s 6s -17%
use_hint 5s 2s +150%
caddq 4s 2s +100%
keccak_f1600_x4_native_aarch64_v8a_scalar_hybrid 4s 1s +300%
keccak_finalize 4s 4s +0%
keccakf1600_extract_bytes (big endian) 4s 5s -20%
keccakf1600_xor_bytes 4s 2s +100%
mld_ct_cmask_nonzero_u8 4s 3s +33%
mld_ct_get_optblocker_u32 4s 2s +100%
mld_sample_s1_s2_serial 4s 4s +0%
pack_sig_c 4s 3s +33%
pack_sig_z 4s 5s -20%
pointwise_native_aarch64 4s 2s +100%
pointwise_native_x86_64 4s 2s +100%
poly_caddq_c 4s 5s -20%
poly_chknorm_native 4s 2s +100%
poly_pointwise_montgomery 4s 3s +33%
poly_sub 4s 3s +33%
poly_uniform_eta 4s 5s -20%
poly_uniform_gamma1 4s 3s +33%
poly_use_hint_c 4s 4s +0%
poly_use_hint_native 4s 6s -33%
polyt1_unpack 4s 5s -20%
polyveck_invntt_tomont 4s 3s +33%
polyveck_pointwise_poly_montgomery 4s 3s +33%
polyvecl_ntt 4s 6s -33%
rej_eta_c 4s 5s -20%
shake128x4_squeezeblocks 4s 2s +100%
shake256 4s 2s +100%
shake256_init 4s 2s +100%
shake256x4_absorb_once 4s 4s +0%
sign_keypair 4s 6s -33%
sign_signature_extmu 4s 6s -33%
sign_signature_pre_hash_shake256 4s 4s +0%
sign_verify 4s 6s -33%
sys_check_capability 4s 4s +0%
decompose 3s 2s +50%
intt_native_x86_64 3s 3s +0%
keccak_f1600_x1_native_aarch64_v84a 3s 3s +0%
keccak_f1600_x4_native_aarch64_v8a_v84a_scalar_hybrid 3s 4s -25%
keccakf1600x4_permute 3s 2s +50%
mld_ct_cmask_nonzero_u32 3s 2s +50%
mld_keccakf1600_extract_bytes 3s 3s +0%
mld_prepare_domain_separation_prefix 3s 6s -50%
mld_sample_s1_s2 3s 6s -50%
mld_value_barrier_i64 3s 2s +50%
pack_sig_h_poly 3s 5s -40%
pack_sk 3s 3s +0%
poly_caddq 3s 3s +0%
poly_caddq_native 3s 3s +0%
poly_chknorm_native_aarch64 3s 4s -25%
poly_ntt_native 3s 1s +200%
poly_power2round 3s 2s +50%
poly_reduce 3s 3s +0%
poly_shiftl 3s 3s +0%
poly_uniform 3s 4s -25%
polyeta_pack 3s 2s +50%
polyt0_pack 3s 7s -57%
polyt1_pack 3s 4s -25%
polyvec_matrix_pointwise_montgomery_yvec_eager 3s - new
polyveck_caddq 3s 3s +0%
polyveck_pack_eta 3s 4s -25%
polyveck_pack_t0 3s 3s +0%
polyveck_pack_w1 3s 3s +0%
polyveck_unpack_t0 3s 3s +0%
polyvecl_pack_eta 3s 4s -25%
polyvecl_pointwise_acc_montgomery 3s 3s +0%
polyvecl_uniform_gamma1_serial 3s 3s +0%
polyw1_pack 3s 2s +50%
polyz_pack 3s 2s +50%
polyz_unpack_native 3s 3s +0%
power2round 3s 5s -40%
shake256_finalize 3s 3s +0%
shake256_squeeze 3s 3s +0%
shake256x4_squeezeblocks 3s 1s +200%
sign_verify_extmu 3s 4s -25%
sign_verify_pre_hash_shake256 3s 3s +0%
unpack_hints 3s 6s -50%
unpack_pk 3s 2s +50%
unpack_sig 3s 3s +0%
fqscale 2s 3s -33%
keccak_f1600_x4_native_aarch64_v84a 2s 2s +0%
keccak_init 2s 2s +0%
keccak_squeeze 2s 6s -67%
keccakf1600_xor_bytes (big endian) 2s 2s +0%
keccakf1600x4_extract_bytes 2s 3s -33%
keccakf1600x4_xor_bytes 2s 3s -33%
make_hint 2s 1s +100%
mld_ct_cmask_neg_i32 2s 1s +100%
mld_ct_get_optblocker_u8 2s 1s +100%
mld_ct_sel_int32 2s 2s +0%
mld_value_barrier_u32 2s 1s +100%
montgomery_reduce 2s 2s +0%
ntt_native_aarch64 2s 5s -60%
poly_caddq_native_aarch64 2s 4s -50%
poly_decompose_c 2s 3s -33%
poly_invntt_tomont 2s 4s -50%
poly_invntt_tomont_native 2s 2s +0%
poly_ntt 2s 2s +0%
poly_ntt_c 2s 2s +0%
poly_pointwise_montgomery_native 2s 3s -33%
poly_use_hint 2s 3s -33%
polyveck_unpack_eta 2s 4s -50%
polyvecl_permute_bitrev_to_custom 2s 5s -60%
polyvecl_pointwise_acc_montgomery_native 2s 4s -50%
polyvecl_unpack_z 2s 3s -33%
reduce32 2s 2s +0%
rej_eta 2s 4s -50%
shake128_init 2s 5s -60%
shake128_release 2s 5s -60%
shake128_squeeze 2s 3s -33%
sign_signature_pre_hash_internal 2s 2s +0%
keccak_f1600_x1_native_aarch64 1s 2s -50%
mld_ct_abs_i32 1s 3s -67%
mld_value_barrier_u8 1s 2s -50%
pack_pk 1s 4s -75%
polyz_unpack 1s 2s -50%
shake128_absorb 1s 3s -67%
shake128_finalize 1s 3s -67%
shake128x4_absorb_once 1s 4s -75%
shake256_absorb 1s 2s -50%
shake256_release 1s 3s -67%

@mkannwischer mkannwischer force-pushed the lowram-sign-eliminate-y branch 2 times, most recently from de53526 to 4b9fcd1 Compare April 9, 2026 01:43
Replace the row-level matrix buffer (mld_polyvecl) with a single-poly
buffer in REDUCE_RAM mode. In the lazy path, matrix elements A[k][l]
are sampled on demand one at a time, and the matrix-vector product
accumulates element-by-element instead of row-by-row.

Restructure polymat into eager/lazy variants following the same pattern
as s1hat/s2hat/t0hat:
- mld_polymat_eager: stores full K x L matrix
- mld_polymat_lazy: stores rho + single poly_buffer + tmp
- mld_polyvec_matrix_expand_eager/_lazy: separate implementations
- mld_polyvec_matrix_pointwise_montgomery_eager/_lazy: separate
  implementations with CBMC contracts only on the eager variants

Move all polymat-related code from polyvec.h/polyvec.c into
polyvec_lazy.h/polyvec_lazy.c.

Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Add mld_yvec following the lazy polyvec pattern: in REDUCE_RAM mode it
stores only the seed and nonce and regenerates y[i] on demand. The
fused matrix-vector helper mld_polyvec_matrix_pointwise_montgomery_yvec
samples y column-by-column in REDUCE_RAM mode.

CBMC proofs updated for the eager path; lazy variant has no proof yet.

Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
@mkannwischer mkannwischer force-pushed the lowram-sign-eliminate-y branch from 4b9fcd1 to cef9d32 Compare April 9, 2026 02:29
@mkannwischer mkannwischer marked this pull request as ready for review April 9, 2026 03:05
@mkannwischer mkannwischer requested a review from a team as a code owner April 9, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants