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

Uniform endianness of bits/bytes serialization #148

Open
DanieleDiBenedetto opened this issue Dec 22, 2021 · 0 comments
Open

Uniform endianness of bits/bytes serialization #148

DanieleDiBenedetto opened this issue Dec 22, 2021 · 0 comments
Assignees
Labels
nice to have Possible new feature to introduce sw design SW design choice to be made or implemented

Comments

@DanieleDiBenedetto
Copy link
Collaborator

Currently:

  • All the primitive/gadget functions dealing with serialization to/from bytes, will output LE bytes;
  • All the primitive/gadget functions dealing with serialization to/from bits, will output BE bits.

This discrepancy is often cause of errors and confusion, especially because function names and comments are generic and don't specify that. We can:

  1. Assume everything to be in LE. This requires to modify all the primitive/gadget functions dealing with serialization to/from bits and also all the places, in all repositories, in which they are used. Let's also modify primitive/gadgets function taking Boolean or UInt8 gadget arrays, dropping any pre-existing assumption on their endianness and assuming them to always be in LE. This is a breaking change.
  2. Simply add to the primitive/gadget traits dealing with serialization to/from bits a "to_bits_le()" and "from_bits_le()" variation.
@DanieleDiBenedetto DanieleDiBenedetto added sw design SW design choice to be made or implemented nice to have Possible new feature to introduce labels Dec 22, 2021
@DanieleDiBenedetto DanieleDiBenedetto linked a pull request Jan 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice to have Possible new feature to introduce sw design SW design choice to be made or implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants