Skip to content
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/encode uint64 slices #379

Merged
merged 4 commits into from
Apr 20, 2023
Merged

Feat/encode uint64 slices #379

merged 4 commits into from
Apr 20, 2023

Conversation

Tabaie
Copy link
Contributor

@Tabaie Tabaie commented Apr 9, 2023

In the Plonk verification key, when multi-commits are implemented, we will have to store an array of indexes to commitment constraints. This PR enables that by storing slices of uint64 in the len(x), x[0], x[1], ..., x[len(x)-1] format.

@Tabaie Tabaie requested a review from gbotrel April 9, 2023 02:23
@gbotrel
Copy link
Collaborator

gbotrel commented Apr 11, 2023

This one might not be necessary; the default

binary.Write(buf, binary.BigEndian, slice)

will catch the slide, and encode it without the length. The only issue is for decoding, you need to pass an initialized slice as argument. Does the PlonK verification key know how many indexes to read?

@Tabaie
Copy link
Contributor Author

Tabaie commented Apr 16, 2023

This one might not be necessary; the default

binary.Write(buf, binary.BigEndian, slice)

will catch the slide, and encode it without the length. The only issue is for decoding, you need to pass an initialized slice as argument. Does the PlonK verification key know how many indexes to read?

No the length of the array is how we know how many levels of commitments there are.

Copy link
Collaborator

@gbotrel gbotrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for the PR, just, I believe we use binary.BigEndian as default encoding for everything else, just for consistency, can you replace binary.LittleEndian to BigEndian?

@Tabaie Tabaie requested a review from gbotrel April 20, 2023 14:09
@Tabaie Tabaie merged commit 641170e into develop Apr 20, 2023
5 checks passed
@Tabaie Tabaie deleted the feat/encode-uint64-slices branch April 20, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants