@@ -117,13 +117,17 @@ void mlk_polyvec_basemul_acc_montgomery_cached_asm_k2(
117117/* This must be kept in sync with the HOL-Light specification in
118118 * proofs/hol_light/arm/proofs/mlkem_poly_basemul_acc_montgomery_cached_k2.ml.
119119 */
120+ /* TODO - refine_bounds branch - Check HOL-Light specification has the
121+ * INT16_MAX/2 bound on post-condition and re-prove/
122+ */
120123__contract__ (
121124 requires (memory_no_alias (r , sizeof (int16_t ) * MLKEM_N ))
122125 requires (memory_no_alias (a , sizeof (int16_t ) * 2 * MLKEM_N ))
123126 requires (memory_no_alias (b , sizeof (int16_t ) * 2 * MLKEM_N ))
124127 requires (memory_no_alias (b_cache , sizeof (int16_t ) * 2 * (MLKEM_N / 2 )))
125128 requires (array_abs_bound (a , 0 , 2 * MLKEM_N , MLKEM_UINT12_LIMIT + 1 ))
126129 assigns (memory_slice (r , sizeof (int16_t ) * MLKEM_N ))
130+ ensures (array_abs_bound (r , 0 , MLKEM_N , INT16_MAX /2 ))
127131);
128132
129133#define mlk_polyvec_basemul_acc_montgomery_cached_asm_k3 \
@@ -134,13 +138,17 @@ void mlk_polyvec_basemul_acc_montgomery_cached_asm_k3(
134138/* This must be kept in sync with the HOL-Light specification in
135139 * proofs/hol_light/arm/proofs/mlkem_poly_basemul_acc_montgomery_cached_k3.ml.
136140 */
141+ /* TODO - refine_bounds branch - Check HOL-Light specification has the
142+ * INT16_MAX/2 bound on post-condition and re-prove/
143+ */
137144__contract__ (
138145 requires (memory_no_alias (r , sizeof (int16_t ) * MLKEM_N ))
139146 requires (memory_no_alias (a , sizeof (int16_t ) * 3 * MLKEM_N ))
140147 requires (memory_no_alias (b , sizeof (int16_t ) * 3 * MLKEM_N ))
141148 requires (memory_no_alias (b_cache , sizeof (int16_t ) * 3 * (MLKEM_N / 2 )))
142149 requires (array_abs_bound (a , 0 , 3 * MLKEM_N , MLKEM_UINT12_LIMIT + 1 ))
143150 assigns (memory_slice (r , sizeof (int16_t ) * MLKEM_N ))
151+ ensures (array_abs_bound (r , 0 , MLKEM_N , INT16_MAX /2 ))
144152);
145153
146154#define mlk_polyvec_basemul_acc_montgomery_cached_asm_k4 \
@@ -151,13 +159,17 @@ void mlk_polyvec_basemul_acc_montgomery_cached_asm_k4(
151159/* This must be kept in sync with the HOL-Light specification in
152160 * proofs/hol_light/arm/proofs/mlkem_poly_basemul_acc_montgomery_cached_k4.ml.
153161 */
162+ /* TODO - refine_bounds branch - Check HOL-Light specification has the
163+ * INT16_MAX/2 bound on post-condition and re-prove/
164+ */
154165__contract__ (
155166 requires (memory_no_alias (r , sizeof (int16_t ) * MLKEM_N ))
156167 requires (memory_no_alias (a , sizeof (int16_t ) * 4 * MLKEM_N ))
157168 requires (memory_no_alias (b , sizeof (int16_t ) * 4 * MLKEM_N ))
158169 requires (memory_no_alias (b_cache , sizeof (int16_t ) * 4 * (MLKEM_N / 2 )))
159170 requires (array_abs_bound (a , 0 , 4 * MLKEM_N , MLKEM_UINT12_LIMIT + 1 ))
160171 assigns (memory_slice (r , sizeof (int16_t ) * MLKEM_N ))
172+ ensures (array_abs_bound (r , 0 , MLKEM_N , INT16_MAX /2 ))
161173);
162174
163175#define mlk_rej_uniform_asm MLK_NAMESPACE(rej_uniform_asm)
0 commit comments