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:
parent
73048a31b2
commit
bcaafe0f48
@ -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))
|
||||||
};
|
};
|
||||||
|
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user