Skip to content
Snippets Groups Projects
Commit 68bda2ec authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

fix #458

parent dc4a9f5a
No related branches found
No related tags found
No related merge requests found
......@@ -509,6 +509,18 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services'
return deferred.promise;
};
/**
* Compute the box secret key, from a sign secret key
*/
this.box_sk_from_sign = function(signSk) {
var deferred = $q.defer();
that.nacl.crypto_sign_ed25519_sk_to_curve25519(signSk, function(err, boxSk) {
if (err) { deferred.reject(err); return;}
deferred.resolve(boxSk);
});
return deferred.promise;
};
/**
* Encrypt a message, from a key pair
*/
......@@ -596,6 +608,7 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services'
this.box = {
keypair: {
fromSignKeypair: that.box_keypair_from_sign,
skFromSignSk: that.box_sk_from_sign,
pkFromSignPk: that.box_pk_from_sign
},
pack: that.box,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment