This repository was archived by the owner on Apr 4, 2026. It is now read-only.
feat: implement subarray equality check using RLC#189
Open
NikolayKostadinov21 wants to merge 8 commits intosuccinctlabs:mainfrom
Open
feat: implement subarray equality check using RLC#189NikolayKostadinov21 wants to merge 8 commits intosuccinctlabs:mainfrom
NikolayKostadinov21 wants to merge 8 commits intosuccinctlabs:mainfrom
Conversation
jtguibas
reviewed
Sep 22, 2023
| variable.to_be_bits(self) | ||
| } | ||
|
|
||
| /// Takes a slice of bits and returns the number with little-endian bit representation as a Variable |
jtguibas
reviewed
Sep 22, 2023
|
|
||
| /// Takes a slice of bits and returns the number with little-endian bit representation as a Variable | ||
| pub fn le_sum(&mut self, bits: &[BoolVariable]) -> Variable { | ||
| let bits_in_booltarget = bits |
jtguibas
reviewed
Sep 22, 2023
| if a[a_offset + i] != b[b_offset + i] { | ||
| return 0; | ||
| impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> { | ||
| /// Generates a commitment for a subarray using RLC |
jtguibas
reviewed
Sep 22, 2023
| let mut is_within_subarray: Variable = self.zero(); | ||
| let mut commitment = self.zero(); | ||
|
|
||
| let _one: Variable = self.one(); |
Contributor
There was a problem hiding this comment.
let one, instead of let _one
jtguibas
reviewed
Sep 22, 2023
| builder.assert_subarray_equal(&a, a_offset, &b, b_offset, len); | ||
|
|
||
| let pw = PartialWitness::new(); | ||
| let circuit = builder.build(); |
Contributor
There was a problem hiding this comment.
can you make this use circuit.inputs() and circuit.prove()?
jtguibas
reviewed
Sep 22, 2023
|
|
||
| let pw = PartialWitness::new(); | ||
| let circuit = builder.build(); | ||
| let proof = circuit.data.prove(pw).unwrap(); |
Contributor
|
@NikolayKostadinov21 Overall, looks like a solid implementation of the subarray equality check. I'll take a closer look at the actual RLC implementation and make sure the logic looks correct in a bit. In the meantime, it would be great if you could address the comments I left on the PR! |
f77d751 to
7dc11d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.