From ee481d0096a88b5c5bc09a1ee53e62b8e6be6051 Mon Sep 17 00:00:00 2001 From: Christophe Diederichs Date: Mon, 21 Nov 2022 17:17:09 +0000 Subject: [PATCH] typo fixes in crypto_box and crypto_aead --- crypto_aead.js | 4 ++-- crypto_box.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto_aead.js b/crypto_aead.js index 60e8679..2aa04c7 100644 --- a/crypto_aead.js +++ b/crypto_aead.js @@ -29,7 +29,7 @@ function crypto_aead_chacha20poly1305_ietf_encrypt (c, m, ad, nsec, npub, k) { } function crypto_aead_chacha20poly1305_ietf_encrypt_detached (c, mac, m, ad, nsec, npub, k) { - if (ad === null) return crypto_aead_chacha20poly1305_ietf_encrypt(c, mac, m, new Uint8Array(0), nsec, npub, k) + if (ad === null) return crypto_aead_chacha20poly1305_ietf_encrypt_detached(c, mac, m, new Uint8Array(0), nsec, npub, k) assert(c.byteLength === m.byteLength, 'ciphertext should be same length than message') assert(npub.byteLength === crypto_aead_chacha20poly1305_ietf_NPUBBYTES, @@ -90,7 +90,7 @@ function crypto_aead_chacha20poly1305_ietf_decrypt (m, nsec, c, ad, npub, k) { } function crypto_aead_chacha20poly1305_ietf_decrypt_detached (m, nsec, c, mac, ad, npub, k) { - if (ad === null) return crypto_aead_chacha20poly1305_ietf_decrypt(m, nsec, c, mac, new Uint8Array(0), npub, k) + if (ad === null) return crypto_aead_chacha20poly1305_ietf_decrypt_detached(m, nsec, c, mac, new Uint8Array(0), npub, k) assert(c.byteLength === m.byteLength, 'message should be same length than ciphertext') assert(npub.byteLength === crypto_aead_chacha20poly1305_ietf_NPUBBYTES, diff --git a/crypto_box.js b/crypto_box.js index 2eb8d44..84a7ab1 100644 --- a/crypto_box.js +++ b/crypto_box.js @@ -1,6 +1,6 @@ const { crypto_hash_sha512 } = require('./crypto_hash') const { crypto_scalarmult, crypto_scalarmult_base } = require('./crypto_scalarmult') -const { randombytes } = require('./randombytes') +const { randombytes_buf } = require('./randombytes') const { crypto_generichash_batch } = require('./crypto_generichash') const { crypto_secretbox_open_easy, crypto_secretbox_easy } = require('./crypto_secretbox') const xsalsa20 = require('xsalsa20') @@ -35,7 +35,7 @@ module.exports = { function crypto_box_keypair(pk, sk) { check(pk, crypto_box_PUBLICKEYBYTES) check(sk, crypto_box_SECRETKEYBYTES) - randombytes(sk, 32) + randombytes_buf(sk, 32) return crypto_scalarmult_base(pk, sk) }