Commit 0e9c732
CBMC: Don't declare arrays in harnesses
When CBMC checks a function contract, it seems that the preconditions
set out in the contract are overlayed by the context set out in the
harness. For example, if a function takes a pointer to `foo`, and the
harness passes `&f` for `foo f`, then the function would never be
evaluated for the possibility of an invalid pointer being passed.
For that reason, harnesses must be as minimal as possible, merely
declaring uninitialized variables of the expected type and calling
the function under proof.
This commit fixes a few instances in mlkem-native where this was
not yet the case.
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>1 parent 5112f49 commit 0e9c732
File tree
2 files changed
+3
-3
lines changed- proofs/cbmc
- poly_permute_bitrev_to_custom
- poly_rej_uniform_x4
2 files changed
+3
-3
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
0 commit comments