commit c3757c54c417dd7866be427798d11e2b0290f461
parent cb9825615a5a4cb58895223b6c8407a7f1cd8cbf
Author: finwo <finwo@pm.me>
Date: Mon, 17 Jun 2019 20:14:59 +0200
Not using native crypto for random
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/index.js b/index.js
@@ -2,11 +2,11 @@ var Module = require('./supercop.js')
function randomBytes(length) {
return Buffer.from(new Array(length).fill(0).map(()=>Math.floor(Math.random()*256)));
-}
+};
exports.createSeed = function(){
- return randomBytes(32)
-}
+ return randomBytes(32);
+};
exports.createKeyPair = function(seed){
if(!Buffer.isBuffer(seed)){
@@ -27,7 +27,7 @@ exports.createKeyPair = function(seed){
publicKey: new Buffer(pubKey),
secretKey: new Buffer(privKey)
}
-}
+};
exports.sign = function(msg, pubKey, privKey){
if(!Buffer.isBuffer(msg) || !Buffer.isBuffer(pubKey) || !Buffer.isBuffer(privKey)){