Skip to content

Commit 978b31c

Browse files
committed
Correct contracts following rebase
Signed-off-by: Rod Chapman <rodchap@amazon.com>
1 parent dfe269f commit 978b31c

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

mlkem/src/indcpa.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,20 +353,20 @@ __contract__(
353353
forall(k1, 0, MLKEM_K,
354354
array_bound(a->vec[k0].vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT))))
355355
requires(forall(k1, 0, MLKEM_K,
356-
array_abs_bound(v[k1].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
356+
array_abs_bound(v->vec[k1].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
357357
requires(forall(k2, 0, MLKEM_K,
358-
array_abs_bound(vc[k2].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
358+
array_abs_bound(vc->vec[k2].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
359359
assigns(object_whole(out))
360360
ensures(forall(k3, 0, MLKEM_K,
361-
array_abs_bound(out[k3].coeffs, 0, MLKEM_N, INT16_MAX/2))))
361+
array_abs_bound(out->vec[k3].coeffs, 0, MLKEM_N, INT16_MAX/2))))
362362
{
363363
unsigned i;
364364
for (i = 0; i < MLKEM_K; i++)
365365
__loop__(
366366
assigns(i, object_whole(out))
367367
invariant(i <= MLKEM_K)
368368
invariant(forall(k, 0, i,
369-
array_abs_bound(out[k].coeffs, 0, MLKEM_N, INT16_MAX/2)))
369+
array_abs_bound(out->vec[k].coeffs, 0, MLKEM_N, INT16_MAX/2)))
370370
)
371371
{
372372
mlk_polyvec_basemul_acc_montgomery_cached(&out->vec[i], &a->vec[i], v, vc);

mlkem/src/poly_k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ __contract__(
156156
requires(forall(k1, 0, MLKEM_K,
157157
array_bound(a->vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT)))
158158
requires(forall(k2, 0, MLKEM_K,
159-
array_abs_bound(b[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
159+
array_abs_bound(b->vec[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
160160
requires(forall(k3, 0, MLKEM_K,
161-
array_abs_bound(b_cache[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
161+
array_abs_bound(b_cache->vec[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
162162
assigns(memory_slice(r, sizeof(mlk_poly)))
163163
ensures(array_abs_bound(r->coeffs, 0, MLKEM_N, INT16_MAX/2))
164164
)

mlkem/src/poly_k.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ __contract__(
406406
requires(forall(k1, 0, MLKEM_K,
407407
array_bound(a->vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT)))
408408
requires(forall(k2, 0, MLKEM_K,
409-
array_abs_bound(b[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
409+
array_abs_bound(b->vec[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
410410
requires(forall(k3, 0, MLKEM_K,
411-
array_abs_bound(b_cache[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
411+
array_abs_bound(b_cache->vec[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
412412
assigns(memory_slice(r, sizeof(mlk_poly)))
413413
ensures(array_abs_bound(r->coeffs, 0, MLKEM_N, INT16_MAX/2))
414414
);
@@ -451,7 +451,7 @@ __contract__(
451451
requires(memory_no_alias(a, sizeof(mlk_polyvec)))
452452
assigns(memory_slice(x, sizeof(mlk_polyvec_mulcache)))
453453
ensures(forall(k0, 0, MLKEM_K,
454-
array_abs_bound(x[k0].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
454+
array_abs_bound(x->vec[k0].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
455455
);
456456

457457
#define mlk_polyvec_reduce MLK_NAMESPACE_K(polyvec_reduce)

0 commit comments

Comments
 (0)