git ssb

1+

Dominic / ssb-keys



Commit 5e0ce0be49e06370a59bb1a5b6bcef5b334360df

use strict

Dominic Tarr committed on 1/27/2017, 10:06:53 AM
Parent: 54a0ffd57dbabde028ee240e63fc2e25eacd9ee1

Files changed

index.jschanged
index.jsView
@@ -1,4 +1,5 @@
1 +'use strict'
12 var sodium = require('chloride')
23
34 var pb = require('private-box')
45
@@ -142,10 +143,9 @@
142143 exports.box = function (msg, recipients) {
143144 msg = new Buffer(JSON.stringify(msg))
144145
145146 recipients = recipients.map(function (keys) {
146- var public = keys.public || keys
147- return sodium.crypto_sign_ed25519_pk_to_curve25519(u.toBuffer(public))
147 + return sodium.crypto_sign_ed25519_pk_to_curve25519(u.toBuffer(keys.public || keys))
148148 })
149149
150150 return pb.multibox(msg, recipients).toString('base64')+'.box'
151151 }
@@ -156,4 +156,5 @@
156156
157157 var msg = pb.multibox_open(boxed, sk)
158158 if(msg) return JSON.parse(''+msg)
159159 }
160 +

Built with git-ssb-web