Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/vm/contracts.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ import (
"github.com/ava-labs/libevm/params"
)

// P256Verify is a [PrecompiledContract] implementation of P-256 (secp256r1)
// ECDSA verification, as defined by [EIP-7951].
//
// [EIP-7951]: https://eips.ethereum.org/EIPS/eip-7951
type P256Verify struct {
p256Verify
}

// ActivePrecompiles returns the precompiles enabled with the current configuration.
func ActivePrecompiles(rules params.Rules) []common.Address {
orig := activePrecompiles(rules) // original, upstream implementation
Expand Down
33 changes: 33 additions & 0 deletions core/vm/contracts_pkg_vm.libevm_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2025 the libevm authors.
//
// The libevm additions to go-ethereum are free software: you can redistribute
// them and/or modify them under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// The libevm additions are distributed in the hope that they will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
// General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see
// <http://www.gnu.org/licenses/>.

package vm

import (
"testing"

"github.com/ava-labs/libevm/common"
)

func TestExportedP256Verify(t *testing.T) {
addr := common.Address{'p', '2', '5', '6', 'l', 'i', 'b', 'e', 'v', 'm'}
allPrecompiles[addr] = &P256Verify{}
t.Cleanup(func() {
delete(allPrecompiles, addr)
})

testJson("p256verify", addr.Hex(), t)
}
Loading