26
26
// SOFTWARE.
27
27
// ---------------------------------------------------------------------------//
28
28
29
- #ifndef CRYPTO3_ZK_MARSHALLING_TEST_PLONK_CIRCUITS_HPP
30
- #define CRYPTO3_ZK_MARSHALLING_TEST_PLONK_CIRCUITS_HPP
29
+ #ifndef CRYPTO3_ZK_TEST_PLONK_CIRCUITS_HPP
30
+ #define CRYPTO3_ZK_TEST_PLONK_CIRCUITS_HPP
31
31
32
32
#define _RND_ algebra::random_element<FieldType>();
33
33
@@ -105,7 +105,8 @@ namespace nil {
105
105
106
106
template <typename FieldType>
107
107
circuit_description<FieldType, placeholder_circuit_params<FieldType, arithmetization_params_1>, 4 , 4 > circuit_test_1 (
108
- typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>()
108
+ typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>(),
109
+ boost::random::mt11213b rnd = boost::random::mt11213b()
109
110
) {
110
111
using assignment_type = typename FieldType::value_type;
111
112
@@ -242,7 +243,11 @@ namespace nil {
242
243
243
244
template <typename FieldType>
244
245
circuit_description<FieldType, placeholder_circuit_params<FieldType, arithmetization_params_t >, 4 , 4 >
245
- circuit_test_t (typename FieldType::value_type pi0 = FieldType::value_type::zero()) {
246
+ circuit_test_t (
247
+ typename FieldType::value_type pi0 = 0 ,
248
+ typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>(),
249
+ boost::random::mt11213b rnd = boost::random::mt11213b()
250
+ ) {
246
251
using assignment_type = typename FieldType::value_type;
247
252
248
253
constexpr static const std::size_t rows_log = 4 ;
@@ -372,7 +377,10 @@ namespace nil {
372
377
public_columns_3, constant_columns_3, selector_columns_3>;
373
378
374
379
template <typename FieldType>
375
- circuit_description<FieldType, placeholder_circuit_params<FieldType, arithmetization_params_3>, 3 , 3 > circuit_test_3 () {
380
+ circuit_description<FieldType, placeholder_circuit_params<FieldType, arithmetization_params_3>, 3 , 3 > circuit_test_3 (
381
+ typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>(),
382
+ boost::random::mt11213b rnd = boost::random::mt11213b()
383
+ ) {
376
384
using assignment_type = typename FieldType::value_type;
377
385
using field_type = typename FieldType::value_type;
378
386
@@ -489,7 +497,10 @@ namespace nil {
489
497
490
498
template <typename FieldType>
491
499
circuit_description<FieldType, placeholder_circuit_params<FieldType,
492
- arithmetization_params_4>, 3 , 3 > circuit_test_4 () {
500
+ arithmetization_params_4>, 3 , 3 > circuit_test_4 (
501
+ typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>(),
502
+ boost::random::mt11213b rnd = boost::random::mt11213b()
503
+ ) {
493
504
using assignment_type = typename FieldType::value_type;
494
505
495
506
constexpr static const std::size_t rows_log = 3 ;
@@ -511,12 +522,11 @@ namespace nil {
511
522
table[j].resize (test_circuit.table_rows );
512
523
}
513
524
514
- srand (time (NULL ));
515
525
// lookup inputs
516
526
typename FieldType::value_type one = FieldType::value_type::one ();
517
527
typename FieldType::value_type zero = FieldType::value_type::zero ();
518
- table[0 ] = {rand () % 2 , rand () % 2 , rand (), rand () % 2 , rand () % 2 , 0 , 0 , 0 };
519
- table[1 ] = {rand () % 2 , rand () % 2 , rand (), rand () % 2 , rand () % 2 , 0 , 0 , 0 };;
528
+ table[0 ] = {rnd () % 2 , rnd () % 2 , rnd (), rnd () % 2 , rnd () % 2 , 0 , 0 , 0 };
529
+ table[1 ] = {rnd () % 2 , rnd () % 2 , rnd (), rnd () % 2 , rnd () % 2 , 0 , 0 , 0 };;
520
530
table[2 ] = {table[0 ][0 ] * table[1 ][0 ], table[0 ][1 ] * table[1 ][1 ], table[0 ][2 ] * table[1 ][2 ], table[0 ][3 ] * table[1 ][3 ], table[0 ][4 ] * table[1 ][4 ], 0 , 0 , 0 };
521
531
522
532
@@ -883,7 +893,10 @@ namespace nil {
883
893
884
894
template <typename FieldType>
885
895
circuit_description<FieldType, placeholder_circuit_params<FieldType,
886
- arithmetization_params_6>, 3 , 3 > circuit_test_6 () {
896
+ arithmetization_params_6>, 3 , 3 > circuit_test_6 (
897
+ typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>(),
898
+ boost::random::mt11213b rnd = boost::random::mt11213b()
899
+ ) {
887
900
using assignment_type = typename FieldType::value_type;
888
901
889
902
constexpr static const std::size_t rows_log = 3 ;
@@ -905,11 +918,10 @@ namespace nil {
905
918
table[j].resize (test_circuit.table_rows );
906
919
}
907
920
908
- srand (time (NULL ));
909
921
// lookup inputs
910
922
typename FieldType::value_type one = FieldType::value_type::one ();
911
923
typename FieldType::value_type zero = FieldType::value_type::zero ();
912
- table[0 ] = {rand () % 5 + 2 , rand () % 5 + 2 , rand () % 5 + 2 , rand () % 5 + 2 , rand () % 5 + 2 , rand () % 5 + 2 , 0 , 0 };
924
+ table[0 ] = {rnd () % 5 + 2 , rnd () % 5 + 2 , rnd () % 5 + 2 , rnd () % 5 + 2 , rnd () % 5 + 2 , rnd () % 5 + 2 , 0 , 0 };
913
925
table[1 ] = {7 , table[0 ][0 ] + table[0 ][1 ], table[0 ][1 ] + table[0 ][2 ], table[0 ][2 ] + table[0 ][3 ], table[0 ][3 ] + table[0 ][4 ], table[0 ][4 ] + table[0 ][5 ], 0 , 0 };;
914
926
915
927
@@ -1030,7 +1042,10 @@ namespace nil {
1030
1042
1031
1043
template <typename FieldType>
1032
1044
circuit_description<FieldType, placeholder_circuit_params<FieldType,
1033
- arithmetization_params_7>, 4 , 3 > circuit_test_7 () {
1045
+ arithmetization_params_7>, 4 , 3 > circuit_test_7 (
1046
+ typename nil::crypto3::random::algebraic_engine<FieldType> alg_rnd = nil::crypto3::random::algebraic_engine<FieldType>(),
1047
+ boost::random::mt11213b rnd = boost::random::mt11213b()
1048
+ ) {
1034
1049
using assignment_type = typename FieldType::value_type;
1035
1050
1036
1051
constexpr static const std::size_t rows_log = 4 ;
@@ -1052,12 +1067,11 @@ namespace nil {
1052
1067
table[j].resize (test_circuit.table_rows );
1053
1068
}
1054
1069
1055
- srand (time (NULL ));
1056
1070
// lookup inputs
1057
1071
typename FieldType::value_type one = FieldType::value_type::one ();
1058
1072
typename FieldType::value_type zero = FieldType::value_type::zero ();
1059
1073
1060
- auto r = rand () % 8 ;
1074
+ auto r = rnd () % 7 ;
1061
1075
table[0 ] = std::vector<typename FieldType::value_type>(16 );
1062
1076
std::size_t j = 0 ;
1063
1077
for ( std::size_t i = 0 ; i < 7 ; i++){
@@ -1088,8 +1102,8 @@ namespace nil {
1088
1102
constant_assignment[2 ] = {0 , 3 , 3 , 3 , 2 , 2 , 2 , 2 , 6 , 7 , 7 , 7 , 7 , 7 , 0 , 0 }; // Lookup tables
1089
1103
constant_assignment[3 ] = {0 , 4 , 4 , 4 , 4 , 3 , 3 , 3 , 64 , 128 , 128 , 128 , 128 , 128 , 0 , 0 }; // Lookup tables
1090
1104
constant_assignment[4 ] = {0 , 5 , 5 , 5 , 5 , 5 , 4 , 4 , 1 , 2 , 4 , 8 , 16 , 32 , 0 , 0 }; // Lookup tables
1091
- constant_assignment[5 ] = {0 , 6 , 6 , 6 , 6 , 6 , 5 , 5 , 64 , 128 , 256 , 512 , 1024 , 2048 , 0 , 0 }; // Lookup tables
1092
- constant_assignment[6 ] = {0 , 7 , 7 , 7 , 7 , 7 , 7 , 6 ,4096 ,8192 ,16384 ,16384 ,16384 ,16384 , 0 , 0 }; // Lookup tables
1105
+ constant_assignment[5 ] = {0 , 6 , 6 , 6 , 6 , 6 , 6 , 5 , 64 , 128 , 256 , 512 , 1024 , 2048 , 0 , 0 }; // Lookup tables
1106
+ constant_assignment[6 ] = {0 , 7 , 7 , 7 , 7 , 7 , 7 , 7 ,4096 ,8192 ,16384 ,16384 ,16384 ,16384 , 0 , 0 }; // Lookup tables
1093
1107
1094
1108
std::array<plonk_column<FieldType>, witness_columns> private_assignment;
1095
1109
for (std::size_t i = 0 ; i < witness_columns; i++) {
@@ -1182,4 +1196,4 @@ namespace nil {
1182
1196
} // namespace nil
1183
1197
1184
1198
1185
- #endif // CRYPTO3_MARSHALLING_ZK_TEST_PLONK_CIRCUITS_HPP
1199
+ #endif // CRYPTO3_ZK_TEST_PLONK_CIRCUITS_HPP
0 commit comments