ark-r1cs-std/crypto-primitives/src/prf/constraints.rs
crypto-primitives/src/prf/constraints.rsRaw
1use algebra_core::Field;
2use core::fmt::Debug;
3
4use crate::{prf::PRF, Vec};
5use r1cs_core::{Namespace, SynthesisError};
6
7use r1cs_std::prelude::*;
8
9pub trait PRFGadget<P: PRF, F: Field> {
10 type OutputVar: EqGadget<F>
11 + ToBytesGadget<F>
12 + AllocVar<P::Output, F>
13 + R1CSVar<F, Value = P::Output>
14 + Clone
15 + Debug;
16
17 fn new_seed(cs: impl Into<Namespace<F>>, seed: &P::Seed) -> Vec<UInt8<F>>;
18
19 fn evaluate(seed: &[UInt8<F>], input: &[UInt8<F>]) -> Result<Self::OutputVar, SynthesisError>;
20}