Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random_test_initializer moved to crypto3/test_tools #52 #54

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

#include <nil/crypto3/zk/commitments/polynomial/fri.hpp>
#include <nil/crypto3/zk/commitments/polynomial/lpc.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>

using namespace nil::crypto3;

Expand Down
1 change: 1 addition & 0 deletions crypto3/libs/marshalling/zk/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ macro(define_marshalling_test test)
cm_test(NAME ${full_test_name} SOURCES ${test}.cpp)

target_include_directories(marshalling_zk_${name}_test PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../test_tools/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>"

Expand Down
7 changes: 4 additions & 3 deletions crypto3/libs/marshalling/zk/test/fri_commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@

#include <nil/crypto3/zk/commitments/detail/polynomial/basic_fri.hpp>
#include <nil/crypto3/zk/commitments/polynomial/fri.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>
#include <nil/crypto3/marshalling/zk/types/commitments/fri.hpp>

#include <nil/crypto3/test_tools/random_test_initializer.hpp>
#include <nil/crypto3/marshalling/zk/detail/random_test_data_generation.hpp>

using namespace nil::crypto3;
Expand Down Expand Up @@ -112,7 +113,7 @@ void test_fri_proof(typename FRI::proof_type &proof, typename nil::crypto3::mars
BOOST_CHECK(proof == constructed_val_read);
}

BOOST_FIXTURE_TEST_SUITE(marshalling_fri_proof_elements, zk::test_tools::random_test_initializer<algebra::curves::bls12<381>::scalar_field_type>)
BOOST_FIXTURE_TEST_SUITE(marshalling_fri_proof_elements, test_tools::random_test_initializer<algebra::curves::bls12<381>::scalar_field_type>)
static constexpr std::size_t lambda = 40;
static constexpr std::size_t m = 2;

Expand Down Expand Up @@ -218,7 +219,7 @@ BOOST_FIXTURE_TEST_SUITE(marshalling_fri_proof_elements, zk::test_tools::random_
BOOST_AUTO_TEST_SUITE_END()


BOOST_FIXTURE_TEST_SUITE(marshalling_real_fri_proofs, zk::test_tools::random_test_initializer<algebra::curves::pallas::base_field_type>)
BOOST_FIXTURE_TEST_SUITE(marshalling_real_fri_proofs, test_tools::random_test_initializer<algebra::curves::pallas::base_field_type>)
using Endianness = nil::marshalling::option::big_endian;

BOOST_AUTO_TEST_CASE(marshalling_fri_basic_test) {
Expand Down
8 changes: 5 additions & 3 deletions crypto3/libs/marshalling/zk/test/lpc_commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@

#include <nil/crypto3/zk/commitments/polynomial/fri.hpp>
#include <nil/crypto3/zk/commitments/polynomial/lpc.hpp>

#include <nil/crypto3/test_tools/random_test_initializer.hpp>
#include <nil/crypto3/marshalling/zk/detail/random_test_data_generation.hpp>

using namespace nil::crypto3;
Expand Down Expand Up @@ -170,7 +172,7 @@ BOOST_AUTO_TEST_SUITE(marshalling_random)
using LPC = typename nil::crypto3::zk::commitments::batched_list_polynomial_commitment<field_type, lpc_params_type>;
using lpc_scheme_type = nil::crypto3::zk::commitments::lpc_commitment_scheme<LPC, math::polynomial<typename field_type::value_type>>;

BOOST_FIXTURE_TEST_CASE(lpc_proof_test, zk::test_tools::random_test_initializer<field_type>) {
BOOST_FIXTURE_TEST_CASE(lpc_proof_test, test_tools::random_test_initializer<field_type>) {

typename FRI::params_type fri_params(1, r + 1, lambda, 4);

Expand All @@ -185,7 +187,7 @@ BOOST_FIXTURE_TEST_CASE(lpc_proof_test, zk::test_tools::random_test_initializer<
test_lpc_proof<Endianness, lpc_scheme_type>(proof, fri_params);
}

BOOST_FIXTURE_TEST_CASE(lpc_aggregated_proof_test, zk::test_tools::random_test_initializer<field_type>) {
BOOST_FIXTURE_TEST_CASE(lpc_aggregated_proof_test, test_tools::random_test_initializer<field_type>) {
typename FRI::params_type fri_params(1, r + 1, lambda, 4);

auto proof = generate_random_lpc_aggregated_proof<LPC>(
Expand All @@ -210,7 +212,7 @@ BOOST_AUTO_TEST_SUITE(marshalling_real)
using transcript_hash_type = nil::crypto3::hashes::keccak_1600<256>;
using merkle_tree_type = typename containers::merkle_tree<merkle_hash_type, 2>;

BOOST_FIXTURE_TEST_CASE(batches_num_3_test, zk::test_tools::random_test_initializer<field_type>){
BOOST_FIXTURE_TEST_CASE(batches_num_3_test, test_tools::random_test_initializer<field_type>){
// Setup types.
constexpr static const std::size_t lambda = 40;
constexpr static const std::size_t k = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/params.hpp>
#include <nil/crypto3/zk/snark/arithmetization/plonk/params.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/params.hpp>
#include <nil/crypto3/zk/snark/arithmetization/plonk/params.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
Expand All @@ -59,6 +59,7 @@
#include <nil/crypto3/marshalling/zk/types/commitments/kzg.hpp>
#include <nil/crypto3/marshalling/zk/types/commitments/lpc.hpp>
#include <nil/crypto3/marshalling/zk/types/placeholder/preprocessed_public_data.hpp>

#include <nil/crypto3/marshalling/zk/detail/random_test_data_generation.hpp>
#include "./detail/circuits.hpp"

Expand Down
2 changes: 1 addition & 1 deletion crypto3/libs/marshalling/zk/test/placeholder_proof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
#include <nil/crypto3/zk/snark/arithmetization/plonk/params.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp>
#include <nil/crypto3/zk/snark/arithmetization/plonk/table_description.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>

#include <nil/crypto3/marshalling/zk/types/commitments/eval_storage.hpp>
#include <nil/crypto3/marshalling/zk/types/commitments/kzg.hpp>
Expand All @@ -94,6 +93,7 @@
#include <nil/crypto3/math/algorithms/calculate_domain_set.hpp>

#include "./detail/circuits.hpp"
#include <nil/crypto3/test_tools/random_test_initializer.hpp>
#include <nil/crypto3/marshalling/zk/detail/random_test_data_generation.hpp>

using namespace nil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/placeholder_policy.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/params.hpp>
#include <nil/crypto3/zk/snark/arithmetization/plonk/variable.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include <nil/crypto3/random/algebraic_random_device.hpp>
#include <nil/crypto3/random/algebraic_engine.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/placeholder_policy.hpp>
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/params.hpp>
#include <nil/crypto3/zk/snark/arithmetization/plonk/variable.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include <nil/crypto3/random/algebraic_random_device.hpp>
#include <nil/crypto3/random/algebraic_engine.hpp>
Expand Down
4 changes: 3 additions & 1 deletion crypto3/libs/marshalling/zk/test/polys_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
#include <nil/crypto3/zk/commitments/polynomial/fri.hpp>
#include <nil/crypto3/zk/commitments/polynomial/lpc.hpp>
#include <nil/crypto3/zk/commitments/batched_commitment.hpp> // contains class polys_evaluator

#include <nil/crypto3/test_tools/random_test_initializer.hpp>
#include <nil/crypto3/marshalling/zk/detail/random_test_data_generation.hpp>

using namespace nil::crypto3;
Expand Down Expand Up @@ -111,7 +113,7 @@ BOOST_AUTO_TEST_SUITE(marshalling_real)
using transcript_hash_type = nil::crypto3::hashes::keccak_1600<256>;
using merkle_tree_type = typename containers::merkle_tree<merkle_hash_type, 2>;

BOOST_FIXTURE_TEST_CASE(batches_num_3_test, zk::test_tools::random_test_initializer<field_type>){
BOOST_FIXTURE_TEST_CASE(batches_num_3_test, test_tools::random_test_initializer<field_type>){
// Setup types.
constexpr static const std::size_t lambda = 40;
constexpr static const std::size_t k = 1;
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions crypto3/libs/zk/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
include(CMTest)

target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../test_tools/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <nil/crypto3/hash/algorithm/hash.hpp>
#include <nil/crypto3/hash/poseidon.hpp>

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

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <nil/crypto3/hash/algorithm/hash.hpp>
#include <nil/crypto3/hash/poseidon.hpp>

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

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <nil/crypto3/zk/transcript/fiat_shamir.hpp>
#include <nil/crypto3/zk/commitments/polynomial/fri.hpp>
#include <nil/crypto3/zk/commitments/polynomial/lpc.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include "circuits.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <nil/crypto3/algebra/fields/arithmetic_params/goldilocks64.hpp>

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

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <nil/crypto3/hash/keccak.hpp>
#include <nil/crypto3/hash/poseidon.hpp>

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

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include <nil/crypto3/zk/commitments/polynomial/kzg.hpp>
#include <nil/crypto3/zk/commitments/polynomial/kzg_v2.hpp>
#include <nil/crypto3/zk/commitments/batched_commitment.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include <nil/crypto3/zk/commitments/polynomial/lpc.hpp>
#include <nil/crypto3/zk/commitments/batched_commitment.hpp>

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

#include "circuits.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#include <nil/crypto3/zk/commitments/polynomial/fri.hpp>
#include <nil/crypto3/zk/commitments/polynomial/lpc.hpp>
#include <nil/crypto3/zk/commitments/batched_commitment.hpp>
#include <nil/crypto3/zk/detail/random_test_initializer.hpp>
#include <nil/crypto3/test_tools/random_test_initializer.hpp>

#include "circuits.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <nil/crypto3/algebra/fields/arithmetic_params/pallas.hpp>

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

#include "circuits.hpp"
#include "placeholder_test_runner.hpp"
Expand Down
Loading
Loading