Files
ark-r1cs-std/crypto-primitives/src/crh/mod.rs
2020-02-20 11:35:53 -08:00

24 lines
565 B
Rust

use algebra::bytes::ToBytes;
use core::hash::Hash;
use rand::Rng;
pub mod bowe_hopwood;
pub mod injective_map;
pub mod pedersen;
use crate::Error;
#[cfg(feature = "r1cs")]
pub mod constraints;
#[cfg(feature = "r1cs")]
pub use constraints::*;
pub trait FixedLengthCRH {
const INPUT_SIZE_BITS: usize;
type Output: ToBytes + Clone + Eq + Hash + Default;
type Parameters: Clone + Default;
fn setup<R: Rng>(r: &mut R) -> Result<Self::Parameters, Error>;
fn evaluate(parameters: &Self::Parameters, input: &[u8]) -> Result<Self::Output, Error>;
}