-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first sketch of the environment for the serializer circuit #1860
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod columns; | ||
pub mod interpreter; | ||
pub mod witness; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use ark_ff::Field; | ||
|
||
use crate::LIMBS_NUM; | ||
|
||
/// Environment for the serializer interpreter | ||
/// It is parametrized by the number of field elements to be serialized and the | ||
/// field | ||
pub struct Env<const N: usize, Fp> { | ||
pub step: usize, | ||
pub kimchi_limbs: [[Fp; 3]; N], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also thinking if it's a builder-like struct, then probably the fields should be not arrays but vectors, and we intend to append to them? So far this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One row of computation. |
||
pub current_kimchi_limbs: [Fp; 3], | ||
/// The LIMB_NUM limbs that is used to encode a field element for the MSM | ||
pub msm_limbs: [Fp; LIMBS_NUM], | ||
/// Used for the decomposition in base 4 of the last limb of the foreign | ||
/// field Kimchi gate | ||
pub intermediate_limbs: [Fp; 19], | ||
} | ||
|
||
impl<const N: usize, Fp: Field> Env<N, Fp> { | ||
pub fn create(kimchi_limbs: [[Fp; 3]; N]) -> Self { | ||
Self { | ||
step: 0, | ||
kimchi_limbs, | ||
current_kimchi_limbs: [Fp::zero(); 3], | ||
msm_limbs: [Fp::zero(); LIMBS_NUM], | ||
intermediate_limbs: [Fp::zero(); 19], | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is building witness, right? We have three kind of environments IIRC: witness, constraint, and column (anything else?). I won't block on naming conventions, but
WitnessBuilder
perhaps would be a more descriptive name?