There's a small problem:
The current default method for mul_bigint operates on limbs, and so works for any scalar, also those larger than MODULUS.
On the other hand, the GLV interface assumes that the scalar is already an element of the ScalarField:
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
[ ] Targeted PR against correct branch (master)
[ ] Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
[ ] Wrote unit tests
[ ] Updated relevant documentation in the code
[ ] Added a relevant changelog entry to the Pending section in CHANGELOG.md
[ ] Re-reviewed Files changed in the Github PR explorer
Description
Fixes(?) the failing tests in https://github.com/arkworks-rs/curves/pull/158.
There's a small problem: The current default method for
mul_bigint
operates on limbs, and so works for any scalar, also those larger thanMODULUS
. On the other hand, the GLV interface assumes that the scalar is already an element of theScalarField
:And so to call the GLV implementation, when we convert from limbs to
ScalarField
, we assume that the scalar has already been mod reduced: https://github.com/arkworks-rs/curves/blob/a39aa8480e216fb3193139747e149b252ebfc1fd/ed_on_bls12_381_bandersnatch/src/curves/mod.rs#L144 -> which panics when #limbs > N, thus causing the tests to fail.Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer