#![allow(clippy::upper_case_acronyms)]
use crate::Error;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{borrow::Borrow, fmt::Debug, hash::Hash, rand::Rng};
#[cfg(feature = "blake3")]
pub mod blake3;
pub mod bowe_hopwood;
pub mod byte_digest;
pub use byte_digest::ByteDigest;
#[cfg(feature = "constraints")]
pub mod constraints;
pub mod injective_map;
pub mod pedersen;
pub mod poseidon;
pub mod rescue;
pub mod sha256;
#[cfg(feature = "constraints")]
pub use constraints::*;
pub trait CRHScheme {
type Input: ?Sized + Send;
type Output: Clone + Eq + Debug + Hash + Default + CanonicalSerialize + CanonicalDeserialize;
type Parameters: Clone + CanonicalSerialize + CanonicalDeserialize + Sync;
fn setup<R: Rng>(r: &mut R) -> Result<Self::Parameters, Error>;
fn evaluate<T: Borrow<Self::Input>>(
parameters: &Self::Parameters,
input: T,
) -> Result<Self::Output, Error>;
}
pub trait TwoToOneCRHScheme {
type Input: ?Sized;
type Output: Clone + Eq + Debug + Hash + Default + CanonicalSerialize + CanonicalDeserialize;
type Parameters: Clone + CanonicalSerialize + CanonicalDeserialize + Sync;
fn setup<R: Rng>(r: &mut R) -> Result<Self::Parameters, Error>;
fn evaluate<T: Borrow<Self::Input>>(
parameters: &Self::Parameters,
left_input: T,
right_input: T,
) -> Result<Self::Output, Error>;
fn compress<T: Borrow<Self::Output>>(
parameters: &Self::Parameters,
left_input: T,
right_input: T,
) -> Result<Self::Output, Error>;
}