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 macro definition error #1797

Closed
EverTear opened this issue May 20, 2024 · 6 comments · Fixed by #1799
Closed

ML-DSA macro definition error #1797

EverTear opened this issue May 20, 2024 · 6 comments · Fixed by #1799

Comments

@EverTear
Copy link

Describe the bug
Several macros in the sig_ml_dsa.h header file are incorrectly defined as kem types.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'src/sig/ml_dsa/sig_ml_dsa.h'
  2. Click on 'sig_ml_dsa.h'
  3. Scroll down to 'line 20'
  4. See error
    #define OQS_SIG_ml_dsa_44_length_ciphertext OQS_SIG_ml_dsa_44_ipd_length_ciphertext
    I think the macro definition here should be
    #define OQS_SIG_ml_dsa_44_length_signature OQS_SIG_ml_dsa_44_ipd_length_signature
    Similarly, there are many similar macro definition errors below.

Expected behavior
At present, the definition of these macros will cause compilation errors. After modification, those algorithms of ML-DSA should be able to be used normally.

Screenshots
Snipaste_2024-05-20_15-01-05

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • OpenSSL version: 3.4.0
  • Compiler version used: gcc 9.4.0
  • Build variables used: none
  • liboqs version: main branch
@baentsch
Copy link
Member

Thanks for this report @EverTear . These defines indeed look misplaced there (tagging @bhess fyi) -- but they should (and in CI also do not) trigger a wrong compilation as they're unused as far as I can see... So what compilation errors are you seeing??

@EverTear
Copy link
Author

Thanks for this report @EverTear . These defines indeed look misplaced there (tagging @bhess fyi) -- but they should (and in CI also do not) trigger a wrong compilation as they're unused as far as I can see... So what compilation errors are you seeing??

Sorry for the misunderstanding. The compilation errors I mentioned are not related to compiling the liboqs library itself, but rather occur when using the ML-DSA algorithm provided by the liboqs library. I was writing a test program that calls all algorithms in liboqs, and I encountered an undefined macro error while trying to call some ML-DSA algorithms (due to modifying code from a template). Specifically, the macro OQS_SIG_ml_dsa_44_length_signature is not defined. I checked the header files of liboqs and found these definition errors.

@EverTear EverTear reopened this May 21, 2024
@bhess
Copy link
Member

bhess commented May 21, 2024

Hi @EverTear, thanks for this report!
The _encaps, _decaps, _ciphertext and _shared_secret macros are misplaced for a signature scheme (ML-DSA). I'll do a PR with a fix.

@bhess
Copy link
Member

bhess commented May 24, 2024

@EverTear please see PR #1799 with a fix. Would you be able to confirm if this fixes the issue? Thx

@EverTear
Copy link
Author

EverTear commented May 27, 2024

@bhess Thanks, I've confirmed that the issue has been fixed by PR #1799.

@bhess
Copy link
Member

bhess commented May 28, 2024

Thanks @EverTear !

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