From dbc9877db70528fa0f52af3a69a3848c681a6523 Mon Sep 17 00:00:00 2001 From: timemarkovqtum Date: Fri, 27 Sep 2024 09:42:41 +0200 Subject: [PATCH] Add point evaluation correct proof tests --- src/Makefile.test.include | 2 + src/test/qtumtests/data/point_evaluation.json | 260 ++++++++++++++++++ src/test/qtumtests/kzg_tests.cpp | 14 +- 3 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 src/test/qtumtests/data/point_evaluation.json diff --git a/src/Makefile.test.include b/src/Makefile.test.include index d74ea6ea0f..185197306a 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -26,6 +26,8 @@ JSON_TEST_FILES = \ test/qtumtests/data/alt_bn128_G1_mul.json \ test/qtumtests/data/alt_bn128_pairing_product.json \ test/qtumtests/data/blake2_compression.json \ + test/qtumtests/data/blake2_compression.json \ + test/qtumtests/data/point_evaluation.json \ test/data/script_tests.json \ test/data/bip341_wallet_vectors.json \ test/data/base58_encode_decode.json \ diff --git a/src/test/qtumtests/data/point_evaluation.json b/src/test/qtumtests/data/point_evaluation.json new file mode 100644 index 0000000000..257157969b --- /dev/null +++ b/src/test/qtumtests/data/point_evaluation.json @@ -0,0 +1,260 @@ +[ + { + "Input": "012b08a0504a63aac18383db69fe6b52fc833e3d060b87c2726c4140c909d91807dddd3c80995c2bb3012943e2036e77490b1f6ddc58ca39a4fb4f3225ae56ab11dc2c4d89f777f0f5c2a51f45b73ff1538761f9cf23ed74c74472fea625ad8bace1db77e25ceb316d914182e05dd810f112352e1d6ed9e47af28e2f64e22b94c411794359c2273bc10bc0390963fb1a97bb642307bfa4424c66bd90ecc0ecffd5045e492b40304df20346693db7450457e2c72588a6a2b1a16909e2ab1e6284", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench1", + "Gas": 50000 + }, + { + "Input": "019cd755316533108b9eade41e35a16442ae76acd5b7d4e8903ecb9d9f48348a00000000000000000000000000000000dd372dcb4e5565861fc29cfb12f4373861e6e2dfca75084191a505f7988db8e82a4a4a09734b6fd7677d590a1cb512768c381fc4957f406ef89996d9dfa1d39b5c8d1368569e56fd61036c537400a3f4515eeb0c4d183142daa2c30423e0c3fa84667445c1669d3a3e3fce8a1144811e4452841399318c21cca9d20c91fb162929c4e96d391b70158bcd4c69b682b272", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench2", + "Gas": 50000 + }, + { + "Input": "0187576b6a38dd4ca8ce00e35dd12d1dd91e06ba3bde49d01568103d826d59732fd172adc351401950681fb66f9464410b15437ab00599aede3f90d0d9552bd162920cfc9b91d123f2c24034006fc9b7f5217cfae1022be231b6bd37262fda83ac48e50cbfeeee227daee56a8bff2f96ede7757b6f2598bd40b14d75b04c07a92299443d1eabe857f57fc95b0ca8b121adff55fad542926063245c402008a846c60eeca2e419a3e9e12ddfc0184a606b31d39268d8b580b57ac274501858bdb5", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench3", + "Gas": 50000 + }, + { + "Input": "0145e6c573f2f24f95eeddb687df7da5da51ae1d58bc3691ff52c8d667e704db0000000000000000000000000000000076231706fc7f1f5cd05a88ed538b74ab2672abe246a6042b24c709294ea2e85672a6edc7aee8ab556adfd7af889086afa1bf23edb5e0300f4d924350197c497f084af76365a6209c4b93f00b1ffc803fb7847ca51f4fc1df4fdb9298c16d6a1ea038d42f9ffa40e872eb722e095ea19ff4f2e891a2676b93905476bc8186b741f64c7281f7bba1a14e086316bf5e4b67", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench4", + "Gas": 50000 + }, + { + "Input": "0129c00365c61f29b376a0ff296052604481bce870816c0b1d8a8643d5903c7e000000000000000000000000000000000ae90ade08feef8d4531b692a6ea98ff07cee3b22e47da139784b96a01c6f2291ecd756cd520c10b4c86db65c7ab754a8c4174fa25da26bb3121232ee8ab7d7bdacf4662971bf9fdc92a374b98dc8ca844ae3950ff5bdd1d956b9169666fcaefb44a2aae8ddcbb7be512604565391bc1d5468488c11dcf27be9f2003a651688d660d82060c225c078192ecb8c25ba802", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench5", + "Gas": 50000 + }, + { + "Input": "018490afa27e04a58f6be1ccd8376ad77819954b5c2c950eb88c5e23413e75356056276dbe61c3076bb23c172adb59beb669713669f42036f305d33e39405e4747420b62257ed239139f68d6f70904a3970809e2c159a5d869f2fe3d28f876ef8d6124ae4698b9b10d5333ed73fedde92b76d7009febd0bbd3eef4748bcfbf8080c452fc31461045e03e24d1a4db246a94f75bad459310cec7f3fe8f9798ba615fe3dffba3dd074d4b906e5c0b1a0db916a519f6251ce9b0f327e0628897f271", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench6", + "Gas": 50000 + }, + { + "Input": "01ae47a1b7702fdc67641c971a8a6b3296f9273667ac2fc540934aedd8d7a8ef3e3af8f3f90a55415e6e8b50e2b86b1b227de39feef2b98d840f39774220ca492345c4e5ba1ed2c0e414bd22fc9155c786e667b009272c6ff1596329668288b0abd3f3aff02af02fdff85f322067004c0a44ea8626d033f3c95470bc7fdda33a3f2ecf49ea24b94aba043b295b1ba82d8aa2ad2b1b9b2b0556679828f0e64a27988f1d9ebda3b00b9c6dbdee6e50aafdffd092583aeba3d42eb48d0cb09da2cc", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench7", + "Gas": 50000 + }, + { + "Input": "015234bf406d81ea1d44ef75f19f9932b426fb8c76ffffe93906d6f7dce0d04900000000000000000000000000000000c3e098d7dad534d2d51cd14da7e73cf442f7483e30344d2efe4d2c7ea3d8b67da3131476983d45d625b0ffabe960395489f402c36d9837eb7c0872a223dd64233e5ba7c6a5dd72de7f8c8406f3f87e5e31df83132ef527aa9dfd3a2f56c98799980fd810ab52f4edd43347a64889d2f9850acbe16d9494478c1a462b69a099a960a98f48971d50b7453e2a03227577b1", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench8", + "Gas": 50000 + }, + { + "Input": "01da11f18d57a31a52071af0062552bca6477958994aa068473a7182241ba65c0000000000000000000000000000000061acc5cf049e854931e084b9bc044ecb4bda7c50de18c50ec84b6d13009bb56afa474010fed9a9c861fc76077eb0b327ad2e1b9700e19f435fda3ad6a53d855315cf61ee2cf24d80b9fbf5523ed5ce76a5267617a4b4bd63234d37430ff0274f8024e664b701b13589313f6b315d32122effb0224b223e055c520c3593df101fcb5c51f823d7eb9a2b882e4c9cb46e2b", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench9", + "Gas": 50000 + }, + { + "Input": "01ff83fbe4488061b695d9e4632e9ab23c5b9dfb046241fac921659c2e3b6a4e5e88a0c20ef27ae5dea6e83a748115df152b207362c022a43c8ebbfbec73ea2a2b38376a1de4ed9abd35175ac422af7df2c6ddf1503979964b1d217747c108978969cc0fcbd47dba8b1e3cbba16920f3fc694fadbf203b55aa66aaf138a38ace946a7ccddc20f45d796cd60268df8a2487d06c11cdc50247c580c5dd25f6fb486053b73868038cb92c2ae6d429a7bde850177f31c9fde00ca824c8c59cd4ef49", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "precompiles_bench10", + "Gas": 50000 + }, + { + "Input": "010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440145eb7004fe57383e6c88b99d839937fddf3f99279353aaf8d5c9a75f91ce33c620000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof1", + "Gas": 50000 + }, + { + "Input": "01ad7666ef9d8f53b5adf54f029b13b6f171b1d0bd346a2ede315d3e243484ef73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000000000000000000000000000000000000000000000000000000000000000000093efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f14655692c51ff81dd71dab71cefecd79e8274b4b7ba36a0f40e2dc086bc4061c7f63249877db23297212991fd63e07b7ebc348", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof2", + "Gas": 50000 + }, + { + "Input": "01cf45213dd7b4716864d378f3c6d861467987e4d94b7f79a1f814a697e3863700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002a572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof3", + "Gas": 50000 + }, + { + "Input": "010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c44401400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof4", + "Gas": 50000 + }, + { + "Input": "014edfed8547661f6cb416eba53061a2f6dce872c0497e6dd485a876fe2567f1000000000000000000000000000000000000000000000000000000000000000050625ad853cc21ba40594f79591e5d35c445ecf9453014da6524c0cf6367c359a421e229565952cfff4ef3517100a97da1d4fe57956fa50a442f92af03b1bf37adacc8ad4ed209b31287ea5bb94d9d06b72d80393dc39beea3857cb3719277138876b2b207f1d5e54dd62a14e3242d123b5a6db066181ff01a51c26c9d2f400b", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof5", + "Gas": 50000 + }, + { + "Input": "014edfed8547661f6cb416eba53061a2f6dce872c0497e6dd485a876fe2567f1564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d363066d928e13fe443e957d82e3e71d48cb65d51028eb4483e719bf8efcdf12f7c321a421e229565952cfff4ef3517100a97da1d4fe57956fa50a442f92af03b1bf37adacc8ad4ed209b31287ea5bb94d9d06a444d6bb5aadc3ceb615b50d6606bd54bfe529f59247987cd1ab848d19de599a9052f1835fb0d0d44cf70183e19a68c9", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof6", + "Gas": 50000 + }, + { + "Input": "01466f7b14f0722bd581cf49418cd43fa8f085ce16e09cd3cdf65b3dfbbcb8c0000000000000000000000000000000000000000000000000000000000000000173eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000b7f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof7", + "Gas": 50000 + }, + { + "Input": "01cf45213dd7b4716864d378f3c6d861467987e4d94b7f79a1f814a697e38637564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d363060000000000000000000000000000000000000000000000000000000000000002a572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof8", + "Gas": 50000 + }, + { + "Input": "01228461eb9cfa5aecb883d64f7434b6c092be63e8599fa9da8473a13f8b804e73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff0000000058cdc98c4c44791bb8ba7e58a80324ef8c021c79c68e253c430fa2663188f7f2b49d88afcd7f6c61a8ea69eff5f609d2432b47e7e4cd50b02cdddb4e0c1460517e8df02e4e64dc55e3d8ca192d57193a9506a8dc7f3f720a592a79a4e711e28d8596854bac66b9cb2d6d361704f1735442d47ea09fda5e0984f0928ce7d2f5f6", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof9", + "Gas": 50000 + }, + { + "Input": "01466f7b14f0722bd581cf49418cd43fa8f085ce16e09cd3cdf65b3dfbbcb8c073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff0000000073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000b7f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof10", + "Gas": 50000 + }, + { + "Input": "01ad7666ef9d8f53b5adf54f029b13b6f171b1d0bd346a2ede315d3e243484ef0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000093efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f146556b9241c6816af6388d1014cd4d7dd21662a6e3d47f96c0257bce642b70e8e375839a880864638669c6a709b414ab8bffc", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof11", + "Gas": 50000 + }, + { + "Input": "01466f7b14f0722bd581cf49418cd43fa8f085ce16e09cd3cdf65b3dfbbcb8c0000000000000000000000000000000000000000000000000000000000000000273eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000b7f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof12", + "Gas": 50000 + }, + { + "Input": "01ad7666ef9d8f53b5adf54f029b13b6f171b1d0bd346a2ede315d3e243484ef000000000000000000000000000000000000000000000000000000000000000073e66878b46ae3705eb6a46a89213de7d3686828bfce5c19400fffff0010000193efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f146556b82ded761997f2c6f1bb3db1e1dada2ef06d936551667c82f659b75f99d2da2068b81340823ee4e829a93c9fbed7810d", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof13", + "Gas": 50000 + }, + { + "Input": "01e798154708fe7789429634053cbf9f99b619f9f084048927333fce637f549b73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000001522a4a7f34e1ea350ae07c29c96c7e79655aa926122e95fe69fcbd932ca49e98f59a8d2a1a625a17f3fea0fe5eb8c896db3764f3185481bc22f91b4aaffcca25f26936857bc3a7c2539ea8ec3a952b7a62ad71d14c5719385c0686f1871430475bf3a00f0aa3f7b8dd99a9abc2160744faf0070725e00b60ad9a026a15b1a8c", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof14", + "Gas": 50000 + }, + { + "Input": "01466f7b14f0722bd581cf49418cd43fa8f085ce16e09cd3cdf65b3dfbbcb8c0564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d3630673eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000b7f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof15", + "Gas": 50000 + }, + { + "Input": "014edfed8547661f6cb416eba53061a2f6dce872c0497e6dd485a876fe2567f100000000000000000000000000000000000000000000000000000000000000011824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffea421e229565952cfff4ef3517100a97da1d4fe57956fa50a442f92af03b1bf37adacc8ad4ed209b31287ea5bb94d9d06b0c829a8d2d3405304fecbea193e6c67f7c3912a6adc7c3737ad3f8a3b750425c1531a7426f03033a3994bc82a10609f", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof16", + "Gas": 50000 + }, + { + "Input": "01cf45213dd7b4716864d378f3c6d861467987e4d94b7f79a1f814a697e386375eb7004fe57383e6c88b99d839937fddf3f99279353aaf8d5c9a75f91ce33c620000000000000000000000000000000000000000000000000000000000000002a572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof17", + "Gas": 50000 + }, + { + "Input": "01cf45213dd7b4716864d378f3c6d861467987e4d94b7f79a1f814a697e3863773eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000000000000000000000000000000000000000000000000000000000000000000002a572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof18", + "Gas": 50000 + }, + { + "Input": "014edfed8547661f6cb416eba53061a2f6dce872c0497e6dd485a876fe2567f100000000000000000000000000000000000000000000000000000000000000022bf4e1f980eb94661a21affc4d7e6e56f214fe3e7dc4d20b98c66ffd43cabeb0a421e229565952cfff4ef3517100a97da1d4fe57956fa50a442f92af03b1bf37adacc8ad4ed209b31287ea5bb94d9d0689012990b0ca02775bd9df8145f6c936444b83f54df1f5f274fb4312800a6505dd000ee8ec7b0ea6d72092a3daf0bffb", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof19", + "Gas": 50000 + }, + { + "Input": "01228461eb9cfa5aecb883d64f7434b6c092be63e8599fa9da8473a13f8b804e0000000000000000000000000000000000000000000000000000000000000001443e7af5274b52214ea6c775908c54519fea957eecd98069165a8b771082fd51b49d88afcd7f6c61a8ea69eff5f609d2432b47e7e4cd50b02cdddb4e0c1460517e8df02e4e64dc55e3d8ca192d57193aa060b350ad63d61979b80b25258e7cc6caf781080222e0209b4a0b074decca874afc5c41de3313d8ed217d905e6ada43", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof20", + "Gas": 50000 + }, + { + "Input": "01466f7b14f0722bd581cf49418cd43fa8f085ce16e09cd3cdf65b3dfbbcb8c0000000000000000000000000000000000000000000000000000000000000000073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000b7f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof21", + "Gas": 50000 + }, + { + "Input": "014edfed8547661f6cb416eba53061a2f6dce872c0497e6dd485a876fe2567f173eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffca421e229565952cfff4ef3517100a97da1d4fe57956fa50a442f92af03b1bf37adacc8ad4ed209b31287ea5bb94d9d06aa86c458b3065e7ec244033a2ade91a7499561f482419a3a372c42a636dad98262a2ce926d142fd7cfe26ca148efe8b4", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof22", + "Gas": 50000 + }, + { + "Input": "01cf45213dd7b4716864d378f3c6d861467987e4d94b7f79a1f814a697e3863700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof23", + "Gas": 50000 + }, + { + "Input": "010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c444014564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d363060000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof24", + "Gas": 50000 + }, + { + "Input": "01cf45213dd7b4716864d378f3c6d861467987e4d94b7f79a1f814a697e3863700000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof25", + "Gas": 50000 + }, + { + "Input": "01ad7666ef9d8f53b5adf54f029b13b6f171b1d0bd346a2ede315d3e243484ef000000000000000000000000000000000000000000000000000000000000000264d3b6baf69395bde2abd1d43f99be66bc64581234fd363e2ae3a0d419cfc3fc93efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f146556893acd46552b81cc9e5ff6ca03dad873588f2c61031781367cfea2a2be4ef3090035623338711b3cf7eff4b4524df742", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof26", + "Gas": 50000 + }, + { + "Input": "01228461eb9cfa5aecb883d64f7434b6c092be63e8599fa9da8473a13f8b804e564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d363066c28d6edfea2f5e1638cb1a8be8197549d52e133fa9dae87e52abb45f7b192ddb49d88afcd7f6c61a8ea69eff5f609d2432b47e7e4cd50b02cdddb4e0c1460517e8df02e4e64dc55e3d8ca192d57193a8a46b67dcba4e3aa66f9952be69e1ecbc24e21d42b1df2bfe1c8e28431c6221a3f1d09808042f5624e857710cb24fb69", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof27", + "Gas": 50000 + }, + { + "Input": "01228461eb9cfa5aecb883d64f7434b6c092be63e8599fa9da8473a13f8b804e00000000000000000000000000000000000000000000000000000000000000026a75e4fe63e5e148c853462a680c3e3ccedea34719d28f19bf1b35ae4eea37d6b49d88afcd7f6c61a8ea69eff5f609d2432b47e7e4cd50b02cdddb4e0c1460517e8df02e4e64dc55e3d8ca192d57193aa38758fca85407078c0a7e5fd6d38b34340c809baa0e1fed9deaabb11aa503062acbbe23fcbe620a21b40a83bfa71b89", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof28", + "Gas": 50000 + }, + { + "Input": "01ad7666ef9d8f53b5adf54f029b13b6f171b1d0bd346a2ede315d3e243484ef564c0a11a0f704f4fc3e8acfe0f8245f0ad1347b378fbf96e206da11a5d36306000000000000000000000000000000000000000000000000000000000000000093efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f146556a256a681861974cdf6b116467044aa75c85b01076423a92c3335b93d10bf2fcb99b943a53adc1ab8feb6b475c4688948", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof29", + "Gas": 50000 + }, + { + "Input": "01466f7b14f0722bd581cf49418cd43fa8f085ce16e09cd3cdf65b3dfbbcb8c05eb7004fe57383e6c88b99d839937fddf3f99279353aaf8d5c9a75f91ce33c6273eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000000b7f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof30", + "Gas": 50000 + }, + { + "Input": "010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c44401473eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof_point_at_infinity1", + "Gas": 50000 + }, + { + "Input": "010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c44401400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof_point_at_infinity2", + "Gas": 50000 + }, + { + "Input": "010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c44401400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Expected": "000000000000000000000000000000000000000000000000000000000000100073EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001", + "Name": "correct_proof_point_at_infinity3", + "Gas": 50000 + } +] diff --git a/src/test/qtumtests/kzg_tests.cpp b/src/test/qtumtests/kzg_tests.cpp index 25efc82092..4724c40306 100644 --- a/src/test/qtumtests/kzg_tests.cpp +++ b/src/test/qtumtests/kzg_tests.cpp @@ -4,6 +4,11 @@ #include #include #include +#include +#include +#include +#include + #include using namespace evmc::literals; @@ -29,7 +34,7 @@ auto versioned_hash(std::span input) noexcept return hash; } -BOOST_FIXTURE_TEST_SUITE(kzg_tests, BasicTestingSetup) +BOOST_FIXTURE_TEST_SUITE(kzg_tests, TestChain100Setup) BOOST_AUTO_TEST_CASE(kzg_verify_proof_hash_invalid){ const auto r = kzg_verify_proof(ZERO32, ZERO32, ZERO32, POINT_AT_INFINITY, POINT_AT_INFINITY); @@ -62,6 +67,13 @@ BOOST_AUTO_TEST_CASE(kzg_verify_proof_constant){ BOOST_CHECK(r == true); } +BOOST_AUTO_TEST_CASE(checking_point_evaluation){ + // Call point_evaluation 0xa + dev::eth::ChainOperationParams const& params = globalSealEngine->chainParams(); + dev::u256 blockNumber = m_node.chainman->ActiveChain().Tip()->nHeight; + RunPrecompiledTests(point_evaluation, point_evaluation, params, blockNumber); +} + BOOST_AUTO_TEST_SUITE_END() }