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

ML-DSA/Dilithium Calls ED #8003

Closed
opencrypto opened this issue Sep 22, 2024 · 3 comments · Fixed by #8009
Closed

ML-DSA/Dilithium Calls ED #8003

opencrypto opened this issue Sep 22, 2024 · 3 comments · Fixed by #8009
Assignees

Comments

@opencrypto
Copy link

There seem to be an issue with the ML-DSA / Dilithium code in WolfCrypt. Specifically, the wc_Dilithium_PublicKeyToDer, calls the SetAsymDerPublic() here:

The SetAsymDerPublic() is defined in the asn.c (L:12043) file and it is meant to be used for ED curves, not for generic ASN.1 (i.e., the documentation refers to RFC8410). The buffer size for the dataASN is set to edPubKeyASN_Length, which does not work for Dilithium.

Proposed Resolution:

  1. Change the name of the function to be specific for ED curves, and
  2. Fix the use in MlDsa/Dilithium code.
@philljj
Copy link
Contributor

philljj commented Sep 22, 2024

Hi @opencrypto,

Thank you for the report, I will look at this.

Thanks,
Jordan

@philljj
Copy link
Contributor

philljj commented Sep 24, 2024

Hi @opencrypto,

The documentation and variable names around SetAsymKeyDerPublic() are outdated, and we'll open a PR to update this.

The SetAsymKeyDerPublic() is a generic function we use for sphincs, dilithium, falcon, Ed, etc. The edPubKeyASN_Length is just the number of ASN items in the template for this type of pub key.

Sorry for the confusion!

Thanks,
Jordan

@dgarske
Copy link
Contributor

dgarske commented Sep 24, 2024

#8009

@philljj philljj linked a pull request Sep 24, 2024 that will close this issue
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 a pull request may close this issue.

3 participants