-
Notifications
You must be signed in to change notification settings - Fork 26
Example: Add custom_backend #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
57c9f4f to
d4f46ac
Compare
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples/custom_backend/mldsa_native/mldsa/src/fips202/native/custom/custom.h
Outdated
Show resolved
Hide resolved
examples/custom_backend/mldsa_native/mldsa/src/fips202/native/custom/src/sha3.c
Show resolved
Hide resolved
examples/custom_backend/mldsa_native/mldsa/src/fips202/native/custom/src/sha3.h
Show resolved
Hide resolved
examples/custom_backend/mldsa_native/mldsa/src/fips202/native/custom/src/sha3.c
Show resolved
Hide resolved
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please squash your commits. This is one logical change.
3ba2351 to
38aa3f0
Compare
38aa3f0 to
a1202a6
Compare
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @willieyz
mkannwischer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, noticed something late.
- This commit add custom backend example, for this example, we add the arithmetic part but skip the arithmetic backend (remove `native` folder), since we decide to disable it. - This commit add a pseudo random number generator, implementing randombytes.h(reference from tests/test_only_rng). - WARNING: The randombytes() implementation used here is for TESTING ONLY. You MUST NOT use this implementation outside of testing. - This commit add custom backend fips202, we use tiny_sha3 here - This commit add `main.c` and symlink `expected_signatures.h` to custom_backend, generate `custom_config.h` from `configs.yml`, also add auto.mk and Makefile. - Add custom_backend to `tests` and `lint` scripts - Add `Readme.md` to custom_backend, reference from mlkem-native Signed-off-by: willieyz <willie.zhao@chelpis.com>
a1202a6 to
d34cb7a
Compare
Resolves: Example: Add
custom_backend#622This PR adds a custom_backend to mldsa-native, referencing the mlkem-native example: https://github.com/pq-code-package/mlkem-native/tree/main/examples/custom_backend.
The
custom_backendexample creates a mldsa-native build and adds tiny_sha3 as a backend option.Currently,
MLD_NATIVE_FUNC_SUCCESSdoes not exist (prior to the merge of Add Runtime dispatch based on custom CPU capabilities function #607). It is temporarily added to theautogen's exception list with a TODO comment, and also change the macro incustom.hwith0. This should be removed after PR #607 is merged.