Skip to content

Commit

Permalink
Addressing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Jun 25, 2024
1 parent e2fcbde commit a13a218
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn compute_encrypted_event_log<Event, NB, MB, OB>(
let eph_sk: GrumpkinPrivateKey = fr_to_private_key(unsafe_rand());
let eph_pk = eph_sk.derive_public_key();

// @todo This value needs to be populated!
// TODO: (#7177) This value needs to be populated!
let recipient = AztecAddress::from_field(0);

let ivpk_app = compute_ivpk_app(ivpk, contract_address);
Expand Down Expand Up @@ -84,7 +84,7 @@ pub fn compute_encrypted_note_log<Note, N, NB, M>(
let eph_sk: GrumpkinPrivateKey = fr_to_private_key(unsafe_rand());
let eph_pk = eph_sk.derive_public_key();

// @todo This value needs to be populated!
// TODO: (#7177) This value needs to be populated!
let recipient = AztecAddress::from_field(0);

let ivpk_app = compute_ivpk_app(ivpk, contract_address);
Expand Down
18 changes: 16 additions & 2 deletions noir-projects/noir-contracts/contracts/test_contract/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,15 @@ contract Test {

let event = ExampleEvent { value0: fields[0], value1: fields[1], value2: fields[2], value3: fields[3], value4: fields[4] };

event.emit(encode_and_encrypt_event_with_keys(&mut context, 5, outgoing_viewer_ovpk_m, owner_ivpk_m));
event.emit(
encode_and_encrypt_event_with_keys(
&mut context,
// testing only - a secret random value is passed in here to salt / mask the address
5,
outgoing_viewer_ovpk_m,
owner_ivpk_m
)
);

// this contract has reached max number of functions, so using this one fn
// to test nested and non nested encrypted logs
Expand All @@ -280,7 +288,13 @@ contract Test {
let otherEvent = ExampleEvent { value0: 1, value1: 2, value2: 3, value3: 4, value4: 5 };

otherEvent.emit(
encode_and_encrypt_event_with_keys(&mut context, 0, outgoing_viewer_ovpk_m, owner_ivpk_m)
encode_and_encrypt_event_with_keys(
&mut context,
// testing only - a randomness of 0 signals the kerels to not mask the address
0,
outgoing_viewer_ovpk_m,
owner_ivpk_m
)
);
}
}
Expand Down

0 comments on commit a13a218

Please sign in to comment.