mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 16:53:07 +00:00
Minor
This commit is contained in:
parent
c78d7611ed
commit
5f7992f0ea
@ -16,13 +16,10 @@ fn main() -> Result<()> {
|
|||||||
// change this to info or warn later.
|
// change this to info or warn later.
|
||||||
env_logger::Builder::from_env(Env::default().default_filter_or("debug")).init();
|
env_logger::Builder::from_env(Env::default().default_filter_or("debug")).init();
|
||||||
|
|
||||||
bench_prove()
|
bench_prove::<PoseidonGoldilocksConfig, 2>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bench_prove() -> Result<()> {
|
fn bench_prove<C: GenericConfig<D>, const D: usize>() -> Result<()> {
|
||||||
const D: usize = 2;
|
|
||||||
type C = PoseidonGoldilocksConfig;
|
|
||||||
type F = <C as GenericConfig<D>>::F;
|
|
||||||
let config = CircuitConfig {
|
let config = CircuitConfig {
|
||||||
num_wires: 126,
|
num_wires: 126,
|
||||||
num_routed_wires: 33,
|
num_routed_wires: 33,
|
||||||
@ -40,7 +37,7 @@ fn bench_prove() -> Result<()> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let inputs = PartialWitness::new();
|
let inputs = PartialWitness::new();
|
||||||
let mut builder = CircuitBuilder::<F, D>::new(config);
|
let mut builder = CircuitBuilder::<C::F, D>::new(config);
|
||||||
|
|
||||||
let zero = builder.zero();
|
let zero = builder.zero();
|
||||||
let zero_ext = builder.zero_extension();
|
let zero_ext = builder.zero_extension();
|
||||||
|
|||||||
@ -156,7 +156,3 @@ pub fn hash_n_to_hash<F: RichField, P: PlonkyPermutation<F>>(
|
|||||||
) -> HashOut<F> {
|
) -> HashOut<F> {
|
||||||
HashOut::from_vec(hash_n_to_m::<F, P>(inputs, 4, pad))
|
HashOut::from_vec(hash_n_to_m::<F, P>(inputs, 4, pad))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hash_n_to_1<F: RichField, P: PlonkyPermutation<F>>(inputs: Vec<F>, pad: bool) -> F {
|
|
||||||
hash_n_to_m::<F, P>(inputs, 1, pad)[0]
|
|
||||||
}
|
|
||||||
|
|||||||
@ -24,7 +24,6 @@ pub trait Hasher<F: RichField>: Sized + Clone + Debug + Eq + PartialEq {
|
|||||||
type Hash: From<Vec<u8>>
|
type Hash: From<Vec<u8>>
|
||||||
+ Into<Vec<u8>>
|
+ Into<Vec<u8>>
|
||||||
+ Into<Vec<F>>
|
+ Into<Vec<F>>
|
||||||
+ Into<u64>
|
|
||||||
+ Copy
|
+ Copy
|
||||||
+ Clone
|
+ Clone
|
||||||
+ Debug
|
+ Debug
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user