diff --git a/src/js/crypto/nacl-crypto.js b/src/js/crypto/nacl-crypto.js index 278a915..27f0610 100644 --- a/src/js/crypto/nacl-crypto.js +++ b/src/js/crypto/nacl-crypto.js @@ -19,6 +19,7 @@ var NaclCrypto = function(nacl, util) { } return { + id: util.UUID(), boxPk: util.str2Base64(nacl.decode_latin1(keys.boxPk)), boxSk: util.str2Base64(nacl.decode_latin1(keys.boxSk)) }; diff --git a/test/unit/nacl-crypto-test.js b/test/unit/nacl-crypto-test.js index 2d89569..01b8426 100644 --- a/test/unit/nacl-crypto-test.js +++ b/test/unit/nacl-crypto-test.js @@ -1,7 +1,8 @@ module("NaCl Crypto"); var nacl_test = { - keySize: 128 + keySize: 128, + nonceSize: 192 }; test("Init", 1, function() { @@ -17,7 +18,7 @@ test("Generate Keypair from seed", 1, function() { // generate keypair from seed var seed = nacl_test.util.random(128); var keys = nacl_test.crypto.generateKeypair(seed); - ok(keys.boxSk && keys.boxPk, "Keypair: " + JSON.stringify(keys)); + ok(keys.boxSk && keys.boxPk && keys.id, "Keypair: " + JSON.stringify(keys)); }); test("Generate Keypair", 2, function() {