Skip to content

Commit d36b82b

Browse files
committed
fix: change the MLD_INTT_BOUND to (3 * MLDSA_Q / 4), fix the debug test error
Signed-off-by: willieyz <[email protected]>
1 parent ca96114 commit d36b82b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mldsa/ntt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/* Absolute exclusive upper bound for the output of the forward NTT */
1313
#define MLD_NTT_BOUND (9 * MLDSA_Q)
1414
/* Absolute exclusive upper bound for the output of the inverse NTT*/
15-
#define MLD_INTT_BOUND 4211139
15+
#define MLD_INTT_BOUND (3 * MLDSA_Q / 4)
1616

1717
#define mld_ntt MLD_NAMESPACE(ntt)
1818
/*************************************************

mldsa/poly.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void mld_poly_invntt_tomont(mld_poly *a)
137137
{
138138
mld_assert_abs_bound(a->coeffs, MLDSA_N, MLDSA_Q);
139139
mld_intt_native(a->coeffs);
140-
mld_assert_abs_bound(a->coeffs, MLDSA_N, MLDSA_Q);
140+
mld_assert_abs_bound(a->coeffs, MLDSA_N, MLD_INTT_BOUND);
141141
}
142142
#endif /* MLD_USE_NATIVE_INTT */
143143

mldsa/polyvec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void mld_polyvecl_invntt_tomont(mld_polyvecl *v)
240240
mld_poly_invntt_tomont(&v->vec[i]);
241241
}
242242

243-
mld_assert_abs_bound_2d(v->vec, MLDSA_L, MLDSA_N, MLD_NTT_BOUND);
243+
mld_assert_abs_bound_2d(v->vec, MLDSA_L, MLDSA_N, MLD_INTT_BOUND);
244244
}
245245

246246
void mld_polyvecl_pointwise_poly_montgomery(mld_polyvecl *r, const mld_poly *a,
@@ -483,7 +483,7 @@ void mld_polyveck_invntt_tomont(mld_polyveck *v)
483483
mld_poly_invntt_tomont(&v->vec[i]);
484484
}
485485

486-
mld_assert_abs_bound_2d(v->vec, MLDSA_K, MLDSA_N, MLD_NTT_BOUND);
486+
mld_assert_abs_bound_2d(v->vec, MLDSA_K, MLDSA_N, MLD_INTT_BOUND);
487487
}
488488

489489
void mld_polyveck_pointwise_poly_montgomery(mld_polyveck *r, const mld_poly *a,

0 commit comments

Comments
 (0)