sonobe/folding-schemes/src/folding/hypernova/mod.rs
folding-schemes/src/folding/hypernova/mod.rsRaw
1/// Implements the scheme described in [HyperNova](https://eprint.iacr.org/2023/573.pdf)
2use crate::ccs::CCS;
3use ark_ff::PrimeField;
4
5pub mod cccs;
6pub mod circuits;
7pub mod lcccs;
8pub mod nimfs;
9pub mod utils;
10
11/// Witness for the LCCCS & CCCS, containing the w vector, and the r_w used as randomness in the Pedersen commitment.
12#[derive(Debug, Clone, Eq, PartialEq)]
13pub struct Witness<F: PrimeField> {
14 pub w: Vec<F>,
15 pub r_w: F,
16}
17
18impl<F: PrimeField> Witness<F> {
19 pub fn new(w: Vec<F>) -> Self {
20 // note: at the current version, we don't use the blinding factors and we set them to 0
21 // always.
22 Self { w, r_w: F::zero() }
23 }
24 pub fn dummy(ccs: &CCS<F>) -> Self {
25 Witness::<F>::new(vec![F::zero(); ccs.n - ccs.l - 1])
26 }
27}