This commit is contained in:
parent
515244ce66
commit
40e942337f
1 changed files with 1 additions and 1 deletions
|
|
@ -142,7 +142,7 @@ export const crypto: MTPCrypto = {
|
||||||
decryptText: async (key, ciphertext) => {
|
decryptText: async (key, ciphertext) => {
|
||||||
const cipher = new bindings.WasmChaCha20Poly1305(key);
|
const cipher = new bindings.WasmChaCha20Poly1305(key);
|
||||||
try {
|
try {
|
||||||
const decoded = bytesFromString(ciphertext, "ciphertext");
|
const decoded = base64ToBytes(ciphertext);
|
||||||
const plaintext = cipher.decrypt(decoded, new Uint8Array(0));
|
const plaintext = cipher.decrypt(decoded, new Uint8Array(0));
|
||||||
return utf8Decode(plaintext);
|
return utf8Decode(plaintext);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue