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

Hex string representation of small digest values should have leading zeros #214

Open
Sword-Smith opened this issue May 22, 2024 · 0 comments

Comments

@Sword-Smith
Copy link
Member

Sword-Smith commented May 22, 2024

Whenever we represent a digest as a hex string, we should encode it in a big-endian way to make small1 digest values have leading zeros.

The behavior of the functions to_hex, try_from_hex, and the Ord implementation should be consistent. The conversion to and from BigUint also needs to agree.

Note that we do not necessarily have to change the encoding of other values. I am only concerned with the hex string representation of Digest. e.g. BFieldElement or Digest is serialized is not of a concern, I think.

Footnotes

  1. Small is well-defined for Digest as it implements the Ord trait.

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

No branches or pull requests

1 participant