From 5a87473b982943da037cb70a6d4d803d42b2ce18 Mon Sep 17 00:00:00 2001 From: Martun Karapetyan Date: Mon, 8 Jan 2024 01:11:14 -0800 Subject: [PATCH 1/2] Change size to degree in assert of kzg. --- include/nil/crypto3/zk/commitments/polynomial/kzg.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp b/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp index 3fe4495e6..24cdbfb9f 100644 --- a/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp +++ b/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp @@ -689,7 +689,7 @@ namespace nil { std::vector result = {}; for (std::size_t i = 0; i < this->_polys[index].size(); ++i) { - BOOST_ASSERT(this->_polys[index][i].size() <= _params.commitment_key.size()); + BOOST_ASSERT(this->_polys[index][i].degree() <= _params.commitment_key.degree()); auto single_commitment = nil::crypto3::zk::algorithms::commit_one(_params, this->_polys[index][i]); this->_ind_commitments[index].push_back(single_commitment); auto single_commitment_bytes = KZGScheme::serializer::point_to_octets(single_commitment); From 3e446d3afa669ec0950f86eba374c1f2ec67c2fa Mon Sep 17 00:00:00 2001 From: Martun Karapetyan Date: Mon, 8 Jan 2024 01:16:27 -0800 Subject: [PATCH 2/2] Change an assert in KZG. --- include/nil/crypto3/zk/commitments/polynomial/kzg.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp b/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp index 24cdbfb9f..8e499cb61 100644 --- a/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp +++ b/include/nil/crypto3/zk/commitments/polynomial/kzg.hpp @@ -689,7 +689,7 @@ namespace nil { std::vector result = {}; for (std::size_t i = 0; i < this->_polys[index].size(); ++i) { - BOOST_ASSERT(this->_polys[index][i].degree() <= _params.commitment_key.degree()); + BOOST_ASSERT(this->_polys[index][i].degree() <= _params.commitment_key.size()); auto single_commitment = nil::crypto3::zk::algorithms::commit_one(_params, this->_polys[index][i]); this->_ind_commitments[index].push_back(single_commitment); auto single_commitment_bytes = KZGScheme::serializer::point_to_octets(single_commitment);