-
Notifications
You must be signed in to change notification settings - Fork 140
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
EVM: bn256ScalarMul precompile (0x07) does not behave correctly when scalar=0 #1639
Labels
Milestone
Comments
@Stebalien -- I am not well-versed in EC multiplication, so would appreciate your input. I'm not sure if it makes sense to shortcut and return 0 if the supplied point is valid and the scalar is zero. |
Can use
|
pikachua7
added a commit
to shannon-vaz/spacewarp-2023
that referenced
this issue
Feb 5, 2023
filecoin-project/ref-fvm#1639 Co-authored-by: Shannon Vaz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original report
https://filecoinproject.slack.com/archives/CRK2LKYHW/p1675441024104129
Investigation
Our implementation of the
ecMul
precompile attempts to place the result of the multiplication (zero) on the alt_bn128 curve, which fails with anEcErr(InvalidEncoding)
error. Instead, we should successfully return zero. Other implementations return zero.Note that according to EIP-196, where this precompile was introduced, zero is a valid scalar argument.
Separately, we should investigate why the input sent to this precompile is longer than it needs to be (appears to include zero padding of some kind)?
Repro
filecoin-project/builtin-actors#1164
The text was updated successfully, but these errors were encountered: