-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat: VID take iterator instead of slice #381
Conversation
impl<P, T, H, V> VidScheme for GenericAdvz<P, T, H, V> | ||
where | ||
P: UnivariatePCS<Point = <P as PolynomialCommitmentScheme>::Evaluation>, | ||
P::Evaluation: FftField, |
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.
Any specific reason for making it PrimeField
?
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 was in a rush. 😊 I'm happy to extend it to Field
if you request it. That gives me an excuse to allocate the time to do it.
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.
The answer to your question is here:
jellyfish/primitives/src/vid/advz.rs
Lines 152 to 153 in 474fcdf
// `PrimeField` needed only because `bytes_to_field` needs it. | |
// Otherwise we could relax to `FftField`. |
This #381 (comment) is an explanation for why I restricted bytes_to_field
to PrimeField
.
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.
Got it. We can settle with PrimeField
for now, and add a follow-up issue for the future improvement.
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.
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.
LGTM. We can merge it after some follow-up issues and CI fixes.
Description
closes: #375
closes: #300
conversion.rs
: add newbytes_to_field
andfield_to_bytes
that act on iterators instead of slices. The code is more complex than I like. But if you trust the tests then you don't need to get too deep into it. The cause of this complexity is that we need to append an extra field element at the end to encode some length information in order to enable inversion of this process.PrimeField
, notField
. We could extend it toField
but I don't want to take extra time for that now.bytes_to_field_elements
,bytes_from_field_elements
that act on slices. But we could delete them if needed. (Currently they're still used in plonk.)elems_len
field toCommon
struct in VID. This data is needed because recovery adds extra zero elements via RS decoding. Previously we did not need this because the existingbytes_to_field_elements
encodes the total byte length in the output. Thus,bytes_from_field_elements
automatically drops any extra zero elements added by RS decoding. By contrast, the newbytes_to_field
encodes only the byte length of the final element (not the total byte length). So now VID needs to keep track of how many zero elems were added by RS decoding.Other stuff snuck into this PR
VidDisperse
struct that are useful downstreamBefore we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer