Skip to content

Commit 22a71a4

Browse files
committed
Update to use the official Verus repo
1 parent b7068e4 commit 22a71a4

33 files changed

Lines changed: 146 additions & 125 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,36 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
build:
13+
verified-build:
1414
runs-on: ubuntu-latest
1515

1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
1919
with:
2020
submodules: true
21-
- name: Build Debug
22-
run: source tools/activate.sh && vargo build
23-
- name: Build Release
24-
run: source tools/activate.sh && vargo build --release
21+
- name: Build debug
22+
run: source tools/activate.sh && cargo verus build
23+
- name: Build debug with tracing
24+
run: source tools/activate.sh && cargo verus build --features trace
25+
- name: Build release
26+
run: source tools/activate.sh && cargo verus build --release
27+
- name: Build release with aws-lc feature
28+
run: source tools/activate.sh && cargo verus build --release --features aws-lc
2529
- name: Test
26-
run: source tools/activate.sh && vargo test --workspace
30+
run: source tools/activate.sh && cargo test --workspace
31+
32+
unverified-build:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
submodules: true
40+
- name: Build debug
41+
run: cargo build
42+
- name: Build release
43+
run: cargo build --release
44+
- name: Build release with aws-lc feature
45+
run: cargo build --release --features aws-lc

‎.gitmodules‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "deps/verus"]
22
path = deps/verus
3-
url = https://github.com/zhengyao-lin/verus.git
3+
url = https://github.com/verus-lang/verus.git
44
branch = x509
55
[submodule "deps/libcrux"]
66
path = deps/libcrux

‎README.md‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,25 @@ To build, first run (Bash or Zsh)
1818
```
1919
. tools/activate.sh
2020
```
21-
This will first compile a vendored version of Verus, and then
22-
provide a command `vargo` with the same usage as `cargo`.
21+
This will first compile a vendored version of Verus and add relevant binaries to `PATH`.
2322

2423
To verify and build the entire project, run
2524
```
26-
vargo build --release
25+
cargo verus build --release
2726
```
2827
Then use `target/release/verdict` to validate certificate chains or run benchmarks.
2928
See `target/release/verdict --help` for details.
3029

31-
By default, we only use crypto primitives that are verified from [libcrux](https://github.com/cryspen/libcrux) and [aws-lc-rs](https://github.com/aws/aws-lc-rs).
30+
By default, we only use *verified* crypto primitives from [libcrux](https://github.com/cryspen/libcrux) and [aws-lc-rs](https://github.com/aws/aws-lc-rs).
3231
To use primitives entirely from `aws-lc-rs` which might have better performance but include unverified signature checking for RSA and ECDSA P-256,
3332
compile with
3433
```
35-
vargo build --release --features aws-lc
34+
cargo verus build --release --features aws-lc
3635
```
3736

3837
To run some sanity checks
3938
```
40-
vargo test --workspace
39+
cargo test --workspace
4140
```
4241

4342
### Build without verification
@@ -56,7 +55,7 @@ which should work like in a normal Rust package, with all verification annotatio
5655

5756
Use
5857
```
59-
RUSTFLAGS="--cfg trace" vargo build [--release]
58+
cargo verus build [--release] --features trace
6059
```
6160
to build a version with tracing enabled.
6261
This will print out every successfully parsed construct and the result of each predicate in the policy DSL.

‎deps/verus‎

Submodule verus updated 552 files

‎deps/vest/src/regular/repeat.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ impl<C: Combinator> Repeat<C> where
202202
},
203203
offset < s@.len() ==>
204204
(self@.spec_parse(s@.subrange(offset as int, s@.len() as int)) is Err ==> self@.spec_parse(s@) is Err),
205+
decreases s.len() - offset
205206
{
206207
let (n, v) = self.0.parse(slice_subrange(s, offset, s.len()))?;
207208
if n == 0 {
@@ -240,6 +241,7 @@ impl<C: Combinator> Repeat<C> where
240241
&&& self@.spec_serialize(old(v)@) matches Ok(s) ==> n == (len + s.len()) && data@
241242
=~= seq_splice(old(data)@, (pos + len) as usize, s)
242243
},
244+
decreases old(v)@.len()
243245
{
244246
if pos > usize::MAX - len || pos + len >= data.len() {
245247
return Err(SerializeError::InsufficientBuffer);

‎deps/vest/src/utils.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ pub fn set_range<'a>(data: &mut Vec<u8>, i: usize, input: &[u8])
194194
forall|k| i + input@.len() <= k < data@.len() ==> data@[k] == old(data)@[k],
195195
0 <= i <= i + j <= i + input@.len() <= data@.len() <= usize::MAX,
196196
forall|k| 0 <= k < j ==> data@[i + k] == input@[k],
197+
decreases input.len() - j
197198
{
198199
data.set(i + j, *slice_index_get(input, j));
199200
j = j + 1
@@ -249,6 +250,7 @@ pub exec fn init_vec_u8(n: usize) -> (res: Vec<u8>)
249250
invariant
250251
0 <= i <= n,
251252
ret@.len() == i,
253+
decreases n - i
252254
{
253255
ret.push(0);
254256
assert(ret@[i as int] == 0);

‎rust-toolchain.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.82.0"
2+
channel = "1.86.0"

‎tools/activate.sh‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# Usage: source this script at the root of the repo
22

3-
# Similar to how Verus's internal vargo would work
4-
# https://github.com/verus-lang/verus/blob/main/tools/activate
5-
6-
unset -f cargo 2>/dev/null || true
7-
unset -f vargo 2>/dev/null || true
8-
93
REPO_ROOT=$(pwd)
10-
REAL_CARGO="$(which cargo)"
114

125
git submodule update --init
136

@@ -18,16 +11,4 @@ rustup toolchain install &&
1811
source ../tools/activate &&
1912
vargo build --release) || return 1
2013

21-
# Build verusc
22-
(cd "tools/verusc" && cargo build --release) || return 1
23-
24-
vargo() {
25-
RUSTC_WRAPPER="$REPO_ROOT/tools/verusc/target/release/verusc" "$REAL_CARGO" "$@"
26-
}
27-
28-
cargo() {
29-
echo You have activated the build environment of Verus, so it is likely that
30-
echo you want to use \`vargo\` instead of \`cargo\`. Restart the shell to disable.
31-
}
32-
3314
export PATH="$REPO_ROOT/deps/verus/source/target-verus/release:$PATH"

‎verdict-bin/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ rand = "0.8.5"
2424
[features]
2525
default = []
2626
aws-lc = ["verdict/aws-lc"]
27+
trace = ["verdict/trace"]

‎verdict-parser/Cargo.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ der = { version = "0.7.9", features = [ "alloc", "oid" ] }
1414
base64 = "0.22.1"
1515
paste = "1.0.15"
1616

17+
[features]
18+
default = []
19+
trace = []
20+
1721
[package.metadata.verus]
1822
verify = true
1923

0 commit comments

Comments
 (0)