docs: function generatePskSecrets(publicKeysToNotify,
                              ecdhForLocalDevice,
                              beaconStreamWithPreAmble) {
    var preAmbleSizeInBytes = module.exports.PUBLIC_KEY_SIZE +
      module.exports.EXPIRATION_SIZE;
  
    var preAmble = beaconStreamWithPreAmble.slice(0, preAmbleSizeInBytes);
    var beaconStreamNoPreAmble =
      beaconStreamWithPreAmble.slice(preAmbleSizeInBytes);
  
    var beacons = [];
    for (var i = 0; i < beaconStreamNoPreAmble.length;
         i += module.exports.BEACON_SIZE) {
      beacons.push(
        beaconStreamNoPreAmble.slice(i, i + module.exports.BEACON_SIZE));
    }
  
    assert(beacons.length === publicKeysToNotify.length, 'We should have the' +
      'same number of beacons as public keys to notify');
  
    var pskMap = {};
    for (i = 0; i < publicKeysToNotify.length; ++i) {
      var pskIdentityField = generatePskIdentityField(preAmble, beacons[i]);
      var pskSecret = generatePskSecret(ecdhForLocalDevice, publicKeysToNotify[i],
        pskIdentityField);
      pskMap[pskIdentityField] = {
        publicKey: publicKeysToNotify[i],
        pskSecret: pskSecret
      };
    }
    return pskMap;
  }