This commit is contained in:
wborgeaud 2021-11-08 10:04:53 +01:00
parent c78d7611ed
commit 5f7992f0ea
3 changed files with 3 additions and 11 deletions

View File

@ -16,13 +16,10 @@ fn main() -> Result<()> {
// change this to info or warn later.
env_logger::Builder::from_env(Env::default().default_filter_or("debug")).init();
bench_prove()
bench_prove::<PoseidonGoldilocksConfig, 2>()
}
fn bench_prove() -> Result<()> {
const D: usize = 2;
type C = PoseidonGoldilocksConfig;
type F = <C as GenericConfig<D>>::F;
fn bench_prove<C: GenericConfig<D>, const D: usize>() -> Result<()> {
let config = CircuitConfig {
num_wires: 126,
num_routed_wires: 33,
@ -40,7 +37,7 @@ fn bench_prove() -> Result<()> {
};
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_ext = builder.zero_extension();

View File

@ -156,7 +156,3 @@ pub fn hash_n_to_hash<F: RichField, P: PlonkyPermutation<F>>(
) -> HashOut<F> {
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]
}

View File

@ -24,7 +24,6 @@ pub trait Hasher<F: RichField>: Sized + Clone + Debug + Eq + PartialEq {
type Hash: From<Vec<u8>>
+ Into<Vec<u8>>
+ Into<Vec<F>>
+ Into<u64>
+ Copy
+ Clone
+ Debug