1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-29 12:22:22 -05:00

added ID to nacl keypair

This commit is contained in:
Tankred Hase 2013-04-11 11:52:48 +02:00
parent 73048a31b2
commit bcaafe0f48
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ var NaclCrypto = function(nacl, util) {
} }
return { return {
id: util.UUID(),
boxPk: util.str2Base64(nacl.decode_latin1(keys.boxPk)), boxPk: util.str2Base64(nacl.decode_latin1(keys.boxPk)),
boxSk: util.str2Base64(nacl.decode_latin1(keys.boxSk)) boxSk: util.str2Base64(nacl.decode_latin1(keys.boxSk))
}; };

View File

@ -1,7 +1,8 @@
module("NaCl Crypto"); module("NaCl Crypto");
var nacl_test = { var nacl_test = {
keySize: 128 keySize: 128,
nonceSize: 192
}; };
test("Init", 1, function() { test("Init", 1, function() {
@ -17,7 +18,7 @@ test("Generate Keypair from seed", 1, function() {
// generate keypair from seed // generate keypair from seed
var seed = nacl_test.util.random(128); var seed = nacl_test.util.random(128);
var keys = nacl_test.crypto.generateKeypair(seed); 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() { test("Generate Keypair", 2, function() {