From 8c78dc1df4eefdd7a1945859a8a6f309aaefa6ee Mon Sep 17 00:00:00 2001 From: Areg Hayrapetian Date: Tue, 5 Jul 2022 22:40:17 -0700 Subject: [PATCH 1/4] GH-554: Allow zero in alt_bn128. Update fc submodule to include changes that allow zeros as inputs into the host functions dealing with the alt_bn128 curve. Tests have been updated to reflect the new behavior. --- libraries/fc | 2 +- unittests/crypto_primitives_tests.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/fc b/libraries/fc index b67cc2d9c6..68115c0793 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit b67cc2d9c69083096a946a556917cde002419ad2 +Subproject commit 68115c0793be9fbfb4c7f9f5b6f7eefa0b6cc788 diff --git a/unittests/crypto_primitives_tests.cpp b/unittests/crypto_primitives_tests.cpp index cdc6172010..5247f3b0f3 100644 --- a/unittests/crypto_primitives_tests.cpp +++ b/unittests/crypto_primitives_tests.cpp @@ -86,8 +86,8 @@ BOOST_AUTO_TEST_CASE( alt_bn128_add_test ) { try { { "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "1bd20beca3d8d28e536d2b5bd3bf36d76af68af5e6c96ca6e5519ba9ff8f53322a53edf6b48bcf5cb1c0b4ad1d36dfce06a79dcd6526f1c386a14d8ce4649844", - return_code::failure, - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + return_code::success, + "1bd20beca3d8d28e536d2b5bd3bf36d76af68af5e6c96ca6e5519ba9ff8f53322a53edf6b48bcf5cb1c0b4ad1d36dfce06a79dcd6526f1c386a14d8ce4649844" }, }; @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE( alt_bn128_mul_test ) { try { { "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "0312ed43559cf8ecbab5221256a56e567aac5035308e3f1d54954d8b97cd1c9b", - return_code::failure, + return_code::success, "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" }, }; @@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE( alt_bn128_pair_test ) { try { "12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa", } }, - 0 + 0 // With these input pairs, alt_bn128_pair should return 0 indicating a pair result of true. }, //test2: 1 pair => (G1_a,G2_a) G1_a not on curve @@ -286,10 +286,10 @@ BOOST_AUTO_TEST_CASE( alt_bn128_pair_test ) { try { }, }, - return_code::failure + 0 // With these input pairs, alt_bn128_pair should return 0 indicating a pair result of true. }, - //test6: 1 pair => (G1_a,G2_a) ; G1_a.x == |Fp| + //test5: 1 pair => (G1_a,G2_a) ; G1_a.x == |Fp| { { { //G1_a G2_a From 69d08e106a51d5f45319d63f6e61237a5d4c3c96 Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Mon, 27 Jun 2022 16:03:48 -0300 Subject: [PATCH 2/4] GH-602: Fix libff/gmp linking in EosioTester --- CMakeModules/EosioTester.cmake.in | 2 +- CMakeModules/EosioTesterBuild.cmake.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeModules/EosioTester.cmake.in b/CMakeModules/EosioTester.cmake.in index ae2ddbd91a..0d9d224ab9 100644 --- a/CMakeModules/EosioTester.cmake.in +++ b/CMakeModules/EosioTester.cmake.in @@ -104,7 +104,7 @@ macro(add_eosio_test_executable test_name) ${libbuiltins} ${libsecp256k1} ${libff} - @GMP_LIBRARIES@ + @GMP_LIBRARY@ ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} diff --git a/CMakeModules/EosioTesterBuild.cmake.in b/CMakeModules/EosioTesterBuild.cmake.in index 7300e55425..f00f1020cb 100644 --- a/CMakeModules/EosioTesterBuild.cmake.in +++ b/CMakeModules/EosioTesterBuild.cmake.in @@ -102,7 +102,7 @@ macro(add_eosio_test_executable test_name) ${libbuiltins} ${libsecp256k1} ${libff} - @GMP_LIBRARIES@ + @GMP_LIBRARY@ ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} From 66faea7d1a49400c223889293b48d4abd0fde873 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 6 Jul 2022 09:44:15 -0400 Subject: [PATCH 3/4] bump submod --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index 68115c0793..35c45cb2de 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 68115c0793be9fbfb4c7f9f5b6f7eefa0b6cc788 +Subproject commit 35c45cb2defe6ce5738074a47c18fdb7616bf9fc From a0e740b7953d7ad1c2e29483e82190d481c68b0f Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 6 Jul 2022 09:45:20 -0400 Subject: [PATCH 4/4] wrong reference --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index 35c45cb2de..26cffa0ae4 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 35c45cb2defe6ce5738074a47c18fdb7616bf9fc +Subproject commit 26cffa0ae4118bd6cd01458d1d98efa702ed92b1