Skip to content

Commit 1602ef8

Browse files
committed
Correct contracts following rebase
Signed-off-by: Rod Chapman <rodchap@amazon.com>
1 parent 43d0277 commit 1602ef8

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
@@ -356,20 +356,20 @@ __contract__(
356356
forall(k1, 0, MLKEM_K,
357357
array_bound(a->vec[k0].vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT))))
358358
requires(forall(k1, 0, MLKEM_K,
359-
array_abs_bound(v[k1].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
359+
array_abs_bound(v->vec[k1].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
360360
requires(forall(k2, 0, MLKEM_K,
361-
array_abs_bound(vc[k2].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
361+
array_abs_bound(vc->vec[k2].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
362362
assigns(object_whole(out))
363363
ensures(forall(k3, 0, MLKEM_K,
364-
array_abs_bound(out[k3].coeffs, 0, MLKEM_N, INT16_MAX/2))))
364+
array_abs_bound(out->vec[k3].coeffs, 0, MLKEM_N, INT16_MAX/2))))
365365
{
366366
unsigned i;
367367
for (i = 0; i < MLKEM_K; i++)
368368
__loop__(
369369
assigns(i, object_whole(out))
370370
invariant(i <= MLKEM_K)
371371
invariant(forall(k, 0, i,
372-
array_abs_bound(out[k].coeffs, 0, MLKEM_N, INT16_MAX/2)))
372+
array_abs_bound(out->vec[k].coeffs, 0, MLKEM_N, INT16_MAX/2)))
373373
)
374374
{
375375
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
@@ -157,9 +157,9 @@ __contract__(
157157
requires(forall(k1, 0, MLKEM_K,
158158
array_bound(a->vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT)))
159159
requires(forall(k2, 0, MLKEM_K,
160-
array_abs_bound(b[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
160+
array_abs_bound(b->vec[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
161161
requires(forall(k3, 0, MLKEM_K,
162-
array_abs_bound(b_cache[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
162+
array_abs_bound(b_cache->vec[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
163163
assigns(memory_slice(r, sizeof(mlk_poly)))
164164
ensures(array_abs_bound(r->coeffs, 0, MLKEM_N, INT16_MAX/2))
165165
)

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)