Skip to content

Commit 71a40c9

Browse files
committed
HOL-Light: Move notes on specification matching CBMC to actual spec
Signed-off-by: Matthias J. Kannwischer <[email protected]>
1 parent b14e6f0 commit 71a40c9

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

proofs/hol_light/arm/proofs/mlkem_intt.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ let intt_constants = define
482482
(* Correctness proof. *)
483483
(* ------------------------------------------------------------------------- *)
484484

485-
(* NOTE: This must be kept in sync with the CBMC specification
486-
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
487485

488486
let MLKEM_INTT_CORRECT = prove
489487
(`!a z_12345 z_67 x pc.
@@ -578,6 +576,9 @@ let MLKEM_INTT_CORRECT = prove
578576

579577
(*** Subroutine form, somewhat messy elaboration of the usual wrapper ***)
580578

579+
(* NOTE: This must be kept in sync with the CBMC specification
580+
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
581+
581582
let MLKEM_INTT_SUBROUTINE_CORRECT = prove
582583
(`!a z_12345 z_67 x pc stackpointer returnaddress.
583584
aligned 16 stackpointer /\

proofs/hol_light/arm/proofs/mlkem_ntt.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ let ntt_constants = define
357357
(* Correctness proof. *)
358358
(* ------------------------------------------------------------------------- *)
359359

360-
(* NOTE: This must be kept in sync with the CBMC specification
361-
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
362-
363360
let MLKEM_NTT_CORRECT = prove
364361
(`!a z_12345 z_67 x pc.
365362
ALL (nonoverlapping (a,512))
@@ -459,6 +456,9 @@ let MLKEM_NTT_CORRECT = prove
459456

460457
(*** Subroutine form, somewhat messy elaboration of the usual wrapper ***)
461458

459+
(* NOTE: This must be kept in sync with the CBMC specification
460+
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
461+
462462
let MLKEM_NTT_SUBROUTINE_CORRECT = prove
463463
(`!a z_12345 z_67 x pc stackpointer returnaddress.
464464
aligned 16 stackpointer /\

proofs/hol_light/arm/proofs/mlkem_poly_reduce.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ let overall_lemma = prove
118118
REWRITE_TAC[MATCH_MP lemma_rem (CONGBOUND_RULE `barred x`)] THEN
119119
BITBLAST_TAC);;
120120

121-
(* NOTE: This must be kept in sync with the CBMC specification
122-
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
123-
124121
let MLKEM_POLY_REDUCE_CORRECT = prove
125122
(`!a x pc.
126123
nonoverlapping (word pc,0x124) (a,512)
@@ -183,6 +180,9 @@ let MLKEM_POLY_REDUCE_CORRECT = prove
183180
ASM_REWRITE_TAC[WORD_ADD_0] THEN DISCARD_STATE_TAC "s276" THEN
184181
REWRITE_TAC[GSYM barred; overall_lemma]);;
185182

183+
(* NOTE: This must be kept in sync with the CBMC specification
184+
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
185+
186186
let MLKEM_POLY_REDUCE_SUBROUTINE_CORRECT = prove
187187
(`!a x pc returnaddress.
188188
nonoverlapping (word pc,0x124) (a,512)

proofs/hol_light/arm/proofs/mlkem_poly_tobytes.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ let lemma =
168168
CONV_RULE(EXPAND_CASES_CONV THENC
169169
DEPTH_CONV (NUM_RED_CONV ORELSEC EL_CONV)) th';;
170170

171-
(* NOTE: This must be kept in sync with the CBMC specification
172-
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
173-
174171
let MLKEM_POLY_TOBYTES_CORRECT = prove
175172
(`!r a (l:int16 list) pc.
176173
ALL (nonoverlapping (r,384)) [(word pc,0x158); (a,512)]
@@ -247,6 +244,9 @@ let MLKEM_POLY_TOBYTES_CORRECT = prove
247244
REWRITE_TAC[GSYM REAL_OF_NUM_CLAUSES] THEN
248245
ABBREV_TAC `twae = &2:real` THEN REAL_ARITH_TAC);;
249246

247+
(* NOTE: This must be kept in sync with the CBMC specification
248+
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
249+
250250
let MLKEM_POLY_TOBYTES_SUBROUTINE_CORRECT = prove
251251
(`!r a (l:int16 list) pc returnaddress.
252252
ALL (nonoverlapping (r,384)) [(word pc,0x158); (a,512)]

proofs/hol_light/arm/proofs/mlkem_rej_uniform.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,6 @@ let DIMINDEX_384 = DIMINDEX_CONV `dimindex(:384)`;;
455455
(* Now the actual proof. *)
456456
(* ------------------------------------------------------------------------- *)
457457

458-
(* NOTE: This must be kept in sync with the CBMC specification
459-
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
460-
461458
let MLKEM_REJ_UNIFORM_CORRECT = prove
462459
(`!res buf buflen table (inlist:(12 word)list) pc stackpointer.
463460
24 divides val buflen /\
@@ -1604,6 +1601,9 @@ let MLKEM_REJ_UNIFORM_CORRECT = prove
16041601
SUBST1_TAC(SYM(ASSUME `curlen + len0:num = curlen1`)) THEN
16051602
CONV_TAC WORD_RULE);;
16061603

1604+
(* NOTE: This must be kept in sync with the CBMC specification
1605+
* in mlkem/native/aarch64/src/arith_native_aarch64.h *)
1606+
16071607
let MLKEM_REJ_UNIFORM_SUBROUTINE_CORRECT = prove
16081608
(`!res buf buflen table (inlist:(12 word)list) pc stackpointer returnaddress.
16091609
24 divides val buflen /\

0 commit comments

Comments
 (0)