Skip to content

Commit

Permalink
Support EIP-2539 and EIP-3026 (polkadot-evm#1049)
Browse files Browse the repository at this point in the history
* Release branch polkadot-v0.9.38 (polkadot-evm#1015)

* EIP-2539 (#15)

* Update shell.nix

* Read point from input

* Finish `BLS12377G1Add`

* Fix `BLS12377G1Add` output encode

* Finish `BLS12377G1Mul`

* Finish `BLS12377G1MultiExp`

* Finish `BLS12377G2Add`

* Finish `BLS12377G2Mul`

* Draft `eip-2539` implement

* Finish `BLS12377Pairing`

* Draft `eip-2539`

* Multiplication by the unnormalized scalar

* Rename serialize to write

* Test Cases

* Test Cases

* Rewrite read_fq

* Rename

* Doc and cleanup

* Tidy

* Tidy

* Tidy

* Only check point in subgroup for pairing

* Fmt

* Tests

* Typo

* Typo

* Fix conv

* Change err info

* Fmt

* EIP-2539 tests

* EIP-2539 tests

* Lint and test

* EIP-3026  (#16)

* Update shell.nix

* G1Add and G1Mul

* G1MultiExp

* G2Add

* G2Mul and G2MultiExp

* Bw6Pairing

* EIP-3026 tests

* EIP-3026 failure tests

* Fix lint

* Lint

* Lint and test

* Comment

* Deps order

* Fmt

* Lint

---------

Co-authored-by: Wei Tang <wei@pacna.org>
  • Loading branch information
2 people authored and ashutoshvarma committed May 28, 2023
1 parent a39a6fd commit 98fd0ad
Show file tree
Hide file tree
Showing 39 changed files with 1,517 additions and 3 deletions.
164 changes: 164 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ members = [
"frame/evm/precompile/ed25519",
"frame/evm/precompile/bn128",
"frame/evm/precompile/blake2",
"frame/evm/precompile/bw6761",
"frame/evm/precompile/bls12377",
"frame/evm/precompile/dispatch",
"frame/evm/precompile/curve25519",
"client/consensus",
Expand Down Expand Up @@ -151,3 +153,9 @@ pallet-evm-test-vector-support = { version = "1.0.0-dev", path = "frame/evm/test
pallet-hotfix-sufficients = { version = "1.0.0", path = "frame/hotfix-sufficients", default-features = false }
# Frontier Template
frontier-template-runtime = { path = "template/runtime", default-features = false }
# Arkworks
ark-bls12-377 = { version = "0.4.0", default-features = false, features = ["curve"] }
ark-bw6-761 = { version = "0.4.0", default-features = false }
ark-ec = { version = "0.4.0", default-features = false }
ark-ff = { version = "0.4.0", default-features = false }
ark-std = { version = "0.4.0", default-features = false }
33 changes: 33 additions & 0 deletions frame/evm/precompile/bls12377/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "pallet-evm-precompile-bls12377"
version = "1.0.0-dev"
authors = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }

[dependencies]
# Arkworks
ark-bls12-377 = { workspace = true }
ark-ec = { workspace = true }
ark-ff = { workspace = true }
ark-std = { workspace = true }

# Frontier
fp-evm = { workspace = true }

[dev-dependencies]
# Frontier
pallet-evm-test-vector-support = { workspace = true }

[features]
default = ["std"]
std = [
# Arkworks
"ark-bls12-377/std",
"ark-ec/std",
"ark-ff/std",
"ark-std/std",

# Frontier
"fp-evm/std",
]
Loading

0 comments on commit 98fd0ad

Please sign in to comment.