Skip to content

Commit

Permalink
fix: use pedersen for addr nullifier (#3027)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirasistant authored Oct 25, 2023
1 parent a3a8811 commit 28ec608
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 21 deletions.
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.

0 comments on commit 28ec608

Please sign in to comment.