Skip to content
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

wolfHSM support for ML-DSA #523

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

bigbrett
Copy link
Contributor

@bigbrett bigbrett commented Dec 3, 2024

  • Adds wolfHSM offload for ML-DSA
  • Consolidates AURIX helper scripts into wbaurixtool.sh, a one-stop-shop configuration tool that handles the manual configuration steps that aren't handled by AURIX IDE
  • Various AURIX project configuration improvements

Note that this requires updating wolfSSL to include wolfSSL/wolfssl#8177 and wolfSSL/wolfssl#8229. If we need to wait until the required changes are incorporated in a release, let me know and this can remain a draft PR

@bigbrett bigbrett marked this pull request as draft December 3, 2024 20:01
@bigbrett
Copy link
Contributor Author

bigbrett commented Dec 3, 2024

Converting to draft until @danielinux merges #521

- consolidate AURIX scripts into wbaurixtool.sh
- documentation updates
@bigbrett
Copy link
Contributor Author

bigbrett commented Dec 6, 2024

rebased after #521 was merged, re-tested on Sim + AURIX. Ready for review

@bigbrett bigbrett marked this pull request as ready for review December 6, 2024 19:51
@bigbrett bigbrett requested review from danielinux and dgarske and removed request for danielinux December 6, 2024 19:51
if (saveAsDer) {
/* Export public key in DER format */
uint8_t pubDer[
#if ML_DSA_LEVEL == 2
Copy link
Contributor

Choose a reason for hiding this comment

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

These come from run-time arguments now. You might need to rebase and fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops. Already had rebased but forgot to change this line. Fixed in latest commit to switch on ml_dsa_level

dgarske
dgarske previously approved these changes Dec 9, 2024
exit(1);
break;
}
pubDer = malloc(pubDerSz);
Copy link
Contributor

Choose a reason for hiding this comment

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

Cast (uint8_t*)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in latest commit. Didn't realize this was in our coding standard, but indeed it is. Just of curiosity why do we do this? For C++ compatibility?

pubOutLen = wc_Dilithium_PublicKeyToDer(&key, pubDer, pubDerSz,
WITH_ALG_SPKI);
if (pubOutLen < 0) {
fprintf(stderr, "Unable to export public key to DER, ret=%d\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to free pubDer?

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 immediately exit(1) on any failure, so didn't free. Just following the paradigm elsewhere in keygen.c.

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.

2 participants