Merge branch 'hash_benchmark' into composition

This commit is contained in:
Manish Kumar 2024-04-01 18:57:25 +05:30
commit 36ee10b5b0
6 changed files with 13 additions and 1733 deletions

View File

@ -14,6 +14,7 @@ ark-ff = "0.4.2"
hex = "0.4.3"
ark-serialize = "0.4"
risc0-core = { path = "../external/risc0/risc0/core" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
[profile.dev]
opt-level = 3

View File

@ -12,4 +12,4 @@ echo "HASH = $ZKBENCH_HASH_TYPE"
echo "Input Size (Bytes) = $ZKBENCH_INPUT_SIZE_BYTES"
# Run the benchmarks
./target/release/benchmark $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES
RUST_LOG=info ./target/release/benchmark $ZKBENCH_HASH_TYPE $ZKBENCH_INPUT_SIZE_BYTES

View File

@ -12,4 +12,4 @@ echo "HASH = $ZKBENCH_HASH_TYPE_TREE"
echo "Tree Depth = $ZKBENCH_TREE_DEPTH"
# Run the benchmarks
./target/release/benchmark $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH
RUST_LOG=info ./target/release/benchmark $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH

View File

@ -5,7 +5,8 @@ use benchmark_methods::{
};
use risc0_zkvm::{
ExecutorImpl,
ExecutorEnv
ExecutorEnv,
sha::Digest
};
use std::time::Instant;
use rand::Rng;
@ -60,7 +61,7 @@ pub fn poseidon2_babybear_native_bench(mt_depth: usize) {
elapsed
};
let output: Vec<u32> = receipt.journal.decode().unwrap();
let output: Box<Digest> = receipt.journal.decode().unwrap();
eprintln!("Proving Time: {:?}", proving_time);
eprintln!("Verification time: {:?}", verification_time);

View File

@ -30,6 +30,10 @@ fn main() {
let hash_type = &args[1];
let size = args[2].parse::<usize>().unwrap();
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env())
.init();
match hash_type.as_str() {
"sha256" => {