Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions mlkem/src/poly.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,17 +456,14 @@ __contract__(
MLK_INTERNAL_API
void mlk_poly_ntt(mlk_poly *p)
{
mlk_assert_abs_bound(p, MLKEM_N, MLKEM_Q);

#if defined(MLK_USE_NATIVE_NTT)
int ret;
mlk_assert_abs_bound(p, MLKEM_N, MLKEM_Q);
ret = mlk_ntt_native(p->coeffs);
if (ret == MLK_NATIVE_FUNC_SUCCESS)
{
int ret;
ret = mlk_ntt_native(p->coeffs);
if (ret == MLK_NATIVE_FUNC_SUCCESS)
{
mlk_assert_abs_bound(p, MLKEM_N, MLK_NTT_BOUND);
return;
}
mlk_assert_abs_bound(p, MLKEM_N, MLK_NTT_BOUND);
return;
}
#endif /* MLK_USE_NATIVE_NTT */

Expand Down
4 changes: 1 addition & 3 deletions mlkem/src/poly_k.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ void mlk_polyvec_basemul_acc_montgomery_cached(
#if defined(MLK_USE_NATIVE_POLYVEC_BASEMUL_ACC_MONTGOMERY_CACHED)
{
int ret;
/* Omitting bounds assertion for cache since native implementations may
* decide not to use a mulcache. Note that the C backend implementation
* of poly_basemul_montgomery_cached() does still include the check. */
mlk_assert_bound_2d(a->vec, MLKEM_K, MLKEM_N, 0, MLKEM_UINT12_LIMIT);
#if MLKEM_K == 2
ret = mlk_polyvec_basemul_acc_montgomery_cached_k2_native(
r->coeffs, (const int16_t *)a, (const int16_t *)b,
Expand Down