From 1d135ee850dde6f9b89a7bc0e3aaa4cee6c439f1 Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 22 Jan 2025 15:40:35 +0000 Subject: [PATCH] feat: re-exposing compute_initialization_hash --- .../aztec/src/macros/functions/initialization_utils.nr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/aztec/src/macros/functions/initialization_utils.nr b/noir-projects/aztec-nr/aztec/src/macros/functions/initialization_utils.nr index b650a922a9ec..16c190e94141 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/functions/initialization_utils.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/functions/initialization_utils.nr @@ -60,7 +60,12 @@ pub fn assert_initialization_matches_address_preimage_private(context: PrivateCo ); } -fn compute_initialization_hash(init_selector: FunctionSelector, init_args_hash: Field) -> Field { +/// This function is not only used in macros but it's also used by external people to check that an instance has been +/// initialized with the correct constructor arguments. Don't hide this unless you implement factory functionality. +pub fn compute_initialization_hash( + init_selector: FunctionSelector, + init_args_hash: Field, +) -> Field { poseidon2_hash_with_separator( [init_selector.to_field(), init_args_hash], GENERATOR_INDEX__CONSTRUCTOR,