Skip to content

Commit

Permalink
MSM: introduce different lookup tables used by the serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Mar 7, 2024
1 parent 9ec240c commit d0f6fef
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions msm/src/serialization/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use ark_ff::Field;

use crate::mvlookup::LookupTableID;

/// The number of intermediate limbs of 4 bits required for the circuit
pub const N_INTERMEDIATE_LIMBS: usize = 20;

Expand All @@ -6,6 +10,20 @@ pub mod constraints;
pub mod interpreter;
pub mod witness;

pub enum LookupTable {
RangeCheck15,
RangeCheck4,
}

impl LookupTableID for LookupTable {
fn into_field<F: Field>(self) -> F {
match self {
Self::RangeCheck15 => F::one(),
Self::RangeCheck4 => F::one() + F::one(),
}
}
}

#[cfg(test)]
mod tests {
use kimchi::circuits::domains::EvaluationDomains;
Expand Down

0 comments on commit d0f6fef

Please sign in to comment.