forked from arkworks-rs/snark
-
Notifications
You must be signed in to change notification settings - Fork 17
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 little endian functions to to bits gadget #151
Closed
nicholas-mainardi
wants to merge
8
commits into
rc/feat/comp_gadget
from
add-little-endian-functions-to-ToBits-gadget
Closed
Add little endian functions to to bits gadget #151
nicholas-mainardi
wants to merge
8
commits into
rc/feat/comp_gadget
from
add-little-endian-functions-to-ToBits-gadget
Conversation
This file contains 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
nicholas-mainardi
changed the base branch from
master
to
refactor_ginger_monorepo
December 29, 2021 19:04
DanieleDiBenedetto
requested changes
Jan 3, 2022
DanieleDiBenedetto
approved these changes
Jan 3, 2022
DanieleDiBenedetto
changed the base branch from
refactor_ginger_monorepo
to
rc/feat/comp_gadget
May 2, 2022 09:30
DanieleDiBenedetto
changed the base branch from
rc/feat/comp_gadget
to
refactor_ginger_monorepo
May 2, 2022 09:31
DanieleDiBenedetto
force-pushed
the
add-little-endian-functions-to-ToBits-gadget
branch
from
May 2, 2022 09:55
93a929c
to
1984dc3
Compare
DanieleDiBenedetto
changed the base branch from
refactor_ginger_monorepo
to
rc/feat/comp_gadget
May 2, 2022 09:56
nicholas-mainardi
force-pushed
the
add-little-endian-functions-to-ToBits-gadget
branch
from
May 4, 2022 09:32
25d50da
to
ce8ee6d
Compare
DanieleDiBenedetto
changed the base branch from
rc/feat/comp_gadget
to
fix-cmp-with-eq-implementation
May 5, 2022 11:20
DanieleDiBenedetto
changed the base branch from
fix-cmp-with-eq-implementation
to
rc/feat/comp_gadget
May 5, 2022 11:24
nicholas-mainardi
changed the base branch from
rc/feat/comp_gadget
to
fix-cmp-with-eq-implementation
May 9, 2022 17:11
nicholas-mainardi
changed the base branch from
fix-cmp-with-eq-implementation
to
rc/feat/comp_gadget
May 9, 2022 17:21
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addressed the issue #148 by adding the functions
to_bits_le
andfrom_bits_le
to theToBitsGadget
andFromBitsGadget
, respectively. These functions allow to serialize/deserialize for the types implementing such gadgets to/from a little-endian bit representation. A default implementation is provided that relies on the functionsto_bits
andfrom_bits
, which serializes/deserializes the type to/from a big endian bit representation.Similalry, this PR adds the functions
write_bits_le
andread_bits_le
functions to theToBits
andFromBits
traits, respectively, in thealgebra
package, with default implementations relying on thewrite_bits
andread_bits
functions, respectively.The function
to_bits_strict_le
is also added to theToBitsGadget
to check the validity of the little-endian bit representation of the serialized type. The default implementation simply reverse a valid big-endian bit representation obtained by callid theto_bits_strict
function ofToBitsGadget
.Unit tests in
r1cs/gadgets/std/src/fields/mod.rs
, which verify the correctness of serialization/deserialization of field gadgets to/from big endian bit representation, are enriched to also test serialization/deserialization to/from little endian bit representation.