@@ -143,13 +143,14 @@ impl EncryptionToolkit {
143
143
Ok ( RecordPlaintext :: from ( decrypted_record) )
144
144
}
145
145
146
+ /// Generates a transition view key from the view key and the transition public key.
146
147
#[ wasm_bindgen( js_name = "generateTvk" ) ]
147
148
pub fn generate_tvk ( view_key : & ViewKey , tpk : & Group ) -> Field {
148
149
tpk. scalar_multiply ( & view_key. to_scalar ( ) ) . to_x_coordinate ( )
149
150
}
150
151
151
- /// Creates a record view key from the view key. This method is intended to be used
152
- /// by the record owner to enable decryption of a select record by a third party .
152
+ /// Creates a record view key from the view key. This can be later be used to decrypt a
153
+ // record without revealing an account's view key .
153
154
#[ wasm_bindgen( js_name = "generateRecordViewkey" ) ]
154
155
pub fn generate_record_view_key ( view_key : & ViewKey , record_ciphertext : & RecordCiphertext ) -> Result < Field , String > {
155
156
let record_nonce = record_ciphertext. nonce ( ) ;
@@ -186,7 +187,7 @@ mod tests {
186
187
use super :: * ;
187
188
188
189
use std:: str:: FromStr ;
189
- use wasm_bindgen_test:: { console_log , wasm_bindgen_test} ;
190
+ use wasm_bindgen_test:: wasm_bindgen_test;
190
191
191
192
const NON_OWNER_VIEW_KEY : & str = "AViewKey1e2WyreaH5H4RBcioLL2GnxvHk5Ud46EtwycnhTdXLmXp" ;
192
193
const OWNER_CIPHERTEXT : & str = "record1qyqsqpe2szk2wwwq56akkwx586hkndl3r8vzdwve32lm7elvphh37rsyqyxx66trwfhkxun9v35hguerqqpqzqrtjzeu6vah9x2me2exkgege824sd8x2379scspmrmtvczs0d93qttl7y92ga0k0rsexu409hu3vlehe3yxjhmey3frh2z5pxm5cmxsv4un97q" ;
@@ -224,7 +225,6 @@ mod tests {
224
225
let tvk = EncryptionToolkit :: generate_tvk ( & view_key, & tpk) ;
225
226
226
227
// Verify the transition view key matches the expected value
227
- // console_log!("Transition View Key: {}", tvk.to_string());
228
228
assert_eq ! ( tvk. to_string( ) , TRANSITION_VIEW_KEY ) ;
229
229
}
230
230
0 commit comments