@@ -184,18 +184,21 @@ MLD_INTERNAL_API
184184void mld_poly_pointwise_montgomery (mld_poly * c , const mld_poly * a ,
185185 const mld_poly * b )
186186{
187- #if defined(MLD_USE_NATIVE_POINTWISE_MONTGOMERY )
188- /* TODO: proof */
189- mld_assert_abs_bound (a -> coeffs , MLDSA_N , MLD_NTT_BOUND );
190- mld_assert_abs_bound (b -> coeffs , MLDSA_N , MLD_NTT_BOUND );
191- mld_poly_pointwise_montgomery_native (c -> coeffs , a -> coeffs , b -> coeffs );
192- mld_assert_abs_bound (c -> coeffs , MLDSA_N , MLDSA_Q );
193- #else /* MLD_USE_NATIVE_POINTWISE_MONTGOMERY */
194187 unsigned int i ;
195-
196188 mld_assert_abs_bound (a -> coeffs , MLDSA_N , MLD_NTT_BOUND );
197189 mld_assert_abs_bound (b -> coeffs , MLDSA_N , MLD_NTT_BOUND );
198-
190+ #if defined(MLD_USE_NATIVE_POINTWISE_MONTGOMERY )
191+ {
192+ /* TODO: proof */
193+ int ret ;
194+ ret = mld_poly_pointwise_montgomery_native (c -> coeffs , a -> coeffs , b -> coeffs );
195+ if (ret == MLD_NATIVE_FUNC_SUCCESS )
196+ {
197+ mld_assert_abs_bound (c -> coeffs , MLDSA_N , MLDSA_Q );
198+ return ;
199+ }
200+ }
201+ #endif /* MLD_USE_NATIVE_POINTWISE_MONTGOMERY */
199202 for (i = 0 ; i < MLDSA_N ; ++ i )
200203 __loop__ (
201204 invariant (i <= MLDSA_N )
@@ -206,7 +209,6 @@ void mld_poly_pointwise_montgomery(mld_poly *c, const mld_poly *a,
206209 }
207210
208211 mld_assert_abs_bound (c -> coeffs , MLDSA_N , MLDSA_Q );
209- #endif /* !MLD_USE_NATIVE_POINTWISE_MONTGOMERY */
210212}
211213
212214MLD_INTERNAL_API
0 commit comments