Skip to content

Uniform endianness of bits/bytes serialization #148

@95DDB

Description

@95DDB

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.

Metadata

Metadata

Labels

nice to havePossible new feature to introducesw designSW design choice to be made or implemented

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions