From 460601a5d1b49fd1eb5dd966a45e47da682a3c29 Mon Sep 17 00:00:00 2001 From: Christian Bundy Date: Fri, 11 Sep 2020 12:50:30 -0700 Subject: [PATCH] BREAKING: Remove unused exported methods Some methods have accidentally been exported, even though they don't appear in Sodium-Native, which gives Sodium-JavaScript a slightly different API. The goal is to have the same API except: - Wasm methods - _instance methods (legacy) This commit removes the extra methods so that we have API parity with Sodium-Native (with the above two exceptions). --- crypto_box.js | 7 +------ crypto_secretbox.js | 4 ---- index.js | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/crypto_box.js b/crypto_box.js index 6479e10..12f689a 100644 --- a/crypto_box.js +++ b/crypto_box.js @@ -10,8 +10,6 @@ const assert = require('nanoassert') const crypto_box_PUBLICKEYBYTES = 32 const crypto_box_SECRETKEYBYTES = 32 const crypto_box_NONCEBYTES = 24 -const crypto_box_ZEROBYTES = 32 -const crypto_box_BOXZEROBYTES = 16 const crypto_box_SEALBYTES = 48 const crypto_box_SEEDBYTES = 32 const crypto_box_BEFORENMBYTES = 32 @@ -24,11 +22,8 @@ module.exports = { crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES, crypto_box_NONCEBYTES, - crypto_box_ZEROBYTES, - crypto_box_BOXZEROBYTES, crypto_box_SEALBYTES, - crypto_box_SEEDBYTES, - crypto_box_BEFORENMBYTES + crypto_box_SEEDBYTES } function crypto_box_keypair (pk, sk) { diff --git a/crypto_secretbox.js b/crypto_secretbox.js index 05fb264..1025c33 100644 --- a/crypto_secretbox.js +++ b/crypto_secretbox.js @@ -10,16 +10,12 @@ const crypto_secretbox_BOXZEROBYTES = 16 const crypto_secretbox_MACBYTES = 16 module.exports = { - crypto_secretbox, - crypto_secretbox_open, crypto_secretbox_detached, crypto_secretbox_open_detached, crypto_secretbox_easy, crypto_secretbox_open_easy, crypto_secretbox_KEYBYTES, crypto_secretbox_NONCEBYTES, - crypto_secretbox_ZEROBYTES, - crypto_secretbox_BOXZEROBYTES, crypto_secretbox_MACBYTES } diff --git a/index.js b/index.js index 48a88bb..7ec82f0 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,6 @@ forward(require('./randombytes')) forward(require('./memory')) forward(require('./helpers')) -forward(require('./crypto_verify')) forward(require('./crypto_box')) forward(require('./crypto_generichash')) forward(require('./crypto_hash'))