From 7680be77b7e508df0fabdb325b4a8838c07f67dc Mon Sep 17 00:00:00 2001 From: Franco Victorio Date: Thu, 16 May 2024 17:56:41 +0200 Subject: [PATCH 1/2] Add precompile test for secp256r1 --- script/checks/precompiles.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/script/checks/precompiles.ts b/script/checks/precompiles.ts index 19bed14..8350833 100644 --- a/script/checks/precompiles.ts +++ b/script/checks/precompiles.ts @@ -101,4 +101,14 @@ export const precompiles: { expectedResponse: '0x000000000000000000000000000000000000000000000000000000000000100073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001', }, + { + // RIP-7212: Precompile for secp256r1 Curve Support + // This test vector is from https://github.com/maticnetwork/bor/blob/bade7f57df5c09ae060c15fc66aed488c526149e/core/vm/testdata/precompiles/p256Verify.json#L3 + // The secp256r1 precompile returns bytes32(1) if the signature is valid, and 0x otherwise. + address: '0x0000000000000000000000000000000000000100', + name: 'secp256r1', + testCalldata: + '0x4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4da73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d604aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff37618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e', + expectedResponse: '0x0000000000000000000000000000000000000000000000000000000000000001', + }, ]; From 4a0b4ea8d6f622ef657e90b59f8dc51f24952b9c Mon Sep 17 00:00:00 2001 From: Matt Solomon Date: Thu, 16 May 2024 13:45:21 -0700 Subject: [PATCH 2/2] update chain data --- script/data/chain/1.json | 5 ++++ script/data/chain/10.json | 5 ++++ script/data/chain/137.json | 5 ++++ script/data/chain/34443.json | 5 ++++ script/data/chain/42161.json | 5 ++++ script/data/chain/43114.json | 5 ++++ script/data/chain/534352.json | 5 ++++ script/data/chain/59144.json | 5 ++++ script/data/chain/8453.json | 5 ++++ script/data/feature/precompiles.json | 45 ++++++++++++++++++++++++++++ 10 files changed, 90 insertions(+) diff --git a/script/data/chain/1.json b/script/data/chain/1.json index 8b549c1..f53416a 100644 --- a/script/data/chain/1.json +++ b/script/data/chain/1.json @@ -292,6 +292,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/10.json b/script/data/chain/10.json index 2baf973..a362ff6 100644 --- a/script/data/chain/10.json +++ b/script/data/chain/10.json @@ -278,6 +278,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/137.json b/script/data/chain/137.json index 5b9cafe..4226dae 100644 --- a/script/data/chain/137.json +++ b/script/data/chain/137.json @@ -279,6 +279,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": true } ], "evmStackAddresses": { diff --git a/script/data/chain/34443.json b/script/data/chain/34443.json index 3eddb24..092c086 100644 --- a/script/data/chain/34443.json +++ b/script/data/chain/34443.json @@ -259,6 +259,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/42161.json b/script/data/chain/42161.json index 36bf865..30ce959 100644 --- a/script/data/chain/42161.json +++ b/script/data/chain/42161.json @@ -276,6 +276,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/43114.json b/script/data/chain/43114.json index f9c5aca..4f3bbc6 100644 --- a/script/data/chain/43114.json +++ b/script/data/chain/43114.json @@ -263,6 +263,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/534352.json b/script/data/chain/534352.json index 0021d68..ae0b942 100644 --- a/script/data/chain/534352.json +++ b/script/data/chain/534352.json @@ -266,6 +266,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/59144.json b/script/data/chain/59144.json index 3e13da1..e6a4348 100644 --- a/script/data/chain/59144.json +++ b/script/data/chain/59144.json @@ -283,6 +283,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/chain/8453.json b/script/data/chain/8453.json index 26c66c6..c1ccc57 100644 --- a/script/data/chain/8453.json +++ b/script/data/chain/8453.json @@ -279,6 +279,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "evmStackAddresses": { diff --git a/script/data/feature/precompiles.json b/script/data/feature/precompiles.json index 2b833d9..3751afd 100644 --- a/script/data/feature/precompiles.json +++ b/script/data/feature/precompiles.json @@ -49,6 +49,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "10": [ @@ -101,6 +106,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "137": [ @@ -153,6 +163,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": true } ], "8453": [ @@ -205,6 +220,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "34443": [ @@ -257,6 +277,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": true + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "42161": [ @@ -309,6 +334,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "43114": [ @@ -361,6 +391,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "59144": [ @@ -413,6 +448,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ], "534352": [ @@ -465,6 +505,11 @@ "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", "implemented": false + }, + { + "name": "secp256r1", + "address": "0x0000000000000000000000000000000000000100", + "implemented": false } ] }