From 7bdb3f3484df6108367e16b9703d42b4a2220b76 Mon Sep 17 00:00:00 2001 From: Rumata888 Date: Thu, 26 Sep 2024 17:13:11 +0000 Subject: [PATCH] Fix for informational issue assert_equal with a constant without self_reduce could fail. Added comment --- .../barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp index 8ecc776afa5..bf522e86ff2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp @@ -2044,6 +2044,9 @@ template void bigfield::assert_less_t // check elements are equal mod p by proving their integer difference is a multiple of p. // This relies on the minus operator for a-b increasing a by a multiple of p large enough so diff is non-negative +// When one of the elements is a constant and another is a witness we check equality of limbs, so if the witness +// bigfield element is in an unreduced form, it needs to be reduced first. We don't have automatice reduced form +// detection for now, so it is up to the circuit writer to detect this template void bigfield::assert_equal(const bigfield& other) const { Builder* ctx = this->context ? this->context : other.context;