-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: get_nullifier_keys cleanup (#6451)
- Loading branch information
Showing
12 changed files
with
44 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 11 additions & 25 deletions
36
noir-projects/aztec-nr/aztec/src/oracle/nullifier_keys.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,21 @@ | ||
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] {} | ||
fn get_nullifier_key_validation_request_oracle(_npk_m_hash: Field) -> [Field; 3] {} | ||
|
||
unconstrained fn get_nullifier_keys_internal(npk_m_hash: Field) -> NullifierKeys { | ||
let result = get_nullifier_keys_oracle(npk_m_hash); | ||
NullifierKeys { | ||
unconstrained fn get_nullifier_key_validation_request_internal(npk_m_hash: Field) -> NullifierKeyValidationRequest { | ||
let result = get_nullifier_key_validation_request_oracle(npk_m_hash); | ||
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 { | ||
get_nullifier_keys_internal(npk_m_hash) | ||
pub fn get_nullifier_key_validation_request(npk_m_hash: Field) -> NullifierKeyValidationRequest { | ||
get_nullifier_key_validation_request_internal(npk_m_hash) | ||
} | ||
|
||
pub fn get_nsk_app(npk_m_hash: Field) -> Field { | ||
get_nullifier_key_validation_request_internal(npk_m_hash).app_nullifier_secret_key | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters