Skip to content

Commit 328c153

Browse files
rodiazetchfast
andcommitted
evmmax: Enable new epairing implementation
Co-authored-by: Paweł Bylica <[email protected]>
1 parent 5447833 commit 328c153

File tree

3 files changed

+2
-76
lines changed

3 files changed

+2
-76
lines changed

test/state/precompiles.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ inline constexpr auto traits = []() noexcept {
576576
{expmod_analyze, expmod_stub},
577577
{ecadd_analyze, ecadd_execute},
578578
{ecmul_analyze, ecmul_execute},
579-
{ecpairing_analyze, ecpairing_stub},
579+
{ecpairing_analyze, ecpairing_execute},
580580
{blake2bf_analyze, blake2bf_execute},
581581
{point_evaluation_analyze, point_evaluation_execute},
582582
{bls12_g1add_analyze, bls12_g1add_execute},
@@ -594,7 +594,7 @@ inline constexpr auto traits = []() noexcept {
594594
tbl[static_cast<size_t>(PrecompileId::expmod)].execute = silkpre_expmod_execute;
595595
// tbl[static_cast<size_t>(PrecompileId::ecadd)].execute = silkpre_ecadd_execute;
596596
// tbl[static_cast<size_t>(PrecompileId::ecmul)].execute = silkpre_ecmul_execute;
597-
tbl[static_cast<size_t>(PrecompileId::ecpairing)].execute = silkpre_ecpairing_execute;
597+
// tbl[static_cast<size_t>(PrecompileId::ecpairing)].execute = silkpre_ecpairing_execute;
598598
// tbl[static_cast<size_t>(PrecompileId::blake2bf)].execute = silkpre_blake2bf_execute;
599599
#endif
600600
return tbl;

test/state/precompiles_stubs.cpp

-72
Original file line numberDiff line numberDiff line change
@@ -384,76 +384,4 @@ ExecutionResult expmod_stub(
384384
};
385385
return stubs.lookup({input, input_size}, output, max_output_size);
386386
}
387-
388-
ExecutionResult ecpairing_stub(
389-
const uint8_t* input, size_t input_size, uint8_t* output, size_t max_output_size) noexcept
390-
{
391-
static const auto _0 = "0000000000000000000000000000000000000000000000000000000000000000"_hex;
392-
static const auto _1 = "0000000000000000000000000000000000000000000000000000000000000001"_hex;
393-
static const HashedInputStubs stubs{
394-
{0x006b0484c653b1be16a359057269baa24e343db52e44dce7c6cefeef149735f3_bytes32, _1},
395-
{0x086b338f7e1848d3b4403b1c68ec8aca7a528ede6b8ec2fe224befd44be88fce_bytes32, _0},
396-
{0x1c99829c90fc052bddb247280db7e125d01ea5fa3837be302bb4385faf04c21e_bytes32, _0},
397-
{0x2fe4971f59c3dedb114db9798d3bdd9141ff8396e083e72ac3ce6cfedcf4e0b0_bytes32, _1},
398-
{0x34ab9af661244dbcf8f5579970f5052c7d3c210ce13b6ca1c11172c7863a10f0_bytes32, _1},
399-
{0x40653f9463fc27af1ae2d102513f34a73d3b3b7ddcecdd5b610ff03edeaf72c9_bytes32, _0},
400-
{0x5101633c6b687ee8aee29d9618ac1397a30cd7a14ff339cb19608101ed74813c_bytes32, _1},
401-
{0x58272cd6bf0816a2a7bcc15804d2e94efb1dc38505d3349b6372f0bbcf5e1a6c_bytes32, _1},
402-
{0x5a815339f8a25c8e84000b0372b4cbb4dd70277eb1f53dba5f51a419673348be_bytes32, _0},
403-
{0x5e8c3b1154f324f528a87fd8ee700753aa61df9ac087029cca81909985a16ccd_bytes32, _1},
404-
{0x722bf5c9235aae2151346ce1d19ef04b006aa7766268bf836377445092da5441_bytes32, _0},
405-
{0x730792bc8e23a24142495d77d62d22713f03bd3171abbe79e41eed071b064347_bytes32, _0},
406-
{0x79b0f933a47d870f4605811e2bcb2ca804b5d0afbae398b2f1b8106b30afa6af_bytes32, _1},
407-
{0x86400f22e06689a2968f0a4089bda8c60df97f463e7166b7b967c7e919edf0ff_bytes32, _1},
408-
{0x982485363eccb2a35b40cb7c5389901fe540e00bc4261bb3d856a9b49f11207f_bytes32, _1},
409-
{0xa60b9fc20ee07592f3581aca8ac1f77e609a1b353b3a66a6f4c29f521e533b73_bytes32, _1},
410-
{0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470_bytes32, _1},
411-
{0xd0c775f8d408d1c6e863c2d529a7edfbe3df1737d86bb6b69edc7508ad4e4926_bytes32, _1},
412-
{0xd3eb0c32becbfb2d9c6c15edf0d51f84daac9dda3ce2d6506e1d4573db29bb89_bytes32, _1},
413-
{0xd41981a62a65bc8d3ec7e86aeaadf0a5069f58c61705f64ead9d6a33f56f6b5b_bytes32, _1},
414-
415-
// https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stZeroKnowledge/ecpairing_inputsFiller.yml#L88-L92
416-
{0xedf5a91b7972b77cef24e42ebf683ef81bdbc2f97cad1e6197f42cdea5e9d489_bytes32, _0},
417-
{0x38052a6ac4c5131f3391bb49ad3f1d5f00c9eff3a68696eccaf776c31de66755_bytes32, _0},
418-
{0x4bff5699271962bf77165efea69c77ae9620d5d63d9e6cf2aacfa6180d76be64_bytes32, _0},
419-
{0xb4e6d4451f859e560863f3097450b57c481ac2604889f528ae25fd82294bb2ee_bytes32, _0},
420-
{0x2c6a9ba3568c7c3a4d167645185dc247e56fee419984c63071ad398315c91e10_bytes32, _0},
421-
422-
// https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stZeroKnowledge/ecpairing_inputsFiller.yml#L93-L125
423-
{0xb67d886462fac350fdee4f6c7e9039e76ecd8b76bb3966da171a3e27667c1ec9_bytes32, _1},
424-
{0x1335e5982cf4b93dd6841c0037bdebe204b87e82e10a3c79c01f762a1e7c4d1a_bytes32, _1},
425-
{0x954e14906cb50e29de9f03d4a36c64f5404022853d22bdceae6fb4283f8c1832_bytes32, _1},
426-
{0xe5b53f3cf626793a6025fdd553f7b541ac3cb92dfb93601902e87b2827eff7a6_bytes32, _1},
427-
{0x34d0e58d51512383475806ca14f4a5c78459060fd01cd4be57ff9f7c69a6351b_bytes32, _1},
428-
{0xd59908760c797c4e1abb89ac297c3584c0fc0f56ec5c4edd807813fc3104143c_bytes32, _1},
429-
{0x38fccf0bf46a22541e77dbe7f8349b5ee76dc074ef550c3b0c79919f102a3d7c_bytes32, _1},
430-
{0xff13ad7025ffe82f4f3d05bd7981640865cbe06f8ad8f10305410c57e57c853f_bytes32, _1},
431-
{0x3567df81192e58f480ee7424c01bef8ecd7cb831f30c3550977acda477c7d457_bytes32, _1},
432-
{0x4e399cd983cb3849d73c8132b3af7700fe8eb76aa1ea359462abea6d6b385341_bytes32, _1},
433-
{0x4d52c96da659d1fba37d0b5658afc3ba1d2c593753e01dc37be19c3f723f6ffb_bytes32, _1},
434-
{0x271eea9d94639a22eae52eee98aee895210f60539d20bc4dec1949e461107395_bytes32, _1},
435-
{0x06a5d258a138e0430e5fa9e5d3d0456d2081ee35014d06a44559120272b04927_bytes32, _1},
436-
{0xf1c5b77850ef1d521ded25b7b6940b54b47601c28b46bc512b22721d953a8f45_bytes32, _1},
437-
{0x76d73dac407ca9a4aa671c25628f3d9ca60bd7490c42f27201c5e5214b726353_bytes32, _1},
438-
{0x642ce9262387f9368e917753262ee445c20c27334e9808b924c8ef00e12fcb75_bytes32, _1},
439-
{0x7407aa98cf3a0263df6d1c3f5d24a0ffe29bd8cebba48552a50cb06b4fb225ad_bytes32, _1},
440-
{0x50847a4741f81644bf49a4ce22329d8487c34897001701b35cf1fcb37cd0590e_bytes32, _1},
441-
{0x73cfc82608f54bd4e6c7d729afe9e690adf9d88e856f0aa6cac2b26fc7890ef2_bytes32, _1},
442-
{0x0676ac886e215342147e4ff6f2d62a3d2a79b41ba532760394098840efb5b11a_bytes32, _1},
443-
{0x46958a07ceea64e3e46b9338b85718027ddca6b6531ad59912ad98fc30bdfb74_bytes32, _1},
444-
{0x29780bc45a549776559b934dbb1ad289a45e5d0b07c7a75401ac311a99d4bf8e_bytes32, _1},
445-
{0x4f519b293c0fc788e39591955bed841763afa836b07afaba0dbf28db756122e8_bytes32, _1},
446-
{0x59c33dc069ff2818c161df2baafe51a21106739aa4f54e4251536833aa0d28cc_bytes32, _1},
447-
{0xede6d3ebd333189a99f4d5b6ca6dd03296f7b3c83dba9ebe5a99a8eecac126d3_bytes32, _1},
448-
{0x75aef1dc2eb432680d33ed9d330008dce5cf71e9e3cd6bf4b68575e5e613a076_bytes32, _1},
449-
{0x151397d397dd7647321e386990a1fcbb13544b507ffb29c38ec95f10f9ea65d5_bytes32, _1},
450-
{0x3ef93cb30d7b786f9d294566676aecd29dd7cd05ee1da48a3f8281f7cfd5923c_bytes32, _1},
451-
{0x45f50343a48f7ea57bfc317e5170b945e748124cdbedacf163fe0674790149ad_bytes32, _1},
452-
{0xbfa15492c7462ec9ac2a2c4a1f02ef12518746920ce5254673a9af0917f5b856_bytes32, _1},
453-
{0x06ea20597bf9cf2951d7a127cbbac029ab479d668e8cb848595fb8af0d2620d0_bytes32, _1},
454-
{0x14fe90e9791ada31b07cc85195109e573f1902fa2692a12113ae0a1af8c9753f_bytes32, _1},
455-
{0x7ac98487a7b592bff7e5b04f9e5454f218ebcf1b51c705794b795860a35f8253_bytes32, _1},
456-
};
457-
return stubs.lookup({input, input_size}, output, max_output_size);
458-
}
459387
} // namespace evmone::state

test/state/precompiles_stubs.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ namespace evmone::state
99
{
1010
ExecutionResult expmod_stub(
1111
const uint8_t* input, size_t input_size, uint8_t* output, size_t max_output_size) noexcept;
12-
ExecutionResult ecpairing_stub(
13-
const uint8_t* input, size_t input_size, uint8_t* output, size_t max_output_size) noexcept;
1412
} // namespace evmone::state

0 commit comments

Comments
 (0)