Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. const calculateTempValuesforSecretKey = (listSorted, participantJid, uid, callback) => {
  2. getPreviousNext(listSorted, participantJid, (current, previous, next) => {
  3. if (!_.has(next, 'd')) {
  4. return cryptoHelpers.xorBuffers([generateBuffer(current.d), generateBuffer(next.z)], (value) => {
  5. next.d = value;
  6. calculateTempValuesforSecretKey(listSorted, next.jid, uid, callback);
  7. });
  8. }
  9. const buffers = _.map(listSorted, participant => participant.d);
  10. buffers.push(generateBuffer(uid));
  11. _.each(buffers, buffer => buffer.toString('hex'));
  12. return callback(cryptoHelpers.hashBufferList(buffers));
  13. });
  14. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement