Skip to content

Commit

Permalink
Derandomize placeholder_placeholder_test #211
Browse files Browse the repository at this point in the history
  • Loading branch information
ETatuzova committed Oct 23, 2023
1 parent 7d471dd commit 3f9a4de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions test/systems/plonk/placeholder/circuits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace nil {
plonk_public_assignment_table<FieldType, arithmetization_params_1>(
public_input_assignment, constant_assignment, selectors_assignment));

test_circuit.table_rows = zk_padding<FieldType, arithmetization_params_1, plonk_column<FieldType>>(test_circuit.table);
test_circuit.table_rows = zk_padding<FieldType, arithmetization_params_1, plonk_column<FieldType>>(test_circuit.table, alg_rnd);

plonk_variable<assignment_type> w0(0, 0, true, plonk_variable<assignment_type>::column_type::witness);
plonk_variable<assignment_type> w1(1, 0, true, plonk_variable<assignment_type>::column_type::witness);
Expand Down Expand Up @@ -326,7 +326,7 @@ namespace nil {
plonk_private_assignment_table<FieldType, arithmetization_params_t>(private_assignment),
plonk_public_assignment_table<FieldType, arithmetization_params_t>(
public_input_assignment, constant_assignment, selectors_assignment));
test_circuit.table_rows = zk_padding<FieldType, arithmetization_params_t, plonk_column<FieldType>>(test_circuit.table);
test_circuit.table_rows = zk_padding<FieldType, arithmetization_params_t, plonk_column<FieldType>>(test_circuit.table, alg_rnd);

plonk_variable<assignment_type> w0(0, 0, true,
plonk_variable<assignment_type>::column_type::witness);
Expand Down Expand Up @@ -433,7 +433,7 @@ namespace nil {
plonk_private_assignment_table<FieldType, arithmetization_params_3>(private_assignment),
plonk_public_assignment_table<FieldType, arithmetization_params_3>(
public_input_assignment, constant_assignment, selectors_assignment));
test_circuit.table_rows = zk_padding(test_circuit.table);
test_circuit.table_rows = zk_padding(test_circuit.table, alg_rnd);

plonk_variable<assignment_type> w0(0, 0, true, plonk_variable<assignment_type>::column_type::witness);
plonk_variable<assignment_type> w1(1, 0, true, plonk_variable<assignment_type>::column_type::witness);
Expand Down Expand Up @@ -613,7 +613,9 @@ namespace nil {

template<typename FieldType, std::size_t usable_rows>
circuit_description<FieldType, placeholder_circuit_params<FieldType, arithmetization_params_fib>, usable_rows, 2>
circuit_test_fib() {
circuit_test_fib(
typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>()
) {
using assignment_type = typename FieldType::value_type;

constexpr static const std::size_t permutation = 2;
Expand Down Expand Up @@ -681,7 +683,7 @@ namespace nil {
plonk_private_assignment_table<FieldType, arithmetization_params_fib>(private_assignment),
plonk_public_assignment_table<FieldType, arithmetization_params_fib>(
public_input_assignment, constant_assignment, selectors_assignment));
test_circuit.table_rows = zk_padding<FieldType, arithmetization_params_fib, plonk_column<FieldType>>(test_circuit.table);
test_circuit.table_rows = zk_padding<FieldType, arithmetization_params_fib, plonk_column<FieldType>>(test_circuit.table, alg_rnd);

plonk_variable<assignment_type> w0(0, -1, true, plonk_variable<assignment_type>::column_type::witness);
plonk_variable<assignment_type> w1(0, 0, true, plonk_variable<assignment_type>::column_type::witness);
Expand Down Expand Up @@ -796,7 +798,7 @@ namespace nil {
plonk_private_assignment_table<FieldType, arithmetization_params_6>(private_assignment),
plonk_public_assignment_table<FieldType, arithmetization_params_6>(
public_input_assignment, constant_assignment, selectors_assignment));
test_circuit.table_rows = zk_padding(test_circuit.table);
test_circuit.table_rows = zk_padding(test_circuit.table, alg_rnd);

plonk_variable<assignment_type> w0( 0, 0, true, plonk_variable<assignment_type>::column_type::witness);
plonk_variable<assignment_type> w0_1(0,-1, true, plonk_variable<assignment_type>::column_type::witness);
Expand Down Expand Up @@ -958,7 +960,7 @@ namespace nil {
plonk_private_assignment_table<FieldType, arithmetization_params_7>(private_assignment),
plonk_public_assignment_table<FieldType, arithmetization_params_7>(
public_input_assignment, constant_assignment, selectors_assignment));
test_circuit.table_rows = zk_padding(test_circuit.table);
test_circuit.table_rows = zk_padding(test_circuit.table, alg_rnd);

plonk_variable<assignment_type> w0( 0, 0, true, plonk_variable<assignment_type>::column_type::witness);
plonk_variable<assignment_type> w0__7(0,-7, true, plonk_variable<assignment_type>::column_type::witness);
Expand Down
4 changes: 2 additions & 2 deletions test/systems/plonk/placeholder/placeholder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit3)
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_params>;

BOOST_FIXTURE_TEST_CASE(prover_test, test_initializer) {
auto circuit = circuit_test_3<field_type>();
auto circuit = circuit_test_3<field_type>(test_global_alg_rnd_engine<field_type>);

plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;

Expand Down Expand Up @@ -1068,7 +1068,7 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit6)
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_params>;

BOOST_FIXTURE_TEST_CASE(prover_test, test_initializer) {
auto circuit = circuit_test_6<field_type>();
auto circuit = circuit_test_6<field_type>(test_global_alg_rnd_engine<field_type>);

plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;

Expand Down

0 comments on commit 3f9a4de

Please sign in to comment.