mirror of
https://github.com/logos-storage/zk-benchmarks.git
synced 2026-01-15 04:03:09 +00:00
readme and cfg files added
This commit is contained in:
parent
5927557f08
commit
4335f28dc7
12
hash/jolt/bench/README.md
Normal file
12
hash/jolt/bench/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
Benchmarking different hashes inside Jolt zkvm
|
||||
-----------------------------------------------
|
||||
|
||||
The benchmark is defined by the following shell scripts:
|
||||
|
||||
- `build.sh` - build the code.
|
||||
|
||||
- `run.sh` and `run_tree.sh` - run the benchmark itself (`run.sh` for sha256, keccak, blake2b, blake3 and `run2.sh` for poseidon2 over bn254 and babybear)
|
||||
|
||||
Benchmarks can be parameterized using environment variables. By convention, we start the names of these environment variables with the `ZKBENCH_` prefix(See `run.sh` and `run_tree.sh` files).
|
||||
|
||||
Additional files `bench.cfg` and `bench_tree.cfg` specifies the configurations and parameters.
|
||||
11
hash/jolt/bench/bench.cfg
Normal file
11
hash/jolt/bench/bench.cfg
Normal file
@ -0,0 +1,11 @@
|
||||
name: "Hashes benchmarking using jolt zkvm prover"
|
||||
author:
|
||||
timeout: 200
|
||||
params:
|
||||
[ HASH_TYPE: [ "sha256", "keccak", "blake2b", "blake3"]
|
||||
, INPUT_SIZE_BYTES: [ 256, 512, 1024, 2048 ]
|
||||
]
|
||||
tags: jolt, $HASH_TYPE
|
||||
comments:
|
||||
The benchmarks includes for sha256, keccak, blake2b, blake3.
|
||||
the hashing is done inside the guest.
|
||||
10
hash/jolt/bench/bench_tree.cfg
Normal file
10
hash/jolt/bench/bench_tree.cfg
Normal file
@ -0,0 +1,10 @@
|
||||
name: "Hashes benchmarking using jolt zkvm prover"
|
||||
author:
|
||||
timeout: 1000
|
||||
params:
|
||||
[ HASH_TYPE_TREE: [ "poseidon2_babybear", "poseidon2_bn256"]
|
||||
, TREE_DEPTH: [ 2, 4, 8 ]
|
||||
]
|
||||
tags: jolt, $HASH_TYPE_TREE
|
||||
comments:
|
||||
The benchmarks includes for poseidon2(merkle hashing) over bn254 and babybear.
|
||||
@ -68,7 +68,6 @@ fn poseidon2_babybear(input: Vec<u32>) -> Vec<u32> {
|
||||
|
||||
}
|
||||
|
||||
//TODO: too slow!! need to do some optimizations
|
||||
// poseidon2 over BN256
|
||||
#[jolt::provable(stack_size = 1000000, memory_size = 10000000)]
|
||||
pub fn poseidon2_bn256(input: Vec<Vec<u8>>) -> Vec<u8> {
|
||||
|
||||
@ -9,7 +9,7 @@ use alloc::vec::Vec;
|
||||
extern crate core;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
pub type Scalar = ark_bn254::fr::Fr;
|
||||
pub type Scalar = ark_bn254::Fr;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Poseidon2Params<F: PrimeField> {
|
||||
@ -633,5 +633,6 @@ impl<F: PrimeField> MerkleTreeHash<F> for Poseidon2<F> {
|
||||
|
||||
pub fn from_hex<F: PrimeField>(s: &str) -> F {
|
||||
let a = Vec::from_hex(&s[2..]).expect("Invalid Hex String");
|
||||
|
||||
F::from_be_bytes_mod_order(&a as &[u8])
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user