Skip to content

Commit

Permalink
Added mutable copy constraint access to circuit. (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iluvmagick authored Mar 14, 2024
1 parent 7eb7859 commit 4c60190
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ namespace nil {
return _copy_constraints;
}

copy_constraints_container_type &mutable_copy_constraints() {
return _copy_constraints;
}

const lookup_gates_container_type &lookup_gates() const {
return _lookup_gates;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#ifndef CRYPTO3_ZK_PLONK_COPY_CONSTRAINT_HPP
#define CRYPTO3_ZK_PLONK_COPY_CONSTRAINT_HPP

#include <utility>

#include <nil/crypto3/zk/snark/arithmetization/plonk/variable.hpp>

namespace nil {
Expand All @@ -37,6 +39,12 @@ namespace nil {
template<typename FieldType>
using plonk_copy_constraint = std::pair<plonk_variable<typename FieldType::value_type>, plonk_variable<typename FieldType::value_type>>;

template<typename FieldType>
bool operator==(const plonk_copy_constraint<FieldType> &lhs, const plonk_copy_constraint<FieldType> &rhs) {
return ((lhs.first == rhs.first ) && (lhs.second == rhs.second)) ||
((lhs.first == rhs.second) && (lhs.second == rhs.first ));
}

} // namespace snark
} // namespace zk
} // namespace crypto3
Expand Down

0 comments on commit 4c60190

Please sign in to comment.