From e9d81ce25c0e9f138b1011ff4b13e97ab747edfa Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:44:04 +0700 Subject: [PATCH] Update Secretbox.js --- src/client/voice/util/Secretbox.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/voice/util/Secretbox.js b/src/client/voice/util/Secretbox.js index 5fb6684..fa8d615 100644 --- a/src/client/voice/util/Secretbox.js +++ b/src/client/voice/util/Secretbox.js @@ -7,10 +7,10 @@ const libs = { /** @deprecated */ close: sodium.api.crypto_secretbox_easy, random: n => sodium.randombytes_buf(n), - crypto_aead_xchacha20poly1305_ietf_encrypt: (message, additionalData, nonce, key) => - sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt(message, additionalData, null, nonce, key), - crypto_aead_xchacha20poly1305_ietf_decrypt: (message, additionalData, nonce, key) => - sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt(message, additionalData, null, nonce, key), + crypto_aead_xchacha20poly1305_ietf_encrypt: (plaintext, additionalData, nonce, key) => + sodium.api.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce, key), + crypto_aead_xchacha20poly1305_ietf_decrypt: (plaintext, additionalData, nonce, key) => + sodium.api.crypto_aead_xchacha20poly1305_ietf_decrypt(plaintext, additionalData, null, nonce, key), }), 'libsodium-wrappers': sodium => ({ /** @deprecated */ @@ -18,10 +18,10 @@ const libs = { /** @deprecated */ close: sodium.crypto_secretbox_easy, random: n => sodium.randombytes_buf(n), - crypto_aead_xchacha20poly1305_ietf_encrypt: (message, additionalData, nonce, key) => - sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(message, additionalData, null, nonce, key), - crypto_aead_xchacha20poly1305_ietf_decrypt: (message, additionalData, nonce, key) => - sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, message, additionalData, nonce, key), + crypto_aead_xchacha20poly1305_ietf_encrypt: (plaintext, additionalData, nonce, key) => + sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(plaintext, additionalData, null, nonce, key), + crypto_aead_xchacha20poly1305_ietf_decrypt: (plaintext, additionalData, nonce, key) => + sodium.crypto_aead_xchacha20poly1305_ietf_decrypt(null, plaintext, additionalData, nonce, key), }), };