Skip to content

Commit b216f5d

Browse files
committed
Add "Proof Guide" document following review in PR 246
This PR add a guide to proof using CBMC for the mlkem-native project in cbmc/proofs/proof_guide.md The document contains: * Onboarding and installation guide for CBMC * Common proof "patterns" * Advice on writing loop invariants and contracts * A step-by-step guide to producing a new proof of a C function * A worked example of the above process. Signed-off-by: Rod Chapman <[email protected]>
1 parent 1bbf687 commit b216f5d

File tree

3 files changed

+464
-4
lines changed

3 files changed

+464
-4
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ ENVIRONMENT OR TO PROTECT ANY SENSITIVE DATA.** Once we have the first stable ve
3232

3333
#### Verification
3434

35-
Mostly TODO. We apply CBMC to verify the absence of UB in a few basic C routines, but the bulk of the C verification
35+
Mostly TODO. We apply [CBMC](https://github.com/diffblue/cbmc) to verify type-safety and the absence of
36+
UB in a few basic C routines, but the bulk of the C verification
3637
is outstanding. No formal verification has yet been applied to the backends.
3738

39+
See the [Proof README](cbmc/proofs/README.md) and [Proof Guide](cbmc/proofs/proof_guide.md) for more details.
40+
3841
### Getting started
3942

4043
### Nix setup

cbmc/proofs/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ of certain classes of undefined behaviour for parts of the C-code in mlkem-nativ
1111
Proofs are organized by functions, with the harnesses and proofs for each function
1212
in a separate directory.
1313

14-
TODO: Provide more information about CBMC and the properties it proves
14+
See the [Proof Guide](proof_guide.md) for a walkthrough of how to use CBMC and
15+
develop new proofs.
1516

1617
# Usage
1718

@@ -26,6 +27,10 @@ If `GITHUB_STEP_SUMMARY` is set, the proof summary will be appended to it.
2627

2728
# Covered functions
2829

29-
The following functions are currently covered:
30+
Each proved function has an eponymous sub-directory of its own. The shell command
3031

31-
- `poly.c`: `poly_compress`
32+
```
33+
find . -name cbmc-proof.txt
34+
```
35+
36+
yields a list of the subdirectories, and thus function names, that have a proof.

0 commit comments

Comments
 (0)