diff --git a/include/nil/blueprint/components/algebra/curves/detail/plonk/mnt6_g2_point_addition.hpp b/include/nil/blueprint/components/algebra/curves/detail/plonk/mnt6_g2_point_addition.hpp index fa20a3f61..576139eba 100644 --- a/include/nil/blueprint/components/algebra/curves/detail/plonk/mnt6_g2_point_addition.hpp +++ b/include/nil/blueprint/components/algebra/curves/detail/plonk/mnt6_g2_point_addition.hpp @@ -1,5 +1,6 @@ //---------------------------------------------------------------------------// // Copyright (c) 2023 Alexey Yashunsky +// Copyright (c) 2024 Vasiliy Olekhov // // MIT License // @@ -26,8 +27,8 @@ // F_p^2 = F_p[u]/(u^2 - (-1)) and a a non-cubic residue. //---------------------------------------------------------------------------// -#ifndef CRYPTO3_BLUEPRINT_COMPONENTS_PLONK_BLS12_G2_POINT_ADDITION_HPP -#define CRYPTO3_BLUEPRINT_COMPONENTS_PLONK_BLS12_G2_POINT_ADDITION_HPP +#ifndef CRYPTO3_BLUEPRINT_COMPONENTS_PLONK_MNT6_G2_POINT_ADDITION_HPP +#define CRYPTO3_BLUEPRINT_COMPONENTS_PLONK_MNT6_G2_POINT_ADDITION_HPP #include @@ -59,10 +60,10 @@ namespace nil { // template - class bls12_g2_point_addition; + class mnt6_g2_point_addition; template - class bls12_g2_point_addition> + class mnt6_g2_point_addition> : public plonk_component { public: @@ -74,7 +75,7 @@ namespace nil { class gate_manifest_type : public component_gate_manifest { public: std::uint32_t gates_amount() const override { - return bls12_g2_point_addition::gates_amount; + return mnt6_g2_point_addition::gates_amount; } }; @@ -115,7 +116,7 @@ namespace nil { struct result_type { std::array R; - result_type(const bls12_g2_point_addition &component, std::uint32_t start_row_index) { + result_type(const mnt6_g2_point_addition &component, std::uint32_t start_row_index) { const std::size_t WA = component.witness_amount(); for(std::size_t i = 0; i < 4; i++) { @@ -132,15 +133,15 @@ namespace nil { }; template - explicit bls12_g2_point_addition(ContainerType witness) : component_type(witness, {}, {}, get_manifest()) {}; + explicit mnt6_g2_point_addition(ContainerType witness) : component_type(witness, {}, {}, get_manifest()) {}; template - bls12_g2_point_addition(WitnessContainerType witness, ConstantContainerType constant, + mnt6_g2_point_addition(WitnessContainerType witness, ConstantContainerType constant, PublicInputContainerType public_input) : component_type(witness, constant, public_input, get_manifest()) {}; - bls12_g2_point_addition( + mnt6_g2_point_addition( std::initializer_list witnesses, std::initializer_list @@ -151,16 +152,16 @@ namespace nil { }; template - using plonk_bls12_g2_point_addition = - bls12_g2_point_addition< + using plonk_mnt6_g2_point_addition = + mnt6_g2_point_addition< crypto3::zk::snark::plonk_constraint_system>; template - typename plonk_bls12_g2_point_addition::result_type generate_assignments( - const plonk_bls12_g2_point_addition &component, + typename plonk_mnt6_g2_point_addition::result_type generate_assignments( + const plonk_mnt6_g2_point_addition &component, assignment> &assignment, - const typename plonk_bls12_g2_point_addition::input_type + const typename plonk_mnt6_g2_point_addition::input_type &instance_input, const std::uint32_t start_row_index) { @@ -221,22 +222,22 @@ namespace nil { assignment.witness(component.W((22 + i) % WA),start_row_index + (WA < 24)) = yR.data[i]; } - return typename plonk_bls12_g2_point_addition::result_type( + return typename plonk_mnt6_g2_point_addition::result_type( component, start_row_index); } template std::size_t generate_gates( - const plonk_bls12_g2_point_addition &component, + const plonk_mnt6_g2_point_addition &component, circuit> &bp, assignment> &assignment, - const typename plonk_bls12_g2_point_addition::input_type + const typename plonk_mnt6_g2_point_addition::input_type &instance_input) { const std::size_t WA = component.witness_amount(); - using var = typename plonk_bls12_g2_point_addition::var; + using var = typename plonk_mnt6_g2_point_addition::var; using constraint_type = crypto3::zk::snark::plonk_constraint; // Fp2 field over constraints: @@ -326,14 +327,14 @@ namespace nil { template void generate_copy_constraints( - const plonk_bls12_g2_point_addition &component, + const plonk_mnt6_g2_point_addition &component, circuit> &bp, assignment> &assignment, - const typename plonk_bls12_g2_point_addition::input_type &instance_input, + const typename plonk_mnt6_g2_point_addition::input_type &instance_input, const std::size_t start_row_index) { - using var = typename plonk_bls12_g2_point_addition::var; + using var = typename plonk_mnt6_g2_point_addition::var; const std::size_t WA = component.witness_amount(); @@ -343,12 +344,12 @@ namespace nil { } template - typename plonk_bls12_g2_point_addition::result_type generate_circuit( - const plonk_bls12_g2_point_addition &component, + typename plonk_mnt6_g2_point_addition::result_type generate_circuit( + const plonk_mnt6_g2_point_addition &component, circuit> &bp, assignment> &assignment, - const typename plonk_bls12_g2_point_addition::input_type &instance_input, + const typename plonk_mnt6_g2_point_addition::input_type &instance_input, const std::size_t start_row_index) { std::size_t selector_index = generate_gates(component, bp, assignment, instance_input); @@ -357,7 +358,7 @@ namespace nil { generate_copy_constraints(component, bp, assignment, instance_input, start_row_index); - return typename plonk_bls12_g2_point_addition::result_type( + return typename plonk_mnt6_g2_point_addition::result_type( component, start_row_index); } @@ -365,4 +366,4 @@ namespace nil { } // namespace blueprint } // namespace nil -#endif // CRYPTO3_BLUEPRINT_COMPONENTS_PLONK_BLS12_G2_POINT_ADDITION_HPP +#endif // CRYPTO3_BLUEPRINT_COMPONENTS_PLONK_MNT6_G2_POINT_ADDITION_HPP