Skip to content

ML-DSA Wconversion fixes#10399

Open
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:mldsa_Wconversion
Open

ML-DSA Wconversion fixes#10399
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:mldsa_Wconversion

Conversation

@Frauschi
Copy link
Copy Markdown
Contributor

@Frauschi Frauschi commented May 5, 2026

Add ML-DSA to Wconversion CI tests and add required casts to fix all errors. Required for FIPS 140-3 certification.

@Frauschi Frauschi self-assigned this May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

MemBrowse Memory Report

No memory changes detected for:

@Frauschi Frauschi force-pushed the mldsa_Wconversion branch from 624af9c to 591f28a Compare May 5, 2026 15:26
@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi May 5, 2026
@Frauschi Frauschi force-pushed the mldsa_Wconversion branch from 591f28a to 78a27c4 Compare May 5, 2026 19:22
Copy link
Copy Markdown
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

seeing some new warnings from this currently, atop current (6a3eb6f) master:

[quantum-safe-wolfssl-all-clang-tidy] [29 of 42] [41a62b2e29]
    configure with clang-tidy...   real 0m12.471s  user 0m0.002s  sys 0m0.005s
    build...075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 2835)             state[4*4 + l] = (word64)(0x1f0000U + ((word32)k << 8) + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:2835:30: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
2835 |             state[4*4 + l] = (word64)(0x1f0000U + ((word32)k << 8) + (word32)l);
|                              ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 2942)             state[4*4 + l] = (word64)(0x1f0000U + ((word32)((k + l) / 5) << 8) +
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:2942:30: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
2942 |             state[4*4 + l] = (word64)(0x1f0000U + ((word32)((k + l) / 5) << 8) +
|                              ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 2997)         state[4*4 + l] = (word64)(0x1f0000U + (5U << 8) + (word32)(l + 3));
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:2997:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
2997 |         state[4*4 + l] = (word64)(0x1f0000U + (5U << 8) + (word32)(l + 3));
|                          ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 3088)             state[4*4 + l] = (word64)(0x1f0000U + ((word32)((k + l) / 7) << 8) +
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:3088:30: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
3088 |             state[4*4 + l] = (word64)(0x1f0000U + ((word32)((k + l) / 7) << 8) +
|                              ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 3700)             state[8*4 + l] = (word64)(0x1f0000U + ((word32)k * 4U + (word32)l));
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:3700:30: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
3700 |             state[8*4 + l] = (word64)(0x1f0000U + ((word32)k * 4U + (word32)l));
|                              ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 3813)             state[8*4 + l] = (word64)(0x1f0000U + ((word32)k * 4U + (word32)l));
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:3813:30: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
3813 |             state[8*4 + l] = (word64)(0x1f0000U + ((word32)k * 4U + (word32)l));
|                              ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 3866)         state[8*4 + l] = (word64)(0x1f0000U + 8U + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:3866:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
3866 |         state[8*4 + l] = (word64)(0x1f0000U + 8U + (word32)l);
|                          ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 3968)             state[8*4 + l] = (word64)(0x1f0000U + ((word32)k * 4U + (word32)l));
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:3968:30: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
3968 |             state[8*4 + l] = (word64)(0x1f0000U + ((word32)k * 4U + (word32)l));
|                              ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 4021)         state[8*4 + l] = (word64)(0x1f0000U + 12U + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:4021:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
4021 |         state[8*4 + l] = (word64)(0x1f0000U + 12U + (word32)l);
|                          ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 4224)         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:4224:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
4224 |         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
|                          ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 4294)         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:4294:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
4294 |         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
|                          ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 4372)         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:4372:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
4372 |         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
|                          ^
075e6a3f8a (<tobias@wolfssl.com> 2026-05-05 15:21:15 +0200 4401)         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
/tmp/tmp.4346_38755/wolfssl_test_workdir.2622907/wolfssl/wolfcrypt/src/dilithium.c:4401:26: warning: either cast from 'unsigned int' to 'word64' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
4401 |         state[8*4 + l] = (word64)(0x1f0000U + (word32)kappa + (word32)l);
|                          ^
Suppressed 18 warnings (18 in non-user code).
   real 0m16.168s  user 0m0.061s  sys 0m0.075s
    clang-tidy reported defects in 1 file(s).

@Frauschi Frauschi force-pushed the mldsa_Wconversion branch from 78a27c4 to 96a220b Compare May 6, 2026 07:09
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.

3 participants