diff --git a/src/js/crypto/nacl-crypto.js b/src/js/crypto/nacl-crypto.js index 2cc49aa..643f05f 100644 --- a/src/js/crypto/nacl-crypto.js +++ b/src/js/crypto/nacl-crypto.js @@ -1,7 +1,7 @@ /** * A Wrapper for NaCl's asymmetric/symmetric crypto */ -var NaclCrypto = function(util) { +var NaclCrypto = function(nacl, util) { 'use strict'; /** diff --git a/src/js/crypto/util.js b/src/js/crypto/util.js index b538f11..f5e029d 100644 --- a/src/js/crypto/util.js +++ b/src/js/crypto/util.js @@ -1,9 +1,7 @@ -var crypt = crypt; - /** * Various utitity methods for crypto, encoding & decoding */ -var Util = function(window, uuid) { +var Util = function(window, uuid, crypt) { 'use strict'; /** @@ -213,7 +211,6 @@ var Util = function(window, uuid) { }; if (typeof module !== 'undefined' && module.exports) { - crypt = require('crypto'); module.exports = Util; } else { app.crypto.Util = Util; diff --git a/src/test/unit/nacl-crypto-test.js b/src/test/unit/nacl-crypto-test.js index d76cfd6..999e39e 100644 --- a/src/test/unit/nacl-crypto-test.js +++ b/src/test/unit/nacl-crypto-test.js @@ -10,7 +10,7 @@ test("Init", 1, function() { ok(nacl_test.util, 'Util'); // generate test data nacl_test.test_message = new TestData().generateBigString(1000); - nacl_test.crypto = new app.crypto.NaclCrypto(nacl_test.util); + nacl_test.crypto = new app.crypto.NaclCrypto(nacl, nacl_test.util); }); test("Generate Keypair from seed", 1, function() {