/// Implements the scheme described in [ProtoGalaxy](https://eprint.iacr.org/2023/1106.pdf) use ark_ec::CurveGroup; use ark_ff::PrimeField; use ark_r1cs_std::fields::fp::FpVar; use thiserror::Error; use super::circuits::nonnative::affine::NonNativeAffineVar; pub mod folding; pub mod traits; pub(crate) mod utils; #[derive(Clone, Debug)] pub struct CommittedInstance { phi: C, betas: Vec, e: C::ScalarField, } #[derive(Clone, Debug)] pub struct CommittedInstanceVar { phi: NonNativeAffineVar, betas: Vec>, e: FpVar, } #[derive(Clone, Debug)] pub struct Witness { w: Vec, r_w: F, } #[derive(Debug, Error, PartialEq)] pub enum ProtoGalaxyError { #[error("The remainder from G(X)-F(α)*L_0(X)) / Z(X) should be zero")] RemainderNotZero, #[error("Could not divide by vanishing polynomial")] CouldNotDivideByVanishing, #[error("The number of incoming instances + 1 should be a power of two, current number of instances: {0}")] WrongNumInstances(usize), #[error("The number of incoming items should be a power of two, current number of coefficients: {0}")] BTreeNotFull(usize), #[error("The lengths of β and δ do not equal: |β| = {0}, |δ|={0}")] WrongLenBetas(usize, usize), }