-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update the encrypted note log format
- Loading branch information
Showing
35 changed files
with
475 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,40 @@ | ||
use dep::protocol_types::{address::AztecAddress, grumpkin_point::GrumpkinPoint}; | ||
|
||
// TODO(1139): Should take encrypted data. | ||
// Currently returns encrypted data to be hashed | ||
// = 112 + 32 * (N + 3) bytes = N + 7 fields | ||
// = 480 + 32 * N bytes | ||
#[oracle(emitEncryptedNoteLog)] | ||
fn emit_encrypted_note_log_oracle<M>(_note_hash: Field, _encrypted_note: [u8; M], _counter: u32) {} | ||
|
||
unconstrained pub fn emit_encrypted_note_log<M>( | ||
note_hash: Field, | ||
encrypted_note: [u8; M], | ||
counter: u32 | ||
) { | ||
emit_encrypted_note_log_oracle(note_hash, encrypted_note, counter) | ||
} | ||
|
||
#[oracle(emitEncryptedLog)] | ||
fn emit_encrypted_log_oracle<N, M>( | ||
fn emit_encrypted_log_oracle<M>(_encrypted_note: [u8; M], _counter: u32) {} | ||
|
||
unconstrained pub fn emit_encrypted_log<M>(encrypted_note: [u8; M], counter: u32) { | ||
emit_encrypted_log_oracle(encrypted_note, counter) | ||
} | ||
|
||
// = 480 + 32 * N bytes | ||
#[oracle(computeEncryptedLog)] | ||
fn compute_encrypted_log_oracle<N, M>( | ||
_contract_address: AztecAddress, | ||
_storage_slot: Field, | ||
_note_type_id: Field, | ||
_encryption_pub_key: GrumpkinPoint, | ||
_preimage: [Field; N], | ||
_counter: u32 | ||
) -> [Field; M] {} | ||
_preimage: [Field; N] | ||
) -> [u8; M] {} | ||
|
||
unconstrained pub fn emit_encrypted_log<N, M>( | ||
unconstrained pub fn compute_encrypted_log<N, M>( | ||
contract_address: AztecAddress, | ||
storage_slot: Field, | ||
note_type_id: Field, | ||
ivpk_m: GrumpkinPoint, | ||
preimage: [Field; N], | ||
counter: u32 | ||
) -> [Field; M] { | ||
emit_encrypted_log_oracle( | ||
contract_address, | ||
storage_slot, | ||
note_type_id, | ||
ivpk_m, | ||
preimage, | ||
counter | ||
) | ||
preimage: [Field; N] | ||
) -> [u8; M] { | ||
compute_encrypted_log_oracle(contract_address, storage_slot, note_type_id, ivpk_m, preimage) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.