Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: expose pedersen hash in acir and bb solver #3269

Merged
merged 47 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a302b7a
disable return constant error
kevaundray Oct 12, 2023
3ee24a6
save new wasm build
kevaundray Oct 13, 2023
dbec490
change pedersen implementation
kevaundray Oct 13, 2023
68d5dd8
remove unneeded file
kevaundray Oct 13, 2023
1e6b903
change test vectors
kevaundray Oct 13, 2023
c45ad3c
add wasm to filter
kevaundray Oct 13, 2023
b129587
modify test vectors
kevaundray Oct 13, 2023
25d50e3
clippy -- remove unused functions and imports
kevaundray Oct 13, 2023
887b332
fixes
kevaundray Oct 13, 2023
e28a00c
jake: fix lookup_method
kevaundray Oct 13, 2023
2c559a8
merkle insert fix
kevaundray Oct 13, 2023
4fd1b30
simple_shield
kevaundray Oct 13, 2023
c1c603c
lint --fix
kevaundray Oct 13, 2023
20c692c
check_type = false
kevaundray Oct 13, 2023
3c91fc4
remove constant return test case until we get warning
kevaundray Oct 13, 2023
aa5b706
prefix to show unused variable
kevaundray Oct 13, 2023
0b5383d
Merge remote-tracking branch 'origin/master' into kw/disable-return-e…
kevaundray Oct 13, 2023
99dcd53
Merge branch 'kw/disable-return-error' into kw/switch-backend
kevaundray Oct 13, 2023
8f4c410
fix test
kevaundray Oct 13, 2023
c270f0d
remove test
kevaundray Oct 14, 2023
15cac1a
Merge branch 'kw/disable-return-error' into kw/switch-backend
kevaundray Oct 14, 2023
bc5639e
feat: expose pedersen hash in acir and solver
sirasistant Oct 24, 2023
cce97e7
feat: add to stdlib and add brillig gen for hash
sirasistant Oct 24, 2023
92e3c3e
fix: add constant for pedersen hash
sirasistant Oct 24, 2023
b43384b
test: add e2e test for pedersen hash
sirasistant Oct 24, 2023
7f4f76c
Merge remote-tracking branch 'origin/master' into arv/pedersen_hash
kevaundray Oct 24, 2023
4022a09
add pedersen hash impl
kevaundray Oct 24, 2023
027b832
wrap is_opcode_supported
kevaundray Oct 24, 2023
2271c10
update artefacts
kevaundray Oct 24, 2023
317b621
Merge remote-tracking branch 'origin/master' into arv/pedersen_hash
kevaundray Oct 24, 2023
242c55d
change pedersen -> pedersen_commitent
kevaundray Oct 24, 2023
32c7c22
pedersen -> pedersen commitment codegen
kevaundray Oct 24, 2023
b241cb0
feat: add supported pedersen_hash in mock backend
sirasistant Oct 24, 2023
3eca798
Merge branch 'arv/pedersen_hash' of github.com:noir-lang/noir into ar…
kevaundray Oct 24, 2023
0e03151
pedersen -> pedersen commitment
kevaundray Oct 24, 2023
59bd739
change serialization
kevaundray Oct 24, 2023
ae97e63
update serialization
kevaundray Oct 24, 2023
543d6c9
cargo fmt
kevaundray Oct 24, 2023
ed1e710
Merge remote-tracking branch 'origin/master' into arv/pedersen_hash
kevaundray Oct 24, 2023
5b94d5b
fix aztec_library
kevaundray Oct 24, 2023
9e54055
add stub for mock backend
kevaundray Oct 24, 2023
c0f0eb6
cargo fmt
kevaundray Oct 24, 2023
9362a64
update version
kevaundray Oct 24, 2023
e13a2a5
yarn
kevaundray Oct 24, 2023
bc41558
Merge remote-tracking branch 'origin/master' into arv/pedersen_hash
kevaundray Oct 24, 2023
93935a5
update artefacts
kevaundray Oct 24, 2023
b8af278
use 0.11.1
kevaundray Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 132 additions & 24 deletions acvm-repo/acir/codegen/acir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,24 @@ namespace Circuit {
static SchnorrVerify bincodeDeserialize(std::vector<uint8_t>);
};

struct Pedersen {
struct PedersenCommitment {
std::vector<Circuit::FunctionInput> inputs;
uint32_t domain_separator;
std::array<Circuit::Witness, 2> outputs;

friend bool operator==(const Pedersen&, const Pedersen&);
friend bool operator==(const PedersenCommitment&, const PedersenCommitment&);
std::vector<uint8_t> bincodeSerialize() const;
static Pedersen bincodeDeserialize(std::vector<uint8_t>);
static PedersenCommitment bincodeDeserialize(std::vector<uint8_t>);
};

struct PedersenHash {
std::vector<Circuit::FunctionInput> inputs;
uint32_t domain_separator;
Circuit::Witness output;

friend bool operator==(const PedersenHash&, const PedersenHash&);
std::vector<uint8_t> bincodeSerialize() const;
static PedersenHash bincodeDeserialize(std::vector<uint8_t>);
};

struct HashToField128Security {
Expand Down Expand Up @@ -167,7 +177,7 @@ namespace Circuit {
static RecursiveAggregation bincodeDeserialize(std::vector<uint8_t>);
};

std::variant<AND, XOR, RANGE, SHA256, Blake2s, SchnorrVerify, Pedersen, HashToField128Security, EcdsaSecp256k1, EcdsaSecp256r1, FixedBaseScalarMul, Keccak256, Keccak256VariableLength, RecursiveAggregation> value;
std::variant<AND, XOR, RANGE, SHA256, Blake2s, SchnorrVerify, PedersenCommitment, PedersenHash, HashToField128Security, EcdsaSecp256k1, EcdsaSecp256r1, FixedBaseScalarMul, Keccak256, Keccak256VariableLength, RecursiveAggregation> value;

friend bool operator==(const BlackBoxFuncCall&, const BlackBoxFuncCall&);
std::vector<uint8_t> bincodeSerialize() const;
Expand Down Expand Up @@ -443,14 +453,24 @@ namespace Circuit {
static SchnorrVerify bincodeDeserialize(std::vector<uint8_t>);
};

struct Pedersen {
struct PedersenCommitment {
Circuit::HeapVector inputs;
Circuit::RegisterIndex domain_separator;
Circuit::HeapArray output;

friend bool operator==(const Pedersen&, const Pedersen&);
friend bool operator==(const PedersenCommitment&, const PedersenCommitment&);
std::vector<uint8_t> bincodeSerialize() const;
static PedersenCommitment bincodeDeserialize(std::vector<uint8_t>);
};

struct PedersenHash {
Circuit::HeapVector inputs;
Circuit::RegisterIndex domain_separator;
Circuit::RegisterIndex output;

friend bool operator==(const PedersenHash&, const PedersenHash&);
std::vector<uint8_t> bincodeSerialize() const;
static Pedersen bincodeDeserialize(std::vector<uint8_t>);
static PedersenHash bincodeDeserialize(std::vector<uint8_t>);
};

struct FixedBaseScalarMul {
Expand All @@ -463,7 +483,7 @@ namespace Circuit {
static FixedBaseScalarMul bincodeDeserialize(std::vector<uint8_t>);
};

std::variant<Sha256, Blake2s, Keccak256, HashToField128Security, EcdsaSecp256k1, EcdsaSecp256r1, SchnorrVerify, Pedersen, FixedBaseScalarMul> value;
std::variant<Sha256, Blake2s, Keccak256, HashToField128Security, EcdsaSecp256k1, EcdsaSecp256r1, SchnorrVerify, PedersenCommitment, PedersenHash, FixedBaseScalarMul> value;

friend bool operator==(const BlackBoxOp&, const BlackBoxOp&);
std::vector<uint8_t> bincodeSerialize() const;
Expand Down Expand Up @@ -1871,22 +1891,22 @@ Circuit::BlackBoxFuncCall::SchnorrVerify serde::Deserializable<Circuit::BlackBox

namespace Circuit {

inline bool operator==(const BlackBoxFuncCall::Pedersen &lhs, const BlackBoxFuncCall::Pedersen &rhs) {
inline bool operator==(const BlackBoxFuncCall::PedersenCommitment &lhs, const BlackBoxFuncCall::PedersenCommitment &rhs) {
if (!(lhs.inputs == rhs.inputs)) { return false; }
if (!(lhs.domain_separator == rhs.domain_separator)) { return false; }
if (!(lhs.outputs == rhs.outputs)) { return false; }
return true;
}

inline std::vector<uint8_t> BlackBoxFuncCall::Pedersen::bincodeSerialize() const {
inline std::vector<uint8_t> BlackBoxFuncCall::PedersenCommitment::bincodeSerialize() const {
auto serializer = serde::BincodeSerializer();
serde::Serializable<BlackBoxFuncCall::Pedersen>::serialize(*this, serializer);
serde::Serializable<BlackBoxFuncCall::PedersenCommitment>::serialize(*this, serializer);
return std::move(serializer).bytes();
}

inline BlackBoxFuncCall::Pedersen BlackBoxFuncCall::Pedersen::bincodeDeserialize(std::vector<uint8_t> input) {
inline BlackBoxFuncCall::PedersenCommitment BlackBoxFuncCall::PedersenCommitment::bincodeDeserialize(std::vector<uint8_t> input) {
auto deserializer = serde::BincodeDeserializer(input);
auto value = serde::Deserializable<BlackBoxFuncCall::Pedersen>::deserialize(deserializer);
auto value = serde::Deserializable<BlackBoxFuncCall::PedersenCommitment>::deserialize(deserializer);
if (deserializer.get_buffer_offset() < input.size()) {
throw serde::deserialization_error("Some input bytes were not read");
}
Expand All @@ -1897,22 +1917,66 @@ namespace Circuit {

template <>
template <typename Serializer>
void serde::Serializable<Circuit::BlackBoxFuncCall::Pedersen>::serialize(const Circuit::BlackBoxFuncCall::Pedersen &obj, Serializer &serializer) {
void serde::Serializable<Circuit::BlackBoxFuncCall::PedersenCommitment>::serialize(const Circuit::BlackBoxFuncCall::PedersenCommitment &obj, Serializer &serializer) {
serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
serde::Serializable<decltype(obj.domain_separator)>::serialize(obj.domain_separator, serializer);
serde::Serializable<decltype(obj.outputs)>::serialize(obj.outputs, serializer);
}

template <>
template <typename Deserializer>
Circuit::BlackBoxFuncCall::Pedersen serde::Deserializable<Circuit::BlackBoxFuncCall::Pedersen>::deserialize(Deserializer &deserializer) {
Circuit::BlackBoxFuncCall::Pedersen obj;
Circuit::BlackBoxFuncCall::PedersenCommitment serde::Deserializable<Circuit::BlackBoxFuncCall::PedersenCommitment>::deserialize(Deserializer &deserializer) {
Circuit::BlackBoxFuncCall::PedersenCommitment obj;
obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
obj.domain_separator = serde::Deserializable<decltype(obj.domain_separator)>::deserialize(deserializer);
obj.outputs = serde::Deserializable<decltype(obj.outputs)>::deserialize(deserializer);
return obj;
}

namespace Circuit {

inline bool operator==(const BlackBoxFuncCall::PedersenHash &lhs, const BlackBoxFuncCall::PedersenHash &rhs) {
if (!(lhs.inputs == rhs.inputs)) { return false; }
if (!(lhs.domain_separator == rhs.domain_separator)) { return false; }
if (!(lhs.output == rhs.output)) { return false; }
return true;
}

inline std::vector<uint8_t> BlackBoxFuncCall::PedersenHash::bincodeSerialize() const {
auto serializer = serde::BincodeSerializer();
serde::Serializable<BlackBoxFuncCall::PedersenHash>::serialize(*this, serializer);
return std::move(serializer).bytes();
}

inline BlackBoxFuncCall::PedersenHash BlackBoxFuncCall::PedersenHash::bincodeDeserialize(std::vector<uint8_t> input) {
auto deserializer = serde::BincodeDeserializer(input);
auto value = serde::Deserializable<BlackBoxFuncCall::PedersenHash>::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 <typename Serializer>
void serde::Serializable<Circuit::BlackBoxFuncCall::PedersenHash>::serialize(const Circuit::BlackBoxFuncCall::PedersenHash &obj, Serializer &serializer) {
serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
serde::Serializable<decltype(obj.domain_separator)>::serialize(obj.domain_separator, serializer);
serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
}

template <>
template <typename Deserializer>
Circuit::BlackBoxFuncCall::PedersenHash serde::Deserializable<Circuit::BlackBoxFuncCall::PedersenHash>::deserialize(Deserializer &deserializer) {
Circuit::BlackBoxFuncCall::PedersenHash obj;
obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
obj.domain_separator = serde::Deserializable<decltype(obj.domain_separator)>::deserialize(deserializer);
obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
return obj;
}

namespace Circuit {

inline bool operator==(const BlackBoxFuncCall::HashToField128Security &lhs, const BlackBoxFuncCall::HashToField128Security &rhs) {
Expand Down Expand Up @@ -2594,22 +2658,66 @@ Circuit::BlackBoxOp::SchnorrVerify serde::Deserializable<Circuit::BlackBoxOp::Sc

namespace Circuit {

inline bool operator==(const BlackBoxOp::Pedersen &lhs, const BlackBoxOp::Pedersen &rhs) {
inline bool operator==(const BlackBoxOp::PedersenCommitment &lhs, const BlackBoxOp::PedersenCommitment &rhs) {
if (!(lhs.inputs == rhs.inputs)) { return false; }
if (!(lhs.domain_separator == rhs.domain_separator)) { return false; }
if (!(lhs.output == rhs.output)) { return false; }
return true;
}

inline std::vector<uint8_t> BlackBoxOp::PedersenCommitment::bincodeSerialize() const {
auto serializer = serde::BincodeSerializer();
serde::Serializable<BlackBoxOp::PedersenCommitment>::serialize(*this, serializer);
return std::move(serializer).bytes();
}

inline BlackBoxOp::PedersenCommitment BlackBoxOp::PedersenCommitment::bincodeDeserialize(std::vector<uint8_t> input) {
auto deserializer = serde::BincodeDeserializer(input);
auto value = serde::Deserializable<BlackBoxOp::PedersenCommitment>::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 <typename Serializer>
void serde::Serializable<Circuit::BlackBoxOp::PedersenCommitment>::serialize(const Circuit::BlackBoxOp::PedersenCommitment &obj, Serializer &serializer) {
serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
serde::Serializable<decltype(obj.domain_separator)>::serialize(obj.domain_separator, serializer);
serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
}

template <>
template <typename Deserializer>
Circuit::BlackBoxOp::PedersenCommitment serde::Deserializable<Circuit::BlackBoxOp::PedersenCommitment>::deserialize(Deserializer &deserializer) {
Circuit::BlackBoxOp::PedersenCommitment obj;
obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
obj.domain_separator = serde::Deserializable<decltype(obj.domain_separator)>::deserialize(deserializer);
obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
return obj;
}

namespace Circuit {

inline bool operator==(const BlackBoxOp::PedersenHash &lhs, const BlackBoxOp::PedersenHash &rhs) {
if (!(lhs.inputs == rhs.inputs)) { return false; }
if (!(lhs.domain_separator == rhs.domain_separator)) { return false; }
if (!(lhs.output == rhs.output)) { return false; }
return true;
}

inline std::vector<uint8_t> BlackBoxOp::Pedersen::bincodeSerialize() const {
inline std::vector<uint8_t> BlackBoxOp::PedersenHash::bincodeSerialize() const {
auto serializer = serde::BincodeSerializer();
serde::Serializable<BlackBoxOp::Pedersen>::serialize(*this, serializer);
serde::Serializable<BlackBoxOp::PedersenHash>::serialize(*this, serializer);
return std::move(serializer).bytes();
}

inline BlackBoxOp::Pedersen BlackBoxOp::Pedersen::bincodeDeserialize(std::vector<uint8_t> input) {
inline BlackBoxOp::PedersenHash BlackBoxOp::PedersenHash::bincodeDeserialize(std::vector<uint8_t> input) {
auto deserializer = serde::BincodeDeserializer(input);
auto value = serde::Deserializable<BlackBoxOp::Pedersen>::deserialize(deserializer);
auto value = serde::Deserializable<BlackBoxOp::PedersenHash>::deserialize(deserializer);
if (deserializer.get_buffer_offset() < input.size()) {
throw serde::deserialization_error("Some input bytes were not read");
}
Expand All @@ -2620,16 +2728,16 @@ namespace Circuit {

template <>
template <typename Serializer>
void serde::Serializable<Circuit::BlackBoxOp::Pedersen>::serialize(const Circuit::BlackBoxOp::Pedersen &obj, Serializer &serializer) {
void serde::Serializable<Circuit::BlackBoxOp::PedersenHash>::serialize(const Circuit::BlackBoxOp::PedersenHash &obj, Serializer &serializer) {
serde::Serializable<decltype(obj.inputs)>::serialize(obj.inputs, serializer);
serde::Serializable<decltype(obj.domain_separator)>::serialize(obj.domain_separator, serializer);
serde::Serializable<decltype(obj.output)>::serialize(obj.output, serializer);
}

template <>
template <typename Deserializer>
Circuit::BlackBoxOp::Pedersen serde::Deserializable<Circuit::BlackBoxOp::Pedersen>::deserialize(Deserializer &deserializer) {
Circuit::BlackBoxOp::Pedersen obj;
Circuit::BlackBoxOp::PedersenHash serde::Deserializable<Circuit::BlackBoxOp::PedersenHash>::deserialize(Deserializer &deserializer) {
Circuit::BlackBoxOp::PedersenHash obj;
obj.inputs = serde::Deserializable<decltype(obj.inputs)>::deserialize(deserializer);
obj.domain_separator = serde::Deserializable<decltype(obj.domain_separator)>::deserialize(deserializer);
obj.output = serde::Deserializable<decltype(obj.output)>::deserialize(deserializer);
Expand Down
10 changes: 7 additions & 3 deletions acvm-repo/acir/src/circuit/black_box_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub enum BlackBoxFunc {
/// [grumpkin]: https://hackmd.io/@aztec-network/ByzgNxBfd#2-Grumpkin---A-curve-on-top-of-BN-254-for-SNARK-efficient-group-operations
SchnorrVerify,
/// Calculates a Pedersen commitment to the inputs.
Pedersen,
PedersenCommitment,
/// Calculates a Pedersen hash to the inputs.
PedersenHash,
/// Hashes a set of inputs and applies the field modulus to the result
/// to return a value which can be represented as a [`FieldElement`][acir_field::FieldElement]
///
Expand Down Expand Up @@ -62,7 +64,8 @@ impl BlackBoxFunc {
BlackBoxFunc::SHA256 => "sha256",
BlackBoxFunc::SchnorrVerify => "schnorr_verify",
BlackBoxFunc::Blake2s => "blake2s",
BlackBoxFunc::Pedersen => "pedersen",
BlackBoxFunc::PedersenCommitment => "pedersen",
BlackBoxFunc::PedersenHash => "pedersen_hash",
BlackBoxFunc::HashToField128Security => "hash_to_field_128_security",
BlackBoxFunc::EcdsaSecp256k1 => "ecdsa_secp256k1",
BlackBoxFunc::FixedBaseScalarMul => "fixed_base_scalar_mul",
Expand All @@ -79,7 +82,8 @@ impl BlackBoxFunc {
"sha256" => Some(BlackBoxFunc::SHA256),
"schnorr_verify" => Some(BlackBoxFunc::SchnorrVerify),
"blake2s" => Some(BlackBoxFunc::Blake2s),
"pedersen" => Some(BlackBoxFunc::Pedersen),
"pedersen" => Some(BlackBoxFunc::PedersenCommitment),
"pedersen_hash" => Some(BlackBoxFunc::PedersenHash),
"hash_to_field_128_security" => Some(BlackBoxFunc::HashToField128Security),
"ecdsa_secp256k1" => Some(BlackBoxFunc::EcdsaSecp256k1),
"ecdsa_secp256r1" => Some(BlackBoxFunc::EcdsaSecp256r1),
Expand Down
25 changes: 19 additions & 6 deletions acvm-repo/acir/src/circuit/opcodes/black_box_function_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ pub enum BlackBoxFuncCall {
message: Vec<FunctionInput>,
output: Witness,
},
Pedersen {
PedersenCommitment {
inputs: Vec<FunctionInput>,
domain_separator: u32,
outputs: (Witness, Witness),
},
PedersenHash {
inputs: Vec<FunctionInput>,
domain_separator: u32,
output: Witness,
},
// 128 here specifies that this function
// should have 128 bits of security
HashToField128Security {
Expand Down Expand Up @@ -138,11 +143,16 @@ impl BlackBoxFuncCall {
message: vec![],
output: Witness(0),
},
BlackBoxFunc::Pedersen => BlackBoxFuncCall::Pedersen {
BlackBoxFunc::PedersenCommitment => BlackBoxFuncCall::PedersenCommitment {
inputs: vec![],
domain_separator: 0,
outputs: (Witness(0), Witness(0)),
},
BlackBoxFunc::PedersenHash => BlackBoxFuncCall::PedersenHash {
inputs: vec![],
domain_separator: 0,
output: Witness(0),
},
BlackBoxFunc::HashToField128Security => {
BlackBoxFuncCall::HashToField128Security { inputs: vec![], output: Witness(0) }
}
Expand Down Expand Up @@ -187,7 +197,8 @@ impl BlackBoxFuncCall {
BlackBoxFuncCall::SHA256 { .. } => BlackBoxFunc::SHA256,
BlackBoxFuncCall::Blake2s { .. } => BlackBoxFunc::Blake2s,
BlackBoxFuncCall::SchnorrVerify { .. } => BlackBoxFunc::SchnorrVerify,
BlackBoxFuncCall::Pedersen { .. } => BlackBoxFunc::Pedersen,
BlackBoxFuncCall::PedersenCommitment { .. } => BlackBoxFunc::PedersenCommitment,
BlackBoxFuncCall::PedersenHash { .. } => BlackBoxFunc::PedersenHash,
BlackBoxFuncCall::HashToField128Security { .. } => BlackBoxFunc::HashToField128Security,
BlackBoxFuncCall::EcdsaSecp256k1 { .. } => BlackBoxFunc::EcdsaSecp256k1,
BlackBoxFuncCall::EcdsaSecp256r1 { .. } => BlackBoxFunc::EcdsaSecp256r1,
Expand All @@ -207,7 +218,8 @@ impl BlackBoxFuncCall {
BlackBoxFuncCall::SHA256 { inputs, .. }
| BlackBoxFuncCall::Blake2s { inputs, .. }
| BlackBoxFuncCall::Keccak256 { inputs, .. }
| BlackBoxFuncCall::Pedersen { inputs, .. }
| BlackBoxFuncCall::PedersenCommitment { inputs, .. }
| BlackBoxFuncCall::PedersenHash { inputs, .. }
| BlackBoxFuncCall::HashToField128Security { inputs, .. } => inputs.to_vec(),
BlackBoxFuncCall::AND { lhs, rhs, .. } | BlackBoxFuncCall::XOR { lhs, rhs, .. } => {
vec![*lhs, *rhs]
Expand Down Expand Up @@ -304,9 +316,10 @@ impl BlackBoxFuncCall {
| BlackBoxFuncCall::HashToField128Security { output, .. }
| BlackBoxFuncCall::SchnorrVerify { output, .. }
| BlackBoxFuncCall::EcdsaSecp256k1 { output, .. }
| BlackBoxFuncCall::PedersenHash { output, .. }
| BlackBoxFuncCall::EcdsaSecp256r1 { output, .. } => vec![*output],
BlackBoxFuncCall::FixedBaseScalarMul { outputs, .. }
| BlackBoxFuncCall::Pedersen { outputs, .. } => vec![outputs.0, outputs.1],
| BlackBoxFuncCall::PedersenCommitment { outputs, .. } => vec![outputs.0, outputs.1],
BlackBoxFuncCall::RANGE { .. } => vec![],
BlackBoxFuncCall::Keccak256VariableLength { outputs, .. } => outputs.to_vec(),
}
Expand Down Expand Up @@ -395,7 +408,7 @@ impl std::fmt::Display for BlackBoxFuncCall {

// SPECIFIC PARAMETERS
match self {
BlackBoxFuncCall::Pedersen { domain_separator, .. } => {
BlackBoxFuncCall::PedersenCommitment { domain_separator, .. } => {
write!(f, " domain_separator: {domain_separator}")
}
_ => write!(f, ""),
Expand Down
Loading
Loading