Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
640 commits
Select commit Hold shift + click to select a range
cf5bfed
Remove unneeded invariants
TheodoreEhrenborg Jul 31, 2025
42237f8
Clean the lemmas Claude added
TheodoreEhrenborg Jul 31, 2025
b3fa526
Remove line
TheodoreEhrenborg Jul 31, 2025
576220e
Insert spaces
TheodoreEhrenborg Jul 31, 2025
efe8de9
Format
TheodoreEhrenborg Jul 31, 2025
22d6728
Reduce diff
TheodoreEhrenborg Jul 31, 2025
b1115fe
Fix cargo check
TheodoreEhrenborg Jul 31, 2025
5ef1adb
Fix warning
TheodoreEhrenborg Jul 31, 2025
1eeca24
Fix fiat backend
TheodoreEhrenborg Jul 31, 2025
119c118
Format
TheodoreEhrenborg Jul 31, 2025
2d69fd2
2 tiny changes
astefano Aug 1, 2025
87e1993
Prove no overflow for add and sub (#30)
TheodoreEhrenborg Aug 1, 2025
17596df
Claude adds specs
TheodoreEhrenborg Aug 1, 2025
d71b687
Claude notes which specs are AI-generated
TheodoreEhrenborg Aug 1, 2025
2e1f58c
Update pin to fix CI
TheodoreEhrenborg Aug 1, 2025
4dc0aa9
Attempt to fix CI
TheodoreEhrenborg Aug 1, 2025
3d96095
Ask Claude to make spec more precise
TheodoreEhrenborg Aug 1, 2025
efcddb3
Probably fix this spec
TheodoreEhrenborg Aug 1, 2025
41b079f
Approve this spec
TheodoreEhrenborg Aug 1, 2025
589f4e8
I'm suspicious of this bit
TheodoreEhrenborg Aug 1, 2025
8efe767
The spec for helper functions depends on the proof
TheodoreEhrenborg Aug 1, 2025
f728bc5
Claude tightens the specs
TheodoreEhrenborg Aug 1, 2025
fa70874
Claude refactors
TheodoreEhrenborg Aug 1, 2025
aab1cfb
Approve these specs
TheodoreEhrenborg Aug 1, 2025
da914d9
Fix CI ahead of time
TheodoreEhrenborg Aug 1, 2025
7752f1f
Need to fix CI anyway
TheodoreEhrenborg Aug 1, 2025
c0c0c5c
Add specs to u64/scalar.rs (#31)
TheodoreEhrenborg Aug 1, 2025
e69a4f7
Claude does some proofs
TheodoreEhrenborg Aug 1, 2025
e9bbcd6
Claude moves proofs into lemmas
TheodoreEhrenborg Aug 1, 2025
874fe9f
Claude proves square, but leaves in assumes
TheodoreEhrenborg Aug 1, 2025
e9c7b86
Claude refuses to fix the assumes
TheodoreEhrenborg Aug 1, 2025
e1958f6
Shorten Claude's assumes into one assume
TheodoreEhrenborg Aug 1, 2025
7634150
Run verus cleaner
TheodoreEhrenborg Aug 1, 2025
49977eb
Hence remove unneeded lemmas
TheodoreEhrenborg Aug 1, 2025
6b11e03
Accept the automatic triggers
TheodoreEhrenborg Aug 1, 2025
35807d7
Reduce diff
TheodoreEhrenborg Aug 1, 2025
87b786d
Reduce diff again
TheodoreEhrenborg Aug 1, 2025
08fcebe
Remove comment
TheodoreEhrenborg Aug 1, 2025
a4742a0
Remove unused lemma
TheodoreEhrenborg Aug 1, 2025
8ea7565
Reformat for verus_cleaner
TheodoreEhrenborg Aug 1, 2025
22448a4
Remove unneeded parts of lemmas
TheodoreEhrenborg Aug 1, 2025
72c72da
Add comment
TheodoreEhrenborg Aug 1, 2025
59ca9e0
Format
TheodoreEhrenborg Aug 1, 2025
1e09603
More formatting
TheodoreEhrenborg Aug 1, 2025
713984a
Format
TheodoreEhrenborg Aug 1, 2025
c396de1
Prove 3 easy montgomery functions (#32)
TheodoreEhrenborg Aug 1, 2025
6bbac4d
try workflow
astefano Aug 3, 2025
a7e1619
Update scripts/README.md
astefano Aug 4, 2025
a53b096
address comments from copilot
astefano Aug 4, 2025
1276e53
bump verus to 08.01.33c6cec
astefano Aug 4, 2025
9c3832f
bump verus to 08.01.33c6cec (#34)
astefano Aug 4, 2025
6f58cdc
90%
Kukovec Aug 4, 2025
817cb31
pow2k
Kukovec Aug 4, 2025
a533ef2
lemma_u128_low_bits_mask_is_mod workaround
Kukovec Aug 4, 2025
96980f9
modified placeholder
Kukovec Aug 4, 2025
e4f986d
Proof that `pow2k` returns the correct value (#35)
Kukovec Aug 5, 2025
b28b191
pow2k corollaries
Kukovec Aug 5, 2025
4acc9ab
Add a github workflow to generate graphs for newly verified functions…
astefano Aug 6, 2025
53c0db0
Replace with another proof
TheodoreEhrenborg Aug 6, 2025
a233338
And get it working
TheodoreEhrenborg Aug 6, 2025
46527c6
Apply verus cleaner
TheodoreEhrenborg Aug 6, 2025
d07e3e1
Reduce diff
TheodoreEhrenborg Aug 6, 2025
8925f5d
Reduce diff again
TheodoreEhrenborg Aug 6, 2025
061c005
Fix hanging proof on Linux (#37)
TheodoreEhrenborg Aug 6, 2025
84ec155
`pow2k` corollaries (#36)
Kukovec Aug 7, 2025
a132cdb
repair
astefano Aug 7, 2025
e6eba84
artificial change in scalar
astefano Aug 7, 2025
efc6a60
try to display png directly in the comment
astefano Aug 7, 2025
801a994
remove the display of graphs in the PR, the pngs are too big
astefano Aug 8, 2025
fd8e5d4
remove PR comment step
astefano Aug 8, 2025
f46cb70
fix to capture new functions again
astefano Aug 8, 2025
34767b7
undo artificial change
astefano Aug 8, 2025
de2f6c8
La/repair graph workflow (#41)
astefano Aug 8, 2025
4f72e37
as_nat_squared groupings
Kukovec Aug 8, 2025
1c87cbf
as_nat_squared all
Kukovec Aug 8, 2025
ad44c8c
all bcasts in field_lemmas
Kukovec Aug 8, 2025
ec6d1e3
all bcast from vstd in common_verus
Kukovec Aug 8, 2025
baef1d1
neg
Kukovec Aug 10, 2025
b5f85a9
field_verus
Kukovec Aug 10, 2025
1e39b83
Removes `broadcast use` lemmas in `field_verus` and dependencies (#43)
Kukovec Aug 11, 2025
6d6138b
pow2k lemma factorization
Kukovec Aug 6, 2025
2559aee
minor cosmetic tweaks
Kukovec Aug 11, 2025
506f8ae
Factoring out data boundaries in `pow2k` (#40)
Kukovec Aug 11, 2025
9942fc2
Fixes SMT seed for cargo-verus GH actions
Kukovec Aug 11, 2025
74999ce
Fixes SMT seed for cargo-verus GH actions (#45)
Kukovec Aug 11, 2025
fe7a70c
Add to the spec
TheodoreEhrenborg Aug 9, 2025
7f2eac5
Make some asserts with correct syntax
TheodoreEhrenborg Aug 9, 2025
ede60fb
Remove unneeded code
TheodoreEhrenborg Aug 9, 2025
d75c942
Put in invariant and prove it's initially true
TheodoreEhrenborg Aug 9, 2025
d9bf793
Claude adds helpful lemma
TheodoreEhrenborg Aug 9, 2025
cea8650
Remove comments
TheodoreEhrenborg Aug 9, 2025
1292443
Claude adds a calc statement
TheodoreEhrenborg Aug 9, 2025
226f417
Fix syntax
TheodoreEhrenborg Aug 9, 2025
824c76c
Put in a bunch of assumes
TheodoreEhrenborg Aug 9, 2025
9dccb0e
Add asserts after the loop
TheodoreEhrenborg Aug 9, 2025
731d328
Some work on 2nd loop
TheodoreEhrenborg Aug 9, 2025
0d057e9
Claude updates subtle_assumes.rs
TheodoreEhrenborg Aug 9, 2025
a409fc5
Change variable names
TheodoreEhrenborg Aug 9, 2025
e61cdd3
IMPORTANT: Fix assumption that was wrong on main
TheodoreEhrenborg Aug 9, 2025
734329e
Hence fix up scalar.rs
TheodoreEhrenborg Aug 9, 2025
ffe9fac
Continue pushing easy case of loop 2
TheodoreEhrenborg Aug 9, 2025
589c87d
Continue easy part of loop 2
TheodoreEhrenborg Aug 9, 2025
e0fe40f
Clean a bit
TheodoreEhrenborg Aug 9, 2025
c203a81
Prove 2nd loop in easy case is a no-op
TheodoreEhrenborg Aug 9, 2025
fbb93fd
Almost done with case 1, and simplify spec
TheodoreEhrenborg Aug 9, 2025
fc1c61c
Use mod property and hence prove easy case
TheodoreEhrenborg Aug 9, 2025
dd2697c
Claude adds an invariant
TheodoreEhrenborg Aug 9, 2025
8fa7799
Claude writes an invariant
TheodoreEhrenborg Aug 9, 2025
dd6d82f
Remove dead code
TheodoreEhrenborg Aug 9, 2025
557e9cf
Simplify structure
TheodoreEhrenborg Aug 9, 2025
6586119
Prove invariant is true on entry
TheodoreEhrenborg Aug 9, 2025
6c0aed2
Prove invariant holds, up to assumes
TheodoreEhrenborg Aug 9, 2025
5a73321
Fix an easy assume
TheodoreEhrenborg Aug 9, 2025
a7c5cda
Start proving invariant
TheodoreEhrenborg Aug 9, 2025
f033d53
Another step
TheodoreEhrenborg Aug 9, 2025
141388d
Push another step
TheodoreEhrenborg Aug 9, 2025
15c9087
Push another step
TheodoreEhrenborg Aug 9, 2025
2d6126a
Claude adds 2 steps and I mostly fix it up
TheodoreEhrenborg Aug 9, 2025
7e7a24c
Reduce to a property of pow2
TheodoreEhrenborg Aug 9, 2025
4b6f0c2
Remove that assume
TheodoreEhrenborg Aug 9, 2025
2ffb7b5
Add assert after 2nd loop
TheodoreEhrenborg Aug 9, 2025
e52f2e6
Improve variable name
TheodoreEhrenborg Aug 9, 2025
e12f9c8
Add comment
TheodoreEhrenborg Aug 9, 2025
b419698
Add more asserts after 2nd loop
TheodoreEhrenborg Aug 9, 2025
9219b23
Mostly prove carry >> 52 == 1
TheodoreEhrenborg Aug 9, 2025
8cfd57a
Remove assume
TheodoreEhrenborg Aug 9, 2025
d85fd1e
Pull out common part of proof
TheodoreEhrenborg Aug 9, 2025
f125c7f
Assert nearly the goal
TheodoreEhrenborg Aug 9, 2025
cf0ebea
Try to reach final goal, but hangs
TheodoreEhrenborg Aug 9, 2025
9ea42a5
Move hanging bit to lemma
TheodoreEhrenborg Aug 9, 2025
5f53876
Prove lemma
TheodoreEhrenborg Aug 9, 2025
37f6fe0
Format
TheodoreEhrenborg Aug 9, 2025
b6d8986
Claude refactors, revealing a non-obvious part
TheodoreEhrenborg Aug 9, 2025
d81a76e
Make non-obvious assumption clearer
TheodoreEhrenborg Aug 9, 2025
8cb27dd
Reduce to simpler assertion
TheodoreEhrenborg Aug 9, 2025
8016706
Factor out into lemma
TheodoreEhrenborg Aug 9, 2025
f537584
Start proving lemma with more general case
TheodoreEhrenborg Aug 9, 2025
50087ae
Claude writes a proof with some assumes
TheodoreEhrenborg Aug 9, 2025
69d037f
On second thought, use Seq<u64>
TheodoreEhrenborg Aug 9, 2025
836be91
Claude finishes the lemma without assumes
TheodoreEhrenborg Aug 10, 2025
264b4cd
Clean up proof a little
TheodoreEhrenborg Aug 10, 2025
90d864b
Fix an assume
TheodoreEhrenborg Aug 10, 2025
e5bc3e7
Remove another assume
TheodoreEhrenborg Aug 10, 2025
7e7c9d1
Start work on last assume in loop 1
TheodoreEhrenborg Aug 10, 2025
eab2a53
Add defn of wrapping_sub
TheodoreEhrenborg Aug 10, 2025
27d765d
Simplify a little bit
TheodoreEhrenborg Aug 10, 2025
6b04a2a
Expand expression
TheodoreEhrenborg Aug 10, 2025
6e28b6d
Remove forall
TheodoreEhrenborg Aug 10, 2025
854cf1c
Rewrite assert as two asserts
TheodoreEhrenborg Aug 10, 2025
cd5f285
Figure out what `assume` is needed for easy case
TheodoreEhrenborg Aug 10, 2025
4a27f20
Prove bound on borrow
TheodoreEhrenborg Aug 10, 2025
1cc1685
Claude removes some assumes
TheodoreEhrenborg Aug 10, 2025
58e5204
Reduce assume to easier assumes
TheodoreEhrenborg Aug 10, 2025
9485942
Do some computations
TheodoreEhrenborg Aug 10, 2025
6381b2e
Reduce diff
TheodoreEhrenborg Aug 10, 2025
62f7d2c
Add skeleton proof for trickier part
TheodoreEhrenborg Aug 10, 2025
2f9efe1
Replace an assume with an easier one
TheodoreEhrenborg Aug 10, 2025
8227806
Make assumption about borrow's value
TheodoreEhrenborg Aug 10, 2025
b5ee959
Get the algebra working
TheodoreEhrenborg Aug 10, 2025
d89bed9
Remove step
TheodoreEhrenborg Aug 10, 2025
110cf9d
Remove another step
TheodoreEhrenborg Aug 10, 2025
ecf01d0
Hence remove assume(false)
TheodoreEhrenborg Aug 10, 2025
0b1ba17
Prove that borrow is large enough
TheodoreEhrenborg Aug 10, 2025
a01fbdb
Hence remove assume
TheodoreEhrenborg Aug 10, 2025
e5d4e09
Remove another assume
TheodoreEhrenborg Aug 10, 2025
321e756
Reduce assume to easier assumes
TheodoreEhrenborg Aug 10, 2025
08b5128
Prove 2 easy assumes
TheodoreEhrenborg Aug 10, 2025
ce13ef5
Verus can prove this assume
TheodoreEhrenborg Aug 10, 2025
8c3c6a6
Factor out into lemma
TheodoreEhrenborg Aug 10, 2025
6f1a629
Claude proves a lemma
TheodoreEhrenborg Aug 10, 2025
b5d85d5
Remove redundant assert
TheodoreEhrenborg Aug 10, 2025
b47c9c7
Pull first loop invariant proof into lemma
TheodoreEhrenborg Aug 10, 2025
933dfcb
Add some preconditions to lemma
TheodoreEhrenborg Aug 10, 2025
b3ebfca
Fix up preconditions but then verus hangs
TheodoreEhrenborg Aug 10, 2025
b7abd0b
Put in assert and it stops hanging
TheodoreEhrenborg Aug 10, 2025
a607824
Add more preconditions
TheodoreEhrenborg Aug 10, 2025
87d943a
Add more assertions to part that fails
TheodoreEhrenborg Aug 10, 2025
4ef0725
Add another assert to satisfy precondition
TheodoreEhrenborg Aug 10, 2025
39beca0
Shore up the lemma with assumes
TheodoreEhrenborg Aug 10, 2025
cfe83c1
Can use lemma_decompose without rlimit problem
TheodoreEhrenborg Aug 10, 2025
38f9126
Add more asserts to fix those 2 new assumes
TheodoreEhrenborg Aug 10, 2025
3b1ae0a
Fix two assumes
TheodoreEhrenborg Aug 10, 2025
e67cb37
Fix assume
TheodoreEhrenborg Aug 10, 2025
41ab36e
Fix other assume
TheodoreEhrenborg Aug 10, 2025
bb269f3
Mostly prove lemma
TheodoreEhrenborg Aug 10, 2025
6a1f76f
Clean up asserts a little
TheodoreEhrenborg Aug 10, 2025
af7a880
Try to prove base case
TheodoreEhrenborg Aug 10, 2025
71d9cde
Claude tries to prove base case
TheodoreEhrenborg Aug 10, 2025
bc1ab78
Put in an assume to stop proof hanging
TheodoreEhrenborg Aug 10, 2025
7625da9
Some progess on why it doesn't verify
TheodoreEhrenborg Aug 10, 2025
ee31ce1
Still hanging
TheodoreEhrenborg Aug 10, 2025
f2738fa
Fix hanging by keeping one assume
TheodoreEhrenborg Aug 10, 2025
317396f
Can prove that assert in a lemma
TheodoreEhrenborg Aug 10, 2025
e46d583
Hence remove final assume
TheodoreEhrenborg Aug 10, 2025
ba9ff09
Clean up last lemma
TheodoreEhrenborg Aug 10, 2025
08190af
Change spec to be more correct
TheodoreEhrenborg Aug 10, 2025
71a82b4
Add todo
TheodoreEhrenborg Aug 10, 2025
3ab992d
Weaken spec, but I think this is what add needs
TheodoreEhrenborg Aug 10, 2025
f8766c5
`sub` verifies with essentially no more effort
TheodoreEhrenborg Aug 10, 2025
660ba72
Make `add` happy
TheodoreEhrenborg Aug 10, 2025
b5426a8
Remove unused function
TheodoreEhrenborg Aug 10, 2025
1d17065
Remove cruft
TheodoreEhrenborg Aug 10, 2025
d7d8e07
Move lemma
TheodoreEhrenborg Aug 10, 2025
38fac50
Fix up imports
TheodoreEhrenborg Aug 10, 2025
c0a74cf
Move lemmas down
TheodoreEhrenborg Aug 10, 2025
b0d028a
Format
TheodoreEhrenborg Aug 10, 2025
378cdb5
Start silencing warnings
TheodoreEhrenborg Aug 10, 2025
5efc78c
Move code to lemma
TheodoreEhrenborg Aug 10, 2025
1255d8e
Small syntax fixes
TheodoreEhrenborg Aug 10, 2025
423d620
Add some preconditions and a post-condition
TheodoreEhrenborg Aug 10, 2025
22890c0
More preconditions
TheodoreEhrenborg Aug 10, 2025
e52fd05
Lemma now verifies
TheodoreEhrenborg Aug 10, 2025
4b006bd
Remove some asserts
TheodoreEhrenborg Aug 10, 2025
7ab61f7
Combine if statements
TheodoreEhrenborg Aug 10, 2025
49446f6
Combine if statements, again
TheodoreEhrenborg Aug 10, 2025
9cb6018
Move loop 2 proof into lemma
TheodoreEhrenborg Aug 10, 2025
28f303e
Fix syntax errors
TheodoreEhrenborg Aug 10, 2025
241738c
Add postconditions to lemma
TheodoreEhrenborg Aug 10, 2025
552989a
Add preconditions to lemma
TheodoreEhrenborg Aug 10, 2025
bcc015a
More preconditions
TheodoreEhrenborg Aug 10, 2025
fc7e60b
Down to 5 errors
TheodoreEhrenborg Aug 10, 2025
401ec4c
Tell the lemma what addend is
TheodoreEhrenborg Aug 10, 2025
4379c7b
Get lemma to verify
TheodoreEhrenborg Aug 10, 2025
b834c05
Format
TheodoreEhrenborg Aug 10, 2025
3e2c80c
Remove unneeded assert
TheodoreEhrenborg Aug 10, 2025
fd4eec6
More small tweaks
TheodoreEhrenborg Aug 10, 2025
07f1765
Remove unused imports
TheodoreEhrenborg Aug 10, 2025
0ef0f3d
Remove unused parameter
TheodoreEhrenborg Aug 10, 2025
b687b10
Remove unused import
TheodoreEhrenborg Aug 10, 2025
25bc694
Rename variable
TheodoreEhrenborg Aug 10, 2025
c3f8fbd
Reduce diff
TheodoreEhrenborg Aug 10, 2025
fff73f2
Fix my typo
TheodoreEhrenborg Aug 10, 2025
8d7e9e2
Add link to subtle docs
TheodoreEhrenborg Aug 10, 2025
435f0fd
Clarify comment
TheodoreEhrenborg Aug 11, 2025
856e203
Delete unneeded assert
TheodoreEhrenborg Aug 11, 2025
0ed1f5e
Add comments
TheodoreEhrenborg Aug 11, 2025
55d56c8
Small typo
TheodoreEhrenborg Aug 11, 2025
bc45994
Prove `sub` (#44)
TheodoreEhrenborg Aug 11, 2025
8ab4e79
Restore scalar.rs and scalar_lemmas.rs from main
TheodoreEhrenborg Sep 1, 2025
a81e537
Uncomment some code and remove import
TheodoreEhrenborg Sep 1, 2025
538f7ed
rm -r scripts/
TheodoreEhrenborg Sep 1, 2025
506bf24
Remove more files
TheodoreEhrenborg Sep 1, 2025
f5c1d42
Remove field files but keep 2 lemmas
TheodoreEhrenborg Sep 1, 2025
34e387f
Remove assumes
TheodoreEhrenborg Sep 1, 2025
6080805
Bring back tests
TheodoreEhrenborg Sep 1, 2025
ccd3690
Remove comment
TheodoreEhrenborg Sep 1, 2025
253fcfd
Remove unused specs
TheodoreEhrenborg Sep 1, 2025
484d4b6
Get cargo fmt working
TheodoreEhrenborg Sep 1, 2025
8d473e5
Remove unused proof
TheodoreEhrenborg Sep 1, 2025
cfd0e38
Format
TheodoreEhrenborg Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions .github/workflows/curve25519-dalek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,6 @@ jobs:
RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"'
run: cargo test --target ${{ matrix.target }}

# Default no_std test only tests using serial across all crates
Copy link
Author

Choose a reason for hiding this comment

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

Almost all of the CI still works. The no_std tests annoyingly don't. I haven't looked into this deeply yet---I hope it's something trivial

Copy link
Author

Choose a reason for hiding this comment

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

See Beneficial-AI-Foundation#59 for an example of the CI passing

build-nostd-fiat:
name: Build fiat on no_std target (thumbv7em-none-eabi)
runs-on: ubuntu-latest
strategy:
matrix:
include:
- crate: curve25519-dalek
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: thumbv7em-none-eabi
- uses: taiki-e/install-action@cargo-hack
# No default features build
- name: no_std fiat / no feat ${{ matrix.crate }}
env:
RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"'
run: cargo build -p ${{ matrix.crate }} --target thumbv7em-none-eabi --release --no-default-features
- name: no_std fiat / cargo hack ${{ matrix.crate }}
env:
RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"'
run: cargo hack build -p ${{ matrix.crate }} --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std,getrandom

test-serial:
name: Test serial backend
Expand Down Expand Up @@ -143,3 +119,23 @@ jobs:
- run: cargo build --no-default-features --features serde
# Also make sure the AVX2 build works
- run: cargo build --target x86_64-unknown-linux-gnu

verus:
name: Run `cargo verify verus`
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/[email protected]
- name: Install Verus
run: |
wget https://github.com/verus-lang/verus/releases/download/release%2F0.2025.08.01.33c6cec/verus-0.2025.08.01.33c6cec-x86-linux.zip
unzip verus-0.2025.08.01.33c6cec-x86-linux.zip
mv verus-x86-linux ~/.cargo/bin
cd ~/.cargo/bin
ln -s verus-x86-linux/cargo-verus
- name: Run test
run: |
cargo-verus verify -- --smt-option smt.random_seed=0
Copy link
Author

Choose a reason for hiding this comment

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

Checking the proofs in CI


23 changes: 0 additions & 23 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,6 @@ jobs:
- name: Build default (host native) bench
run: cargo build --benches

# Test no_std with serial (default)
build-nostd-serial:
name: Build serial on no_std target (thumbv7em-none-eabi)
runs-on: ubuntu-latest
strategy:
matrix:
include:
- crate: curve25519-dalek
- crate: ed25519-dalek
- crate: x25519-dalek
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: thumbv7em-none-eabi
- uses: taiki-e/install-action@cargo-hack
# No default features build
- name: no_std / no feat ${{ matrix.crate }}
run: cargo build -p ${{ matrix.crate }} --target thumbv7em-none-eabi --release --no-default-features
- name: no_std / cargo hack ${{ matrix.crate }}
run: cargo hack build -p ${{ matrix.crate }} --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std,os_rng

clippy:
name: Check that clippy is happy
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ build*.txt
*.bak

*.s
.aider*
.verus-solver-log
6 changes: 6 additions & 0 deletions curve25519-dalek/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ harness = false
required-features = ["alloc", "rand_core"]

[dependencies]
vstd = { git = "https://github.com/verus-lang/verus", rev = "33c6cec7bd19818e51d2b61f629d5d2484778bed"}
verus_builtin = { git = "https://github.com/verus-lang/verus", rev = "33c6cec7bd19818e51d2b61f629d5d2484778bed"}
verus_builtin_macros = { git = "https://github.com/verus-lang/verus", rev = "33c6cec7bd19818e51d2b61f629d5d2484778bed"}
cfg-if = "1"
ff = { version = "=0.14.0-pre.0", default-features = false, optional = true }
group = { version = "=0.14.0-pre.0", default-features = false, optional = true }
Expand Down Expand Up @@ -95,3 +98,6 @@ check-cfg = [
'cfg(curve25519_dalek_bits, values("32", "64"))',
'cfg(nightly)',
]

[package.metadata.verus]
verify = true
9 changes: 9 additions & 0 deletions curve25519-dalek/src/backend/serial/fiat_u64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ pub mod field;

#[path = "../u64/constants.rs"]
pub mod constants;

#[path = "../u64/subtle_assumes.rs"]
pub mod subtle_assumes;

#[path = "../u64/scalar_lemmas.rs"]
pub mod scalar_lemmas;

#[path = "../u64/scalar_specs.rs"]
pub mod scalar_specs;
30 changes: 18 additions & 12 deletions curve25519-dalek/src/backend/serial/u32/constants.rs
Copy link
Author

Choose a reason for hiding this comment

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

There are no proofs in the u32 folder. But we had to change the types for compatibility because we got rid of tuple structs in the u64 folder

Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,31 @@ pub(crate) const MONTGOMERY_A_NEG: FieldElement2625 = FieldElement2625::from_lim

/// `L` is the order of base point, i.e. 2^252 +
/// 27742317777372353535851937790883648493
pub(crate) const L: Scalar29 = Scalar29([
0x1cf5d3ed, 0x009318d2, 0x1de73596, 0x1df3bd45, 0x0000014d, 0x00000000, 0x00000000, 0x00000000,
0x00100000,
]);
pub(crate) const L: Scalar29 = Scalar29 {
limbs: [
0x1cf5d3ed, 0x009318d2, 0x1de73596, 0x1df3bd45, 0x0000014d, 0x00000000, 0x00000000,
0x00000000, 0x00100000,
],
};

/// `L` * `LFACTOR` = -1 (mod 2^29)
pub(crate) const LFACTOR: u32 = 0x12547e1b;

/// `R` = R % L where R = 2^261
pub(crate) const R: Scalar29 = Scalar29([
0x114df9ed, 0x1a617303, 0x0f7c098c, 0x16793167, 0x1ffd656e, 0x1fffffff, 0x1fffffff, 0x1fffffff,
0x000fffff,
]);
pub(crate) const R: Scalar29 = Scalar29 {
limbs: [
0x114df9ed, 0x1a617303, 0x0f7c098c, 0x16793167, 0x1ffd656e, 0x1fffffff, 0x1fffffff,
0x1fffffff, 0x000fffff,
],
};

/// `RR` = (R^2) % L where R = 2^261
pub(crate) const RR: Scalar29 = Scalar29([
0x0b5f9d12, 0x1e141b17, 0x158d7f3d, 0x143f3757, 0x1972d781, 0x042feb7c, 0x1ceec73d, 0x1e184d1e,
0x0005046d,
]);
pub(crate) const RR: Scalar29 = Scalar29 {
limbs: [
0x0b5f9d12, 0x1e141b17, 0x158d7f3d, 0x143f3757, 0x1972d781, 0x042feb7c, 0x1ceec73d,
0x1e184d1e, 0x0005046d,
],
};

/// The Ed25519 basepoint, as an `EdwardsPoint`.
///
Expand Down
Loading