Closed znewman01 closed 4 years ago
The comment https://github.com/zkcrypto/bls12_381/pull/39#issuecomment-617994330 applies here:
The reason this is not exposed is because it's not an element of the field, so it breaks the contract of the
Scalar
type. We should expose the underlying[u64; 4]
representation though.
If you change your PR to expose the [u64; 4]
portion of the modulus instead, and replace MODULUS
with Scalar(MODULUS)
elsewhere in the file, that would be fine.
Makes sense; just force-pushed.
Couple notes:
fr.rs
was 4 64-bit words; lib.rs
has a 32-byte constant that I moved into fr.rs
and ultimately exposed.lib.rs
name FR_MODULUS_BYTES
---not totally sure how to reconcile Fr
vs. Scalar
@str4d
anything else to do here?
@str4d ping
Hey! This change is being done (indirectly) as part of a cross-crate refactoring effort happening in this repository. So, soon this will make its way into the API somehow. The changes are slightly different, though, and I want to avoid messy conflicts.
Sweet, looking forward! Feel free to close out in favor of that
As
jubjub::MODULUS
:IMO the current docs ("Constant representing the modulus r = 0x...") are okay, and it doesn't need a rename or anything.
I found this useful, not sure if others will.