hypercore 11.8.0 → 11.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -235,7 +235,8 @@ class Hypercore extends EventEmitter {
235
235
  return s
236
236
  }
237
237
 
238
- setEncryptionKey (key, opts) {
238
+ async setEncryptionKey (key, opts) {
239
+ if (!this.opened) await this.opening
239
240
  const encryption = this._getEncryptionProvider({ key, block: !!(opts && opts.block) })
240
241
  return this.setEncryption(encryption, opts)
241
242
  }
@@ -84,7 +84,7 @@ async function verify (storage, buffer, { referrer = null } = {}) {
84
84
  if (batch.signature[1] !== 0) return null
85
85
 
86
86
  signable = batch.signable(auth.key)
87
- signature = batch.signature.subarray(2)
87
+ signature = batch.signature.subarray(2, 66)
88
88
  }
89
89
 
90
90
  if (!crypto.verify(signable, signature, publicKey)) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.8.0",
3
+ "version": "11.8.2",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "standard && node test/all.js",
7
+ "test": "standard && brittle test/all.js",
8
8
  "test:bare": "bare test/all.js",
9
9
  "test:generate": "brittle -r test/all.js test/*.js"
10
10
  },