Skip to content

Commit

Permalink
test paths updated, merge errors corrected #98
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git committed Jan 17, 2023
1 parent a75a83e commit 080f3bf
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ namespace nil {
template<typename BlueprintFieldType, typename ArithmetizationParams>
class bool_scalar_multiplication<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
typename crypto3::algebra::curves::ed25519, 9>:
public component<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
9, 0, 0> {
public plonk_component<BlueprintFieldType, ArithmetizationParams, 9, 0, 0> {

constexpr static const std::uint32_t WitnessesAmount = 9;

using component_type = component<
crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
WitnessesAmount, 0, 0>;
using component_type = plonk_component<BlueprintFieldType, ArithmetizationParams, WitnessesAmount, 0, 0>;

public:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/multiplication.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/addition.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/subtraction.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/multiplication.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/addition.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/subtraction.hpp>

namespace nil {
namespace blueprint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ namespace nil {
typename ArithmetizationParams>
class division_or_zero<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
BlueprintFieldType, 5>:
public component<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
5,1,1> {
public plonk_component<BlueprintFieldType, ArithmetizationParams, 5, 0, 0> {

constexpr static const std::int32_t WitnessAmount = 5;

using component_type = component<
crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
WitnessAmount,1,1>;
using component_type = plonk_component<BlueprintFieldType, ArithmetizationParams, WitnessAmount, 0, 0>;

public:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,11 @@ namespace nil {
typename ArithmetizationParams>
class mul_by_constant<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
BlueprintFieldType, 2>:
public component<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
2,1,1> {
public plonk_component<BlueprintFieldType, ArithmetizationParams, 2, 1, 0> {

constexpr static const std::int32_t WitnessAmount = 2;

using component_type = component<
crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
WitnessAmount,1,1>;
using component_type = plonk_component<BlueprintFieldType, ArithmetizationParams, WitnessAmount, 1, 0>;

public:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ namespace nil {

template<typename BlueprintFieldType, typename ArithmetizationParams>
class sha512<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>, 9>:
public component<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
9, 2, 5> {
public plonk_component<BlueprintFieldType, ArithmetizationParams, 9, 1, 0> {

using ArithmetizationType = crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>;
using component_type = component<ArithmetizationType, 9, 2, 5>;
using component_type = plonk_component<BlueprintFieldType, ArithmetizationParams, 9, 1, 0>;

using sha512_process_component = sha512_process<ArithmetizationType, 9, 1>;
// using decomposition_component =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,12 @@ namespace nil {

template<typename BlueprintFieldType, typename ArithmetizationParams>
class sha512_process<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>, 9, 1>:
public component<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
9, 1, 0> {
public plonk_component<BlueprintFieldType, ArithmetizationParams, 9, 1, 0> {

constexpr static const std::uint32_t WitnessesAmount = 9;
constexpr static const std::uint32_t ConstantsAmount = 1;

using component_type = component<
crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType, ArithmetizationParams>,
WitnessesAmount, ConstantsAmount, 0>;
using component_type = plonk_component<BlueprintFieldType, ArithmetizationParams, WitnessesAmount, ConstantsAmount, 0>;

public:

Expand Down
22 changes: 11 additions & 11 deletions test/algebra/fields/plonk/field_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_multiplication) {

using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::multiplication<ArithmetizationType, BlueprintFieldType, 3>;
using component_type = blueprint::components::multiplication<ArithmetizationType, BlueprintFieldType, 3, nil::blueprint::basic_non_native_policy<BlueprintFieldType>>;

typename BlueprintFieldType::value_type x = 2;
typename BlueprintFieldType::value_type y = 12;
Expand All @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_multiplication) {
assert(expected_res == var_value(assignment, real_res.output));
};

component_type component_instance({0, 1, 2},{},{0});
component_type component_instance({0, 1, 2},{},{});

crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda>(
component_instance, public_input, result_check, instance_input);
Expand All @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_addition) {

using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::addition<ArithmetizationType, BlueprintFieldType, 3>;
using component_type = blueprint::components::addition<ArithmetizationType, BlueprintFieldType, 3, nil::blueprint::basic_non_native_policy<BlueprintFieldType>>;

typename BlueprintFieldType::value_type x = 2;
typename BlueprintFieldType::value_type y = 22;
Expand All @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_addition) {
assert(expected_res == var_value(assignment, real_res.output));
};

component_type component_instance({0, 1, 2},{},{0});
component_type component_instance({0, 1, 2},{},{});

crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda>(
component_instance, public_input, result_check, instance_input);
Expand All @@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_division) {

using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::division<ArithmetizationType, BlueprintFieldType, 4>;
using component_type = blueprint::components::division<ArithmetizationType, BlueprintFieldType, 4, nil::blueprint::basic_non_native_policy<BlueprintFieldType>>;

typename BlueprintFieldType::value_type x = 16;
typename BlueprintFieldType::value_type y = 2;
Expand All @@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_division) {
assert(expected_res == var_value(assignment, real_res.output));
};

component_type component_instance({0, 1, 2, 3},{},{0});
component_type component_instance({0, 1, 2, 3},{},{});

crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda>(
component_instance, public_input, result_check, instance_input);
Expand All @@ -176,7 +176,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_subtraction) {

using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::subtraction<ArithmetizationType, BlueprintFieldType, 3>;
using component_type = blueprint::components::subtraction<ArithmetizationType, BlueprintFieldType, 3, nil::blueprint::basic_non_native_policy<BlueprintFieldType>>;

typename BlueprintFieldType::value_type x = 0x56BC8334B5713726A_cppui256;
typename BlueprintFieldType::value_type y = 101;
Expand All @@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_subtraction) {
assert(expected_res == var_value(assignment, real_res.output));
};

component_type component_instance({0, 1, 2},{},{0});
component_type component_instance({0, 1, 2},{},{});

crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda>(
component_instance, public_input, result_check, instance_input);
Expand Down Expand Up @@ -230,7 +230,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_mul_by_constant) {
assert(expected_res == var_value(assignment, real_res.output));
};

component_type component_instance({0, 1},{0},{0});
component_type component_instance({0, 1},{0},{});
crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda>(
component_instance, public_input, result_check, instance_input);
}
Expand All @@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_div_or_zero) {
using BlueprintFieldType = typename curve_type::base_field_type;
constexpr std::size_t WitnessColumns = 5;
constexpr std::size_t PublicInputColumns = 1;
constexpr std::size_t ConstantColumns = 1;
constexpr std::size_t ConstantColumns = 0;
constexpr std::size_t SelectorColumns = 1;
using ArithmetizationParams =
crypto3::zk::snark::plonk_arithmetization_params<WitnessColumns, PublicInputColumns, ConstantColumns, SelectorColumns>;
Expand All @@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(blueprint_plonk_div_or_zero) {
assert(expected_res == var_value(assignment, real_res.output));
};

component_type component_instance({0, 1, 2, 3, 4},{0},{0});
component_type component_instance({0, 1, 2, 3, 4},{},{});
crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda>(
component_instance, public_input, result_check, instance_input);
}
Expand Down
6 changes: 3 additions & 3 deletions test/algebra/fields/plonk/non_native/addition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/addition.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/addition.hpp>

#include "../../test_plonk_component.hpp"
#include "../../../../test_plonk_component.hpp"

using namespace nil;

Expand All @@ -63,7 +63,7 @@ void test_field_add(std::vector<typename BlueprintFieldType::value_type> public_
using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::addition<ArithmetizationType,
typename ed25519_type::base_field_type, 9>;
typename ed25519_type::base_field_type, 9, blueprint::basic_non_native_policy<BlueprintFieldType>>;

std::array<var, 4> input_var_a = {
var(0, 0, false, var::column_type::public_input), var(0, 1, false, var::column_type::public_input),
Expand Down
4 changes: 2 additions & 2 deletions test/algebra/fields/plonk/non_native/bit_decomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/bit_decomposition.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/bit_decomposition.hpp>

#include "../../test_plonk_component.hpp"
#include "../../../../test_plonk_component.hpp"

using namespace nil;

Expand Down
6 changes: 3 additions & 3 deletions test/algebra/fields/plonk/non_native/multiplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/multiplication.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/multiplication.hpp>

#include "../../test_plonk_component.hpp"
#include "../../../../test_plonk_component.hpp"

using namespace nil;

Expand All @@ -64,7 +64,7 @@ void test_field_mul(std::vector<typename BlueprintFieldType::value_type> public_
using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::multiplication<ArithmetizationType,
typename ed25519_type::base_field_type, 9>;
typename ed25519_type::base_field_type, 9, blueprint::basic_non_native_policy<BlueprintFieldType>>;

std::array<var, 4> input_var_a = {
var(0, 0, false, var::column_type::public_input), var(0, 1, false, var::column_type::public_input),
Expand Down
6 changes: 3 additions & 3 deletions test/algebra/fields/plonk/non_native/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/range.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/range.hpp>

#include "../../test_plonk_component.hpp"
#include "../../../../test_plonk_component.hpp"

using namespace nil;

Expand All @@ -59,7 +59,7 @@ void test_field_range(std::vector<typename BlueprintFieldType::value_type> publi
using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::range<ArithmetizationType,
typename crypto3::algebra::fields::curve25519_base_field, 9>;
typename crypto3::algebra::fields::curve25519_base_field, 9, blueprint::basic_non_native_policy<BlueprintFieldType>>;

std::array<var, 4> input_var = {
var(0, 0, false, var::column_type::public_input), var(0, 1, false, var::column_type::public_input),
Expand Down
2 changes: 1 addition & 1 deletion test/algebra/fields/plonk/non_native/reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>

#include <nil/blueprint/components/non_native/algebra/fields/plonk/reduction.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/reduction.hpp>

#include "test_plonk_component.hpp"

Expand Down
6 changes: 3 additions & 3 deletions test/algebra/fields/plonk/non_native/subtraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/subtraction.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/subtraction.hpp>

#include "../../test_plonk_component.hpp"
#include "../../../../test_plonk_component.hpp"

using namespace nil;

Expand All @@ -64,7 +64,7 @@ void test_field_sub(std::vector<typename BlueprintFieldType::value_type> public_
using var = crypto3::zk::snark::plonk_variable<BlueprintFieldType>;

using component_type = blueprint::components::subtraction<ArithmetizationType,
typename ed25519_type::base_field_type, 9>;
typename ed25519_type::base_field_type, 9, nil::blueprint::basic_non_native_policy<BlueprintFieldType>>;

std::array<var, 4> input_var_a = {
var(0, 0, false, var::column_type::public_input), var(0, 1, false, var::column_type::public_input),
Expand Down
8 changes: 4 additions & 4 deletions test/hashes/plonk/sha512.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ template <typename BlueprintFieldType>
void test_sha512(std::vector<typename BlueprintFieldType::value_type> public_input){

constexpr std::size_t WitnessColumns = 9;
constexpr std::size_t PublicInputColumns = 5;
constexpr std::size_t ConstantColumns = 2;
constexpr std::size_t SelectorColumns = 15;
constexpr std::size_t PublicInputColumns = 1;
constexpr std::size_t ConstantColumns = 1;
constexpr std::size_t SelectorColumns = 5;
using hash_type = nil::crypto3::hashes::keccak_1600<256>;
constexpr std::size_t Lambda = 1;

Expand Down Expand Up @@ -89,7 +89,7 @@ void test_sha512(std::vector<typename BlueprintFieldType::value_type> public_inp
auto result_check = [](AssignmentType &assignment,
typename component_type::result_type &real_res) {};

component_type component_instance({0, 1, 2, 3, 4, 5, 6, 7, 8},{0, 1},{0, 1, 2, 3, 4});
component_type component_instance({0, 1, 2, 3, 4, 5, 6, 7, 8},{0},{});

nil::crypto3::test_component<component_type, BlueprintFieldType, ArithmetizationParams, hash_type, Lambda> (component_instance, public_input, result_check, instance_input);
}
Expand Down
2 changes: 1 addition & 1 deletion test/non_native/plonk/bool_scalar_multiplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/bool_scalar_multiplication.hpp>
#include <nil/blueprint/components/algebra/curves/edwards/plonk/non_native/bool_scalar_multiplication.hpp>

#include "../../test_plonk_component.hpp"

Expand Down
2 changes: 1 addition & 1 deletion test/non_native/plonk/complete_addition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/complete_addition_edwards25519.hpp>
#include <nil/blueprint/components/algebra/curves/edwards/plonk/non_native/complete_addition.hpp>

#include "../../test_plonk_component.hpp"

Expand Down
2 changes: 1 addition & 1 deletion test/non_native/plonk/doubling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <nil/blueprint/blueprint/plonk/circuit.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
#include <nil/blueprint/components/non_native/algebra/fields/plonk/doubling_edwards25519.hpp>
#include <nil/blueprint/components/algebra/fields/plonk/non_native/doubling_edwards25519.hpp>

#include "../../test_plonk_component.hpp"

Expand Down

0 comments on commit 080f3bf

Please sign in to comment.