diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index ce7987cf015..9cfe1bc834c 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -3,8 +3,7 @@ use crate::{ keys::getters::get_nullifier_keys, messaging::process_l1_to_l2_message, hash::{hash_args_array, ArgsHasher, compute_encrypted_log_hash, compute_unencrypted_log_hash}, oracle::{ - nullifier_keys::NullifierKeys, arguments, returns, - call_private_function::call_private_function_internal, header::get_header_at, + arguments, returns, call_private_function::call_private_function_internal, header::get_header_at, logs::emit_encrypted_log, logs_traits::{LensForEncryptedLog, ToBytesForUnencryptedLog}, enqueue_public_function_call::{ enqueue_public_function_call_internal, set_public_teardown_function_call_internal, @@ -69,7 +68,7 @@ struct PrivateContext { encrypted_log_preimages_length: Field, unencrypted_log_preimages_length: Field, - nullifier_key: Option, + nullifier_key: Option, } impl ContextInterface for PrivateContext { @@ -205,7 +204,7 @@ impl PrivateContext { pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field { // A value of empty nullifier keys will fail the key validation request. - let cached_nullifier_keys = self.nullifier_key.unwrap_or(NullifierKeys::empty()); + let cached_nullifier_keys = self.nullifier_key.unwrap_or(NullifierKeyValidationRequest::empty()); let nullifier_keys = if cached_nullifier_keys.master_nullifier_public_key.hash() == npk_m_hash { cached_nullifier_keys diff --git a/noir-projects/aztec-nr/aztec/src/keys/getters.nr b/noir-projects/aztec-nr/aztec/src/keys/getters.nr index 1759d3a9e57..ad7c7275920 100644 --- a/noir-projects/aztec-nr/aztec/src/keys/getters.nr +++ b/noir-projects/aztec-nr/aztec/src/keys/getters.nr @@ -1,9 +1,12 @@ -use dep::protocol_types::{address::AztecAddress, constants::CANONICAL_KEY_REGISTRY_ADDRESS, grumpkin_point::GrumpkinPoint}; +use dep::protocol_types::{ + abis::nullifier_key_validation_request::NullifierKeyValidationRequest, address::AztecAddress, + constants::CANONICAL_KEY_REGISTRY_ADDRESS, grumpkin_point::GrumpkinPoint +}; use crate::{ context::PrivateContext, oracle::{ keys::get_public_keys_and_partial_address, - nullifier_keys::{NullifierKeys, get_nullifier_keys as get_nullifier_keys_oracle} + nullifier_keys::get_nullifier_keys as get_nullifier_keys_oracle }, keys::public_keys::{PublicKeys, NULLIFIER_INDEX, INCOMING_INDEX}, state_vars::{ @@ -92,7 +95,7 @@ fn fetch_and_constrain_keys(address: AztecAddress) -> PublicKeys { } // We get the full struct Nullifier Keys here -pub fn get_nullifier_keys(npk_m_hash: Field) -> NullifierKeys { +pub fn get_nullifier_keys(npk_m_hash: Field) -> NullifierKeyValidationRequest { let nullifier_keys = get_nullifier_keys_oracle(npk_m_hash); assert_eq(nullifier_keys.master_nullifier_public_key.hash(), npk_m_hash); diff --git a/noir-projects/aztec-nr/aztec/src/oracle/nullifier_keys.nr b/noir-projects/aztec-nr/aztec/src/oracle/nullifier_keys.nr index 1d8fd94052f..37ec10e5919 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/nullifier_keys.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/nullifier_keys.nr @@ -1,35 +1,17 @@ -use dep::protocol_types::{ - address::AztecAddress, traits::Empty, grumpkin_point::GrumpkinPoint, - grumpkin_private_key::GrumpkinPrivateKey -}; - -// Nullifier keys pertaining to a specific account -struct NullifierKeys { - master_nullifier_public_key: GrumpkinPoint, - app_nullifier_secret_key: Field, -} - -impl Empty for NullifierKeys { - fn empty() -> Self { - NullifierKeys { - master_nullifier_public_key: GrumpkinPoint::zero(), - app_nullifier_secret_key: 0 - } - } -} +use dep::protocol_types::{grumpkin_point::GrumpkinPoint, abis::nullifier_key_validation_request::NullifierKeyValidationRequest}; #[oracle(getNullifierKeys)] fn get_nullifier_keys_oracle(_npk_m_hash: Field) -> [Field; 3] {} -unconstrained fn get_nullifier_keys_internal(npk_m_hash: Field) -> NullifierKeys { +unconstrained fn get_nullifier_keys_internal(npk_m_hash: Field) -> NullifierKeyValidationRequest { let result = get_nullifier_keys_oracle(npk_m_hash); - NullifierKeys { + NullifierKeyValidationRequest { master_nullifier_public_key: GrumpkinPoint { x: result[0], y: result[1] }, app_nullifier_secret_key: result[2] } } // We get the full struct Nullifier Keys here -pub fn get_nullifier_keys(npk_m_hash: Field) -> NullifierKeys { +pub fn get_nullifier_keys(npk_m_hash: Field) -> NullifierKeyValidationRequest { get_nullifier_keys_internal(npk_m_hash) }