forked from visoftsolutions/noir_rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: moving compute_address func to AztecAddress (AztecProtocol#3801)
Fixes AztecProtocol#3794
- Loading branch information
Showing
5 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,5 +1,4 @@ | ||
mod abi; | ||
mod address; | ||
mod context; | ||
mod hash; | ||
mod history; | ||
|
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
9 changes: 5 additions & 4 deletions
9
yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/src/util.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,15 +1,16 @@ | ||
use dep::protocol_types::address::AztecAddress; | ||
use dep::std::{schnorr::verify_signature}; | ||
use dep::aztec::address::compute_address; | ||
use crate::auth_oracle::{AuthWitness}; | ||
|
||
pub fn recover_address(message_hash: Field, witness: AuthWitness) -> AztecAddress { | ||
let message_bytes = message_hash.to_be_bytes(32); | ||
let verification = verify_signature(witness.owner.x, | ||
let verification = verify_signature( | ||
witness.owner.x, | ||
witness.owner.y, | ||
witness.signature, | ||
message_bytes); | ||
message_bytes | ||
); | ||
assert(verification == true); | ||
|
||
compute_address(witness.owner.x, witness.owner.y, witness.partial_address) | ||
AztecAddress::compute(witness.owner.x, witness.owner.y, witness.partial_address) | ||
} |
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