@@ -149,17 +149,62 @@ __contract__(
149149
150150#define mld_polyvecl_pointwise_acc_montgomery_l4_asm \
151151 MLD_NAMESPACE(polyvecl_pointwise_acc_montgomery_l4_asm)
152- void mld_polyvecl_pointwise_acc_montgomery_l4_asm (int32_t * , const int32_t * ,
153- const int32_t * );
152+ void mld_polyvecl_pointwise_acc_montgomery_l4_asm (int32_t * r , const int32_t * a ,
153+ const int32_t * b )
154+ /* This must be kept in sync with the HOL-Light specification
155+ * in proofs/hol_light/aarch64/proofs/mldsa_pointwise_acc_l4.ml */
156+ __contract__ (
157+ requires (memory_no_alias (r , sizeof (int32_t ) * MLDSA_N ))
158+ requires (memory_no_alias (a , sizeof (int32_t ) * 4 * MLDSA_N ))
159+ requires (memory_no_alias (b , sizeof (int32_t ) * 4 * MLDSA_N ))
160+ /* check-magic: off */
161+ requires (array_abs_bound (a , 0 , 4 * MLDSA_N , 75423753 ))
162+ requires (array_abs_bound (b , 0 , 4 * MLDSA_N , 75423753 ))
163+ /* check-magic: on */
164+ assigns (memory_slice (r , sizeof (int32_t ) * MLDSA_N ))
165+ /* check-magic: off */
166+ ensures (array_abs_bound (r , 0 , MLDSA_N , 8380417 ))
167+ /* check-magic: on */
168+ );
154169
155170#define mld_polyvecl_pointwise_acc_montgomery_l5_asm \
156171 MLD_NAMESPACE(polyvecl_pointwise_acc_montgomery_l5_asm)
157- void mld_polyvecl_pointwise_acc_montgomery_l5_asm (int32_t * , const int32_t * ,
158- const int32_t * );
172+ void mld_polyvecl_pointwise_acc_montgomery_l5_asm (int32_t * r , const int32_t * a ,
173+ const int32_t * b )
174+ /* This must be kept in sync with the HOL-Light specification
175+ * in proofs/hol_light/aarch64/proofs/mldsa_pointwise_acc_l5.ml */
176+ __contract__ (
177+ requires (memory_no_alias (r , sizeof (int32_t ) * MLDSA_N ))
178+ requires (memory_no_alias (a , sizeof (int32_t ) * 5 * MLDSA_N ))
179+ requires (memory_no_alias (b , sizeof (int32_t ) * 5 * MLDSA_N ))
180+ /* check-magic: off */
181+ requires (array_abs_bound (a , 0 , 5 * MLDSA_N , 75423753 ))
182+ requires (array_abs_bound (b , 0 , 5 * MLDSA_N , 75423753 ))
183+ /* check-magic: on */
184+ assigns (memory_slice (r , sizeof (int32_t ) * MLDSA_N ))
185+ /* check-magic: off */
186+ ensures (array_abs_bound (r , 0 , MLDSA_N , 8380417 ))
187+ /* check-magic: on */
188+ );
159189
160190#define mld_polyvecl_pointwise_acc_montgomery_l7_asm \
161191 MLD_NAMESPACE(polyvecl_pointwise_acc_montgomery_l7_asm)
162- void mld_polyvecl_pointwise_acc_montgomery_l7_asm (int32_t * , const int32_t * ,
163- const int32_t * );
192+ void mld_polyvecl_pointwise_acc_montgomery_l7_asm (int32_t * r , const int32_t * a ,
193+ const int32_t * b )
194+ /* This must be kept in sync with the HOL-Light specification
195+ * in proofs/hol_light/aarch64/proofs/mldsa_pointwise_acc_l7.ml */
196+ __contract__ (
197+ requires (memory_no_alias (r , sizeof (int32_t ) * MLDSA_N ))
198+ requires (memory_no_alias (a , sizeof (int32_t ) * 7 * MLDSA_N ))
199+ requires (memory_no_alias (b , sizeof (int32_t ) * 7 * MLDSA_N ))
200+ /* check-magic: off */
201+ requires (array_abs_bound (a , 0 , 7 * MLDSA_N , 75423753 ))
202+ requires (array_abs_bound (b , 0 , 7 * MLDSA_N , 75423753 ))
203+ /* check-magic: on */
204+ assigns (memory_slice (r , sizeof (int32_t ) * MLDSA_N ))
205+ /* check-magic: off */
206+ ensures (array_abs_bound (r , 0 , MLDSA_N , 8380417 ))
207+ /* check-magic: on */
208+ );
164209
165210#endif /* !MLD_NATIVE_AARCH64_SRC_ARITH_NATIVE_AARCH64_H */
0 commit comments