diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index 0d70d85bef94..0ad7ebd4bfdd 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -333,10 +333,10 @@ impl PrivateContext { preimage ); - self.emit_raw_log_with_masked_address(randomness, encrypted_log); + self.emit_raw_event_log_with_masked_address(randomness, encrypted_log); } - pub fn emit_raw_log_with_masked_address( + pub fn emit_raw_event_log_with_masked_address( &mut self, randomness: Field, encrypted_log: [u8; M] @@ -370,20 +370,11 @@ impl PrivateContext { let contract_address = self.this_address(); let ovsk_app = self.request_ovsk_app(ovpk_m.hash()); - // Current unoptimized size of the encrypted log - // incoming_tag (32 bytes) - // outgoing_tag (32 bytes) - // eph_pk (64 bytes) - // incoming_header (48 bytes) - // outgoing_header (48 bytes) - // outgoing_body (176 bytes) - // incoming_body_fixed (64 bytes) - // incoming_body_variable (N * 32 bytes + 16 bytes padding) let encrypted_log: [u8; M] = compute_encrypted_note_log(contract_address, storage_slot, ovsk_app, ovpk_m, ivpk_m, note); - self.emit_raw_log(note_hash_counter, encrypted_log); + self.emit_raw_note_log(note_hash_counter, encrypted_log); } - pub fn emit_raw_log(&mut self, note_hash_counter: u32, encrypted_log: [u8; M]) { + pub fn emit_raw_note_log(&mut self, note_hash_counter: u32, encrypted_log: [u8; M]) { let counter = self.next_counter(); let len = encrypted_log.len() as Field + 4; let log_hash = sha256_to_field(encrypted_log); diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr index c83c3e43a58d..273142bca9d7 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr @@ -59,6 +59,15 @@ pub fn compute_encrypted_note_log( encrypted_bytes[400 + i] = incoming_body_ciphertext[i]; } + // Current unoptimized size of the encrypted log + // incoming_tag (32 bytes) + // outgoing_tag (32 bytes) + // eph_pk (64 bytes) + // incoming_header (48 bytes) + // outgoing_header (48 bytes) + // outgoing_body (176 bytes) + // incoming_body_fixed (64 bytes) + // incoming_body_variable (N * 32 bytes + 16 bytes padding) encrypted_bytes }