@@ -116,13 +116,17 @@ void mlk_polyvec_basemul_acc_montgomery_cached_asm_k2(
116
116
/* This must be kept in sync with the HOL-Light specification in
117
117
* proofs/hol_light/arm/proofs/mlkem_poly_basemul_acc_montgomery_cached_k2.ml.
118
118
*/
119
+ /* TODO - refine_bounds branch - Check HOL-Light specification has the
120
+ * INT16_MAX/2 bound on post-condition and re-prove/
121
+ */
119
122
__contract__ (
120
123
requires (memory_no_alias (r , sizeof (int16_t ) * MLKEM_N ))
121
124
requires (memory_no_alias (a , sizeof (int16_t ) * 2 * MLKEM_N ))
122
125
requires (memory_no_alias (b , sizeof (int16_t ) * 2 * MLKEM_N ))
123
126
requires (memory_no_alias (b_cache , sizeof (int16_t ) * 2 * (MLKEM_N / 2 )))
124
127
requires (array_abs_bound (a , 0 , 2 * MLKEM_N , MLKEM_UINT12_LIMIT + 1 ))
125
128
assigns (memory_slice (r , sizeof (int16_t ) * MLKEM_N ))
129
+ ensures (array_abs_bound (r , 0 , MLKEM_N , INT16_MAX /2 ))
126
130
);
127
131
128
132
#define mlk_polyvec_basemul_acc_montgomery_cached_asm_k3 \
@@ -133,13 +137,17 @@ void mlk_polyvec_basemul_acc_montgomery_cached_asm_k3(
133
137
/* This must be kept in sync with the HOL-Light specification in
134
138
* proofs/hol_light/arm/proofs/mlkem_poly_basemul_acc_montgomery_cached_k3.ml.
135
139
*/
140
+ /* TODO - refine_bounds branch - Check HOL-Light specification has the
141
+ * INT16_MAX/2 bound on post-condition and re-prove/
142
+ */
136
143
__contract__ (
137
144
requires (memory_no_alias (r , sizeof (int16_t ) * MLKEM_N ))
138
145
requires (memory_no_alias (a , sizeof (int16_t ) * 3 * MLKEM_N ))
139
146
requires (memory_no_alias (b , sizeof (int16_t ) * 3 * MLKEM_N ))
140
147
requires (memory_no_alias (b_cache , sizeof (int16_t ) * 3 * (MLKEM_N / 2 )))
141
148
requires (array_abs_bound (a , 0 , 3 * MLKEM_N , MLKEM_UINT12_LIMIT + 1 ))
142
149
assigns (memory_slice (r , sizeof (int16_t ) * MLKEM_N ))
150
+ ensures (array_abs_bound (r , 0 , MLKEM_N , INT16_MAX /2 ))
143
151
);
144
152
145
153
#define mlk_polyvec_basemul_acc_montgomery_cached_asm_k4 \
@@ -150,13 +158,17 @@ void mlk_polyvec_basemul_acc_montgomery_cached_asm_k4(
150
158
/* This must be kept in sync with the HOL-Light specification in
151
159
* proofs/hol_light/arm/proofs/mlkem_poly_basemul_acc_montgomery_cached_k4.ml.
152
160
*/
161
+ /* TODO - refine_bounds branch - Check HOL-Light specification has the
162
+ * INT16_MAX/2 bound on post-condition and re-prove/
163
+ */
153
164
__contract__ (
154
165
requires (memory_no_alias (r , sizeof (int16_t ) * MLKEM_N ))
155
166
requires (memory_no_alias (a , sizeof (int16_t ) * 4 * MLKEM_N ))
156
167
requires (memory_no_alias (b , sizeof (int16_t ) * 4 * MLKEM_N ))
157
168
requires (memory_no_alias (b_cache , sizeof (int16_t ) * 4 * (MLKEM_N / 2 )))
158
169
requires (array_abs_bound (a , 0 , 4 * MLKEM_N , MLKEM_UINT12_LIMIT + 1 ))
159
170
assigns (memory_slice (r , sizeof (int16_t ) * MLKEM_N ))
171
+ ensures (array_abs_bound (r , 0 , MLKEM_N , INT16_MAX /2 ))
160
172
);
161
173
162
174
#define mlk_rej_uniform_asm MLK_NAMESPACE(rej_uniform_asm)
0 commit comments