Skip to content

Conversation

jakemas
Copy link
Contributor

@jakemas jakemas commented Sep 11, 2025

Still WORK in progress. Steps for multi-level build.
testing removing mldsa_mode in another CI

Core System Changes:

  1. Replaced hardcoded namespace prefixes (MLD_44_ref_, MLD_65_ref_, MLD_87_ref_) with configurable MLD_CONFIG_NAMESPACE_PREFIX system
  2. Added missing build infrastructure (test/mk/compiler.mk, test/mk/auto.mk) with compiler feature detection and host capability matching
  3. Migrated parameter configuration from MLDSA_MODE (2/3/5) to MLD_CONFIG_PARAMETER_SET (44/65/87) with backward compatibility
  4. Separated function declarations from api.h to sign.h, leaving only constants in public API
  5. Implemented dual namespace macros - MLD_NAMESPACE() for shared functions, MLD_NAMESPACE_K() for parameter-specific functions
  6. Fixed native backend integration with proper include order dependencies and platform-specific assembly symbol handling
  7. Updated test configuration files (break_pct_config.h, custom_zeroize_config.h) to use new namespace system
  8. Updated CBMC proofs/break_pct/custom_zeroize/stack_use: to use new namespace/api.h where needed

Parameter set naming convention

mlkem-native:

  • MLK_CONFIG_PARAMETER_SET (512, 768, 1024) → MLKEM_K (2, 3, 4)

mldsa-native:

  • MLD_CONFIG_PARAMETER_SET (44, 65, 87) → MLDSA_K (4, 6, 8) and MLDSA_L (4, 5, 7)

or do we want to preserve the NIST levels in some respect?

@jakemas jakemas requested a review from a team as a code owner September 11, 2025 20:24
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
@jakemas jakemas marked this pull request as draft September 11, 2025 20:44
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
Signed-off-by: Jake Massimo <[email protected]>
@jakemas jakemas changed the title Namespacing: Switch to mlkem-native style namespace, api, common, config Namespacing: Add MLD_CONFIG_PARAMETER_SET + MLD_CONFIG_NAMESPACE_PREFIX, modify api, common, config accordingly Sep 12, 2025
@jakemas
Copy link
Contributor Author

jakemas commented Sep 12, 2025

hmm looks like mld_polyvec_matrix_expand CBMC is failing on ml-dsa-87

Signed-off-by: Jake Massimo <[email protected]>
else
$(error Invalid value of MLDSA_MODE)
endif

# Add parameter set configuration to build
DEFINES += -DMLD_CONFIG_PARAMETER_SET=$(MLD_CONFIG_PARAMETER_SET)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theory, cant be defined from here, so its defaulting to 65, and breaking in 87 case (as never set)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config: Add MLD_CONFIG_PARAMETER_SET + MLD_CONFIG_NAMESPACE_PREFIX
1 participant