Skip to content

Commit

Permalink
Implement Lasso inside Hyperplonk
Browse files Browse the repository at this point in the history
  • Loading branch information
DoHoonKim8 committed Oct 31, 2023
1 parent 1991271 commit 21ec795
Show file tree
Hide file tree
Showing 26 changed files with 2,494 additions and 326 deletions.
2 changes: 1 addition & 1 deletion benchmark/benches/proof_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use halo2_proofs::{
};
use itertools::Itertools;
use plonkish_backend::{
backend::{self, PlonkishBackend, PlonkishCircuit},
backend::{self, lookup::logup, PlonkishBackend, PlonkishCircuit},
frontend::halo2::{circuit::VanillaPlonk, CircuitExt, Halo2Circuit},
halo2_curves::bn256::{Bn256, Fr},
pcs::multilinear,
Expand Down
11 changes: 8 additions & 3 deletions plonkish_backend/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ use crate::{
use rand::RngCore;
use std::{collections::BTreeSet, fmt::Debug, iter};

use self::lookup::lasso::DecomposableTable;

pub mod hyperplonk;
pub mod lookup;

pub trait PlonkishBackend<F: Field>: Clone + Debug {
type Pcs: PolynomialCommitmentScheme<F>;
type ProverParam: Clone + Debug + Serialize + DeserializeOwned;
type VerifierParam: Clone + Debug + Serialize + DeserializeOwned;
type ProverParam: Clone + Debug;
type VerifierParam: Clone + Debug;

fn setup(
circuit_info: &PlonkishCircuitInfo<F>,
Expand All @@ -43,7 +46,7 @@ pub trait PlonkishBackend<F: Field>: Clone + Debug {
) -> Result<(), Error>;
}

#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug)]
pub struct PlonkishCircuitInfo<F> {
/// 2^k is the size of the circuit
pub k: usize,
Expand All @@ -64,6 +67,8 @@ pub struct PlonkishCircuitInfo<F> {
/// which contains vector of tuples representing the input and table
/// respectively.
pub lookups: Vec<Vec<(Expression<F>, Expression<F>)>>,
/// Represents Lasso lookup argument, which contains input, indices, and table
pub lasso_lookups: Vec<(Expression<F>, Expression<F>, Box<dyn DecomposableTable<F>>)>,
/// Each item inside outer vector repesents an closed permutation cycle,
/// which contains vetor of tuples representing the polynomial index and
/// row respectively.
Expand Down
Loading

0 comments on commit 21ec795

Please sign in to comment.