-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple risc0 version in
no-std
- Loading branch information
Showing
236 changed files
with
91,462 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[advisories] | ||
ignore = [ | ||
"RUSTSEC-2024-0388", # Just linked in test from risc0-zkvm for groth16 | ||
"RUSTSEC-2024-0370", # Just linked in test from risc0-zkvm for bonsai-sdk | ||
] | ||
informational_warnings = ["unmaintained", "unsound"] | ||
|
||
[output] | ||
deny = ["warnings", "unsound", "yanked"] | ||
quiet = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/target | ||
/Cargo.lock | ||
lcov.info | ||
lcov.info | ||
resources/cases/temp | ||
flamegraph* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
// Copyright Copyright 2024, Horizen Labs, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
fn main() { | ||
// Run registered benchmarks. | ||
divan::main(); | ||
} | ||
|
||
use risc0_verifier::{Digestible as _, VerifierContext}; | ||
|
||
use utils::*; | ||
|
||
mod utils; | ||
|
||
pub mod sha { | ||
use super::*; | ||
|
||
#[divan::bench] | ||
fn verify_1_2_0_16() { | ||
let ctx = VerifierContext::v1_2(); | ||
let case: Case = read_json("resources/cases/prover_1.2.0/vm_1.2.0/sha_16.json").unwrap(); | ||
let proof = read_bin(case.receipt_path).unwrap(); | ||
|
||
compute( | ||
divan::black_box(&ctx), | ||
divan::black_box(&proof), | ||
divan::black_box(case.vk), | ||
divan::black_box(case.journal.digest()), | ||
) | ||
} | ||
|
||
#[divan::bench] | ||
fn verify_1_2_0_22() { | ||
let ctx = VerifierContext::v1_2(); | ||
let case: Case = read_json("resources/cases/prover_1.2.0/vm_1.2.0/sha_22.json").unwrap(); | ||
let proof = read_bin(case.receipt_path).unwrap(); | ||
|
||
compute( | ||
divan::black_box(&ctx), | ||
divan::black_box(&proof), | ||
divan::black_box(case.vk), | ||
divan::black_box(case.journal.digest()), | ||
) | ||
} | ||
} | ||
|
||
pub mod poseidon2 { | ||
use super::*; | ||
|
||
#[divan::bench] | ||
fn verify_1_2_0_16() { | ||
let ctx = VerifierContext::v1_2(); | ||
let case: Case = | ||
read_json("resources/cases/prover_1.2.0/vm_1.2.0/poseidon2_16.json").unwrap(); | ||
let proof = read_bin(case.receipt_path).unwrap(); | ||
|
||
compute( | ||
divan::black_box(&ctx), | ||
divan::black_box(&proof), | ||
divan::black_box(case.vk), | ||
divan::black_box(case.journal.digest()), | ||
) | ||
} | ||
|
||
#[divan::bench] | ||
fn verify_1_2_0_22() { | ||
let ctx = VerifierContext::v1_2(); | ||
let case: Case = | ||
read_json("resources/cases/prover_1.2.0/vm_1.2.0/poseidon2_22.json").unwrap(); | ||
let proof = read_bin(case.receipt_path).unwrap(); | ||
|
||
compute( | ||
divan::black_box(&ctx), | ||
divan::black_box(&proof), | ||
divan::black_box(case.vk), | ||
divan::black_box(case.journal.digest()), | ||
) | ||
} | ||
} | ||
|
||
pub mod succinct { | ||
use super::*; | ||
|
||
#[divan::bench] | ||
fn verify_1_2_0_16() { | ||
let ctx = VerifierContext::v1_2(); | ||
let case: Case = | ||
read_json("resources/cases/prover_1.2.0/vm_1.2.0/succinct_16.json").unwrap(); | ||
let proof = read_bin(case.receipt_path).unwrap(); | ||
|
||
compute( | ||
divan::black_box(&ctx), | ||
divan::black_box(&proof), | ||
divan::black_box(case.vk), | ||
divan::black_box(case.journal.digest()), | ||
) | ||
} | ||
|
||
#[divan::bench] | ||
fn verify_1_2_0_22() { | ||
let ctx = VerifierContext::v1_2(); | ||
let case: Case = | ||
read_json("resources/cases/prover_1.2.0/vm_1.2.0/succinct_22.json").unwrap(); | ||
let proof = read_bin(case.receipt_path).unwrap(); | ||
|
||
compute( | ||
divan::black_box(&ctx), | ||
divan::black_box(&proof), | ||
divan::black_box(case.vk), | ||
divan::black_box(case.journal.digest()), | ||
) | ||
} | ||
} |
Oops, something went wrong.