1
1
use crate:: {
2
2
context::PrivateContext , note:: {note_emission::NoteEmission , note_interface::NoteInterface },
3
- keys:: getters ::{get_current_public_keys , get_ovsk_app },
3
+ keys ::{ getters ::{get_current_public_keys , get_ovsk_app }, public_keys ::{ OvpkM , IvpkM } },
4
4
encrypted_logs::payload:: compute_encrypted_note_log , oracle::logs_traits::LensForEncryptedLog
5
5
};
6
- use dep::protocol_types:: {
7
- hash::sha256_to_field , address::AztecAddress , point::Point , abis::note_hash::NoteHash ,
8
- constants::MAX_NOTE_HASHES_PER_CALL
9
- };
6
+ use dep::protocol_types:: {hash::sha256_to_field , address::AztecAddress , abis::note_hash::NoteHash };
10
7
11
8
fn compute_raw_note_log <Note , let N : u32 , let NB : u32 , let M : u32 >(
12
9
context : PrivateContext ,
@@ -42,8 +39,8 @@ fn compute_raw_note_log<Note, let N: u32, let NB: u32, let M: u32>(
42
39
unconstrained fn compute_raw_note_log_unconstrained <Note , let N : u32 , let NB : u32 , let M : u32 >(
43
40
context : PrivateContext ,
44
41
note : Note ,
45
- ovpk : Point ,
46
- ivpk : Point ,
42
+ ovpk : OvpkM ,
43
+ ivpk : IvpkM ,
47
44
recipient : AztecAddress
48
45
) -> (u32 , [u8 ; M ], Field ) where Note : NoteInterface <N , NB >, [Field ; N ]: LensForEncryptedLog <N , M > {
49
46
let ovsk_app = get_ovsk_app (ovpk .hash ());
@@ -76,7 +73,9 @@ pub fn encode_and_encrypt_note_unconstrained<Note, let N: u32, let NB: u32, let
76
73
let ovpk = get_current_public_keys (context , ov ).ovpk_m ;
77
74
let ivpk = get_current_public_keys (context , iv ).ivpk_m ;
78
75
79
- let (note_hash_counter , encrypted_log , log_hash ) = compute_raw_note_log_unconstrained (*context , e .note , ovpk , ivpk , iv );
76
+ let (note_hash_counter , encrypted_log , log_hash ) = unsafe {
77
+ compute_raw_note_log_unconstrained (*context , e .note , ovpk , ivpk , iv )
78
+ };
80
79
context .emit_raw_note_log (note_hash_counter , encrypted_log , log_hash );
81
80
}
82
81
}
@@ -102,7 +101,9 @@ pub fn encode_and_encrypt_note_with_keys_unconstrained<Note, let N: u32, let NB:
102
101
recipient : AztecAddress
103
102
) -> fn [(&mut PrivateContext , OvpkM , IvpkM , AztecAddress )](NoteEmission <Note >) -> () where Note : NoteInterface <N , NB >, [Field ; N ]: LensForEncryptedLog <N , M > {
104
103
| e : NoteEmission <Note > | {
105
- let (note_hash_counter , encrypted_log , log_hash ) = compute_raw_note_log_unconstrained (*context , e .note , ovpk , ivpk , recipient );
104
+ let (note_hash_counter , encrypted_log , log_hash ) = unsafe {
105
+ compute_raw_note_log_unconstrained (*context , e .note , ovpk , ivpk , recipient )
106
+ };
106
107
context .emit_raw_note_log (note_hash_counter , encrypted_log , log_hash );
107
108
}
108
109
}
0 commit comments