Skip to content

Commit

Permalink
chore: addressed Noir TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Aug 23, 2023
1 parent 911a102 commit c096da2
Show file tree
Hide file tree
Showing 9 changed files with 5,521 additions and 5,531 deletions.
4,070 changes: 2,035 additions & 2,035 deletions yarn-project/aztec.js/src/abis/ecdsa_account_contract.json

Large diffs are not rendered by default.

5,252 changes: 2,626 additions & 2,626 deletions yarn-project/aztec.js/src/abis/schnorr_account_contract.json

Large diffs are not rendered by default.

1,702 changes: 851 additions & 851 deletions yarn-project/aztec.js/src/abis/schnorr_single_key_account_contract.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use dep::aztec::note::note_interface::NoteInterface;
use dep::aztec::note::note_header::NoteHeader;
use dep::aztec::note::utils::compute_unique_siloed_note_hash;
use dep::aztec::oracle::get_secret_key::get_secret_key;
use dep::aztec::oracle::get_public_key::get_public_key;

global ECDSA_PUBLIC_KEY_NOTE_LEN: Field = 5;

Expand Down Expand Up @@ -54,8 +53,7 @@ impl EcdsaPublicKeyNote {

fn compute_nullifier(self) -> Field {
let unique_siloed_note_hash = compute_unique_siloed_note_hash(EcdsaPublicKeyNoteInterface, self);
let owner_nullifying_public_key = get_public_key(self.owner);
let secret = get_secret_key(owner_nullifying_public_key);
let secret = get_secret_key(self.owner);
dep::std::hash::pedersen([
unique_siloed_note_hash,
secret,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use dep::std::hash::pedersen;
use dep::aztec::note::note_interface::NoteInterface;
use dep::aztec::note::note_header::NoteHeader;
use dep::aztec::oracle::get_secret_key::get_secret_key;
use dep::aztec::oracle::get_public_key::get_public_key;
use dep::aztec::note::utils::compute_siloed_note_hash;

global ADDRESS_NOTE_LEN: Field = 2;
Expand All @@ -29,8 +28,7 @@ impl AddressNote {

fn compute_nullifier(self) -> Field {
let siloed_note_hash = compute_siloed_note_hash(AddressNoteMethods, self);
let owner_nullifying_public_key = get_public_key(self.owner);
let secret = get_secret_key(owner_nullifying_public_key);
let secret = get_secret_key(self.owner);
dep::std::hash::pedersen([
siloed_note_hash,
secret,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use dep::aztec::note::note_interface::NoteInterface;
use dep::aztec::note::note_header::NoteHeader;
use dep::aztec::note::utils::compute_unique_siloed_note_hash;
use dep::aztec::oracle::get_secret_key::get_secret_key;
use dep::aztec::oracle::get_public_key::get_public_key;

global ADDRESS_NOTE_LEN: Field = 1;

Expand All @@ -28,8 +27,7 @@ impl AddressNote {

fn compute_nullifier(self) -> Field {
let unique_siloed_note_hash = compute_unique_siloed_note_hash(AddressNoteMethods, self);
let owner_nullifying_public_key = get_public_key(self.address);
let secret = get_secret_key(owner_nullifying_public_key);
let secret = get_secret_key(self.address);
dep::std::hash::pedersen([
unique_siloed_note_hash,
secret,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use dep::std::hash::pedersen;
use dep::aztec::note::note_interface::NoteInterface;
use dep::aztec::note::note_header::NoteHeader;
use dep::aztec::oracle::get_secret_key::get_secret_key;
use dep::aztec::oracle::get_public_key::get_public_key;
use dep::aztec::note::utils::compute_unique_siloed_note_hash;

global PUBLIC_KEY_NOTE_LEN: Field = 3;
Expand Down Expand Up @@ -33,8 +32,7 @@ impl PublicKeyNote {

fn compute_nullifier(self) -> Field {
let unique_siloed_note_hash = compute_unique_siloed_note_hash(PublicKeyNoteMethods, self);
let owner_nullifying_public_key = get_public_key(self.owner);
let secret = get_secret_key(owner_nullifying_public_key);
let secret = get_secret_key(self.owner);
dep::std::hash::pedersen([
unique_siloed_note_hash,
secret,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use crate::types::point::Point;
use crate::oracle::get_public_key::get_public_key;

#[oracle(getSecretKey)]
fn get_secret_key_oracle(_owner: Point) -> Field {}

unconstrained fn get_secret_key(owner: Point) -> Field {
get_secret_key_oracle(owner)
unconstrained fn get_secret_key(owner: Field) -> Field {
let owner_nullifying_public_key = get_public_key(owner);
get_secret_key_oracle(owner_nullifying_public_key)
}
6 changes: 1 addition & 5 deletions yarn-project/noir-libs/value-note/src/value_note.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use dep::aztec::note::{
use dep::aztec::oracle::{
rand::rand,
get_secret_key::get_secret_key,
get_public_key::get_public_key,
};

global VALUE_NOTE_LEN: Field = 3; // 3 plus a header.
Expand Down Expand Up @@ -55,10 +54,7 @@ impl ValueNote {

fn compute_nullifier(self) -> Field {
let note_hash_for_nullify = compute_note_hash_for_read_or_nullify(ValueNoteMethods, self);
let owner_nullifying_public_key = get_public_key(self.owner);
// TODO: get_secret_key should just accept an address
// TODO!
let secret = get_secret_key(owner_nullifying_public_key);
let secret = get_secret_key(self.owner);
dep::std::hash::pedersen([
note_hash_for_nullify,
secret,
Expand Down

0 comments on commit c096da2

Please sign in to comment.