use snarkvm_utilities::{
bytes::{FromBytes, ToBytes},
fmt::Debug,
};
pub trait CryptoHash {
type Input: FromBytes + From<u64> + Clone;
type Output: Copy + Clone + Debug + ToBytes + Eq + Default;
type Parameters: Clone + Debug + Eq;
fn setup() -> Self;
fn evaluate(&self, input: &[Self::Input]) -> Self::Output;
fn evaluate_with_len(&self, input: &[Self::Input]) -> Self::Output {
let mut header = vec![<Self::Input as From<u64>>::from(input.len() as u64)];
header.extend_from_slice(input);
self.evaluate(&header)
}
fn parameters(&self) -> &Self::Parameters;
}