@@ -143,13 +143,14 @@ impl EncryptionToolkit {
143143 Ok ( RecordPlaintext :: from ( decrypted_record) )
144144 }
145145
146+ /// Generates a transition view key from the view key and the transition public key.
146147 #[ wasm_bindgen( js_name = "generateTvk" ) ]
147148 pub fn generate_tvk ( view_key : & ViewKey , tpk : & Group ) -> Field {
148149 tpk. scalar_multiply ( & view_key. to_scalar ( ) ) . to_x_coordinate ( )
149150 }
150151
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 .
153154 #[ wasm_bindgen( js_name = "generateRecordViewkey" ) ]
154155 pub fn generate_record_view_key ( view_key : & ViewKey , record_ciphertext : & RecordCiphertext ) -> Result < Field , String > {
155156 let record_nonce = record_ciphertext. nonce ( ) ;
@@ -186,7 +187,7 @@ mod tests {
186187 use super :: * ;
187188
188189 use std:: str:: FromStr ;
189- use wasm_bindgen_test:: { console_log , wasm_bindgen_test} ;
190+ use wasm_bindgen_test:: wasm_bindgen_test;
190191
191192 const NON_OWNER_VIEW_KEY : & str = "AViewKey1e2WyreaH5H4RBcioLL2GnxvHk5Ud46EtwycnhTdXLmXp" ;
192193 const OWNER_CIPHERTEXT : & str = "record1qyqsqpe2szk2wwwq56akkwx586hkndl3r8vzdwve32lm7elvphh37rsyqyxx66trwfhkxun9v35hguerqqpqzqrtjzeu6vah9x2me2exkgege824sd8x2379scspmrmtvczs0d93qttl7y92ga0k0rsexu409hu3vlehe3yxjhmey3frh2z5pxm5cmxsv4un97q" ;
@@ -224,7 +225,6 @@ mod tests {
224225 let tvk = EncryptionToolkit :: generate_tvk ( & view_key, & tpk) ;
225226
226227 // Verify the transition view key matches the expected value
227- // console_log!("Transition View Key: {}", tvk.to_string());
228228 assert_eq ! ( tvk. to_string( ) , TRANSITION_VIEW_KEY ) ;
229229 }
230230
0 commit comments