native: Allow tables to be declared static#1043
Conversation
|
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? |
|
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 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. |
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. 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. |
6f064f7 to
663c651
Compare
CBMC Results (ML-DSA-44)Full Results (186 proofs)
|
CBMC Results (ML-DSA-65)Full Results (186 proofs)
|
|
@flynd I think adding array sizes solves the issue. |
CBMC Results (ML-DSA-87)Full Results (186 proofs)
|
That's great. I have updated my original commit to add the missing signed-off footer so hopefully CI can pass now. |
c16df95 to
41f6745
Compare
41f6745 to
1040973
Compare
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>
1040973 to
24ba7b9
Compare
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.