Skip to content

proof: extract a single pattern to start#167

Merged
cfm merged 14 commits intofreedomofpress:one-crab-to-rule-them-allfrom
cfm:one-crab-to-rule-them-all
Feb 27, 2026
Merged

proof: extract a single pattern to start#167
cfm merged 14 commits intofreedomofpress:one-crab-to-rule-them-allfrom
cfm:one-crab-to-rule-them-all

Conversation

@cfm
Copy link
Member

@cfm cfm commented Feb 14, 2026

#131 demonstrated how to integrate hax into our CI for extraction (by hax) and proof (in F*).

Closes #154 by demonstrating how to use hax and F* to prove some property about some function implemented in #164. Per #164 (comment), securedrop_protocol_minimal::primitives::*::typed() seemed to be the lowest-hanging fruit.

At a high level:

securedrop-protocol/securedrop-protocol/protocol-minimal
├── Cargo.toml                                                # hax and libcrux crates updated and pinned
├── Makefile                                                  # "make hax" extracts, type-checks, and checks proofs
├── proofs
│   └── fstar
│       ├── extraction
│       │   ├── hax.fst.config.json
│       │   ├── Makefile
│       │   └── Securedrop_protocol_minimal.Primitives.*.fst  # extracted from securedrop_protocol_minimal::primitives::*::typed() [1]
│       └── libcrux-models                                    # axiom stubs for unverified crates (generated by Claude)
│           ├── Anyhow.Error.fsti
│           ├── Anyhow.fsti
│           └── Libcrux_kem.fsti
├── src
│   ├── api.rs
│   ├── encrypt_decrypt.rs
│   ├── keys
│   │   └── newsroom.rs
│   ├── keys.rs
│   ├── lib.rs
│   ├── messages
│   │   ├── core.rs
│   │   └── setup.rs
│   ├── messages.rs
│   ├── primitives                                             # see preconditions on *::typed()
│   │   ├── dh_akem.rs
│   │   ├── mlkem.rs
│   │   ├── pad.rs
│   │   ├── x25519.rs
│   │   └── xwing.rs
│   ├── primitives.rs
│   ├── server.rs
│   ├── setup.rs
│   ├── sign.rs
│   ├── storage.rs
│   └── types.rs
└── tests
    ├── core.rs
    └── setup.rs

Notes:

  1. Committed here for demonstration. In CI these will likely be cleared and extracted fresh on every run, because they should always extract and prove successfully from the Rust source.

@cfm cfm self-assigned this Feb 14, 2026
@cfm cfm added this to SecureDrop Feb 14, 2026
@cfm cfm moved this to In Progress in SecureDrop Feb 14, 2026
@cfm cfm mentioned this pull request Feb 14, 2026
4 tasks
@cfm cfm force-pushed the one-crab-to-rule-them-all branch from c7086a7 to 6683259 Compare February 23, 2026 23:14
@cfm cfm force-pushed the one-crab-to-rule-them-all branch from 197814b to 610388f Compare February 27, 2026 03:04
…()'s assumed postconditions and typed's preconditions
@cfm cfm force-pushed the one-crab-to-rule-them-all branch from 610388f to bcf4e1e Compare February 27, 2026 03:10
@cfm cfm moved this from In Progress to Ready For Review in SecureDrop Feb 27, 2026
@cfm cfm removed their assignment Feb 27, 2026
@cfm cfm marked this pull request as ready for review February 27, 2026 03:36
@cfm cfm requested review from a team as code owners February 27, 2026 03:36
@cfm cfm requested a review from redshiftzero February 27, 2026 03:36
@cfm cfm changed the title proof: extract a single function to start proof: extract a single pattern to start Feb 27, 2026
Comment on lines +12 to +22
# crypto stack, pinned to cryspen/libcrux#1312
libcrux-ed25519 = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f", features = ["rand"] }
libcrux-curve25519 = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f" }
libcrux-chacha20poly1305 = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f" }
libcrux-traits = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f" }
libcrux-kem = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f" }
libcrux-ml-kem = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f" }
libcrux-sha2 = { git = "https://github.com/cryspen/libcrux", rev = "c1e75990cbcf1bf476199fb1367df680c6de570f" }

# fork of cryspen/hpke-rs, transitively pinned to cryspen/libcrux#1312
hpke-rs = { git = "https://github.com/cfm/hpke-rs", rev = "9325551537d642d308edc60f3b271742b3a25b00", features = ["libcrux"] }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cryspen/libcrux#1312 has been merged, so we can revert to specifying a version for these crates once they're released in versions that include it.

Copy link
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I see the wasm build is failing and didn't investigate but good to merge once that's addressed

@cfm cfm moved this from Ready For Review to Under Review in SecureDrop Feb 27, 2026
@cfm
Copy link
Member Author

cfm commented Feb 27, 2026

Thanks, @redshiftzero. That's fixed in c7d4a41.

@cfm cfm merged commit 1e87d2e into freedomofpress:one-crab-to-rule-them-all Feb 27, 2026
8 checks passed
@github-project-automation github-project-automation bot moved this from Under Review to Done in SecureDrop Feb 27, 2026
@cfm cfm mentioned this pull request Feb 27, 2026
2 tasks
@nathandyer nathandyer removed this from SecureDrop Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants