Skip to content

Conversation

jakemas
Copy link
Contributor

@jakemas jakemas commented Oct 8, 2025

When the file mldsa-native.c is within the directory mldsa/ we get issues with the Windows CI was failing with duplicate symbol errors because the NMAKE wildcard pattern {mldsa}.c was including both individual source files AND the single compilation unit mldsa_native.c, causing conflicts. I moved mldsa-native.c up one directory to solve this, but we may instead want to switch over to the mlkem-native src/ style.

Implemented:

  • add mldsa-native.h header file
  • update examples/basic to use this header file as an example

Merging #532 first will clean up NAMESPACETOP issues, so should be done before this PR.

Testing CI, once scope and review is happy, I will remove fix ups, create a nice commit message etc.

);

#define crypto_sign MLD_NAMESPACETOP
#define crypto_sign MLD_NAMESPACE(sign)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will merge #532 that removes namespacetop, so won't have this issue on rebase.

Signed-off-by: Jake Massimo <[email protected]>
@jakemas jakemas marked this pull request as ready for review October 8, 2025 20:00
@jakemas jakemas requested a review from a team as a code owner October 8, 2025 20:00
#include "../../mldsa/sign.h"
#define MLD_CONFIG_API_PARAMETER_SET MLD_CONFIG_PARAMETER_SET
#define MLD_CONFIG_API_NAMESPACE_PREFIX mldsa
#include "../../mldsa/mldsa_native.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

let's change this to #include "mldsa_native/mldsa/mldsa_native.h and add the symlink mldsa_native.
Like in mlkem-native

mldsa/ntt.c mldsa/ntt.h mldsa/packing.c mldsa/packing.h mldsa/params.h mldsa/poly.c
mldsa/poly.h mldsa/polyvec.c mldsa/polyvec.h mldsa/randombytes.h mldsa/reduce.h
mldsa/rounding.h mldsa/sign.c mldsa/sign.h mldsa/symmetric.h mldsa/sys.h mldsa/zetas.inc
mldsa/mldsa_native.h mldsa/ntt.c mldsa/ntt.h mldsa/packing.c mldsa/packing.h mldsa/params.h
Copy link
Contributor

Choose a reason for hiding this comment

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

liboqs does not actually need that file. Let's exclude it.

Copy link
Contributor

@hanno-becker hanno-becker left a comment

Choose a reason for hiding this comment

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

@jakemas IIRC the plan was to have the monobuild files in the monobuild example folder first, and eventually restructure everything to follow the directory pattern as in mlkem-native (with mldsa/src/* for the bulk of the source, and mldsa/mldsa_native.* for the toplevel). I don't think we want mldsa_native.c in the toplevel directory.

Why is mldsa_native.c needed for this change at all, actually?

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.

Update api.h to reflect all supported API functions (and rename to mldsa_native.h)

3 participants