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

fix: use pedersen for addr nullifier #3027

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,9 @@ pub fn stdlib_recursion_verification_key_compress_native_vk(vk : VerificationKey
0
}

// TODO(David): In most* places where I use this, it was previously convert a field to
// bytes and then taking a blake3s hash and then converting the 32 byte hash output to a
// Field.
//
// *See `compute_new_contract_address_hash`
//
// For now, I have replaced this with `hash_to_field` for two reasons:
// - Hash to field takes as input Field, so we can avoid the to_bytes conversion
// on the Noir layer.
// - Hash_to_field abstracts away the fact that we need blake3s
fn hash_to_field<N>(input : [Field; N]) -> Field {
dep::std::hash::hash_to_field(input)
}

// TODO CPP uses blake3 for this
pub fn compute_new_contract_address_hash(new_contract_address : Address) -> Field {
hash_to_field([new_contract_address.to_field()])
dep::std::hash::pedersen_hash([new_contract_address.to_field()])
}

// TODO is the aztec-nr sha256 to field the same as cpp one?
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.