add sodium_malloc

This commit is contained in:
Mathias Buus 2020-03-04 14:50:09 +01:00
parent 4e42b942a5
commit f790621e60

View File

@ -1851,6 +1851,10 @@ sodium.crypto_box_keypair = crypto_box_keypair
sodium.crypto_box_seal = crypto_box_seal
sodium.crypto_box_seal_open = crypto_box_seal_open
sodium.sodium_malloc = function (n) {
return new Uint8Array(n)
}
function cleanup(arr) {
for (var i = 0; i < arr.length; i++) arr[i] = 0;
}