Skip to content

Commit

Permalink
chore!: Change blake3 to blake2 in private kernel (#2861)
Browse files Browse the repository at this point in the history
Related to #2859 

Opening this up in the case that there are no blockers to removing
blake3

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
  • Loading branch information
kevaundray authored Oct 16, 2023
1 parent 90ae5dc commit d629940
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void common_contract_logic(DummyBuilder& builder,

// compute contract address nullifier
auto const blake_input = new_contract_address.to_field().to_buffer();
auto const new_contract_address_nullifier = NT::fr::serialize_from_buffer(NT::blake3s(blake_input).data());
auto const new_contract_address_nullifier = NT::fr::serialize_from_buffer(NT::blake2s(blake_input).data());

// push the contract address nullifier to nullifier vector
array_push(builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void update_end_values(PrivateKernelInputsInner<CT> const& private_inputs, Kerne

// compute contract address nullifier
auto blake_input = CT::byte_array(contract_address.to_field());
auto contract_address_nullifier = CT::fr(CT::blake3s(blake_input));
auto contract_address_nullifier = CT::fr(CT::blake2s(blake_input));

// push the contract address nullifier to nullifier vector
CT::fr const conditional_contract_address_nullifier =
Expand Down
2 changes: 0 additions & 2 deletions circuits/cpp/src/aztec3/utils/types/circuit_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ template <typename Builder> struct CircuitTypes {
};

static byte_array blake2s(const byte_array& input) { return plonk::stdlib::blake2s(input); }

static byte_array blake3s(const byte_array& input) { return plonk::stdlib::blake3s(input); }
};

} // namespace aztec3::utils::types
2 changes: 0 additions & 2 deletions circuits/cpp/src/aztec3/utils/types/native_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ struct NativeTypes {
auto res = blake2::blake2s(input);
return byte_array(res.begin(), res.end());
}

static byte_array blake3s(const byte_array& input) { return blake3::blake3s(input); }
};

} // namespace aztec3::utils::types

0 comments on commit d629940

Please sign in to comment.