use crate::traits::Engine;
use bellpepper_core::{ConstraintSystem, SynthesisError, num::AllocatedNum};
pub trait SpartanCircuit<E: Engine>: Send + Sync + Clone {
fn public_values(&self) -> Result<Vec<E::Scalar>, SynthesisError>;
fn shared<CS: ConstraintSystem<E::Scalar>>(
&self,
cs: &mut CS,
) -> Result<Vec<AllocatedNum<E::Scalar>>, SynthesisError>;
fn precommitted<CS: ConstraintSystem<E::Scalar>>(
&self,
cs: &mut CS,
shared: &[AllocatedNum<E::Scalar>],
) -> Result<Vec<AllocatedNum<E::Scalar>>, SynthesisError>;
fn num_challenges(&self) -> usize;
fn synthesize<CS: ConstraintSystem<E::Scalar>>(
&self,
cs: &mut CS,
shared: &[AllocatedNum<E::Scalar>],
precommitted: &[AllocatedNum<E::Scalar>],
challenges: Option<&[E::Scalar]>, ) -> Result<(), SynthesisError>;
}
pub trait MultiRoundCircuit<E: Engine>: Send + Sync + Clone {
fn num_challenges(&self, round_index: usize) -> Result<usize, SynthesisError>;
fn rounds<CS: ConstraintSystem<E::Scalar>>(
&self,
cs: &mut CS,
round_index: usize,
prior_round_vars: &[Vec<AllocatedNum<E::Scalar>>], prev_challenges: &[Vec<AllocatedNum<E::Scalar>>], challenges: Option<&[E::Scalar]>, ) -> Result<(Vec<AllocatedNum<E::Scalar>>, Vec<AllocatedNum<E::Scalar>>), SynthesisError>;
fn num_rounds(&self) -> usize;
}