-
Notifications
You must be signed in to change notification settings - Fork 34
Description
#801 added MLD_ALLOC for all large structs in sign.c. However, there are some larger buffers further down the call stack that we should consider also allocating via MLD_ALLOC. Ideally, allocations should be done on the higher level and work buffers be passed to the lower levels - but this will complicate CBMC proofs.
The following functions with large stack footprint would be a good place to start:
- mld_poly_uniform_4x: 3,456 bytes -
Lines 665 to 666 in 4ab0e26
MLD_ALIGN uint8_t buf[4][MLD_ALIGN_UP(MLD_POLY_UNIFORM_NBLOCKS * MLD_STREAM128_BLOCKBYTES)]; - mld_poly_uniform_gamma1_4x: 2,816 bytes -
mldsa-native/mldsa/src/poly_kl.c
Lines 531 to 532 in 4ab0e26
MLD_ALIGN uint8_t buf[4][MLD_ALIGN_UP(MLD_POLY_UNIFORM_GAMMA1_NBLOCKS * MLD_STREAM256_BLOCKBYTES)]; - mld_poly_uniform_eta_4x: 1,152 bytes -
mldsa-native/mldsa/src/poly_kl.c
Lines 352 to 353 in 4ab0e26
MLD_ALIGN uint8_t buf[4][MLD_ALIGN_UP(MLD_POLY_UNIFORM_ETA_NBLOCKS * MLD_STREAM256_BLOCKBYTES)]; - mld_poly_uniform: 840 bytes -
Line 631 in 4ab0e26
MLD_ALIGN uint8_t buf[MLD_POLY_UNIFORM_NBLOCKS * MLD_STREAM128_BLOCKBYTES]; - mld_poly_uniform_gamma1: 680 bytes -
mldsa-native/mldsa/src/poly_kl.c
Line 497 in 4ab0e26
buf[MLD_POLY_UNIFORM_GAMMA1_NBLOCKS * MLD_STREAM256_BLOCKBYTES];