Skip to content

Commit fe13eb9

Browse files
committed
Re-format with clang-format and add decreases contract
Signed-off-by: Rod Chapman <rodchap@amazon.com>
1 parent ee02f00 commit fe13eb9

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

mlkem/src/indcpa.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,21 @@ __contract__(
195195
assigns(i, j, memory_slice(a, sizeof(mlk_polymat)))
196196
invariant(i <= MLKEM_K)
197197
invariant(forall(x2, 0, MLKEM_K, forall(y2, 0, MLKEM_K,
198-
array_bound(a->vec[x2].vec[y2].coeffs, 0, MLKEM_N, 0, MLKEM_Q)))))
198+
array_bound(a->vec[x2].vec[y2].coeffs, 0, MLKEM_N, 0, MLKEM_Q))))
199199
decreases(MLKEM_K - i))
200-
{
201-
for (j = 0; j < MLKEM_K; j++)
202-
__loop__(
200+
{
201+
for (j = 0; j < MLKEM_K; j++)
202+
__loop__(
203203
assigns(j, memory_slice(a, sizeof(mlk_polymat)))
204204
invariant(i <= MLKEM_K)
205205
invariant(j <= MLKEM_K)
206206
invariant(forall(x3, 0, MLKEM_K, forall(y3, 0, MLKEM_K,
207-
array_bound(a->vec[x3].vec[y3].coeffs, 0, MLKEM_N, 0, MLKEM_Q)))))
208-
{
209-
mlk_poly_permute_bitrev_to_custom(a->vec[i].vec[j].coeffs);
210-
}
207+
array_bound(a->vec[x3].vec[y3].coeffs, 0, MLKEM_N, 0, MLKEM_Q))))
208+
decreases(MLKEM_K - j))
209+
{
210+
mlk_poly_permute_bitrev_to_custom(a->vec[i].vec[j].coeffs);
211211
}
212+
}
212213
#else /* MLK_USE_NATIVE_NTT_CUSTOM_ORDER */
213214
/* Nothing to do */
214215
(void)a;

0 commit comments

Comments
 (0)