-
Notifications
You must be signed in to change notification settings - Fork 364
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 jubjub twisted edwards curve to stdlib #1259
base: develop
Are you sure you want to change the base?
Conversation
This reverts commit a741f9e.
Add Jubjub to ECC stdlib
@dark64 rebasing the source branch should solve the failing check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep in mind format and changelog for next time ✍️ everything else looks good to me
@Schaeff can you please review the branch? 👾 |
def main(field i) -> bool[256] { | ||
bool[254] b = unpack_unchecked(i); | ||
return [false, false, ...b]; | ||
def main(field i, u32 bit_size) -> bool[256] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: After a second look, I figure this function should have better documentation
cc @alvaro-alonso
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dark64 good point!
What about:
import "./unpack_unchecked";
// Unpack a field element as 256 big-endian bits.
// Since the size of p can differ among different fields,
// p_size has to be given to derive the correct padding.
// For example, for bn128 |p|=254, for bls12-381 |p|=255.
// Note: uniqueness of the output is not guaranteed
// For example, `0` can map to `[0, 0, ..., 0]` or to `bits(p)`
def main(field i, u32 p_size) -> bool[256] {
assert(p_size <= 256);
u32 padding_size = 256 - p_size;
bool[p_size] b = unpack_unchecked(i);
return [...[false; padding_size], ...b];
}
I can not push the changes to the branch. And I think a PR is overkill 💀
#1251