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

Switch to little endian #72

Merged
merged 3 commits into from
May 17, 2018
Merged

Switch to little endian #72

merged 3 commits into from
May 17, 2018

Conversation

ebfull
Copy link
Collaborator

@ebfull ebfull commented May 17, 2018

This correctly implements little endian encoding for everything in the circuit and outside abstractions.

Copy link

@daira daira left a comment

Choose a reason for hiding this comment

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

ut(ACK+cov), modulo the URL of the pairing crate.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ut(ACK+cov).

// Drop the first five bits, so it can be interpreted as a scalar.
h[0] &= 0b0000_0111;
// Drop the most significant five bits, so it can be interpreted as a scalar.
h[31] &= 0b0000_0111;
Copy link
Contributor

Choose a reason for hiding this comment

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

Spec says to interpret the BLAKE2s output as a 256-bit integer mod 2livk, and livk = 251, so this is indeed equivalent to truncating by 5 bits.

@ebfull ebfull merged commit eb409fa into zcash:master May 17, 2018
stefandeml pushed a commit to stefandeml/sapling-crypto that referenced this pull request Jul 5, 2019
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.

3 participants