Add memzero

This commit is contained in:
Emil Bay 2017-06-06 21:04:50 +02:00
parent 5397910bbb
commit 226ecd8778
No known key found for this signature in database
GPG Key ID: AF1CF37B90FBF638

View File

@ -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