-
Notifications
You must be signed in to change notification settings - Fork 3
Add sponge ops #86
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 sponge ops #86
Conversation
Nashtare
left a comment
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.
added my two cents, but not too deep yet given this is still WIP
|
Opening it for review. This design restricts generics to the |
Nashtare
left a comment
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.
@hratoanina can you fix conflicts and resolve all addressed comments so we can do another round of review? thanks
|
I merged with the current design, which is very different from Alonso's approach with a dedicated config per non primitive op. If Alonso's approach is favoured it should be merged before this PR, and I'll merge on top of it. |
| self.inputs.clear(); | ||
| self.reset_flag = true; | ||
| } | ||
|
|
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.
Add some comments explaining what these functions are doing?
circuit/src/tables.rs
Outdated
| pub fn run(mut self) -> Result<Traces<F>, CircuitError> { | ||
| pub fn run< | ||
| P: CryptographicPermutation<[F; N]>, | ||
| const N: usize, |
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.
What are these values?
circuit/src/tables.rs
Outdated
| let mut current_hash = | ||
| if let Some(val) = self.witness.get(leaf.0 as usize).and_then(|x| x.as_ref()) { | ||
| *val | ||
| // Only handle FakeMerkleVerify ops here |
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.
Why only FakeMerkle here?
|
|
||
| fn main() -> Result<(), ProverError> { | ||
| let mut rng = SmallRng::seed_from_u64(1); | ||
| let perm = Poseidon2BabyBear::<HASH_STATE_SIZE>::new_from_rng_128(&mut rng); |
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.
I think you could also do default_babybear_poseidon2_16()
| rate_values.push(val); | ||
| } | ||
|
|
||
| // for i in 0..R { |
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.
Remove commented code?
|
On hold, we might go with a circuit approach for the challenger instead, using hashing tables directly (see #131). |
|
@hratoanina should we just close this? |
Opening as draft for visibility and for the API. I'm having trouble making it generic for the hash function. It technically compiles and runs, but I'm not satisfied with some of the design.