use crate::commitment::CommitmentScheme; use algebra_core::Field; use core::fmt::Debug; use r1cs_core::SynthesisError; use r1cs_std::prelude::*; pub trait CommitmentGadget { type OutputVar: EqGadget + ToBytesGadget + AllocVar + R1CSVar + Clone + Sized + Debug; type ParametersVar: AllocVar + Clone; type RandomnessVar: AllocVar + Clone; fn commit( parameters: &Self::ParametersVar, input: &[UInt8], r: &Self::RandomnessVar, ) -> Result; }