diff --git a/leaktest.js b/leaktest.js index 7ca7438..28d6ae2 100755 --- a/leaktest.js +++ b/leaktest.js @@ -16,12 +16,12 @@ function randomElement(arr) { const algos = ['blake2b', 'blake2s', 'blake2bp', 'blake2sp']; const encodings = [undefined, 'hex', 'base64', 'binary']; let input = Buffer.from(String(Math.random())); -while(1) { +while (1) { let hash = new blake2.Hash(randomElement(algos)); hash.update(input); input = hash.digest(randomElement(encodings)); hash = hash.copy(); // Exercise copy as well - if(typeof input === 'string') { + if (typeof input === 'string') { input = Buffer.from(input.substr(0, 16)); } @@ -29,7 +29,7 @@ while(1) { hash.update(input); hash = hash.copy(); // Exercise copy as well input = hash.digest(randomElement(encodings)); - if(typeof input === 'string') { + if (typeof input === 'string') { input = Buffer.from(input.substr(0, 16)); } } diff --git a/src/blake2.cpp b/src/blake2.cpp index e007f01..7897f07 100644 --- a/src/blake2.cpp +++ b/src/blake2.cpp @@ -248,5 +248,4 @@ class Hash: public Nan::ObjectWrap { } }; - NAN_MODULE_WORKER_ENABLED(NODE_GYP_MODULE_NAME, Hash::Init)