Skip to content

Commit

Permalink
Merge pull request #1876 from o1-labs/dw/msm-serialization-env-add-co…
Browse files Browse the repository at this point in the history
…nstraint-method-in-env

MSM/Serialization: add method add_constraint in trait env
  • Loading branch information
dannywillems authored Feb 29, 2024
2 parents 7aa1f71 + da9a45f commit 79479ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions msm/src/serialization/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pub trait InterpreterEnv {
+ std::ops::Mul<Self::Variable, Output = Self::Variable>
+ std::fmt::Debug;

fn add_constraint(&mut self, cst: Self::Variable);

fn copy(&mut self, x: &Self::Variable, position: Self::Position) -> Self::Variable;

fn get_column_for_kimchi_limb(j: usize) -> Self::Position;
Expand Down
4 changes: 4 additions & 0 deletions msm/src/serialization/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ impl<Fp: Field> InterpreterEnv for Env<Fp> {
// values. Let's see later
type Variable = u128;

fn add_constraint(&mut self, cst: Self::Variable) {
assert_eq!(cst, 0);
}

fn constant(value: u128) -> Self::Variable {
value
}
Expand Down

0 comments on commit 79479ff

Please sign in to comment.