arnaucube
arnaucube/ark-r1cs-stdPublic Self-hosted repository
ark-r1cs-std/crypto-primitives/src/prf/mod.rs
crypto-primitives/src/prf/mod.rsRaw
 1use algebra_core::bytes::{FromBytes, ToBytes};
 2use core::{fmt::Debug, hash::Hash};
 3
 4use crate::CryptoError;
 5
 6#[cfg(feature = "r1cs")]
 7pub mod constraints;
 8#[cfg(feature = "r1cs")]
 9pub use constraints::*;
10
11pub mod blake2s;
12pub use self::blake2s::*;
13
14pub trait PRF {
15    type Input: FromBytes + Default;
16    type Output: ToBytes + Eq + Clone + Debug + Default + Hash;
17    type Seed: FromBytes + ToBytes + Clone + Default + Debug;
18
19    fn evaluate(seed: &Self::Seed, input: &Self::Input) -> Result<Self::Output, CryptoError>;
20}