diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.hpp index b33c935590f..ef84daaabb1 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.hpp @@ -158,7 +158,8 @@ void handle_blackbox_func_call(Circuit::Opcode::BlackBoxFuncCall const& arg, aci }); } else if constexpr (std::is_same_v) { af.fixed_base_scalar_mul_constraints.push_back(FixedBaseScalarMul{ - .scalar = arg.input.witness.value, + .low = arg.low.witness.value, + .high = arg.high.witness.value, .pub_key_x = arg.outputs[0].value, .pub_key_y = arg.outputs[1].value, }); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp index 18f1b59f4cd..d54f8a33c98 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp @@ -5,8 +5,10 @@ namespace acir_format { void create_fixed_base_constraint(Builder& builder, const FixedBaseScalarMul& input) { - field_ct scalar_as_field = field_ct::from_witness_index(&builder, input.scalar); - auto public_key = group_ct::fixed_base_scalar_mul_g1<254>(scalar_as_field); + field_ct low_as_field = field_ct::from_witness_index(&builder, input.low); + field_ct high_as_field = field_ct::from_witness_index(&builder, input.high); + (void)high_as_field; + auto public_key = group_ct::fixed_base_scalar_mul_g1<254>(low_as_field); builder.assert_equal(public_key.x.witness_index, input.pub_key_x); builder.assert_equal(public_key.y.witness_index, input.pub_key_y); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.hpp index 2a7088e67ad..fe4917a8d2a 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.hpp @@ -6,12 +6,13 @@ namespace acir_format { struct FixedBaseScalarMul { - uint32_t scalar; + uint32_t low; + uint32_t high; uint32_t pub_key_x; uint32_t pub_key_y; // for serialization, update with any new fields - MSGPACK_FIELDS(scalar, pub_key_x, pub_key_y); + MSGPACK_FIELDS(low, high, pub_key_x, pub_key_y); friend bool operator==(FixedBaseScalarMul const& lhs, FixedBaseScalarMul const& rhs) = default; }; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp index 60ca1a2c07e..92839b90ec2 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp @@ -126,7 +126,8 @@ struct BlackBoxFuncCall { }; struct FixedBaseScalarMul { - Circuit::FunctionInput input; + Circuit::FunctionInput low; + Circuit::FunctionInput high; std::array outputs; friend bool operator==(const FixedBaseScalarMul&, const FixedBaseScalarMul&); @@ -467,7 +468,8 @@ struct BlackBoxOp { }; struct FixedBaseScalarMul { - Circuit::RegisterIndex input; + Circuit::RegisterIndex low; + Circuit::RegisterIndex high; Circuit::HeapArray result; friend bool operator==(const FixedBaseScalarMul&, const FixedBaseScalarMul&); @@ -2379,7 +2381,10 @@ namespace Circuit { inline bool operator==(const BlackBoxFuncCall::FixedBaseScalarMul& lhs, const BlackBoxFuncCall::FixedBaseScalarMul& rhs) { - if (!(lhs.input == rhs.input)) { + if (!(lhs.low == rhs.low)) { + return false; + } + if (!(lhs.high == rhs.high)) { return false; } if (!(lhs.outputs == rhs.outputs)) { @@ -2413,7 +2418,8 @@ template void serde::Serializable::serialize( const Circuit::BlackBoxFuncCall::FixedBaseScalarMul& obj, Serializer& serializer) { - serde::Serializable::serialize(obj.input, serializer); + serde::Serializable::serialize(obj.low, serializer); + serde::Serializable::serialize(obj.high, serializer); serde::Serializable::serialize(obj.outputs, serializer); } @@ -2423,7 +2429,8 @@ Circuit::BlackBoxFuncCall::FixedBaseScalarMul serde::Deserializable< Circuit::BlackBoxFuncCall::FixedBaseScalarMul>::deserialize(Deserializer& deserializer) { Circuit::BlackBoxFuncCall::FixedBaseScalarMul obj; - obj.input = serde::Deserializable::deserialize(deserializer); + obj.low = serde::Deserializable::deserialize(deserializer); + obj.high = serde::Deserializable::deserialize(deserializer); obj.outputs = serde::Deserializable::deserialize(deserializer); return obj; } @@ -3134,7 +3141,10 @@ namespace Circuit { inline bool operator==(const BlackBoxOp::FixedBaseScalarMul& lhs, const BlackBoxOp::FixedBaseScalarMul& rhs) { - if (!(lhs.input == rhs.input)) { + if (!(lhs.low == rhs.low)) { + return false; + } + if (!(lhs.high == rhs.high)) { return false; } if (!(lhs.result == rhs.result)) { @@ -3167,7 +3177,8 @@ template void serde::Serializable::serialize( const Circuit::BlackBoxOp::FixedBaseScalarMul& obj, Serializer& serializer) { - serde::Serializable::serialize(obj.input, serializer); + serde::Serializable::serialize(obj.low, serializer); + serde::Serializable::serialize(obj.high, serializer); serde::Serializable::serialize(obj.result, serializer); } @@ -3177,7 +3188,8 @@ Circuit::BlackBoxOp::FixedBaseScalarMul serde::Deserializable::deserialize(deserializer); + obj.low = serde::Deserializable::deserialize(deserializer); + obj.high = serde::Deserializable::deserialize(deserializer); obj.result = serde::Deserializable::deserialize(deserializer); return obj; }