diff --git a/.yarnrc.yml b/.yarnrc.yml index fd534a48781..6d27afaac27 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -7,3 +7,6 @@ plugins: spec: "@yarnpkg/plugin-workspace-tools" yarnPath: .yarn/releases/yarn-3.6.3.cjs +logFilters: + - code: YN0013 + level: discard diff --git a/Cargo.lock b/Cargo.lock index 438d74b1b2d..1088bb63004 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,7 +44,6 @@ dependencies = [ "brillig_vm", "indexmap 1.9.3", "num-bigint", - "num-traits", "paste", "proptest", "rand 0.8.5", diff --git a/Dockerfile.packages b/Dockerfile.packages index 17eb0bcd648..f40670c19e4 100644 --- a/Dockerfile.packages +++ b/Dockerfile.packages @@ -2,14 +2,15 @@ FROM rust:alpine3.17 RUN apk update \ && apk upgrade \ && apk add --no-cache \ - build-base \ - pkgconfig \ - openssl-dev \ - npm \ - yarn \ - bash \ - jq \ - git + build-base \ + pkgconfig \ + openssl-dev \ + npm \ + yarn \ + bash \ + jq \ + git \ + curl WORKDIR /usr/src/noir COPY . . @@ -18,4 +19,4 @@ RUN ./scripts/bootstrap_packages.sh FROM scratch COPY --from=0 /usr/src/noir/packages /usr/src/noir/packages # For some unknown reason, on alpine only, we need this to exist. -COPY --from=0 /usr/src/noir/node_modules/@noir-lang /usr/src/noir/node_modules/@noir-lang \ No newline at end of file +COPY --from=0 /usr/src/noir/node_modules/@noir-lang /usr/src/noir/node_modules/@noir-lang diff --git a/acvm-repo/acir/codegen/acir.cpp b/acvm-repo/acir/codegen/acir.cpp index 2b217c7e93d..9b74a8ea631 100644 --- a/acvm-repo/acir/codegen/acir.cpp +++ b/acvm-repo/acir/codegen/acir.cpp @@ -145,6 +145,28 @@ namespace Circuit { static FixedBaseScalarMul bincodeDeserialize(std::vector); }; + struct EmbeddedCurveAdd { + Circuit::FunctionInput input1_x; + Circuit::FunctionInput input1_y; + Circuit::FunctionInput input2_x; + Circuit::FunctionInput input2_y; + std::array outputs; + + friend bool operator==(const EmbeddedCurveAdd&, const EmbeddedCurveAdd&); + std::vector bincodeSerialize() const; + static EmbeddedCurveAdd bincodeDeserialize(std::vector); + }; + + struct EmbeddedCurveDouble { + Circuit::FunctionInput input_x; + Circuit::FunctionInput input_y; + std::array outputs; + + friend bool operator==(const EmbeddedCurveDouble&, const EmbeddedCurveDouble&); + std::vector bincodeSerialize() const; + static EmbeddedCurveDouble bincodeDeserialize(std::vector); + }; + struct Keccak256 { std::vector inputs; std::vector outputs; @@ -184,7 +206,7 @@ namespace Circuit { static RecursiveAggregation bincodeDeserialize(std::vector); }; - std::variant value; + std::variant value; friend bool operator==(const BlackBoxFuncCall&, const BlackBoxFuncCall&); std::vector bincodeSerialize() const; @@ -406,6 +428,15 @@ namespace Circuit { static Blake2s bincodeDeserialize(std::vector); }; + struct Blake3 { + Circuit::HeapVector message; + Circuit::HeapArray output; + + friend bool operator==(const Blake3&, const Blake3&); + std::vector bincodeSerialize() const; + static Blake3 bincodeDeserialize(std::vector); + }; + struct Keccak256 { Circuit::HeapVector message; Circuit::HeapArray output; @@ -415,6 +446,15 @@ namespace Circuit { static Keccak256 bincodeDeserialize(std::vector); }; + struct Keccakf1600 { + Circuit::HeapVector message; + Circuit::HeapArray output; + + friend bool operator==(const Keccakf1600&, const Keccakf1600&); + std::vector bincodeSerialize() const; + static Keccakf1600 bincodeDeserialize(std::vector); + }; + struct EcdsaSecp256k1 { Circuit::HeapVector hashed_msg; Circuit::HeapArray public_key_x; @@ -481,7 +521,29 @@ namespace Circuit { static FixedBaseScalarMul bincodeDeserialize(std::vector); }; - std::variant value; + struct EmbeddedCurveAdd { + Circuit::RegisterIndex input1_x; + Circuit::RegisterIndex input1_y; + Circuit::RegisterIndex input2_x; + Circuit::RegisterIndex input2_y; + Circuit::HeapArray result; + + friend bool operator==(const EmbeddedCurveAdd&, const EmbeddedCurveAdd&); + std::vector bincodeSerialize() const; + static EmbeddedCurveAdd bincodeDeserialize(std::vector); + }; + + struct EmbeddedCurveDouble { + Circuit::RegisterIndex input1_x; + Circuit::RegisterIndex input1_y; + Circuit::HeapArray result; + + friend bool operator==(const EmbeddedCurveDouble&, const EmbeddedCurveDouble&); + std::vector bincodeSerialize() const; + static EmbeddedCurveDouble bincodeDeserialize(std::vector); + }; + + std::variant value; friend bool operator==(const BlackBoxOp&, const BlackBoxOp&); std::vector bincodeSerialize() const; @@ -703,28 +765,8 @@ namespace Circuit { static Brillig bincodeDeserialize(std::vector); }; - struct QuotientDirective { - Circuit::Expression a; - Circuit::Expression b; - Circuit::Witness q; - Circuit::Witness r; - std::optional predicate; - - friend bool operator==(const QuotientDirective&, const QuotientDirective&); - std::vector bincodeSerialize() const; - static QuotientDirective bincodeDeserialize(std::vector); - }; - struct Directive { - struct Quotient { - Circuit::QuotientDirective value; - - friend bool operator==(const Quotient&, const Quotient&); - std::vector bincodeSerialize() const; - static Quotient bincodeDeserialize(std::vector); - }; - struct ToLeRadix { Circuit::Expression a; std::vector b; @@ -746,7 +788,7 @@ namespace Circuit { static PermutationSort bincodeDeserialize(std::vector); }; - std::variant value; + std::variant value; friend bool operator==(const Directive&, const Directive&); std::vector bincodeSerialize() const; @@ -2160,6 +2202,100 @@ Circuit::BlackBoxFuncCall::FixedBaseScalarMul serde::Deserializable BlackBoxFuncCall::EmbeddedCurveAdd::bincodeSerialize() const { + auto serializer = serde::BincodeSerializer(); + serde::Serializable::serialize(*this, serializer); + return std::move(serializer).bytes(); + } + + inline BlackBoxFuncCall::EmbeddedCurveAdd BlackBoxFuncCall::EmbeddedCurveAdd::bincodeDeserialize(std::vector input) { + auto deserializer = serde::BincodeDeserializer(input); + auto value = serde::Deserializable::deserialize(deserializer); + if (deserializer.get_buffer_offset() < input.size()) { + throw serde::deserialization_error("Some input bytes were not read"); + } + return value; + } + +} // end of namespace Circuit + +template <> +template +void serde::Serializable::serialize(const Circuit::BlackBoxFuncCall::EmbeddedCurveAdd &obj, Serializer &serializer) { + serde::Serializable::serialize(obj.input1_x, serializer); + serde::Serializable::serialize(obj.input1_y, serializer); + serde::Serializable::serialize(obj.input2_x, serializer); + serde::Serializable::serialize(obj.input2_y, serializer); + serde::Serializable::serialize(obj.outputs, serializer); +} + +template <> +template +Circuit::BlackBoxFuncCall::EmbeddedCurveAdd serde::Deserializable::deserialize(Deserializer &deserializer) { + Circuit::BlackBoxFuncCall::EmbeddedCurveAdd obj; + obj.input1_x = serde::Deserializable::deserialize(deserializer); + obj.input1_y = serde::Deserializable::deserialize(deserializer); + obj.input2_x = serde::Deserializable::deserialize(deserializer); + obj.input2_y = serde::Deserializable::deserialize(deserializer); + obj.outputs = serde::Deserializable::deserialize(deserializer); + return obj; +} + +namespace Circuit { + + inline bool operator==(const BlackBoxFuncCall::EmbeddedCurveDouble &lhs, const BlackBoxFuncCall::EmbeddedCurveDouble &rhs) { + if (!(lhs.input_x == rhs.input_x)) { return false; } + if (!(lhs.input_y == rhs.input_y)) { return false; } + if (!(lhs.outputs == rhs.outputs)) { return false; } + return true; + } + + inline std::vector BlackBoxFuncCall::EmbeddedCurveDouble::bincodeSerialize() const { + auto serializer = serde::BincodeSerializer(); + serde::Serializable::serialize(*this, serializer); + return std::move(serializer).bytes(); + } + + inline BlackBoxFuncCall::EmbeddedCurveDouble BlackBoxFuncCall::EmbeddedCurveDouble::bincodeDeserialize(std::vector input) { + auto deserializer = serde::BincodeDeserializer(input); + auto value = serde::Deserializable::deserialize(deserializer); + if (deserializer.get_buffer_offset() < input.size()) { + throw serde::deserialization_error("Some input bytes were not read"); + } + return value; + } + +} // end of namespace Circuit + +template <> +template +void serde::Serializable::serialize(const Circuit::BlackBoxFuncCall::EmbeddedCurveDouble &obj, Serializer &serializer) { + serde::Serializable::serialize(obj.input_x, serializer); + serde::Serializable::serialize(obj.input_y, serializer); + serde::Serializable::serialize(obj.outputs, serializer); +} + +template <> +template +Circuit::BlackBoxFuncCall::EmbeddedCurveDouble serde::Deserializable::deserialize(Deserializer &deserializer) { + Circuit::BlackBoxFuncCall::EmbeddedCurveDouble obj; + obj.input_x = serde::Deserializable::deserialize(deserializer); + obj.input_y = serde::Deserializable::deserialize(deserializer); + obj.outputs = serde::Deserializable::deserialize(deserializer); + return obj; +} + namespace Circuit { inline bool operator==(const BlackBoxFuncCall::Keccak256 &lhs, const BlackBoxFuncCall::Keccak256 &rhs) { @@ -2457,6 +2593,47 @@ Circuit::BlackBoxOp::Blake2s serde::Deserializable return obj; } +namespace Circuit { + + inline bool operator==(const BlackBoxOp::Blake3 &lhs, const BlackBoxOp::Blake3 &rhs) { + if (!(lhs.message == rhs.message)) { return false; } + if (!(lhs.output == rhs.output)) { return false; } + return true; + } + + inline std::vector BlackBoxOp::Blake3::bincodeSerialize() const { + auto serializer = serde::BincodeSerializer(); + serde::Serializable::serialize(*this, serializer); + return std::move(serializer).bytes(); + } + + inline BlackBoxOp::Blake3 BlackBoxOp::Blake3::bincodeDeserialize(std::vector input) { + auto deserializer = serde::BincodeDeserializer(input); + auto value = serde::Deserializable::deserialize(deserializer); + if (deserializer.get_buffer_offset() < input.size()) { + throw serde::deserialization_error("Some input bytes were not read"); + } + return value; + } + +} // end of namespace Circuit + +template <> +template +void serde::Serializable::serialize(const Circuit::BlackBoxOp::Blake3 &obj, Serializer &serializer) { + serde::Serializable::serialize(obj.message, serializer); + serde::Serializable::serialize(obj.output, serializer); +} + +template <> +template +Circuit::BlackBoxOp::Blake3 serde::Deserializable::deserialize(Deserializer &deserializer) { + Circuit::BlackBoxOp::Blake3 obj; + obj.message = serde::Deserializable::deserialize(deserializer); + obj.output = serde::Deserializable::deserialize(deserializer); + return obj; +} + namespace Circuit { inline bool operator==(const BlackBoxOp::Keccak256 &lhs, const BlackBoxOp::Keccak256 &rhs) { @@ -2498,6 +2675,47 @@ Circuit::BlackBoxOp::Keccak256 serde::Deserializable BlackBoxOp::Keccakf1600::bincodeSerialize() const { + auto serializer = serde::BincodeSerializer(); + serde::Serializable::serialize(*this, serializer); + return std::move(serializer).bytes(); + } + + inline BlackBoxOp::Keccakf1600 BlackBoxOp::Keccakf1600::bincodeDeserialize(std::vector input) { + auto deserializer = serde::BincodeDeserializer(input); + auto value = serde::Deserializable::deserialize(deserializer); + if (deserializer.get_buffer_offset() < input.size()) { + throw serde::deserialization_error("Some input bytes were not read"); + } + return value; + } + +} // end of namespace Circuit + +template <> +template +void serde::Serializable::serialize(const Circuit::BlackBoxOp::Keccakf1600 &obj, Serializer &serializer) { + serde::Serializable::serialize(obj.message, serializer); + serde::Serializable::serialize(obj.output, serializer); +} + +template <> +template +Circuit::BlackBoxOp::Keccakf1600 serde::Deserializable::deserialize(Deserializer &deserializer) { + Circuit::BlackBoxOp::Keccakf1600 obj; + obj.message = serde::Deserializable::deserialize(deserializer); + obj.output = serde::Deserializable::deserialize(deserializer); + return obj; +} + namespace Circuit { inline bool operator==(const BlackBoxOp::EcdsaSecp256k1 &lhs, const BlackBoxOp::EcdsaSecp256k1 &rhs) { @@ -2780,6 +2998,100 @@ Circuit::BlackBoxOp::FixedBaseScalarMul serde::Deserializable BlackBoxOp::EmbeddedCurveAdd::bincodeSerialize() const { + auto serializer = serde::BincodeSerializer(); + serde::Serializable::serialize(*this, serializer); + return std::move(serializer).bytes(); + } + + inline BlackBoxOp::EmbeddedCurveAdd BlackBoxOp::EmbeddedCurveAdd::bincodeDeserialize(std::vector input) { + auto deserializer = serde::BincodeDeserializer(input); + auto value = serde::Deserializable::deserialize(deserializer); + if (deserializer.get_buffer_offset() < input.size()) { + throw serde::deserialization_error("Some input bytes were not read"); + } + return value; + } + +} // end of namespace Circuit + +template <> +template +void serde::Serializable::serialize(const Circuit::BlackBoxOp::EmbeddedCurveAdd &obj, Serializer &serializer) { + serde::Serializable::serialize(obj.input1_x, serializer); + serde::Serializable::serialize(obj.input1_y, serializer); + serde::Serializable::serialize(obj.input2_x, serializer); + serde::Serializable::serialize(obj.input2_y, serializer); + serde::Serializable::serialize(obj.result, serializer); +} + +template <> +template +Circuit::BlackBoxOp::EmbeddedCurveAdd serde::Deserializable::deserialize(Deserializer &deserializer) { + Circuit::BlackBoxOp::EmbeddedCurveAdd obj; + obj.input1_x = serde::Deserializable::deserialize(deserializer); + obj.input1_y = serde::Deserializable::deserialize(deserializer); + obj.input2_x = serde::Deserializable::deserialize(deserializer); + obj.input2_y = serde::Deserializable::deserialize(deserializer); + obj.result = serde::Deserializable::deserialize(deserializer); + return obj; +} + +namespace Circuit { + + inline bool operator==(const BlackBoxOp::EmbeddedCurveDouble &lhs, const BlackBoxOp::EmbeddedCurveDouble &rhs) { + if (!(lhs.input1_x == rhs.input1_x)) { return false; } + if (!(lhs.input1_y == rhs.input1_y)) { return false; } + if (!(lhs.result == rhs.result)) { return false; } + return true; + } + + inline std::vector BlackBoxOp::EmbeddedCurveDouble::bincodeSerialize() const { + auto serializer = serde::BincodeSerializer(); + serde::Serializable::serialize(*this, serializer); + return std::move(serializer).bytes(); + } + + inline BlackBoxOp::EmbeddedCurveDouble BlackBoxOp::EmbeddedCurveDouble::bincodeDeserialize(std::vector input) { + auto deserializer = serde::BincodeDeserializer(input); + auto value = serde::Deserializable::deserialize(deserializer); + if (deserializer.get_buffer_offset() < input.size()) { + throw serde::deserialization_error("Some input bytes were not read"); + } + return value; + } + +} // end of namespace Circuit + +template <> +template +void serde::Serializable::serialize(const Circuit::BlackBoxOp::EmbeddedCurveDouble &obj, Serializer &serializer) { + serde::Serializable::serialize(obj.input1_x, serializer); + serde::Serializable::serialize(obj.input1_y, serializer); + serde::Serializable::serialize(obj.result, serializer); +} + +template <> +template +Circuit::BlackBoxOp::EmbeddedCurveDouble serde::Deserializable::deserialize(Deserializer &deserializer) { + Circuit::BlackBoxOp::EmbeddedCurveDouble obj; + obj.input1_x = serde::Deserializable::deserialize(deserializer); + obj.input1_y = serde::Deserializable::deserialize(deserializer); + obj.result = serde::Deserializable::deserialize(deserializer); + return obj; +} + namespace Circuit { inline bool operator==(const BlockId &lhs, const BlockId &rhs) { @@ -3856,44 +4168,6 @@ Circuit::Directive serde::Deserializable::deserialize(Deseri return obj; } -namespace Circuit { - - inline bool operator==(const Directive::Quotient &lhs, const Directive::Quotient &rhs) { - if (!(lhs.value == rhs.value)) { return false; } - return true; - } - - inline std::vector Directive::Quotient::bincodeSerialize() const { - auto serializer = serde::BincodeSerializer(); - serde::Serializable::serialize(*this, serializer); - return std::move(serializer).bytes(); - } - - inline Directive::Quotient Directive::Quotient::bincodeDeserialize(std::vector input) { - auto deserializer = serde::BincodeDeserializer(input); - auto value = serde::Deserializable::deserialize(deserializer); - if (deserializer.get_buffer_offset() < input.size()) { - throw serde::deserialization_error("Some input bytes were not read"); - } - return value; - } - -} // end of namespace Circuit - -template <> -template -void serde::Serializable::serialize(const Circuit::Directive::Quotient &obj, Serializer &serializer) { - serde::Serializable::serialize(obj.value, serializer); -} - -template <> -template -Circuit::Directive::Quotient serde::Deserializable::deserialize(Deserializer &deserializer) { - Circuit::Directive::Quotient obj; - obj.value = serde::Deserializable::deserialize(deserializer); - return obj; -} - namespace Circuit { inline bool operator==(const Directive::ToLeRadix &lhs, const Directive::ToLeRadix &rhs) { @@ -4658,60 +4932,6 @@ Circuit::PublicInputs serde::Deserializable::deserialize( return obj; } -namespace Circuit { - - inline bool operator==(const QuotientDirective &lhs, const QuotientDirective &rhs) { - if (!(lhs.a == rhs.a)) { return false; } - if (!(lhs.b == rhs.b)) { return false; } - if (!(lhs.q == rhs.q)) { return false; } - if (!(lhs.r == rhs.r)) { return false; } - if (!(lhs.predicate == rhs.predicate)) { return false; } - return true; - } - - inline std::vector QuotientDirective::bincodeSerialize() const { - auto serializer = serde::BincodeSerializer(); - serde::Serializable::serialize(*this, serializer); - return std::move(serializer).bytes(); - } - - inline QuotientDirective QuotientDirective::bincodeDeserialize(std::vector input) { - auto deserializer = serde::BincodeDeserializer(input); - auto value = serde::Deserializable::deserialize(deserializer); - if (deserializer.get_buffer_offset() < input.size()) { - throw serde::deserialization_error("Some input bytes were not read"); - } - return value; - } - -} // end of namespace Circuit - -template <> -template -void serde::Serializable::serialize(const Circuit::QuotientDirective &obj, Serializer &serializer) { - serializer.increase_container_depth(); - serde::Serializable::serialize(obj.a, serializer); - serde::Serializable::serialize(obj.b, serializer); - serde::Serializable::serialize(obj.q, serializer); - serde::Serializable::serialize(obj.r, serializer); - serde::Serializable::serialize(obj.predicate, serializer); - serializer.decrease_container_depth(); -} - -template <> -template -Circuit::QuotientDirective serde::Deserializable::deserialize(Deserializer &deserializer) { - deserializer.increase_container_depth(); - Circuit::QuotientDirective obj; - obj.a = serde::Deserializable::deserialize(deserializer); - obj.b = serde::Deserializable::deserialize(deserializer); - obj.q = serde::Deserializable::deserialize(deserializer); - obj.r = serde::Deserializable::deserialize(deserializer); - obj.predicate = serde::Deserializable::deserialize(deserializer); - deserializer.decrease_container_depth(); - return obj; -} - namespace Circuit { inline bool operator==(const RegisterIndex &lhs, const RegisterIndex &rhs) { diff --git a/acvm-repo/acir/src/circuit/black_box_functions.rs b/acvm-repo/acir/src/circuit/black_box_functions.rs index 445da50ac81..d1f5560313b 100644 --- a/acvm-repo/acir/src/circuit/black_box_functions.rs +++ b/acvm-repo/acir/src/circuit/black_box_functions.rs @@ -45,6 +45,10 @@ pub enum BlackBoxFunc { /// Compute a recursive aggregation object when verifying a proof inside another circuit. /// This outputted aggregation object will then be either checked in a top-level verifier or aggregated upon again. RecursiveAggregation, + /// Addition over the embedded curve on which [`FieldElement`][acir_field::FieldElement] is defined. + EmbeddedCurveAdd, + /// Point doubling over the embedded curve on which [`FieldElement`][acir_field::FieldElement] is defined. + EmbeddedCurveDouble, } impl std::fmt::Display for BlackBoxFunc { @@ -64,6 +68,8 @@ impl BlackBoxFunc { BlackBoxFunc::PedersenHash => "pedersen_hash", BlackBoxFunc::EcdsaSecp256k1 => "ecdsa_secp256k1", BlackBoxFunc::FixedBaseScalarMul => "fixed_base_scalar_mul", + BlackBoxFunc::EmbeddedCurveAdd => "ec_add", + BlackBoxFunc::EmbeddedCurveDouble => "ec_double", BlackBoxFunc::AND => "and", BlackBoxFunc::XOR => "xor", BlackBoxFunc::RANGE => "range", @@ -84,6 +90,8 @@ impl BlackBoxFunc { "ecdsa_secp256k1" => Some(BlackBoxFunc::EcdsaSecp256k1), "ecdsa_secp256r1" => Some(BlackBoxFunc::EcdsaSecp256r1), "fixed_base_scalar_mul" => Some(BlackBoxFunc::FixedBaseScalarMul), + "ec_add" => Some(BlackBoxFunc::EmbeddedCurveAdd), + "ec_double" => Some(BlackBoxFunc::EmbeddedCurveDouble), "and" => Some(BlackBoxFunc::AND), "xor" => Some(BlackBoxFunc::XOR), "range" => Some(BlackBoxFunc::RANGE), diff --git a/acvm-repo/acir/src/circuit/directives.rs b/acvm-repo/acir/src/circuit/directives.rs index c3a5b055f19..2486f4cfb83 100644 --- a/acvm-repo/acir/src/circuit/directives.rs +++ b/acvm-repo/acir/src/circuit/directives.rs @@ -1,23 +1,11 @@ use crate::native_types::{Expression, Witness}; use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct QuotientDirective { - pub a: Expression, - pub b: Expression, - pub q: Witness, - pub r: Witness, - pub predicate: Option, -} - #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] /// Directives do not apply any constraints. /// You can think of them as opcodes that allow one to use non-determinism /// In the future, this can be replaced with asm non-determinism blocks pub enum Directive { - //Performs euclidean division of a / b (as integers) and stores the quotient in q and the rest in r - Quotient(QuotientDirective), - //decomposition of a: a=\sum b[i]*radix^i where b is an array of witnesses < radix in little endian form ToLeRadix { a: Expression, diff --git a/acvm-repo/acir/src/circuit/opcodes.rs b/acvm-repo/acir/src/circuit/opcodes.rs index ac5ea0b8a69..5aab9d4d472 100644 --- a/acvm-repo/acir/src/circuit/opcodes.rs +++ b/acvm-repo/acir/src/circuit/opcodes.rs @@ -1,7 +1,4 @@ -use super::{ - brillig::Brillig, - directives::{Directive, QuotientDirective}, -}; +use super::{brillig::Brillig, directives::Directive}; use crate::native_types::{Expression, Witness}; use serde::{Deserialize, Serialize}; @@ -48,21 +45,7 @@ impl std::fmt::Display for Opcode { write!(f, " ]") } - Opcode::Directive(Directive::Quotient(QuotientDirective { a, b, q, r, predicate })) => { - write!(f, "DIR::QUOTIENT ")?; - if let Some(pred) = predicate { - writeln!(f, "PREDICATE = {pred}")?; - } - write!( - f, - "(out : _{}, (_{}, {}), _{})", - a, - q.witness_index(), - b, - r.witness_index() - ) - } Opcode::BlackBoxFuncCall(g) => write!(f, "{g}"), Opcode::Directive(Directive::ToLeRadix { a, b, radix: _ }) => { write!(f, "DIR::TORADIX ")?; diff --git a/acvm-repo/acir/src/circuit/opcodes/black_box_function_call.rs b/acvm-repo/acir/src/circuit/opcodes/black_box_function_call.rs index 6e4d7fdd660..7ee4e2498a5 100644 --- a/acvm-repo/acir/src/circuit/opcodes/black_box_function_call.rs +++ b/acvm-repo/acir/src/circuit/opcodes/black_box_function_call.rs @@ -79,6 +79,18 @@ pub enum BlackBoxFuncCall { high: FunctionInput, outputs: (Witness, Witness), }, + EmbeddedCurveAdd { + input1_x: FunctionInput, + input1_y: FunctionInput, + input2_x: FunctionInput, + input2_y: FunctionInput, + outputs: (Witness, Witness), + }, + EmbeddedCurveDouble { + input_x: FunctionInput, + input_y: FunctionInput, + outputs: (Witness, Witness), + }, Keccak256 { inputs: Vec, outputs: Vec, @@ -125,6 +137,8 @@ impl BlackBoxFuncCall { BlackBoxFuncCall::EcdsaSecp256k1 { .. } => BlackBoxFunc::EcdsaSecp256k1, BlackBoxFuncCall::EcdsaSecp256r1 { .. } => BlackBoxFunc::EcdsaSecp256r1, BlackBoxFuncCall::FixedBaseScalarMul { .. } => BlackBoxFunc::FixedBaseScalarMul, + BlackBoxFuncCall::EmbeddedCurveAdd { .. } => BlackBoxFunc::EmbeddedCurveAdd, + BlackBoxFuncCall::EmbeddedCurveDouble { .. } => BlackBoxFunc::EmbeddedCurveDouble, BlackBoxFuncCall::Keccak256 { .. } => BlackBoxFunc::Keccak256, BlackBoxFuncCall::Keccak256VariableLength { .. } => BlackBoxFunc::Keccak256, BlackBoxFuncCall::Keccakf1600 { .. } => BlackBoxFunc::Keccakf1600, @@ -149,6 +163,12 @@ impl BlackBoxFuncCall { vec![*lhs, *rhs] } BlackBoxFuncCall::FixedBaseScalarMul { low, high, .. } => vec![*low, *high], + BlackBoxFuncCall::EmbeddedCurveAdd { + input1_x, input1_y, input2_x, input2_y, .. + } => vec![*input1_x, *input1_y, *input2_x, *input2_y], + BlackBoxFuncCall::EmbeddedCurveDouble { input_x, input_y, .. } => { + vec![*input_x, *input_y] + } BlackBoxFuncCall::RANGE { input } => vec![*input], BlackBoxFuncCall::SchnorrVerify { public_key_x, @@ -237,7 +257,9 @@ impl BlackBoxFuncCall { | BlackBoxFuncCall::PedersenHash { output, .. } | BlackBoxFuncCall::EcdsaSecp256r1 { output, .. } => vec![*output], BlackBoxFuncCall::FixedBaseScalarMul { outputs, .. } - | BlackBoxFuncCall::PedersenCommitment { outputs, .. } => vec![outputs.0, outputs.1], + | BlackBoxFuncCall::PedersenCommitment { outputs, .. } + | BlackBoxFuncCall::EmbeddedCurveAdd { outputs, .. } + | BlackBoxFuncCall::EmbeddedCurveDouble { outputs, .. } => vec![outputs.0, outputs.1], BlackBoxFuncCall::RANGE { .. } | BlackBoxFuncCall::RecursiveAggregation { .. } => { vec![] } diff --git a/acvm-repo/acvm/Cargo.toml b/acvm-repo/acvm/Cargo.toml index f5819d6fa34..be2391a3216 100644 --- a/acvm-repo/acvm/Cargo.toml +++ b/acvm-repo/acvm/Cargo.toml @@ -14,7 +14,6 @@ repository.workspace = true [dependencies] num-bigint.workspace = true -num-traits.workspace = true thiserror.workspace = true tracing.workspace = true diff --git a/acvm-repo/acvm/src/compiler/transformers/mod.rs b/acvm-repo/acvm/src/compiler/transformers/mod.rs index d26b3f8bbf3..306ea1b7c12 100644 --- a/acvm-repo/acvm/src/compiler/transformers/mod.rs +++ b/acvm-repo/acvm/src/compiler/transformers/mod.rs @@ -123,6 +123,13 @@ pub(super) fn transform_internal( outputs, .. } + | acir::circuit::opcodes::BlackBoxFuncCall::EmbeddedCurveAdd { + outputs, .. + } + | acir::circuit::opcodes::BlackBoxFuncCall::EmbeddedCurveDouble { + outputs, + .. + } | acir::circuit::opcodes::BlackBoxFuncCall::PedersenCommitment { outputs, .. @@ -143,10 +150,6 @@ pub(super) fn transform_internal( } Opcode::Directive(ref directive) => { match directive { - Directive::Quotient(quotient_directive) => { - transformer.mark_solvable(quotient_directive.q); - transformer.mark_solvable(quotient_directive.r); - } Directive::ToLeRadix { b, .. } => { for witness in b { transformer.mark_solvable(*witness); diff --git a/acvm-repo/acvm/src/pwg/blackbox/mod.rs b/acvm-repo/acvm/src/pwg/blackbox/mod.rs index c18a97733b8..5eea234885c 100644 --- a/acvm-repo/acvm/src/pwg/blackbox/mod.rs +++ b/acvm-repo/acvm/src/pwg/blackbox/mod.rs @@ -119,8 +119,8 @@ pub(crate) fn solve( let lane = witness_assignment.try_to_u64(); state[i] = lane.unwrap(); } - let state = keccakf1600(state)?; - for (output_witness, value) in outputs.iter().zip(state.into_iter()) { + let output_state = keccakf1600(state)?; + for (output_witness, value) in outputs.iter().zip(output_state.into_iter()) { insert_value(output_witness, FieldElement::from(value as u128), initial_witness)?; } Ok(()) @@ -177,6 +177,12 @@ pub(crate) fn solve( BlackBoxFuncCall::FixedBaseScalarMul { low, high, outputs } => { fixed_base_scalar_mul(backend, initial_witness, *low, *high, *outputs) } + BlackBoxFuncCall::EmbeddedCurveAdd { .. } => { + todo!(); + } + BlackBoxFuncCall::EmbeddedCurveDouble { .. } => { + todo!(); + } // Recursive aggregation will be entirely handled by the backend and is not solved by the ACVM BlackBoxFuncCall::RecursiveAggregation { .. } => Ok(()), } diff --git a/acvm-repo/acvm/src/pwg/directives/mod.rs b/acvm-repo/acvm/src/pwg/directives/mod.rs index cfc458dd611..4605168d98b 100644 --- a/acvm-repo/acvm/src/pwg/directives/mod.rs +++ b/acvm-repo/acvm/src/pwg/directives/mod.rs @@ -1,12 +1,7 @@ use std::cmp::Ordering; -use acir::{ - circuit::directives::{Directive, QuotientDirective}, - native_types::WitnessMap, - FieldElement, -}; +use acir::{circuit::directives::Directive, native_types::WitnessMap, FieldElement}; use num_bigint::BigUint; -use num_traits::Zero; use crate::OpcodeResolutionError; @@ -25,38 +20,6 @@ pub(super) fn solve_directives( directive: &Directive, ) -> Result<(), OpcodeResolutionError> { match directive { - Directive::Quotient(QuotientDirective { a, b, q, r, predicate }) => { - let val_a = get_value(a, initial_witness)?; - let val_b = get_value(b, initial_witness)?; - let int_a = BigUint::from_bytes_be(&val_a.to_be_bytes()); - let int_b = BigUint::from_bytes_be(&val_b.to_be_bytes()); - - // If the predicate is `None`, then we simply return the value 1 - // If the predicate is `Some` but we cannot find a value, then we return unresolved - let pred_value = match predicate { - Some(pred) => get_value(pred, initial_witness)?, - None => FieldElement::one(), - }; - - let (int_r, int_q) = if pred_value.is_zero() || int_b.is_zero() { - (BigUint::zero(), BigUint::zero()) - } else { - (&int_a % &int_b, &int_a / &int_b) - }; - - insert_value( - q, - FieldElement::from_be_bytes_reduce(&int_q.to_bytes_be()), - initial_witness, - )?; - insert_value( - r, - FieldElement::from_be_bytes_reduce(&int_r.to_bytes_be()), - initial_witness, - )?; - - Ok(()) - } Directive::ToLeRadix { a, b, radix } => { let value_a = get_value(a, initial_witness)?; let big_integer = BigUint::from_bytes_be(&value_a.to_be_bytes()); @@ -120,31 +83,3 @@ pub(super) fn solve_directives( } } } - -#[cfg(test)] -mod tests { - use acir::{ - circuit::directives::{Directive, QuotientDirective}, - native_types::{Expression, Witness, WitnessMap}, - FieldElement, - }; - - use super::solve_directives; - - #[test] - fn divisor_is_zero() { - let quotient_directive = QuotientDirective { - a: Expression::zero(), - b: Expression::zero(), - q: Witness(0), - r: Witness(0), - predicate: Some(Expression::one()), - }; - - let mut witness_map = WitnessMap::new(); - witness_map.insert(Witness(0), FieldElement::zero()); - - solve_directives(&mut witness_map, &Directive::Quotient(quotient_directive)) - .expect("expected 0/0 to return 0"); - } -} diff --git a/acvm-repo/blackbox_solver/src/curve_specific_solver.rs b/acvm-repo/blackbox_solver/src/curve_specific_solver.rs index c71eebb8f98..82941e91d61 100644 --- a/acvm-repo/blackbox_solver/src/curve_specific_solver.rs +++ b/acvm-repo/blackbox_solver/src/curve_specific_solver.rs @@ -29,6 +29,18 @@ pub trait BlackBoxFunctionSolver { low: &FieldElement, high: &FieldElement, ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; + fn ec_add( + &self, + input1_x: &FieldElement, + input1_y: &FieldElement, + input2_x: &FieldElement, + input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; + fn ec_double( + &self, + input_x: &FieldElement, + input_x: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; } pub struct StubbedBlackBoxSolver; @@ -73,4 +85,20 @@ impl BlackBoxFunctionSolver for StubbedBlackBoxSolver { ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { Err(Self::fail(BlackBoxFunc::FixedBaseScalarMul)) } + fn ec_add( + &self, + _input1_x: &FieldElement, + _input1_y: &FieldElement, + _input2_x: &FieldElement, + _input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Err(Self::fail(BlackBoxFunc::EmbeddedCurveAdd)) + } + fn ec_double( + &self, + _input_x: &FieldElement, + _input_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Err(Self::fail(BlackBoxFunc::EmbeddedCurveDouble)) + } } diff --git a/acvm-repo/bn254_blackbox_solver/src/lib.rs b/acvm-repo/bn254_blackbox_solver/src/lib.rs index e315c4650be..92c45e93dea 100644 --- a/acvm-repo/bn254_blackbox_solver/src/lib.rs +++ b/acvm-repo/bn254_blackbox_solver/src/lib.rs @@ -87,4 +87,22 @@ impl BlackBoxFunctionSolver for Bn254BlackBoxSolver { ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { fixed_base_scalar_mul(low, high) } + + fn ec_add( + &self, + _input1_x: &FieldElement, + _input1_y: &FieldElement, + _input2_x: &FieldElement, + _input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + todo!(); + } + + fn ec_double( + &self, + _input_x: &FieldElement, + _input_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + todo!(); + } } diff --git a/acvm-repo/brillig/src/black_box.rs b/acvm-repo/brillig/src/black_box.rs index 41e54ab2705..c007e78b785 100644 --- a/acvm-repo/brillig/src/black_box.rs +++ b/acvm-repo/brillig/src/black_box.rs @@ -9,8 +9,12 @@ pub enum BlackBoxOp { Sha256 { message: HeapVector, output: HeapArray }, /// Calculates the Blake2s hash of the inputs. Blake2s { message: HeapVector, output: HeapArray }, + /// Calculates the Blake3 hash of the inputs. + Blake3 { message: HeapVector, output: HeapArray }, /// Calculates the Keccak256 hash of the inputs. Keccak256 { message: HeapVector, output: HeapArray }, + /// Keccak Permutation function of 1600 width + Keccakf1600 { message: HeapVector, output: HeapArray }, /// Verifies a ECDSA signature over the secp256k1 curve. EcdsaSecp256k1 { hashed_msg: HeapVector, @@ -41,4 +45,14 @@ pub enum BlackBoxOp { PedersenHash { inputs: HeapVector, domain_separator: RegisterIndex, output: RegisterIndex }, /// Performs scalar multiplication over the embedded curve. FixedBaseScalarMul { low: RegisterIndex, high: RegisterIndex, result: HeapArray }, + /// Performs addition over the embedded curve. + EmbeddedCurveAdd { + input1_x: RegisterIndex, + input1_y: RegisterIndex, + input2_x: RegisterIndex, + input2_y: RegisterIndex, + result: HeapArray, + }, + /// Performs point doubling over the embedded curve. + EmbeddedCurveDouble { input1_x: RegisterIndex, input1_y: RegisterIndex, result: HeapArray }, } diff --git a/acvm-repo/brillig_vm/src/black_box.rs b/acvm-repo/brillig_vm/src/black_box.rs index 94feb23e1a6..463038509e1 100644 --- a/acvm-repo/brillig_vm/src/black_box.rs +++ b/acvm-repo/brillig_vm/src/black_box.rs @@ -1,8 +1,8 @@ use acir::brillig::{BlackBoxOp, HeapArray, HeapVector, Value}; use acir::{BlackBoxFunc, FieldElement}; use acvm_blackbox_solver::{ - blake2s, ecdsa_secp256k1_verify, ecdsa_secp256r1_verify, keccak256, sha256, - BlackBoxFunctionSolver, BlackBoxResolutionError, + blake2s, blake3, ecdsa_secp256k1_verify, ecdsa_secp256r1_verify, keccak256, keccakf1600, + sha256, BlackBoxFunctionSolver, BlackBoxResolutionError, }; use crate::{Memory, Registers}; @@ -58,12 +58,32 @@ pub(crate) fn evaluate_black_box( memory.write_slice(registers.get(output.pointer).to_usize(), &to_value_vec(&bytes)); Ok(()) } + BlackBoxOp::Blake3 { message, output } => { + let message = to_u8_vec(read_heap_vector(memory, registers, message)); + let bytes = blake3(message.as_slice())?; + memory.write_slice(registers.get(output.pointer).to_usize(), &to_value_vec(&bytes)); + Ok(()) + } BlackBoxOp::Keccak256 { message, output } => { let message = to_u8_vec(read_heap_vector(memory, registers, message)); let bytes = keccak256(message.as_slice())?; memory.write_slice(registers.get(output.pointer).to_usize(), &to_value_vec(&bytes)); Ok(()) } + BlackBoxOp::Keccakf1600 { message, output } => { + let state_vec: Vec = read_heap_vector(memory, registers, message) + .iter() + .map(|value| value.to_field().try_to_u64().unwrap()) + .collect(); + let state: [u64; 25] = state_vec.try_into().unwrap(); + + let new_state = keccakf1600(state)?; + + let new_state: Vec = + new_state.into_iter().map(|x| Value::from(x as usize)).collect(); + memory.write_slice(registers.get(output.pointer).to_usize(), &new_state); + Ok(()) + } BlackBoxOp::EcdsaSecp256k1 { hashed_msg, public_key_x, @@ -136,6 +156,22 @@ pub(crate) fn evaluate_black_box( memory.write_slice(registers.get(result.pointer).to_usize(), &[x.into(), y.into()]); Ok(()) } + BlackBoxOp::EmbeddedCurveAdd { input1_x, input1_y, input2_x, input2_y, result } => { + let input1_x = registers.get(*input1_x).to_field(); + let input1_y = registers.get(*input1_y).to_field(); + let input2_x = registers.get(*input2_x).to_field(); + let input2_y = registers.get(*input2_y).to_field(); + let (x, y) = solver.ec_add(&input1_x, &input1_y, &input2_x, &input2_y)?; + memory.write_slice(registers.get(result.pointer).to_usize(), &[x.into(), y.into()]); + Ok(()) + } + BlackBoxOp::EmbeddedCurveDouble { input1_x, input1_y, result } => { + let input1_x = registers.get(*input1_x).to_field(); + let input1_y = registers.get(*input1_y).to_field(); + let (x, y) = solver.ec_double(&input1_x, &input1_y)?; + memory.write_slice(registers.get(result.pointer).to_usize(), &[x.into(), y.into()]); + Ok(()) + } BlackBoxOp::PedersenCommitment { inputs, domain_separator, output } => { let inputs: Vec = read_heap_vector(memory, registers, inputs).iter().map(|x| x.to_field()).collect(); @@ -171,13 +207,17 @@ fn black_box_function_from_op(op: &BlackBoxOp) -> BlackBoxFunc { match op { BlackBoxOp::Sha256 { .. } => BlackBoxFunc::SHA256, BlackBoxOp::Blake2s { .. } => BlackBoxFunc::Blake2s, + BlackBoxOp::Blake3 { .. } => BlackBoxFunc::Blake3, BlackBoxOp::Keccak256 { .. } => BlackBoxFunc::Keccak256, + BlackBoxOp::Keccakf1600 { .. } => BlackBoxFunc::Keccakf1600, BlackBoxOp::EcdsaSecp256k1 { .. } => BlackBoxFunc::EcdsaSecp256k1, BlackBoxOp::EcdsaSecp256r1 { .. } => BlackBoxFunc::EcdsaSecp256r1, BlackBoxOp::SchnorrVerify { .. } => BlackBoxFunc::SchnorrVerify, BlackBoxOp::PedersenCommitment { .. } => BlackBoxFunc::PedersenCommitment, BlackBoxOp::PedersenHash { .. } => BlackBoxFunc::PedersenHash, BlackBoxOp::FixedBaseScalarMul { .. } => BlackBoxFunc::FixedBaseScalarMul, + BlackBoxOp::EmbeddedCurveAdd { .. } => BlackBoxFunc::EmbeddedCurveAdd, + BlackBoxOp::EmbeddedCurveDouble { .. } => BlackBoxFunc::EmbeddedCurveDouble, } } diff --git a/acvm-repo/brillig_vm/src/lib.rs b/acvm-repo/brillig_vm/src/lib.rs index 482b9b36d77..df4c8135bce 100644 --- a/acvm-repo/brillig_vm/src/lib.rs +++ b/acvm-repo/brillig_vm/src/lib.rs @@ -451,6 +451,22 @@ impl BlackBoxFunctionSolver for DummyBlackBoxSolver { ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { Ok((4_u128.into(), 5_u128.into())) } + fn ec_add( + &self, + _input1_x: &FieldElement, + _input1_y: &FieldElement, + _input2_x: &FieldElement, + _input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Ok((5_u128.into(), 6_u128.into())) + } + fn ec_double( + &self, + _input1_x: &FieldElement, + _input1_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Ok((7_u128.into(), 8_u128.into())) + } } #[cfg(test)] diff --git a/aztec_macros/src/lib.rs b/aztec_macros/src/lib.rs index a0ab4e79760..c985bbc367a 100644 --- a/aztec_macros/src/lib.rs +++ b/aztec_macros/src/lib.rs @@ -520,12 +520,11 @@ const SIGNATURE_PLACEHOLDER: &str = "SIGNATURE_PLACEHOLDER"; /// Generates the impl for an event selector /// -/// TODO(https://github.com/AztecProtocol/aztec-packages/issues/3590): Make this point to aztec-nr once the issue is fixed. /// Inserts the following code: /// ```noir /// impl SomeStruct { /// fn selector() -> FunctionSelector { -/// protocol_types::abis::function_selector::FunctionSelector::from_signature("SIGNATURE_PLACEHOLDER") +/// aztec::protocol_types::abis::function_selector::FunctionSelector::from_signature("SIGNATURE_PLACEHOLDER") /// } /// } /// ``` @@ -536,9 +535,8 @@ const SIGNATURE_PLACEHOLDER: &str = "SIGNATURE_PLACEHOLDER"; fn generate_selector_impl(structure: &NoirStruct) -> TypeImpl { let struct_type = make_type(UnresolvedTypeData::Named(path(structure.name.clone()), vec![])); - // TODO(https://github.com/AztecProtocol/aztec-packages/issues/3590): Make this point to aztec-nr once the issue is fixed. let selector_path = - chained_path!("protocol_types", "abis", "function_selector", "FunctionSelector"); + chained_path!("aztec", "protocol_types", "abis", "function_selector", "FunctionSelector"); let mut from_signature_path = selector_path.clone(); from_signature_path.segments.push(ident("from_signature")); @@ -657,7 +655,21 @@ fn create_context(ty: &str, params: &[Param]) -> Vec { UnresolvedTypeData::Integer(..) | UnresolvedTypeData::Bool => { add_cast_to_hasher(identifier) } - _ => unreachable!("[Aztec Noir] Provided parameter type is not supported"), + UnresolvedTypeData::String(..) => { + let (var_bytes, id) = str_to_bytes(identifier); + injected_expressions.push(var_bytes); + add_array_to_hasher( + &id, + &UnresolvedType { + typ: UnresolvedTypeData::Integer(Signedness::Unsigned, 32), + span: None, + }, + ) + } + _ => panic!( + "[Aztec Noir] Provided parameter type: {:?} is not supported", + unresolved_type + ), }; injected_expressions.push(expression); } @@ -946,6 +958,21 @@ fn add_struct_to_hasher(identifier: &Ident) -> Statement { ))) } +fn str_to_bytes(identifier: &Ident) -> (Statement, Ident) { + // let identifier_as_bytes = identifier.as_bytes(); + let var = variable_ident(identifier.clone()); + let contents = if let ExpressionKind::Variable(p) = &var.kind { + p.segments.first().cloned().unwrap_or_else(|| panic!("No segments")).0.contents + } else { + panic!("Unexpected identifier type") + }; + let bytes_name = format!("{}_bytes", contents); + let var_bytes = assignment(&bytes_name, method_call(var, "as_bytes", vec![])); + let id = Ident::new(bytes_name, Span::default()); + + (var_bytes, id) +} + fn create_loop_over(var: Expression, loop_body: Vec) -> Statement { // If this is an array of primitive types (integers / fields) we can add them each to the hasher // casted to a field diff --git a/bootstrap_cache.sh b/bootstrap_cache.sh new file mode 100755 index 00000000000..6e411a161cc --- /dev/null +++ b/bootstrap_cache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eu + +cd "$(dirname "$0")" +source ../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null + +echo -e "\033[1mRetrieving noir packages from remote cache...\033[0m" +extract_repo noir-packages /usr/src/noir/packages ./noir +echo -e "\033[1mRetrieving nargo from remote cache...\033[0m" +extract_repo noir /usr/src/noir/target/release ./noir/target diff --git a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_black_box.rs b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_black_box.rs index a6d3220fa85..c081806f4a7 100644 --- a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_black_box.rs +++ b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_black_box.rs @@ -41,6 +41,19 @@ pub(crate) fn convert_black_box_call( unreachable!("ICE: Blake2s expects one array argument and one array result") } } + BlackBoxFunc::Blake3 => { + if let ([message], [BrilligVariable::BrilligArray(result_array)]) = + (function_arguments, function_results) + { + let message_vector = convert_array_or_vector(brillig_context, message, bb_func); + brillig_context.black_box_op_instruction(BlackBoxOp::Blake3 { + message: message_vector.to_heap_vector(), + output: result_array.to_heap_array(), + }); + } else { + unreachable!("ICE: Blake3 expects one array argument and one array result") + } + } BlackBoxFunc::Keccak256 => { if let ( [message, BrilligVariable::Simple(array_size)], @@ -58,6 +71,20 @@ pub(crate) fn convert_black_box_call( unreachable!("ICE: Keccak256 expects message, message size and result array") } } + BlackBoxFunc::Keccakf1600 => { + if let ([message], [BrilligVariable::BrilligArray(result_array)]) = + (function_arguments, function_results) + { + let state_vector = convert_array_or_vector(brillig_context, message, bb_func); + + brillig_context.black_box_op_instruction(BlackBoxOp::Keccakf1600 { + message: state_vector.to_heap_vector(), + output: result_array.to_heap_array(), + }); + } else { + unreachable!("ICE: Keccakf1600 expects one array argument and one array result") + } + } BlackBoxFunc::EcdsaSecp256k1 => { if let ( [BrilligVariable::BrilligArray(public_key_x), BrilligVariable::BrilligArray(public_key_y), BrilligVariable::BrilligArray(signature), message], @@ -169,6 +196,42 @@ pub(crate) fn convert_black_box_call( ) } } + BlackBoxFunc::EmbeddedCurveAdd => { + if let ( + [BrilligVariable::Simple(input1_x), BrilligVariable::Simple(input1_y), BrilligVariable::Simple(input2_x), BrilligVariable::Simple(input2_y)], + [BrilligVariable::BrilligArray(result_array)], + ) = (function_arguments, function_results) + { + brillig_context.black_box_op_instruction(BlackBoxOp::EmbeddedCurveAdd { + input1_x: *input1_x, + input1_y: *input1_y, + input2_x: *input2_x, + input2_y: *input2_y, + result: result_array.to_heap_array(), + }); + } else { + unreachable!( + "ICE: EmbeddedCurveAdd expects four register arguments and one array result" + ) + } + } + BlackBoxFunc::EmbeddedCurveDouble => { + if let ( + [BrilligVariable::Simple(input1_x), BrilligVariable::Simple(input1_y)], + [BrilligVariable::BrilligArray(result_array)], + ) = (function_arguments, function_results) + { + brillig_context.black_box_op_instruction(BlackBoxOp::EmbeddedCurveDouble { + input1_x: *input1_x, + input1_y: *input1_y, + result: result_array.to_heap_array(), + }); + } else { + unreachable!( + "ICE: EmbeddedCurveAdd expects two register arguments and one array result" + ) + } + } BlackBoxFunc::AND => { unreachable!("ICE: `BlackBoxFunc::AND` calls should be transformed into a `BinaryOp`") } @@ -181,12 +244,6 @@ pub(crate) fn convert_black_box_call( BlackBoxFunc::RecursiveAggregation => unimplemented!( "ICE: `BlackBoxFunc::RecursiveAggregation` is not implemented by the Brillig VM" ), - BlackBoxFunc::Blake3 => { - unimplemented!("ICE: `BlackBoxFunc::Blake3` is not implemented by the Brillig VM") - } - BlackBoxFunc::Keccakf1600 => { - unimplemented!("ICE: `BlackBoxFunc::Keccakf1600` is not implemented by the Brillig VM") - } } } diff --git a/compiler/noirc_evaluator/src/brillig/brillig_ir.rs b/compiler/noirc_evaluator/src/brillig/brillig_ir.rs index 3c4e77b09ec..db3cd501ca0 100644 --- a/compiler/noirc_evaluator/src/brillig/brillig_ir.rs +++ b/compiler/noirc_evaluator/src/brillig/brillig_ir.rs @@ -1086,6 +1086,24 @@ pub(crate) mod tests { ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { Ok((4_u128.into(), 5_u128.into())) } + + fn ec_add( + &self, + _input1_x: &FieldElement, + _input1_y: &FieldElement, + _input2_x: &FieldElement, + _input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + panic!("Path not trodden by this test") + } + + fn ec_double( + &self, + _input_x: &FieldElement, + _input_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + panic!("Path not trodden by this test") + } } pub(crate) fn create_context() -> BrilligContext { diff --git a/compiler/noirc_evaluator/src/brillig/brillig_ir/debug_show.rs b/compiler/noirc_evaluator/src/brillig/brillig_ir/debug_show.rs index 74b24b280cd..dc8c6b6694c 100644 --- a/compiler/noirc_evaluator/src/brillig/brillig_ir/debug_show.rs +++ b/compiler/noirc_evaluator/src/brillig/brillig_ir/debug_show.rs @@ -350,9 +350,15 @@ impl DebugShow { BlackBoxOp::Keccak256 { message, output } => { debug_println!(self.enable_debug_trace, " KECCAK256 {} -> {}", message, output); } + BlackBoxOp::Keccakf1600 { message, output } => { + debug_println!(self.enable_debug_trace, " KECCAKF1600 {} -> {}", message, output); + } BlackBoxOp::Blake2s { message, output } => { debug_println!(self.enable_debug_trace, " BLAKE2S {} -> {}", message, output); } + BlackBoxOp::Blake3 { message, output } => { + debug_println!(self.enable_debug_trace, " BLAKE3 {} -> {}", message, output); + } BlackBoxOp::EcdsaSecp256k1 { hashed_msg, public_key_x, @@ -396,6 +402,26 @@ impl DebugShow { result ); } + BlackBoxOp::EmbeddedCurveAdd { input1_x, input1_y, input2_x, input2_y, result } => { + debug_println!( + self.enable_debug_trace, + " EMBEDDED_CURVE_ADD ({} {}) ({} {}) -> {}", + input1_x, + input1_y, + input2_x, + input2_y, + result + ); + } + BlackBoxOp::EmbeddedCurveDouble { input1_x, input1_y, result } => { + debug_println!( + self.enable_debug_trace, + " EMBEDDED_CURVE_DOUBLE ({} {}) -> {}", + input1_x, + input1_y, + result + ); + } BlackBoxOp::PedersenCommitment { inputs, domain_separator, output } => { debug_println!( self.enable_debug_trace, diff --git a/compiler/noirc_evaluator/src/ssa.rs b/compiler/noirc_evaluator/src/ssa.rs index deffe84baea..f11c077d49a 100644 --- a/compiler/noirc_evaluator/src/ssa.rs +++ b/compiler/noirc_evaluator/src/ssa.rs @@ -93,8 +93,8 @@ pub fn create_circuit( let mut generated_acir = optimize_into_acir(program, enable_ssa_logging, enable_brillig_logging)?; let opcodes = generated_acir.take_opcodes(); + let current_witness_index = generated_acir.current_witness_index().0; let GeneratedAcir { - current_witness_index, return_witnesses, locations, input_witnesses, diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs index 2506af8c8c8..efc64c5286e 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs @@ -28,9 +28,12 @@ use num_bigint::BigUint; /// The output of the Acir-gen pass pub(crate) struct GeneratedAcir { /// The next witness index that may be declared. + /// If witness index is `None` then we have not yet created a witness + /// and thus next witness index that be declared is zero. + /// This field is private should only ever be accessed through its getter and setter. /// /// Equivalent to acvm::acir::circuit::Circuit's field of the same name. - pub(crate) current_witness_index: u32, + current_witness_index: Option, /// The opcodes of which the compiled ACIR will comprise. opcodes: Vec, @@ -60,7 +63,7 @@ pub(crate) struct GeneratedAcir { impl GeneratedAcir { /// Returns the current witness index. pub(crate) fn current_witness_index(&self) -> Witness { - Witness(self.current_witness_index) + Witness(self.current_witness_index.unwrap_or(0)) } /// Adds a new opcode into ACIR. @@ -78,8 +81,12 @@ impl GeneratedAcir { /// Updates the witness index counter and returns /// the next witness index. pub(crate) fn next_witness_index(&mut self) -> Witness { - self.current_witness_index += 1; - Witness(self.current_witness_index) + if let Some(current_index) = self.current_witness_index { + self.current_witness_index.replace(current_index + 1); + } else { + self.current_witness_index = Some(0); + } + Witness(self.current_witness_index.expect("ICE: current_witness_index should exist")) } /// Converts [`Expression`] `expr` into a [`Witness`]. @@ -205,6 +212,18 @@ impl GeneratedAcir { high: inputs[1][0], outputs: (outputs[0], outputs[1]), }, + BlackBoxFunc::EmbeddedCurveAdd => BlackBoxFuncCall::EmbeddedCurveAdd { + input1_x: inputs[0][0], + input1_y: inputs[1][0], + input2_x: inputs[2][0], + input2_y: inputs[3][0], + outputs: (outputs[0], outputs[1]), + }, + BlackBoxFunc::EmbeddedCurveDouble => BlackBoxFuncCall::EmbeddedCurveDouble { + input_x: inputs[0][0], + input_y: inputs[1][0], + outputs: (outputs[0], outputs[1]), + }, BlackBoxFunc::Keccak256 => { let var_message_size = match inputs.to_vec().pop() { Some(var_message_size) => var_message_size[0], @@ -579,6 +598,10 @@ fn black_box_func_expected_input_size(name: BlackBoxFunc) -> Option { BlackBoxFunc::FixedBaseScalarMul => Some(2), // Recursive aggregation has a variable number of inputs BlackBoxFunc::RecursiveAggregation => None, + // Addition over the embedded curve: input are coordinates (x1,y1) and (x2,y2) of the Grumpkin points + BlackBoxFunc::EmbeddedCurveAdd => Some(4), + // Doubling over the embedded curve: input is (x,y) coordinate of the point. + BlackBoxFunc::EmbeddedCurveDouble => Some(2), } } @@ -606,9 +629,11 @@ fn black_box_expected_output_size(name: BlackBoxFunc) -> Option { BlackBoxFunc::SchnorrVerify | BlackBoxFunc::EcdsaSecp256k1 | BlackBoxFunc::EcdsaSecp256r1 => Some(1), - // Output of fixed based scalar mul over the embedded curve + // Output of operations over the embedded curve // will be 2 field elements representing the point. - BlackBoxFunc::FixedBaseScalarMul => Some(2), + BlackBoxFunc::FixedBaseScalarMul + | BlackBoxFunc::EmbeddedCurveAdd + | BlackBoxFunc::EmbeddedCurveDouble => Some(2), // Recursive aggregation has a variable number of outputs BlackBoxFunc::RecursiveAggregation => None, } diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs index e65e71b045d..c0e3ed1ff66 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs @@ -294,7 +294,7 @@ impl Context { dfg: &DataFlowGraph, ) -> Result, RuntimeError> { // The first witness (if any) is the next one - let start_witness = self.acir_context.current_witness_index().0 + 1; + let start_witness = self.acir_context.current_witness_index().0; for param_id in params { let typ = dfg.type_of_value(*param_id); let value = self.convert_ssa_block_param(&typ)?; diff --git a/compiler/noirc_evaluator/src/ssa/ir/instruction/call.rs b/compiler/noirc_evaluator/src/ssa/ir/instruction/call.rs index 25b7fd0ebbd..d1991abab37 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/instruction/call.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/instruction/call.rs @@ -428,7 +428,9 @@ fn simplify_black_box_func( BlackBoxFunc::FixedBaseScalarMul | BlackBoxFunc::SchnorrVerify | BlackBoxFunc::PedersenCommitment - | BlackBoxFunc::PedersenHash => { + | BlackBoxFunc::PedersenHash + | BlackBoxFunc::EmbeddedCurveAdd + | BlackBoxFunc::EmbeddedCurveDouble => { // Currently unsolvable here as we rely on an implementation in the backend. SimplifyResult::None } diff --git a/compiler/noirc_frontend/src/node_interner.rs b/compiler/noirc_frontend/src/node_interner.rs index 3ff96670e13..193f3fe0436 100644 --- a/compiler/noirc_frontend/src/node_interner.rs +++ b/compiler/noirc_frontend/src/node_interner.rs @@ -1176,6 +1176,7 @@ impl NodeInterner { } /// Adds a trait implementation to the list of known implementations. + #[tracing::instrument(skip(self))] pub fn add_trait_implementation( &mut self, object_type: Type, diff --git a/compiler/wasm/.gitignore b/compiler/wasm/.gitignore index 1b823a2c19a..3ae8fb4b218 100644 --- a/compiler/wasm/.gitignore +++ b/compiler/wasm/.gitignore @@ -1,2 +1,3 @@ dist build + diff --git a/docs/.yarnrc.yml b/docs/.yarnrc.yml index 3186f3f0795..f703d01801b 100644 --- a/docs/.yarnrc.yml +++ b/docs/.yarnrc.yml @@ -1 +1,4 @@ nodeLinker: node-modules +logFilters: + - code: YN0013 + level: discard diff --git a/noir_stdlib/src/uint128.nr b/noir_stdlib/src/uint128.nr index 03f3e9ab074..c8c6217de90 100644 --- a/noir_stdlib/src/uint128.nr +++ b/noir_stdlib/src/uint128.nr @@ -42,6 +42,17 @@ impl U128 { } } + pub fn to_be_bytes(self: Self) -> [u8; 16] { + let lo = self.lo.to_be_bytes(8); + let hi = self.hi.to_be_bytes(8); + let mut bytes = [0;16]; + for i in 0..8 { + bytes[i] = hi[i]; + bytes[i+8] = lo[i]; + } + bytes + } + pub fn to_le_bytes(self: Self) -> [u8; 16] { let lo = self.lo.to_le_bytes(8); let hi = self.hi.to_le_bytes(8); diff --git a/scripts/bootstrap_packages.sh b/scripts/bootstrap_packages.sh index df4ee5b3aed..18c34b9cfb7 100755 --- a/scripts/bootstrap_packages.sh +++ b/scripts/bootstrap_packages.sh @@ -14,7 +14,7 @@ else export GIT_COMMIT=$(git rev-parse --verify HEAD) fi -yarn +yarn --immutable yarn build # We create a folder called packages, that contains each package as it would be published to npm, named correctly. diff --git a/scripts/test_js_packages.sh b/scripts/test_js_packages.sh index a5ec5b92a70..cf4fd81326d 100755 --- a/scripts/test_js_packages.sh +++ b/scripts/test_js_packages.sh @@ -17,10 +17,10 @@ fi cargo build --release export PATH="${PATH}:/usr/src/noir/target/release/" -yarn +yarn --immutable yarn build npx playwright install npx playwright install-deps ./scripts/test.sh -yarn test \ No newline at end of file +yarn test diff --git a/test_programs/.gitignore b/test_programs/.gitignore index 01a3426160c..a229df6197f 100644 --- a/test_programs/.gitignore +++ b/test_programs/.gitignore @@ -1 +1,2 @@ acir_artifacts +execution_success/**/crs \ No newline at end of file diff --git a/test_programs/execution_success/brillig_blake3/Nargo.toml b/test_programs/execution_success/brillig_blake3/Nargo.toml new file mode 100644 index 00000000000..879476dbdcf --- /dev/null +++ b/test_programs/execution_success/brillig_blake3/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "brillig_blake3" +type = "bin" +authors = [""] +compiler_version = ">=0.22.0" + +[dependencies] diff --git a/test_programs/execution_success/brillig_blake3/Prover.toml b/test_programs/execution_success/brillig_blake3/Prover.toml new file mode 100644 index 00000000000..c807701479b --- /dev/null +++ b/test_programs/execution_success/brillig_blake3/Prover.toml @@ -0,0 +1,37 @@ +# hello as bytes +# https://connor4312.github.io/blake3/index.html +x = [104, 101, 108, 108, 111] +result = [ + 0xea, + 0x8f, + 0x16, + 0x3d, + 0xb3, + 0x86, + 0x82, + 0x92, + 0x5e, + 0x44, + 0x91, + 0xc5, + 0xe5, + 0x8d, + 0x4b, + 0xb3, + 0x50, + 0x6e, + 0xf8, + 0xc1, + 0x4e, + 0xb7, + 0x8a, + 0x86, + 0xe9, + 0x08, + 0xc5, + 0x62, + 0x4a, + 0x67, + 0x20, + 0x0f, +] diff --git a/test_programs/execution_success/brillig_blake3/src/main.nr b/test_programs/execution_success/brillig_blake3/src/main.nr new file mode 100644 index 00000000000..05a5b31f936 --- /dev/null +++ b/test_programs/execution_success/brillig_blake3/src/main.nr @@ -0,0 +1,6 @@ +use dep::std; + +unconstrained fn main(x: [u8; 5], result: [u8; 32]) { + let digest = std::hash::blake3(x); + assert(digest == result); +} diff --git a/tooling/backend_interface/src/cli/info.rs b/tooling/backend_interface/src/cli/info.rs index 81b811f0e32..934351dd517 100644 --- a/tooling/backend_interface/src/cli/info.rs +++ b/tooling/backend_interface/src/cli/info.rs @@ -13,12 +13,6 @@ pub(crate) struct InfoCommand { #[derive(Deserialize)] struct InfoResponse { language: LanguageResponse, - #[allow(dead_code)] - #[deprecated(note = "This field is deprecated and will be removed in the future")] - opcodes_supported: Vec, - #[allow(dead_code)] - #[deprecated(note = "This field is deprecated and will be removed in the future")] - black_box_functions_supported: Vec, } #[derive(Deserialize)] diff --git a/tooling/bb_abstraction_leaks/build.rs b/tooling/bb_abstraction_leaks/build.rs index 965a57747f9..18413f87793 100644 --- a/tooling/bb_abstraction_leaks/build.rs +++ b/tooling/bb_abstraction_leaks/build.rs @@ -10,7 +10,7 @@ use const_format::formatcp; const USERNAME: &str = "AztecProtocol"; const REPO: &str = "aztec-packages"; -const VERSION: &str = "0.17.0"; +const VERSION: &str = "0.19.0"; const TAG: &str = formatcp!("aztec-packages-v{}", VERSION); const API_URL: &str = diff --git a/tooling/lsp/src/solver.rs b/tooling/lsp/src/solver.rs index 90dd4a63f64..6217b7ad71f 100644 --- a/tooling/lsp/src/solver.rs +++ b/tooling/lsp/src/solver.rs @@ -39,4 +39,22 @@ impl BlackBoxFunctionSolver for WrapperSolver { ) -> Result { self.0.pedersen_hash(inputs, domain_separator) } + + fn ec_add( + &self, + input1_x: &acvm::FieldElement, + input1_y: &acvm::FieldElement, + input2_x: &acvm::FieldElement, + input2_y: &acvm::FieldElement, + ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { + self.0.ec_add(input1_x, input1_y, input2_x, input2_y) + } + + fn ec_double( + &self, + input_x: &acvm::FieldElement, + input_y: &acvm::FieldElement, + ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { + self.0.ec_double(input_x, input_y) + } } diff --git a/tooling/nargo_fmt/tests/expected/contract.nr b/tooling/nargo_fmt/tests/expected/contract.nr index 0313da832a8..2e3f4d7c8c4 100644 --- a/tooling/nargo_fmt/tests/expected/contract.nr +++ b/tooling/nargo_fmt/tests/expected/contract.nr @@ -3,7 +3,7 @@ // Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. // Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. contract Benchmarking { - use dep::protocol_types::abis::function_selector::FunctionSelector; + use dep::aztec::protocol_types::abis::function_selector::FunctionSelector; use dep::value_note::{ utils::{increment, decrement}, @@ -20,8 +20,8 @@ contract Benchmarking { }; struct Storage { - notes: Map>, - balances: Map>, + notes: Map>, + balances: Map>, } impl Storage { diff --git a/tooling/nargo_fmt/tests/input/contract.nr b/tooling/nargo_fmt/tests/input/contract.nr index 58ae0e909a1..2e3f4d7c8c4 100644 --- a/tooling/nargo_fmt/tests/input/contract.nr +++ b/tooling/nargo_fmt/tests/input/contract.nr @@ -3,7 +3,7 @@ // Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. // Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. contract Benchmarking { - use dep::protocol_types::abis::function_selector::FunctionSelector; + use dep::aztec::protocol_types::abis::function_selector::FunctionSelector; use dep::value_note::{ utils::{increment, decrement}, @@ -20,8 +20,8 @@ contract Benchmarking { }; struct Storage { - notes: Map>, - balances: Map>, + notes: Map>, + balances: Map>, } impl Storage { @@ -58,7 +58,11 @@ contract Benchmarking { fn increment_balance(owner: Field, value: Field) { let current = storage.balances.at(owner).read(); storage.balances.at(owner).write(current + value); - let _callStackItem1 = context.call_public_function(context.this_address(), FunctionSelector::from_signature("broadcast(Field)"), [owner]); + let _callStackItem1 = context.call_public_function( + context.this_address(), + FunctionSelector::from_signature("broadcast(Field)"), + [owner] + ); } // Est ultricies integer quis auctor elit sed. In nibh mauris cursus mattis molestie a iaculis. @@ -67,7 +71,12 @@ contract Benchmarking { emit_unencrypted_log(&mut context, storage.balances.at(owner).read()); } - unconstrained fn compute_note_hash_and_nullifier(contract_address: AztecAddress, nonce: Field, storage_slot: Field, preimage: [Field; VALUE_NOTE_LEN]) -> [Field; 4] { + unconstrained fn compute_note_hash_and_nullifier( + contract_address: AztecAddress, + nonce: Field, + storage_slot: Field, + preimage: [Field; VALUE_NOTE_LEN] + ) -> [Field; 4] { let note_header = NoteHeader::new(contract_address, nonce, storage_slot); note_utils::compute_note_hash_and_nullifier(ValueNoteMethods, note_header, preimage) } diff --git a/tooling/noir_js_backend_barretenberg/package.json b/tooling/noir_js_backend_barretenberg/package.json index 1688db1ab2d..e22ea2ff49d 100644 --- a/tooling/noir_js_backend_barretenberg/package.json +++ b/tooling/noir_js_backend_barretenberg/package.json @@ -42,7 +42,7 @@ "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" }, "dependencies": { - "@aztec/bb.js": "0.17.0", + "@aztec/bb.js": "0.19.0", "@noir-lang/types": "workspace:*", "fflate": "^0.8.0" }, diff --git a/yarn.lock b/yarn.lock index ea141531601..03e8058cc21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -221,9 +221,9 @@ __metadata: languageName: node linkType: hard -"@aztec/bb.js@npm:0.17.0": - version: 0.17.0 - resolution: "@aztec/bb.js@npm:0.17.0" +"@aztec/bb.js@npm:0.19.0": + version: 0.19.0 + resolution: "@aztec/bb.js@npm:0.19.0" dependencies: comlink: ^4.4.1 commander: ^10.0.1 @@ -231,7 +231,7 @@ __metadata: tslib: ^2.4.0 bin: bb.js: dest/node/main.js - checksum: 459838076e4db7e6ca17f95acbd5c83028ea3b5c21e016a1561cec065a95d20e8d65906ad63e44e071556bc331070ceda6d48c058f5accdb76b3c6daab8ef1a5 + checksum: c78c22c3b8c43e0010a43145f973489aa7da9fcf0b8527884107f1f34ac3ca5f5d4ab087d74ce50cb75d6dbaef88bfc693e23745282faa30b81dc78481c65874 languageName: node linkType: hard @@ -4403,7 +4403,7 @@ __metadata: version: 0.0.0-use.local resolution: "@noir-lang/backend_barretenberg@workspace:tooling/noir_js_backend_barretenberg" dependencies: - "@aztec/bb.js": 0.17.0 + "@aztec/bb.js": 0.19.0 "@noir-lang/types": "workspace:*" "@types/node": ^20.6.2 "@types/prettier": ^3