Skip to content

native: Allow tables to be declared static#1043

Merged
mkannwischer merged 3 commits intomainfrom
static-tables
Apr 17, 2026
Merged

native: Allow tables to be declared static#1043
mkannwischer merged 3 commits intomainfrom
static-tables

Conversation

@flynd
Copy link
Copy Markdown
Contributor

@flynd flynd commented Apr 16, 2026

When building single-CU builds and MLD_CONFIG_INTERNAL_API_QUALIFIER is set to make internal API static, also make the data tables static. This makes the data symbols local instead of global, hiding them from the scope of the rest of the application.

@flynd flynd requested a review from a team as a code owner April 16, 2026 10:07
@hanno-becker
Copy link
Copy Markdown
Contributor

Thank you @flynd, I have no issue with this change in principle. Could you think about how we could test this? Perhaps we can run an extra check on the monobuild example confirming that only the public API appears in the symbol table?

@flynd
Copy link
Copy Markdown
Contributor Author

flynd commented Apr 16, 2026

This was minor thing I thought would be nice, but it seems this wasn't as simple as I thought.

If I understand correctly the failed CI test, I cannot use forward declarations for static data without getting an error, at least with some compiler flags.
I tried to just remove the forward declaration and reorder the files in mldsa_native.c to include the C files with tables first, but the tables are used in meta.h which is pulled in by common.h, which must be included first to get all the defines, so without moving around code between files, this is a circular dependency.

I don't know if it is worth trying to solve this. @hanno-becker, do you have a good idea on how to resolve this that doesn't involve a lot of work? If not I'll just abandon this PR as it was just a nice to have, not something important.

Comment thread mldsa/src/common.h
@flynd
Copy link
Copy Markdown
Contributor Author

flynd commented Apr 17, 2026

I don't know if it is worth trying to solve this. @hanno-becker, do you have a good idea on how to resolve this that doesn't involve a lot of work? If not I'll just abandon this PR as it was just a nice to have, not something important.

This is not a blocker for this PR, but a nice-to-have. We can proceed with the review and potentially merge regardless.

To be clear, I wasn't primarily referring to being able to test this feature but to the fact that the CI test fails and I don't know how to fix it.

Making the tables static can be implemented two ways: With forward declarations or without.
The PR currently has forward declarations, but at least with some compiler or compiler flags, the compilation fails when forward declaring static data so I don't think forward declarations can be used.
I have tried to rework it to remove the forward declarations, however that requires the tables to appear before they are used, but due to how the headers are included it would require a bigger move or splitting of code which I didn't feel comfortable doing.
Possibly it could be resolved by adding pointers to the tables that can be forward declared and then the compiler optimizes away the pointers so they never appear in the built binary.

So currently I have no version of this change that can pass the CI tests and I'm not sure this is important enough to try and solve.

@oqs-bot
Copy link
Copy Markdown
Contributor

oqs-bot commented Apr 17, 2026

CBMC Results (ML-DSA-44)

Full Results (186 proofs)
Proof Status Current Previous Change
**TOTAL** 1791s 1763s +1.6%
polyvecl_pointwise_acc_montgomery_c 162s 167s -3%
sign_verify_internal 160s 155s +3%
poly_pointwise_montgomery_c 156s 154s +1%
rej_uniform_native 139s 135s +3%
mld_ct_memcmp 71s 74s -4%
mld_invntt_layer 66s 65s +2%
mld_ntt_layer 52s 51s +2%
mld_attempt_signature_generation 51s 53s -4%
polymat_permute_bitrev_to_custom 29s 27s +7%
polyvec_matrix_expand 28s 26s +8%
rej_uniform 24s 21s +14%
sign_keypair_internal 21s 22s -5%
fqmul 19s 21s -10%
poly_chknorm_c 19s 22s -14%
poly_uniform_eta_4x 17s 17s +0%
sign_pk_from_sk 17s 19s -11%
sign_signature_internal 17s 18s -6%
poly_uniform_4x 16s 13s +23%
polyeta_unpack 16s 16s +0%
rej_uniform_c 16s 15s +7%
polyt0_unpack 14s 14s +0%
keccakf1600x4_permute_native 13s 15s -13%
mld_ntt_butterfly_block 12s 12s +0%
polyz_unpack_c 12s 14s -14%
poly_decompose_c 11s 11s +0%
polyveck_power2round 11s 10s +10%
keccak_absorb_once_x4 10s 10s +0%
mld_compute_pack_z 10s 7s +43%
poly_add 10s 11s -9%
polyvec_matrix_pointwise_montgomery 10s 7s +43%
mld_check_pct 9s 9s +0%
polyveck_add 9s 8s +12%
polyveck_use_hint 9s 6s +50%
keccakf1600_permute 8s 7s +14%
keccakf1600_permute_native 8s 8s +0%
unpack_sk 8s 8s +0%
keccak_absorb 7s 5s +40%
pointwise_acc_native_aarch64 7s 6s +17%
poly_caddq_c 7s 4s +75%
poly_invntt_tomont_c 7s 5s +40%
poly_power2round 7s 6s +17%
polyvec_matrix_expand_serial 7s 9s -22%
rej_eta_native 7s 6s +17%
keccak_squeezeblocks_x4 6s 6s +0%
pointwise_acc_native_x86_64 6s 5s +20%
poly_use_hint_c 6s 5s +20%
polyt0_pack 6s 3s +100%
polyveck_caddq 6s 5s +20%
polyveck_invntt_tomont 6s 5s +20%
polyveck_pointwise_poly_montgomery 6s 5s +20%
polyveck_sub 6s 5s +20%
sign_keypair 6s 5s +20%
sign_open 6s 5s +20%
sign_signature_pre_hash_internal 6s 4s +50%
sign_signature_pre_hash_shake256 6s 4s +50%
caddq 5s 2s +150%
mld_prepare_domain_separation_prefix 5s 3s +67%
poly_caddq_native 5s 4s +25%
poly_challenge 5s 6s -17%
poly_sub 5s 3s +67%
poly_uniform_eta 5s 5s +0%
polyeta_pack 5s 5s +0%
polyt1_pack 5s 3s +67%
polyveck_decompose 5s 4s +25%
polyveck_ntt 5s 4s +25%
polyveck_pack_t0 5s 3s +67%
polyveck_shiftl 5s 6s -17%
polyvecl_chknorm 5s 4s +25%
polyvecl_permute_bitrev_to_custom 5s 2s +150%
polyz_unpack_native 5s 3s +67%
sign_signature_extmu 5s 3s +67%
sign_verify_pre_hash_internal 5s 4s +25%
sign_verify_pre_hash_shake256 5s 5s +0%
use_hint 5s 3s +67%
intt_native_x86_64 4s 3s +33%
keccak_f1600_x4_native_aarch64_v8a_v84a_scalar_hybrid 4s 3s +33%
mld_polyvecl_permute_bitrev_to_custom_native 4s 5s -20%
montgomery_reduce 4s 3s +33%
pack_sk_rho_key_tr_s2_t0 4s 3s +33%
pack_sk_s1 4s 4s +0%
poly_caddq_native_aarch64 4s 2s +100%
poly_chknorm 4s 4s +0%
poly_ntt 4s 4s +0%
poly_ntt_c 4s 3s +33%
poly_pointwise_montgomery 4s 4s +0%
poly_pointwise_montgomery_native 4s 3s +33%
poly_shiftl 4s 4s +0%
poly_uniform 4s 4s +0%
poly_uniform_gamma1 4s 3s +33%
poly_use_hint 4s 5s -20%
polyt1_unpack 4s 4s +0%
polyveck_pack_eta 4s 1s +300%
polyveck_reduce 4s 5s -20%
polyvecl_pointwise_acc_montgomery 4s 3s +33%
polyvecl_pointwise_acc_montgomery_native 4s 3s +33%
polyvecl_uniform_gamma1_serial 4s 4s +0%
polyvecl_unpack_z 4s 2s +100%
polyz_unpack 4s 2s +100%
shake128x4_squeezeblocks 4s 3s +33%
sign 4s 5s -20%
sign_verify 4s 5s -20%
sign_verify_extmu 4s 6s -33%
sys_check_capability 4s 5s -20%
unpack_hints 4s 4s +0%
unpack_pk 4s 1s +300%
keccak_init 3s 1s +200%
keccak_squeeze 3s 4s -25%
keccakf1600_xor_bytes (big endian) 3s 2s +50%
keccakf1600x4_extract_bytes 3s 2s +50%
mld_h 3s 2s +50%
mld_sample_s1_s2_serial 3s 5s -40%
mld_value_barrier_i64 3s 1s +200%
ntt_native_aarch64 3s 2s +50%
ntt_native_x86_64 3s 3s +0%
pack_sig_h_poly 3s 4s -25%
pack_sig_z 3s 3s +0%
pointwise_native_aarch64 3s 2s +50%
poly_caddq 3s 2s +50%
poly_chknorm_native 3s 4s -25%
poly_decompose 3s 2s +50%
poly_decompose_native 3s 3s +0%
poly_invntt_tomont 3s 4s -25%
poly_make_hint 3s 2s +50%
poly_ntt_native 3s 5s -40%
poly_reduce 3s 2s +50%
poly_use_hint_native 3s 4s -25%
polyveck_chknorm 3s 5s -40%
polyveck_pack_w1 3s 2s +50%
polyveck_unpack_t0 3s 2s +50%
polyvecl_ntt 3s 3s +0%
polyvecl_pack_eta 3s 4s -25%
polyvecl_unpack_eta 3s 4s -25%
polyw1_pack 3s 3s +0%
polyz_pack 3s 4s -25%
power2round 3s 3s +0%
reduce32 3s 5s -40%
rej_eta 3s 4s -25%
shake128_init 3s 3s +0%
shake128x4_absorb_once 3s 1s +200%
shake256 3s 2s +50%
shake256_finalize 3s 1s +200%
shake256_init 3s 3s +0%
shake256_squeeze 3s 2s +50%
shake256x4_squeezeblocks 3s 2s +50%
sign_signature 3s 4s -25%
decompose 2s 2s +0%
fqscale 2s 2s +0%
keccak_f1600_x1_native_aarch64 2s 4s -50%
keccak_f1600_x1_native_aarch64_v84a 2s 1s +100%
keccak_f1600_x4_native_aarch64_v84a 2s 4s -50%
keccak_f1600_x4_native_aarch64_v8a_scalar_hybrid 2s 1s +100%
keccak_finalize 2s 2s +0%
keccakf1600_extract_bytes (big endian) 2s 2s +0%
keccakf1600_xor_bytes 2s 2s +0%
keccakf1600x4_permute 2s 4s -50%
make_hint 2s 3s -33%
mld_ct_get_optblocker_u32 2s 3s -33%
mld_ct_sel_int32 2s 1s +100%
mld_keccakf1600_extract_bytes 2s 1s +100%
mld_sample_s1_s2 2s 4s -50%
mld_value_barrier_u32 2s 1s +100%
pack_pk 2s 2s +0%
pack_sig_c 2s 3s -33%
pointwise_native_x86_64 2s 4s -50%
poly_chknorm_native_aarch64 2s 4s -50%
poly_invntt_tomont_native 2s 4s -50%
poly_uniform_gamma1_4x 2s 3s -33%
polyveck_unpack_eta 2s 4s -50%
polyvecl_uniform_gamma1 2s 5s -60%
rej_eta_c 2s 7s -71%
shake128_absorb 2s 3s -33%
shake128_finalize 2s 2s +0%
shake128_release 2s 2s +0%
shake128_squeeze 2s 2s +0%
unpack_sig 2s 3s -33%
keccakf1600x4_xor_bytes 1s 2s -50%
mld_ct_abs_i32 1s 3s -67%
mld_ct_cmask_neg_i32 1s 3s -67%
mld_ct_cmask_nonzero_u32 1s 6s -83%
mld_ct_cmask_nonzero_u8 1s 3s -67%
mld_ct_get_optblocker_i64 1s 3s -67%
mld_ct_get_optblocker_u8 1s 1s +0%
mld_value_barrier_u8 1s 3s -67%
shake256_absorb 1s 3s -67%
shake256_release 1s 3s -67%
shake256x4_absorb_once 1s 4s -75%

@oqs-bot
Copy link
Copy Markdown
Contributor

oqs-bot commented Apr 17, 2026

CBMC Results (ML-DSA-65)

Full Results (186 proofs)
Proof Status Current Previous Change
**TOTAL** 2754s 2454s +12.2%
polyvecl_pointwise_acc_montgomery_c 759s 578s +31%
sign_verify_internal 237s 221s +7%
poly_pointwise_montgomery_c 187s 153s +22%
rej_uniform_native 153s 142s +8%
polyvec_matrix_expand 93s 89s +4%
mld_ct_memcmp 89s 76s +17%
mld_invntt_layer 69s 65s +6%
mld_attempt_signature_generation 64s 65s -2%
mld_ntt_layer 58s 53s +9%
polyvec_matrix_expand_serial 52s 49s +6%
polymat_permute_bitrev_to_custom 38s 35s +9%
sign_keypair_internal 33s 29s +14%
sign_signature_internal 27s 25s +8%
poly_chknorm_c 24s 21s +14%
rej_uniform 24s 21s +14%
fqmul 22s 20s +10%
sign_pk_from_sk 21s 19s +11%
poly_uniform_eta_4x 19s 15s +27%
poly_uniform_4x 17s 18s -6%
polyveck_power2round 17s 16s +6%
rej_uniform_c 17s 13s +31%
poly_add 16s 11s +45%
polyt0_unpack 16s 12s +33%
polyveck_decompose 16s 14s +14%
polyvecl_ntt 14s 9s +56%
keccakf1600x4_permute_native 13s 17s -24%
polyvec_matrix_pointwise_montgomery 13s 12s +8%
polyveck_add 12s 11s +9%
mld_ntt_butterfly_block 11s 11s +0%
keccak_absorb_once_x4 10s 11s -9%
polyeta_unpack 10s 3s +233%
polyveck_caddq 10s 11s -9%
polyveck_sub 10s 9s +11%
polyveck_invntt_tomont 9s 6s +50%
sign 9s 8s +12%
keccakf1600_permute_native 8s 8s +0%
unpack_sk 8s 8s +0%
keccakf1600_permute 7s 7s +0%
mld_check_pct 7s 7s +0%
mld_sample_s1_s2_serial 7s 8s -12%
pointwise_acc_native_x86_64 7s 5s +40%
poly_power2round 7s 7s +0%
polyveck_ntt 7s 7s +0%
polyveck_reduce 7s 7s +0%
polyveck_shiftl 7s 9s -22%
polyveck_use_hint 7s 6s +17%
sign_signature_pre_hash_internal 7s 6s +17%
sign_signature_pre_hash_shake256 7s 5s +40%
keccak_absorb 6s 7s -14%
keccak_squeezeblocks_x4 6s 4s +50%
mld_polyvecl_permute_bitrev_to_custom_native 6s 6s +0%
pointwise_acc_native_aarch64 6s 7s -14%
poly_caddq_c 6s 5s +20%
poly_decompose 6s 4s +50%
poly_decompose_c 6s 6s +0%
poly_invntt_tomont_c 6s 5s +20%
poly_pointwise_montgomery 6s 3s +100%
polyveck_pointwise_poly_montgomery 6s 5s +20%
polyvecl_uniform_gamma1 6s 3s +100%
sign_open 6s 3s +100%
sign_signature 6s 4s +50%
intt_native_x86_64 5s 2s +150%
mld_h 5s 9s -44%
mld_sample_s1_s2 5s 5s +0%
pointwise_native_aarch64 5s 2s +150%
poly_caddq 5s 2s +150%
poly_challenge 5s 4s +25%
poly_chknorm_native 5s 5s +0%
poly_ntt_native 5s 3s +67%
poly_uniform_gamma1_4x 5s 4s +25%
poly_use_hint_c 5s 4s +25%
polyt0_pack 5s 4s +25%
polyveck_pack_eta 5s 4s +25%
polyveck_unpack_eta 5s 5s +0%
rej_eta_native 5s 4s +25%
unpack_hints 5s 6s -17%
keccak_squeeze 4s 2s +100%
keccakf1600x4_extract_bytes 4s 4s +0%
mld_compute_pack_z 4s 6s -33%
mld_ct_cmask_neg_i32 4s 2s +100%
mld_ct_cmask_nonzero_u8 4s 2s +100%
mld_prepare_domain_separation_prefix 4s 4s +0%
ntt_native_aarch64 4s 5s -20%
pointwise_native_x86_64 4s 7s -43%
poly_caddq_native 4s 5s -20%
poly_chknorm 4s 4s +0%
poly_decompose_native 4s 4s +0%
poly_shiftl 4s 3s +33%
poly_uniform 4s 6s -33%
poly_uniform_eta 4s 5s -20%
poly_use_hint 4s 2s +100%
poly_use_hint_native 4s 4s +0%
polyt1_pack 4s 2s +100%
polyt1_unpack 4s 5s -20%
polyveck_chknorm 4s 5s -20%
polyveck_pack_w1 4s 4s +0%
polyveck_unpack_t0 4s 4s +0%
polyvecl_chknorm 4s 3s +33%
polyvecl_pack_eta 4s 3s +33%
polyvecl_permute_bitrev_to_custom 4s 3s +33%
polyvecl_pointwise_acc_montgomery_native 4s 6s -33%
polyvecl_unpack_z 4s 6s -33%
polyw1_pack 4s 3s +33%
polyz_pack 4s 2s +100%
shake256x4_absorb_once 4s 3s +33%
sign_keypair 4s 7s -43%
sign_signature_extmu 4s 4s +0%
sign_verify 4s 3s +33%
sign_verify_pre_hash_internal 4s 2s +100%
sign_verify_pre_hash_shake256 4s 7s -43%
unpack_pk 4s 4s +0%
unpack_sig 4s 4s +0%
fqscale 3s 2s +50%
keccak_f1600_x1_native_aarch64_v84a 3s 2s +50%
keccak_f1600_x4_native_aarch64_v84a 3s 2s +50%
keccak_f1600_x4_native_aarch64_v8a_v84a_scalar_hybrid 3s 2s +50%
keccak_init 3s 2s +50%
mld_ct_get_optblocker_i64 3s 4s -25%
mld_ct_get_optblocker_u32 3s 4s -25%
mld_ct_get_optblocker_u8 3s 4s -25%
mld_value_barrier_u8 3s 1s +200%
pack_pk 3s 5s -40%
pack_sig_c 3s 2s +50%
pack_sk_rho_key_tr_s2_t0 3s 5s -40%
poly_caddq_native_aarch64 3s 2s +50%
poly_invntt_tomont 3s 3s +0%
poly_invntt_tomont_native 3s 5s -40%
poly_make_hint 3s 2s +50%
poly_ntt 3s 3s +0%
poly_ntt_c 3s 1s +200%
poly_reduce 3s 2s +50%
poly_sub 3s 3s +0%
poly_uniform_gamma1 3s 3s +0%
polyveck_pack_t0 3s 3s +0%
polyvecl_uniform_gamma1_serial 3s 2s +50%
polyz_unpack_c 3s 4s -25%
power2round 3s 5s -40%
rej_eta_c 3s 3s +0%
shake128_init 3s 4s -25%
shake128_squeeze 3s 4s -25%
shake128x4_absorb_once 3s 3s +0%
shake256 3s 5s -40%
shake256_absorb 3s 3s +0%
shake256_finalize 3s 3s +0%
shake256x4_squeezeblocks 3s 3s +0%
caddq 2s 3s -33%
decompose 2s 1s +100%
keccak_f1600_x4_native_aarch64_v8a_scalar_hybrid 2s 2s +0%
keccakf1600_xor_bytes 2s 4s -50%
keccakf1600_xor_bytes (big endian) 2s 2s +0%
keccakf1600x4_permute 2s 3s -33%
keccakf1600x4_xor_bytes 2s 4s -50%
make_hint 2s 2s +0%
mld_ct_abs_i32 2s 5s -60%
mld_ct_cmask_nonzero_u32 2s 2s +0%
mld_ct_sel_int32 2s 3s -33%
mld_keccakf1600_extract_bytes 2s 3s -33%
mld_value_barrier_i64 2s 5s -60%
montgomery_reduce 2s 5s -60%
ntt_native_x86_64 2s 4s -50%
pack_sig_h_poly 2s 2s +0%
pack_sig_z 2s 3s -33%
pack_sk_s1 2s 4s -50%
poly_chknorm_native_aarch64 2s 4s -50%
poly_pointwise_montgomery_native 2s 4s -50%
polyeta_pack 2s 4s -50%
polyvecl_pointwise_acc_montgomery 2s 4s -50%
polyvecl_unpack_eta 2s 2s +0%
polyz_unpack 2s 4s -50%
polyz_unpack_native 2s 3s -33%
reduce32 2s 2s +0%
rej_eta 2s 3s -33%
shake128_absorb 2s 3s -33%
shake128_finalize 2s 3s -33%
shake128_release 2s 4s -50%
shake256_init 2s 3s -33%
shake256_release 2s 2s +0%
sign_verify_extmu 2s 3s -33%
sys_check_capability 2s 2s +0%
use_hint 2s 3s -33%
keccak_f1600_x1_native_aarch64 1s 3s -67%
keccak_finalize 1s 2s -50%
keccakf1600_extract_bytes (big endian) 1s 3s -67%
mld_value_barrier_u32 1s 2s -50%
shake128x4_squeezeblocks 1s 2s -50%
shake256_squeeze 1s 3s -67%

@hanno-becker
Copy link
Copy Markdown
Contributor

@flynd I think adding array sizes solves the issue.

@oqs-bot
Copy link
Copy Markdown
Contributor

oqs-bot commented Apr 17, 2026

CBMC Results (ML-DSA-87)

Full Results (186 proofs)
Proof Status Current Previous Change
**TOTAL** 3218s 3439s -6.4%
polyvecl_pointwise_acc_montgomery_c 1114s 1264s -12%
sign_verify_internal 237s 243s -2%
polyvec_matrix_expand 171s 179s -4%
poly_pointwise_montgomery_c 154s 165s -7%
rej_uniform_native 140s 144s -3%
polyvec_matrix_expand_serial 122s 120s +2%
mld_attempt_signature_generation 87s 92s -5%
mld_ct_memcmp 76s 79s -4%
mld_invntt_layer 64s 68s -6%
mld_ntt_layer 50s 54s -7%
sign_keypair_internal 46s 48s -4%
sign_signature_internal 34s 37s -8%
polymat_permute_bitrev_to_custom 29s 29s +0%
polyveck_invntt_tomont 28s 32s -12%
sign_pk_from_sk 25s 24s +4%
rej_uniform 23s 23s +0%
polyveck_decompose 20s 22s -9%
poly_chknorm_c 19s 19s +0%
fqmul 18s 20s -10%
poly_uniform_eta_4x 18s 18s +0%
rej_uniform_c 16s 17s -6%
keccakf1600x4_permute_native 14s 14s +0%
poly_uniform_4x 14s 14s +0%
polyeta_unpack 13s 18s -28%
polyt0_unpack 13s 16s -19%
mld_ntt_butterfly_block 12s 11s +9%
keccak_absorb_once_x4 11s 10s +10%
keccakf1600_permute_native 11s 9s +22%
poly_add 11s 12s -8%
mld_check_pct 10s 9s +11%
mld_sample_s1_s2 10s 8s +25%
polyveck_add 10s 11s -9%
polyvec_matrix_pointwise_montgomery 9s 8s +12%
polyveck_use_hint 9s 8s +12%
polyvecl_ntt 9s 10s -10%
polyz_unpack_c 9s 8s +12%
keccakf1600_permute 8s 7s +14%
pointwise_acc_native_x86_64 8s 8s +0%
poly_power2round 8s 7s +14%
polyveck_caddq 8s 8s +0%
polyveck_chknorm 8s 6s +33%
polyveck_shiftl 8s 7s +14%
unpack_sk 8s 10s -20%
keccak_absorb 7s 5s +40%
mld_compute_pack_z 7s 7s +0%
mld_sample_s1_s2_serial 7s 5s +40%
pointwise_acc_native_aarch64 7s 8s -12%
poly_challenge 7s 4s +75%
poly_invntt_tomont_c 7s 7s +0%
polyveck_power2round 7s 9s -22%
polyveck_reduce 7s 8s -12%
rej_eta_native 7s 6s +17%
sign_verify 7s 5s +40%
sign_verify_pre_hash_shake256 7s 5s +40%
mld_polyvecl_permute_bitrev_to_custom_native 6s 10s -40%
poly_decompose_c 6s 8s -25%
poly_invntt_tomont 6s 2s +200%
poly_uniform_gamma1_4x 6s 5s +20%
polyveck_ntt 6s 7s -14%
polyveck_sub 6s 8s -25%
polyvecl_unpack_eta 6s 4s +50%
rej_eta_c 6s 8s -25%
sign 6s 6s +0%
keccak_squeezeblocks_x4 5s 4s +25%
mld_h 5s 3s +67%
poly_caddq_c 5s 5s +0%
poly_caddq_native_aarch64 5s 5s +0%
poly_decompose 5s 4s +25%
poly_pointwise_montgomery 5s 3s +67%
polyveck_pointwise_poly_montgomery 5s 7s -29%
polyveck_unpack_eta 5s 3s +67%
polyvecl_uniform_gamma1 5s 4s +25%
polyvecl_uniform_gamma1_serial 5s 6s -17%
polyz_unpack_native 5s 3s +67%
reduce32 5s 3s +67%
sign_signature_extmu 5s 5s +0%
keccak_f1600_x4_native_aarch64_v8a_v84a_scalar_hybrid 4s 1s +300%
make_hint 4s 2s +100%
mld_ct_abs_i32 4s 2s +100%
mld_ct_cmask_neg_i32 4s 1s +300%
mld_prepare_domain_separation_prefix 4s 2s +100%
montgomery_reduce 4s 2s +100%
ntt_native_x86_64 4s 4s +0%
pointwise_native_aarch64 4s 5s -20%
poly_caddq_native 4s 4s +0%
poly_chknorm_native_aarch64 4s 5s -20%
poly_ntt_native 4s 2s +100%
poly_reduce 4s 3s +33%
poly_uniform_eta 4s 6s -33%
poly_uniform_gamma1 4s 2s +100%
polyeta_pack 4s 3s +33%
polyt0_pack 4s 4s +0%
polyveck_pack_eta 4s 3s +33%
polyvecl_chknorm 4s 5s -20%
polyvecl_pack_eta 4s 4s +0%
polyvecl_pointwise_acc_montgomery 4s 3s +33%
power2round 4s 5s -20%
shake128x4_absorb_once 4s 3s +33%
shake128x4_squeezeblocks 4s 2s +100%
sign_signature_pre_hash_internal 4s 5s -20%
sign_signature_pre_hash_shake256 4s 3s +33%
sign_verify_extmu 4s 5s -20%
unpack_hints 4s 6s -33%
unpack_pk 4s 4s +0%
unpack_sig 4s 5s -20%
caddq 3s 4s -25%
keccak_f1600_x1_native_aarch64 3s 3s +0%
keccak_f1600_x1_native_aarch64_v84a 3s 5s -40%
keccak_squeeze 3s 4s -25%
keccakf1600_extract_bytes (big endian) 3s 1s +200%
keccakf1600x4_xor_bytes 3s 1s +200%
mld_ct_cmask_nonzero_u32 3s 4s -25%
pack_pk 3s 2s +50%
pack_sig_h_poly 3s 2s +50%
pack_sk_s1 3s 4s -25%
pointwise_native_x86_64 3s 4s -25%
poly_caddq 3s 2s +50%
poly_chknorm_native 3s 3s +0%
poly_invntt_tomont_native 3s 3s +0%
poly_make_hint 3s 3s +0%
poly_ntt 3s 3s +0%
poly_ntt_c 3s 3s +0%
poly_pointwise_montgomery_native 3s 4s -25%
poly_sub 3s 3s +0%
poly_uniform 3s 4s -25%
poly_use_hint 3s 3s +0%
poly_use_hint_c 3s 2s +50%
poly_use_hint_native 3s 3s +0%
polyt1_unpack 3s 3s +0%
polyveck_pack_t0 3s 3s +0%
polyveck_pack_w1 3s 3s +0%
polyvecl_unpack_z 3s 3s +0%
polyw1_pack 3s 2s +50%
polyz_unpack 3s 4s -25%
rej_eta 3s 3s +0%
shake128_absorb 3s 2s +50%
shake128_squeeze 3s 4s -25%
shake256 3s 2s +50%
shake256_absorb 3s 2s +50%
shake256_finalize 3s 1s +200%
shake256x4_squeezeblocks 3s 5s -40%
sign_keypair 3s 2s +50%
sign_open 3s 5s -40%
sign_signature 3s 4s -25%
sign_verify_pre_hash_internal 3s 4s -25%
sys_check_capability 3s 2s +50%
decompose 2s 4s -50%
fqscale 2s 2s +0%
intt_native_x86_64 2s 2s +0%
keccak_f1600_x4_native_aarch64_v84a 2s 3s -33%
keccak_finalize 2s 3s -33%
keccak_init 2s 4s -50%
keccakf1600_xor_bytes 2s 4s -50%
keccakf1600_xor_bytes (big endian) 2s 3s -33%
mld_ct_cmask_nonzero_u8 2s 1s +100%
mld_ct_get_optblocker_u32 2s 4s -50%
mld_ct_get_optblocker_u8 2s 2s +0%
mld_keccakf1600_extract_bytes 2s 1s +100%
mld_value_barrier_i64 2s 2s +0%
mld_value_barrier_u32 2s 3s -33%
ntt_native_aarch64 2s 3s -33%
pack_sig_c 2s 2s +0%
pack_sig_z 2s 2s +0%
pack_sk_rho_key_tr_s2_t0 2s 3s -33%
poly_chknorm 2s 2s +0%
poly_decompose_native 2s 4s -50%
polyveck_unpack_t0 2s 2s +0%
polyvecl_permute_bitrev_to_custom 2s 3s -33%
polyvecl_pointwise_acc_montgomery_native 2s 4s -50%
polyz_pack 2s 3s -33%
shake128_init 2s 2s +0%
shake128_release 2s 4s -50%
shake256_init 2s 3s -33%
shake256_release 2s 2s +0%
shake256_squeeze 2s 2s +0%
shake256x4_absorb_once 2s 4s -50%
use_hint 2s 3s -33%
keccak_f1600_x4_native_aarch64_v8a_scalar_hybrid 1s 4s -75%
keccakf1600x4_extract_bytes 1s 2s -50%
keccakf1600x4_permute 1s 2s -50%
mld_ct_get_optblocker_i64 1s 4s -75%
mld_ct_sel_int32 1s 3s -67%
mld_value_barrier_u8 1s 3s -67%
poly_shiftl 1s 5s -80%
polyt1_pack 1s 4s -75%
shake128_finalize 1s 3s -67%

@flynd
Copy link
Copy Markdown
Contributor Author

flynd commented Apr 17, 2026

@flynd I think adding array sizes solves the issue.

That's great. I have updated my original commit to add the missing signed-off footer so hopefully CI can pass now.

flynd and others added 3 commits April 17, 2026 16:18
When building single-CU builds and MLD_CONFIG_INTERNAL_API_QUALIFIER is
set to make internal API static, also make the data tables static.
This makes the data symbols local instead of global, hiding them from
the scope of the rest of the application.

Signed-off-by: Anders Sonmark <Anders.Sonmark@axis.com>
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
Refactor scripts/autogen to use an emit_c_array() helper for all
generated C array definitions. The helper always emits explicit
array sizes (e.g., mld_rej_uniform_table[256] instead of
mld_rej_uniform_table[]).

The length is manually added to mld_keccakf1600_round_constants,
which is not autogenerated by autogen.

Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
@mkannwischer mkannwischer merged commit 8544cd7 into main Apr 17, 2026
799 of 800 checks passed
@mkannwischer mkannwischer deleted the static-tables branch April 17, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants