From 226ecd8778d51d92a9181b0469fbbda39d79fbd2 Mon Sep 17 00:00:00 2001 From: Emil Bay Date: Tue, 6 Jun 2017 21:04:50 +0200 Subject: [PATCH] Add memzero --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index c9189fe..9e7624c 100644 --- a/index.js +++ b/index.js @@ -2180,6 +2180,10 @@ var crypto_secretbox_KEYBYTES = 32, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; +sodium.memzero = function (len, offset) { + for (var i = offset; i < len; i++) arr[i] = 0; +} + sodium.randombytes_buf = randombytes_buf sodium.crypto_sign_BYTES = crypto_sign_BYTES