sonobe/folding-schemes/src/folding/protogalaxy/mod.rs
folding-schemes/src/folding/protogalaxy/mod.rsRaw
1/// Implements the scheme described in [ProtoGalaxy](https://eprint.iacr.org/2023/1106.pdf)
2use ark_ec::CurveGroup;
3use ark_ff::PrimeField;
4use thiserror::Error;
5
6pub mod folding;
7pub mod traits;
8pub(crate) mod utils;
9
10#[derive(Clone, Debug)]
11pub struct CommittedInstance<C: CurveGroup> {
12 phi: C,
13 betas: Vec<C::ScalarField>,
14 e: C::ScalarField,
15}
16
17#[derive(Clone, Debug)]
18pub struct Witness<F: PrimeField> {
19 w: Vec<F>,
20 r_w: F,
21}
22
23#[derive(Debug, Error, PartialEq)]
24pub enum ProtoGalaxyError {
25 #[error("The remainder from G(X)-F(α)*L_0(X)) / Z(X) should be zero")]
26 RemainderNotZero,
27 #[error("Could not divide by vanishing polynomial")]
28 CouldNotDivideByVanishing,
29 #[error("The number of incoming instances + 1 should be a power of two, current number of instances: {0}")]
30 WrongNumInstances(usize),
31 #[error("The number of incoming items should be a power of two, current number of coefficients: {0}")]
32 BTreeNotFull(usize),
33 #[error("The lengths of β and δ do not equal: |β| = {0}, |δ|={0}")]
34 WrongLenBetas(usize, usize),
35}