git ssb

1+

Dominic / ssb-private-groups



Commit a04dfcd772979f83cc19151bfd4b98c9079ea190

syntax

Dominic Tarr committed on 12/29/2018, 5:27:45 AM
Parent: 128131cbfd2df26649597c787fbf851b2c81a79d

Files changed

index.jschanged
index.jsView
@@ -16,10 +16,15 @@
1616 //and, you can verify this property from the design! you can't
1717 //rewrite this code so they don't know the founding message
1818 //and still be able to decrypt these messages.
1919
20 +function hmac (a, b) {
21 + return cl.crypto_auth(u.toBuffer(a), u.toBuffer(b))
22 +}
23 +
2024 function getGroupMsgKey(previous, group) {
21- return hmac(Buffer.concat([previous, group.id]), group.unbox)
25 + //or would it be better to use generic hash (with key?)
26 + return hmac(Buffer.concat([previous, group.id]), u.toBuffer(group.unbox))
2227 }
2328
2429 exports.name = 'private-groups'
2530
@@ -141,9 +146,9 @@
141146 return {
142147 get: remoteKeys.get,
143148 addGroupKey: function (group, cb) {
144149 af.get(function () {
145- keyState.groupKeys[hmac(group.id, group.unbox)] = group)
150 + keyState.groupKeys[hmac(group.id, group.unbox)] = group
146151 af.set(keys, cb)
147152 })
148153 },
149154 addCurvePair: function (curve_keys, cb) {

Built with git-ssb-web