Skip to content

Commit 5e592bb

Browse files
committed
[TEST] Remove cassert
Signed-off-by: Hanno Becker <[email protected]>
1 parent b4ac310 commit 5e592bb

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

mldsa/polyvec.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <string.h>
77

88
#include "common.h"
9-
#include "debug.h"
109
#include "poly.h"
1110
#include "polyvec.h"
1211

@@ -270,21 +269,7 @@ void mld_polyvecl_pointwise_acc_montgomery(mld_poly *w, const mld_polyvecl *u,
270269
t += (int64_t)u->vec[j].coeffs[i] * v->vec[j].coeffs[i];
271270
}
272271

273-
/* Substitute j == MLSDA_L into the loop invariant to get... */
274-
mld_assert(j == MLDSA_L);
275-
mld_assert(t >= -(int64_t)MLDSA_L * (MLDSA_Q - 1) * (MLD_NTT_BOUND - 1));
276-
mld_assert(t <= (int64_t)MLDSA_L * (MLDSA_Q - 1) * (MLD_NTT_BOUND - 1));
277-
278-
/* ...and therefore... */
279-
mld_assert(t >= -MONTGOMERY_REDUCE_STRONG_DOMAIN_MAX);
280-
mld_assert(t < MONTGOMERY_REDUCE_STRONG_DOMAIN_MAX);
281-
282-
/* ...which meets the "strong" case of mld_montgomery_reduce() */
283272
r = mld_montgomery_reduce(t);
284-
285-
/* ...and therefore we can assert a stronger bound on r */
286-
mld_assert(r > -MLDSA_Q);
287-
mld_assert(r < MLDSA_Q);
288273
w->coeffs[i] = r;
289274
}
290275
}

mldsa/rounding.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
#include <stdint.h>
66

7-
#include "debug.h"
87
#include "rounding.h"
98

109

@@ -18,20 +17,15 @@ void mld_decompose(int32_t *a0, int32_t *a1, int32_t a)
1817
{
1918
*a1 = (a + 127) >> 7;
2019
/* We know a >= 0 and a < MLDSA_Q, so... */
21-
mld_assert(*a1 >= 0 && *a1 <= 65472);
2220

2321
#if MLDSA_MODE == 2
2422
*a1 = (*a1 * 11275 + (1 << 23)) >> 24;
25-
mld_assert(*a1 >= 0 && *a1 <= 44);
2623

2724
*a1 ^= ((43 - *a1) >> 31) & *a1;
28-
mld_assert(*a1 >= 0 && *a1 <= 43);
29-
#else /* MLDSA_MODE == 2 */
25+
#else
3026
*a1 = (*a1 * 1025 + (1 << 21)) >> 22;
31-
mld_assert(*a1 >= 0 && *a1 <= 16);
3227

3328
*a1 &= 15;
34-
mld_assert(*a1 >= 0 && *a1 <= 15);
3529

3630
#endif /* MLDSA_MODE != 2 */
3731

0 commit comments

Comments
 (0)