Skip to content

Commit 2895a9a

Browse files
committed
Fix confusing name for high bits of w
In both the reference implementation and the specification, the decomposed high/low bits of `w` are called `w1`/`w0`. Follow this convention by renaming the current `w1, w2` to `w, w1`. Signed-off-by: jammychiou1 <[email protected]>
1 parent 48fd61f commit 2895a9a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mldsa/sign.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ __contract__(
319319
uint8_t challenge_bytes[MLDSA_CTILDEBYTES];
320320
unsigned int n;
321321
mld_polyvecl y, z;
322-
mld_polyveck w2, w1, w0, h;
322+
mld_polyveck w, w1, w0, h;
323323
mld_poly cp;
324324
uint32_t z_invalid, w0_invalid, h_invalid;
325325
int res;
@@ -330,14 +330,14 @@ __contract__(
330330
/* Matrix-vector multiplication */
331331
z = y;
332332
mld_polyvecl_ntt(&z);
333-
mld_polyvec_matrix_pointwise_montgomery(&w1, mat, &z);
334-
mld_polyveck_reduce(&w1);
335-
mld_polyveck_invntt_tomont(&w1);
333+
mld_polyvec_matrix_pointwise_montgomery(&w, mat, &z);
334+
mld_polyveck_reduce(&w);
335+
mld_polyveck_invntt_tomont(&w);
336336

337337
/* Decompose w and call the random oracle */
338-
mld_polyveck_caddq(&w1);
339-
mld_polyveck_decompose(&w2, &w0, &w1);
340-
mld_polyveck_pack_w1(sig, &w2);
338+
mld_polyveck_caddq(&w);
339+
mld_polyveck_decompose(&w1, &w0, &w);
340+
mld_polyveck_pack_w1(sig, &w1);
341341

342342
mld_H(challenge_bytes, MLDSA_CTILDEBYTES, mu, MLDSA_CRHBYTES, sig,
343343
MLDSA_K * MLDSA_POLYW1_PACKEDBYTES, NULL, 0);
@@ -416,8 +416,8 @@ __contract__(
416416
* For a more detailed discussion, refer to https://eprint.iacr.org/2022/1406.
417417
*/
418418
MLD_CT_TESTING_DECLASSIFY(&w0, sizeof(w0));
419-
MLD_CT_TESTING_DECLASSIFY(&w2, sizeof(w2));
420-
n = mld_polyveck_make_hint(&h, &w0, &w2);
419+
MLD_CT_TESTING_DECLASSIFY(&w1, sizeof(w1));
420+
n = mld_polyveck_make_hint(&h, &w0, &w1);
421421
if (n > MLDSA_OMEGA)
422422
{
423423
res = -1; /* reject */
@@ -438,7 +438,7 @@ __contract__(
438438
mld_zeroize(challenge_bytes, MLDSA_CTILDEBYTES);
439439
mld_zeroize(&y, sizeof(y));
440440
mld_zeroize(&z, sizeof(z));
441-
mld_zeroize(&w2, sizeof(w2));
441+
mld_zeroize(&w, sizeof(w));
442442
mld_zeroize(&w1, sizeof(w1));
443443
mld_zeroize(&w0, sizeof(w0));
444444
mld_zeroize(&h, sizeof(h));

0 commit comments

Comments
 (0)