Skip to content

Commit 1a12828

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

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
@@ -357,20 +357,20 @@ __contract__(
357357
forall(k1, 0, MLKEM_K,
358358
array_bound(a->vec[k0].vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT))))
359359
requires(forall(k1, 0, MLKEM_K,
360-
array_abs_bound(v[k1].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
360+
array_abs_bound(v->vec[k1].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
361361
requires(forall(k2, 0, MLKEM_K,
362-
array_abs_bound(vc[k2].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
362+
array_abs_bound(vc->vec[k2].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
363363
assigns(object_whole(out))
364364
ensures(forall(k3, 0, MLKEM_K,
365-
array_abs_bound(out[k3].coeffs, 0, MLKEM_N, INT16_MAX/2))))
365+
array_abs_bound(out->vec[k3].coeffs, 0, MLKEM_N, INT16_MAX/2))))
366366
{
367367
unsigned i;
368368
for (i = 0; i < MLKEM_K; i++)
369369
__loop__(
370370
assigns(i, object_whole(out))
371371
invariant(i <= MLKEM_K)
372372
invariant(forall(k, 0, i,
373-
array_abs_bound(out[k].coeffs, 0, MLKEM_N, INT16_MAX/2)))
373+
array_abs_bound(out->vec[k].coeffs, 0, MLKEM_N, INT16_MAX/2)))
374374
)
375375
{
376376
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
@@ -158,9 +158,9 @@ __contract__(
158158
requires(forall(k1, 0, MLKEM_K,
159159
array_bound(a->vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT)))
160160
requires(forall(k2, 0, MLKEM_K,
161-
array_abs_bound(b[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
161+
array_abs_bound(b->vec[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
162162
requires(forall(k3, 0, MLKEM_K,
163-
array_abs_bound(b_cache[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
163+
array_abs_bound(b_cache->vec[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
164164
assigns(memory_slice(r, sizeof(mlk_poly)))
165165
ensures(array_abs_bound(r->coeffs, 0, MLKEM_N, INT16_MAX/2))
166166
)

mlkem/src/poly_k.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ __contract__(
407407
requires(forall(k1, 0, MLKEM_K,
408408
array_bound(a->vec[k1].coeffs, 0, MLKEM_N, 0, MLKEM_UINT12_LIMIT)))
409409
requires(forall(k2, 0, MLKEM_K,
410-
array_abs_bound(b[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
410+
array_abs_bound(b->vec[k2].coeffs, 0, MLKEM_N, MLK_NTT_BOUND)))
411411
requires(forall(k3, 0, MLKEM_K,
412-
array_abs_bound(b_cache[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
412+
array_abs_bound(b_cache->vec[k3].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
413413
assigns(memory_slice(r, sizeof(mlk_poly)))
414414
ensures(array_abs_bound(r->coeffs, 0, MLKEM_N, INT16_MAX/2))
415415
);
@@ -452,7 +452,7 @@ __contract__(
452452
requires(memory_no_alias(a, sizeof(mlk_polyvec)))
453453
assigns(memory_slice(x, sizeof(mlk_polyvec_mulcache)))
454454
ensures(forall(k0, 0, MLKEM_K,
455-
array_abs_bound(x[k0].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
455+
array_abs_bound(x->vec[k0].coeffs, 0, MLKEM_N/2, MLKEM_Q)))
456456
);
457457

458458
#define mlk_polyvec_reduce MLK_NAMESPACE_K(polyvec_reduce)

0 commit comments

Comments
 (0)