71
71
#include < nil/crypto3/random/algebraic_engine.hpp>
72
72
73
73
#include < nil/blueprint/transpiler/evm_verifier_gen.hpp>
74
- #include < nil/blueprint/transpiler/recursive_verifier_generator.hpp>
74
+ // #include <nil/blueprint/transpiler/recursive_verifier_generator.hpp>
75
75
76
76
#include " ./detail/circuits.hpp"
77
77
@@ -120,6 +120,7 @@ typename fri_type::params_type create_fri_params(std::size_t degree_log, const i
120
120
121
121
return params;
122
122
}
123
+
123
124
// *******************************************************************************
124
125
// * Randomness setup
125
126
// *******************************************************************************/
@@ -132,7 +133,7 @@ nil::crypto3::random::algebraic_engine<FieldType> test_global_alg_rnd_engine;
132
133
struct test_initializer {
133
134
// Enumerate all fields used in tests;
134
135
using field1_type = algebra::curves::pallas::base_field_type;
135
-
136
+ using field2_type = algebra::curves::bls12< 381 >::scalar_field_type;
136
137
test_initializer () {
137
138
test_global_seed = 0 ;
138
139
@@ -155,6 +156,7 @@ struct test_initializer {
155
156
BOOST_TEST_MESSAGE (" test_global_seed = " << test_global_seed);
156
157
test_global_rnd_engine = boost::random::mt11213b (test_global_seed);
157
158
test_global_alg_rnd_engine<field1_type> = nil::crypto3::random ::algebraic_engine<field1_type>(test_global_seed);
159
+ test_global_alg_rnd_engine<field2_type> = nil::crypto3::random ::algebraic_engine<field2_type>(test_global_seed);
158
160
}
159
161
160
162
void setup () {
@@ -176,7 +178,6 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit1)
176
178
using merkle_hash_type = hashes::keccak_1600<256 >;
177
179
using transcript_hash_type = hashes::keccak_1600<256 >;
178
180
constexpr static const std::size_t table_rows_log = 4 ;
179
- constexpr static const std::size_t table_rows = 1 << table_rows_log;
180
181
181
182
struct placeholder_test_params {
182
183
constexpr static const std::size_t table_rows = 1 << table_rows_log;
@@ -192,7 +193,7 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit1)
192
193
using arithmetization_params =
193
194
plonk_arithmetization_params<witness_columns, public_input_columns, constant_columns, selector_columns>;
194
195
195
- constexpr static const std::size_t lambda = 1 ;
196
+ constexpr static const std::size_t lambda = 40 ;
196
197
constexpr static const std::size_t m = 2 ;
197
198
};
198
199
typedef placeholder_circuit_params<field_type, typename placeholder_test_params::arithmetization_params> circuit_params;
@@ -207,16 +208,17 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit1)
207
208
crypto3::zk::commitments::proof_of_work<transcript_hash_type, std::uint32_t , 0xFFFF8000 >
208
209
>;
209
210
210
-
211
211
using lpc_type = commitments::list_polynomial_commitment<field_type, lpc_params_type>;
212
212
using lpc_scheme_type = typename commitments::lpc_commitment_scheme<lpc_type>;
213
213
using lpc_placeholder_params_type = nil::crypto3::zk::snark::placeholder_params<circuit_params, lpc_scheme_type>;
214
214
using policy_type = zk::snark::detail::placeholder_policy<field_type, lpc_placeholder_params_type>;
215
+
215
216
BOOST_FIXTURE_TEST_CASE (transpiler_test, test_initializer) {
216
217
auto circuit = circuit_test_1<field_type>(test_global_alg_rnd_engine<field_type>);
218
+
217
219
plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;
218
220
219
- desc.rows_amount = table_rows;
221
+ desc.rows_amount = placeholder_test_params:: table_rows;
220
222
desc.usable_rows_amount = placeholder_test_params::usable_rows;
221
223
222
224
typename policy_type::constraint_system_type constraint_system (
@@ -227,7 +229,6 @@ BOOST_FIXTURE_TEST_CASE(transpiler_test, test_initializer) {
227
229
);
228
230
typename policy_type::variable_assignment_type assignments = circuit.table ;
229
231
230
-
231
232
std::vector<std::size_t > columns_with_copy_constraints = {0 , 1 , 2 , 3 };
232
233
233
234
@@ -261,7 +262,7 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit2)
261
262
using curve_type = algebra::curves::bls12<381 >;
262
263
using field_type = typename curve_type::scalar_field_type;
263
264
264
- constexpr static const std::size_t table_rows_log = 4 ;
265
+ constexpr static const std::size_t table_rows_log = 3 ;
265
266
constexpr static const std::size_t table_rows = 1 << table_rows_log;
266
267
constexpr static const std::size_t permutation_size = 4 ;
267
268
constexpr static const std::size_t usable_rows = (1 << table_rows_log) - 3 ;
@@ -300,6 +301,7 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit2)
300
301
using lpc_placeholder_params_type = nil::crypto3::zk::snark::placeholder_params<circuit_t_params, lpc_scheme_type>;
301
302
302
303
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_t_params>;
304
+
303
305
BOOST_FIXTURE_TEST_CASE (transpiler_test, test_initializer) {
304
306
auto pi0 = test_global_alg_rnd_engine<field_type>();
305
307
auto circuit = circuit_test_t <field_type>(pi0, test_global_alg_rnd_engine<field_type>, test_global_rnd_engine);
@@ -316,7 +318,7 @@ BOOST_FIXTURE_TEST_CASE(transpiler_test, test_initializer) {
316
318
);
317
319
typename policy_type::variable_assignment_type assignments = circuit.table ;
318
320
319
- std::vector<std::size_t > columns_with_copy_constraints = {0 , 1 , 2 , 3 };
321
+ std::vector<std::size_t > columns_with_copy_constraints = {0 , 1 , 2 , 3 };
320
322
321
323
bool verifier_res;
322
324
@@ -384,8 +386,10 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit3)
384
386
using lpc_scheme_type = typename commitments::lpc_commitment_scheme<lpc_type>;
385
387
using lpc_placeholder_params_type = nil::crypto3::zk::snark::placeholder_params<circuit_params, lpc_scheme_type>;
386
388
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_params>;
389
+
387
390
BOOST_FIXTURE_TEST_CASE (transpiler_test, test_initializer) {
388
- auto circuit = circuit_test_3<field_type>();
391
+ auto circuit = circuit_test_3<field_type>(test_global_alg_rnd_engine<field_type>, test_global_rnd_engine);
392
+
389
393
plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;
390
394
391
395
desc.rows_amount = table_rows;
@@ -461,10 +465,12 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit4)
461
465
using lpc_scheme_type = typename commitments::lpc_commitment_scheme<lpc_type>;
462
466
using lpc_placeholder_params_type = nil::crypto3::zk::snark::placeholder_params<circuit_params, lpc_scheme_type>;
463
467
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_params>;
468
+
464
469
BOOST_FIXTURE_TEST_CASE (transpiler_test, test_initializer) {
465
- auto circuit = circuit_test_4<field_type>(test_global_alg_rnd_engine<field_type>, test_global_rnd_engine );
470
+ auto circuit = circuit_test_4<field_type>(test_global_alg_rnd_engine<field_type>);
466
471
467
472
plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;
473
+
468
474
desc.rows_amount = table_rows;
469
475
desc.usable_rows_amount = usable_rows;
470
476
@@ -540,10 +546,12 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit6)
540
546
using lpc_scheme_type = typename commitments::lpc_commitment_scheme<lpc_type>;
541
547
using lpc_placeholder_params_type = nil::crypto3::zk::snark::placeholder_params<circuit_params, lpc_scheme_type>;
542
548
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_params>;
549
+
543
550
BOOST_FIXTURE_TEST_CASE (transpiler_test, test_initializer) {
544
551
auto circuit = circuit_test_6<field_type>(test_global_alg_rnd_engine<field_type>, test_global_rnd_engine);
545
552
546
553
plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;
554
+
547
555
desc.rows_amount = table_rows;
548
556
desc.usable_rows_amount = usable_rows;
549
557
@@ -563,6 +571,7 @@ BOOST_FIXTURE_TEST_CASE(transpiler_test, test_initializer) {
563
571
typename placeholder_public_preprocessor<field_type, lpc_placeholder_params_type>::preprocessed_data_type
564
572
preprocessed_public_data = placeholder_public_preprocessor<field_type, lpc_placeholder_params_type>::process (
565
573
constraint_system, assignments.public_table (), desc, lpc_scheme, columns_with_copy_constraints.size ());
574
+
566
575
auto printer = nil::blueprint::evm_verifier_printer<lpc_placeholder_params_type>(
567
576
constraint_system,
568
577
preprocessed_public_data.common_data ,
@@ -619,6 +628,7 @@ BOOST_AUTO_TEST_SUITE(placeholder_circuit7)
619
628
using lpc_scheme_type = typename commitments::lpc_commitment_scheme<lpc_type>;
620
629
using lpc_placeholder_params_type = nil::crypto3::zk::snark::placeholder_params<circuit_params, lpc_scheme_type>;
621
630
using policy_type = zk::snark::detail::placeholder_policy<field_type, circuit_params>;
631
+
622
632
BOOST_FIXTURE_TEST_CASE (transpiler_test, test_initializer) {
623
633
auto circuit = circuit_test_7<field_type>(test_global_alg_rnd_engine<field_type>, test_global_rnd_engine);
624
634
plonk_table_description<field_type, typename circuit_params::arithmetization_params> desc;
@@ -639,6 +649,7 @@ BOOST_FIXTURE_TEST_CASE(transpiler_test, test_initializer) {
639
649
lpc_scheme_type lpc_scheme (fri_params);
640
650
641
651
std::vector<std::size_t > columns_with_copy_constraints = {0 , 1 , 2 , 3 };
652
+
642
653
transcript_type transcript;
643
654
644
655
typename placeholder_public_preprocessor<field_type, lpc_placeholder_params_type>::preprocessed_data_type
@@ -661,6 +672,7 @@ BOOST_FIXTURE_TEST_CASE(transpiler_test, test_initializer) {
661
672
}
662
673
BOOST_AUTO_TEST_SUITE_END ()
663
674
675
+ #if 0
664
676
BOOST_AUTO_TEST_SUITE(recursive_circuit1)
665
677
using Endianness = nil::marshalling::option::big_endian;
666
678
using TTypeBase = nil::marshalling::field_type<Endianness>;
@@ -1278,3 +1290,4 @@ BOOST_FIXTURE_TEST_CASE(transpiler_test, test_initializer) {
1278
1290
}
1279
1291
}
1280
1292
BOOST_AUTO_TEST_SUITE_END()
1293
+ #endif
0 commit comments