Skip to content

Commit

Permalink
Additional comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
suyash67 committed Aug 24, 2023
1 parent 673a81d commit 510836e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ contract EasyPrivateToken {
abi,
abi::PrivateContextInputs,
context::PrivateContext,
log::emit_unencrypted_log,
note::{
note_header::NoteHeader,
utils as note_utils,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ contract ExamplePublicStateIncrement {
PrivateContext,
PublicContext,
};
use dep::aztec::oracle::logs::emit_unencrypted_log;
use dep::aztec::types::point::Point;
use crate::storage::Storage;
use dep::aztec::state_vars::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ contract Lending {
PublicContext
};
use dep::aztec::oracle::{
logs::emit_unencrypted_log,
create_nullifier::create_nullifier,
};
use dep::aztec::public_call_stack_item::PublicCallStackItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ contract PrivateTokenAirdrop {
note_header::NoteHeader,
utils as note_utils,
};
use dep::aztec::log::emit_unencrypted_log;

use crate::storage::Storage;
use crate::claim_note::{ClaimNote, ClaimNoteMethods};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ contract PrivateToken {
send_note(&mut context, owner_balance, initial_supply, owner);

// TODO(1757) Remove this for public release.
// Private functions must not emit unencrypted logs to avoid leaking any information.
emit_unencrypted_log(&mut context, "Balance set in constructor");
}

Expand All @@ -66,6 +67,7 @@ contract PrivateToken {
send_note(&mut context, owner_balance, amount, owner);

// TODO(1757) Remove this for public release.
// Private functions must not emit unencrypted logs to avoid leaking any information.
emit_unencrypted_log(&mut context, "Coins minted");

// Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel..
Expand Down Expand Up @@ -96,6 +98,7 @@ contract PrivateToken {
send_note(&mut context, recipient_balance, amount, recipient);

// TODO(1757) Remove this for public release.
// Private functions must not emit unencrypted logs to avoid leaking any information.
emit_unencrypted_log(&mut context, "Coins transferred");

// Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel..
Expand Down
1 change: 1 addition & 0 deletions yarn-project/noir-libs/noir-aztec/src/oracle/logs.nr
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ unconstrained fn emit_encrypted_log<N>(
#[oracle(emitUnencryptedLog)]
fn emit_unencrypted_log_oracle<T>(_message: T) -> Field {}

// WARNING: Do not use emit_unencrypted_log in private functions to avoid leaking any information.
unconstrained fn emit_unencrypted_log<T>(message: T) -> [Field; NUM_FIELDS_PER_SHA256] {
// https://github.com/AztecProtocol/aztec-packages/issues/885
[emit_unencrypted_log_oracle(message), 0]
Expand Down

0 comments on commit 510836e

Please sign in to comment.