Skip to content

Commit a8f9ccc

Browse files
committed
Fix macro typo: MLK_INTERNAL_API => MLD_INTERNAL_API
- This commit fixes a error cause by macro typo in .clang-format where MLK_INTERNAL_API should be MLD_INTERNAL_API. This typo was detected after extending the macro checker to catch wrongly ported MLK_XXX/MLKEM_XXX macros. - The typo fix causes clang-format to reformat some files (packing.h and polyvec.h) by changing macro order from: MLD_MUST_CHECK_RETURN_VALUE MLD_INTERNAL_API to: MLD_MUST_CHECK_RETURN_VALUE MLD_INTERNAL_API - This reordering is the wrong, and it is because the order of these two macor, after referece from mlkem-native, we switch the macro order from: MLD_MUST_CHECK_RETURN_VALUE MLD_INTERNAL_API to: MLD_INTERNAL_API MLD_MUST_CHECK_RETURN_VALUE This is correct formatting behavior and matches the mlkem-native convention. Signed-off-by: willieyz <[email protected]>
1 parent cf02a49 commit a8f9ccc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Macros:
2525
- __contract__(x)={ void a; void b; void c; void d; void e; void f; } void abcdefghijklmnopqrstuvw()
2626
- __loop__(x)={} do
2727
# Make this artifically long to force line break
28-
- MLK_INTERNAL_API=void abcdefghijklmnopqrstuvwabcdefghijklmnopqrstuvwabcdefg();
28+
- MLD_INTERNAL_API=void abcdefghijklmnopqrstuvwabcdefghijklmnopqrstuvwabcdefg();

mldsa/src/packing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ __contract__(
183183
*
184184
* Returns 1 in case of malformed signature; otherwise 0.
185185
**************************************************/
186-
MLD_MUST_CHECK_RETURN_VALUE
187186
MLD_INTERNAL_API
187+
MLD_MUST_CHECK_RETURN_VALUE
188188
int mld_unpack_sig(uint8_t c[MLDSA_CTILDEBYTES], mld_polyvecl *z,
189189
mld_polyveck *h, const uint8_t sig[MLDSA_CRYPTO_BYTES])
190190
__contract__(

mldsa/src/polyvec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ __contract__(
216216
* Returns 0 if norm of all polynomials is strictly smaller than B <=
217217
* (MLDSA_Q-1)/8 and 0xFFFFFFFF otherwise.
218218
**************************************************/
219-
MLD_MUST_CHECK_RETURN_VALUE
220219
MLD_INTERNAL_API
220+
MLD_MUST_CHECK_RETURN_VALUE
221221
uint32_t mld_polyvecl_chknorm(const mld_polyvecl *v, int32_t B)
222222
__contract__(
223223
requires(memory_no_alias(v, sizeof(mld_polyvecl)))
@@ -424,8 +424,8 @@ __contract__(
424424
* Returns 0 if norm of all polynomials are strictly smaller than B <=
425425
*(MLDSA_Q-1)/8 and 0xFFFFFFFF otherwise.
426426
**************************************************/
427-
MLD_MUST_CHECK_RETURN_VALUE
428427
MLD_INTERNAL_API
428+
MLD_MUST_CHECK_RETURN_VALUE
429429
uint32_t mld_polyveck_chknorm(const mld_polyveck *v, int32_t B)
430430
__contract__(
431431
requires(memory_no_alias(v, sizeof(mld_polyveck)))
@@ -514,8 +514,8 @@ __contract__(
514514
*
515515
* Returns number of 1 bits.
516516
**************************************************/
517-
MLD_MUST_CHECK_RETURN_VALUE
518517
MLD_INTERNAL_API
518+
MLD_MUST_CHECK_RETURN_VALUE
519519
unsigned int mld_polyveck_make_hint(mld_polyveck *h, const mld_polyveck *v0,
520520
const mld_polyveck *v1)
521521
__contract__(

0 commit comments

Comments
 (0)