-
Notifications
You must be signed in to change notification settings - Fork 9
π Elliptic Curve and Modexp Precompiles #23
base: dl-precompiles
Are you sure you want to change the base?
π Elliptic Curve and Modexp Precompiles #23
Conversation
src/precompiles/ecmul.rs
Outdated
// and validating that the conversion is successful | ||
let x1_field = Fq::from_str(x1.to_string().as_str()).ok_or(Error::msg("invalid x1"))?; | ||
let y1_field = Fq::from_str(y1.to_string().as_str()).ok_or(Error::msg("invalid y1"))?; | ||
let s_field = Fr::from_str(s.to_string().as_str()).ok_or(Error::msg("invalid s"))?; |
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.
Why is that? s
can be an arbitrary uint256 number
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.
True, missed that, we will update
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.
Yeah, indeed, missed that. Now, s
can be arbitrary. Also, I added three different tests where the scalar is greater than the group order to make sure we have not missed anything
65c274c
to
8ad9745
Compare
8ad9745
to
245965b
Compare
Fixed the issue where the point at infinity was encoded as a tuple According to the precompile spec, the point at infinity is now encoded as |
What β
This pull request adds the evm abstractions for the following precompiles:
ecadd
: adding two points on the elliptic curve;ecmul
: multiplying two points on the elliptic curve;ecpairing
: verification of pairing operation;modexp
: modular exponentiation.Why β
They haven't been implemented yet, thus the PR.
Checklist
zk fmt
andzk lint
.