refactor(relay): remove unnecessary awaits from synchronous crypto functions (#687)

This commit is contained in:
Mohamed Boudra
2026-05-05 19:56:51 +07:00
parent b45f0a9ad1
commit 2b75df6132
5 changed files with 114 additions and 126 deletions
+2 -2
View File
@@ -331,7 +331,7 @@ export class EncryptedChannel {
})();
if (ciphertext) {
const plaintext = await decrypt(this.sharedKey, ciphertext);
const plaintext = decrypt(this.sharedKey, ciphertext);
this.events.onmessage?.(plaintext);
}
} catch (error) {
@@ -361,7 +361,7 @@ export class EncryptedChannel {
throw new Error("Channel not open");
}
const ciphertext = await encrypt(this.sharedKey, data);
const ciphertext = encrypt(this.sharedKey, data);
// Send as base64 for WebSocket text compatibility
this.transport.send(arrayBufferToBase64(ciphertext));
}