diff options
Diffstat (limited to 'node_modules/sshpk/lib/ed-compat.js')
-rw-r--r-- | node_modules/sshpk/lib/ed-compat.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/node_modules/sshpk/lib/ed-compat.js b/node_modules/sshpk/lib/ed-compat.js index 129c2fc30..70732e1f7 100644 --- a/node_modules/sshpk/lib/ed-compat.js +++ b/node_modules/sshpk/lib/ed-compat.js @@ -5,7 +5,7 @@ module.exports = { Signer: Signer }; -var nacl; +var nacl = require('tweetnacl'); var stream = require('stream'); var util = require('util'); var assert = require('assert-plus'); @@ -13,9 +13,6 @@ var Buffer = require('safer-buffer').Buffer; var Signature = require('./signature'); function Verifier(key, hashAlgo) { - if (nacl === undefined) - nacl = require('tweetnacl'); - if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); @@ -61,9 +58,6 @@ Verifier.prototype.verify = function (signature, fmt) { }; function Signer(key, hashAlgo) { - if (nacl === undefined) - nacl = require('tweetnacl'); - if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); |