@@ -27,11 +27,8 @@ interface ShutterDecryptionKeyData {
27
27
*/
28
28
async function fetchShutterData ( decryptionTimestamp : number ) : Promise < ShutterApiMessageData > {
29
29
try {
30
- console . log ( `Sending request to Shutter API with decryption timestamp: ${ decryptionTimestamp } ` ) ;
31
-
32
30
// Generate a random identity prefix
33
31
const identityPrefix = generateRandomBytes32 ( ) ;
34
- console . log ( `Generated identity prefix: ${ identityPrefix } ` ) ;
35
32
36
33
const response = await fetch ( "https://shutter-api.shutter.network/api/register_identity" , {
37
34
method : "POST" ,
@@ -46,7 +43,6 @@ async function fetchShutterData(decryptionTimestamp: number): Promise<ShutterApi
46
43
} ) ;
47
44
48
45
// Log the response status
49
- console . log ( `API response status: ${ response . status } ` ) ;
50
46
51
47
// Get the response text
52
48
const responseText = await response . text ( ) ;
@@ -81,8 +77,6 @@ async function fetchShutterData(decryptionTimestamp: number): Promise<ShutterApi
81
77
* @returns Promise with the decryption key data
82
78
*/
83
79
async function fetchDecryptionKey ( identity : string ) : Promise < ShutterDecryptionKeyData > {
84
- console . log ( `Fetching decryption key for identity: ${ identity } ` ) ;
85
-
86
80
const response = await fetch ( `https://shutter-api.shutter.network/api/get_decryption_key?identity=${ identity } ` , {
87
81
method : "GET" ,
88
82
headers : {
@@ -160,7 +154,6 @@ export async function encrypt(
160
154
const decryptionTimestamp = Math . floor ( Date . now ( ) / 1000 ) + decryptionDelay ;
161
155
162
156
// Fetch encryption data from Shutter API
163
- console . log ( `Fetching encryption data for decryption at timestamp ${ decryptionTimestamp } ...` ) ;
164
157
const shutterData = await fetchShutterData ( decryptionTimestamp ) ;
165
158
166
159
// Extract the eon key and identity from the response and ensure they have the correct format
@@ -173,10 +166,6 @@ export async function encrypt(
173
166
// Generate a random sigma
174
167
const sigmaHex = generateRandomBytes32 ( ) ;
175
168
176
- console . log ( "Eon Key:" , eonKeyHex ) ;
177
- console . log ( "Identity:" , identityHex ) ;
178
- console . log ( "Sigma:" , sigmaHex ) ;
179
-
180
169
// Encrypt the message
181
170
const encryptedCommitment = await encryptData ( msgHex , identityHex , eonKeyHex , sigmaHex ) ;
182
171
@@ -192,7 +181,6 @@ export async function encrypt(
192
181
export async function decrypt ( encryptedMessage : string , identity : string ) : Promise < string > {
193
182
// Fetch the decryption key
194
183
const decryptionKeyData = await fetchDecryptionKey ( identity ) ;
195
- console . log ( "Decryption key:" , decryptionKeyData . decryption_key ) ;
196
184
197
185
// Ensure the decryption key is properly formatted
198
186
const decryptionKey = ensureHexString ( decryptionKeyData . decryption_key ) ;
0 commit comments