1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 08:52:15 -05:00

nacl is now injected as a dependecy into nacl-crypto

This commit is contained in:
Tankred Hase 2013-04-05 18:38:14 +02:00
parent 2d37e8f3f7
commit 1f3c91f1d3
3 changed files with 3 additions and 6 deletions

View File

@ -1,7 +1,7 @@
/**
* A Wrapper for NaCl's asymmetric/symmetric crypto
*/
var NaclCrypto = function(util) {
var NaclCrypto = function(nacl, util) {
'use strict';
/**

View File

@ -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;

View File

@ -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() {