Skip to content

Commit

Permalink
Added quotient polynomial chunks test #330
Browse files Browse the repository at this point in the history
  • Loading branch information
vo-nil committed May 24, 2024
1 parent edeefb6 commit a95fdf9
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ set(TESTS_NAMES
"systems/plonk/placeholder/placeholder_kzg"
"systems/plonk/placeholder/placeholder_hashes"
"systems/plonk/placeholder/placeholder_curves"
"systems/plonk/placeholder/placeholder_quotient_polynomial_chunks"

# "systems/pcd/r1cs_pcd/r1cs_mp_ppzkpcd/r1cs_mp_ppzkpcd"
# "systems/pcd/r1cs_pcd/r1cs_sp_ppzkpcd/r1cs_sp_ppzkpcd"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2022 Mikhail Komarov <[email protected]>
// Copyright (c) 2022 Nikita Kaskov <[email protected]>
// Copyright (c) 2022 Ilia Shirobokov <[email protected]>
// Copyright (c) 2022 Alisa Cherniaeva <[email protected]>
// Copyright (c) 2022 Ilias Khairullin <[email protected]>
// Copyright (c) 2023 Elena Tatuzova <[email protected]>
// Copyright (c) 2024 Vasiliy Olekhov <[email protected]>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//---------------------------------------------------------------------------//
// Test circuit7 with different chunks of quotient polynomial
//

#define BOOST_TEST_MODULE placeholder_quotient_polynomial_chunks_test

#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>

#include <nil/crypto3/algebra/curves/pallas.hpp>
#include <nil/crypto3/algebra/fields/arithmetic_params/pallas.hpp>

#include <nil/crypto3/hash/keccak.hpp>
#include <nil/crypto3/zk/test_tools/random_test_initializer.hpp>

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"

using namespace nil::crypto3;
using namespace nil::crypto3::zk;
using namespace nil::crypto3::zk::snark;


BOOST_AUTO_TEST_SUITE(placeholder_quotient_polynomial_chunks)

using curve_type = algebra::curves::pallas;
using field_type = typename curve_type::base_field_type;
using hash_type = hashes::keccak_1600<256>;

using TestRunners = boost::mpl::list<
placeholder_test_runner< field_type, hash_type, hash_type, true, 8>,
placeholder_test_runner< field_type, hash_type, hash_type, true, 10>,
placeholder_test_runner< field_type, hash_type, hash_type, true, 30>,
placeholder_test_runner< field_type, hash_type, hash_type, true, 50>
>;

BOOST_AUTO_TEST_CASE_TEMPLATE(quotient_polynomial_test, TestRunner, TestRunners) {
test_tools::random_test_initializer<field_type> random_test_initializer;
auto circuit = circuit_test_7<field_type>(
random_test_initializer.alg_random_engines.template get_alg_engine<field_type>(),
random_test_initializer.generic_random_engine
);
TestRunner test_runner(circuit);
BOOST_CHECK(test_runner.run_test());
}
BOOST_AUTO_TEST_SUITE_END()

0 comments on commit a95fdf9

Please sign in to comment.