Skip to content

Commit

Permalink
issue workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Aug 2, 2024
1 parent b720d57 commit 711274d
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ use dep::aztec::{
keys::getters::get_nsk_app
};

// TODO(#7738): Nuke the following imports
use dep::aztec::{
generators::{Ga1 as G_amt, Ga2 as G_npk, Ga3 as G_rnd},
protocol_types::{point::Point, scalar::Scalar}
};
use dep::std::{embedded_curve_ops::multi_scalar_mul, hash::from_field_unsafe};

trait OwnedNote {
fn new(amount: U128, owner_npk_m_hash: Field) -> Self;
fn get_amount(self) -> U128;
Expand Down Expand Up @@ -48,6 +55,21 @@ impl NoteInterface<TOKEN_NOTE_LEN, TOKEN_NOTE_BYTES_LEN> for TokenNote {
]);
(note_hash_for_nullify, nullifier)
}

// TODO(#7738): Nuke this function and have it auto-generated by macros
fn compute_note_hiding_point(self) -> Point {
let npk_m_hash_scalar = from_field_unsafe(self.npk_m_hash);
let randomness_scalar = from_field_unsafe(self.randomness);
multi_scalar_mul(
[G_amt, G_npk, G_rnd],
[Scalar {
lo: self.amount.to_integer(),
hi: 0
},
npk_m_hash_scalar,
randomness_scalar]
)
}
}

impl OwnedNote for TokenNote {
Expand Down

0 comments on commit 711274d

Please sign in to comment.