hypercore 11.4.1 → 11.5.0

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.
@@ -8,17 +8,17 @@ const nonce = b4a.alloc(sodium.crypto_stream_NONCEBYTES)
8
8
  module.exports = class DefaultEncryption {
9
9
  static PADDING = 8
10
10
 
11
- constructor (encryptionKey, hypercoreKey, { block = false, compat = true } = {}) {
11
+ constructor (encryptionKey, hypercoreKey, opts = {}) {
12
12
  this.key = encryptionKey
13
- this.compat = compat
13
+ this.compat = opts.compat === true
14
14
 
15
- const keys = DefaultEncryption.deriveKeys(encryptionKey, hypercoreKey, block, compat)
15
+ const keys = DefaultEncryption.deriveKeys(encryptionKey, hypercoreKey, opts)
16
16
 
17
17
  this.blockKey = keys.block
18
18
  this.blindingKey = keys.blinding
19
19
  }
20
20
 
21
- static deriveKeys (encryptionKey, hypercoreKey, block, compat) {
21
+ static deriveKeys (encryptionKey, hypercoreKey, { block = false, compat = false } = {}) {
22
22
  const subKeys = b4a.alloc(2 * sodium.crypto_stream_KEYBYTES)
23
23
 
24
24
  const blockKey = block ? encryptionKey : subKeys.subarray(0, sodium.crypto_stream_KEYBYTES)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.4.1",
3
+ "version": "11.5.0",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -54,11 +54,12 @@
54
54
  "hypercore-id-encoding": "^1.2.0",
55
55
  "hypercore-storage": "^1.0.0",
56
56
  "is-options": "^1.0.1",
57
+ "nanoassert": "^2.0.0",
57
58
  "protomux": "^3.5.0",
58
59
  "quickbit-universal": "^2.2.0",
59
60
  "random-array-iterator": "^1.0.0",
60
61
  "safety-catch": "^1.0.1",
61
- "sodium-universal": "^4.0.0",
62
+ "sodium-universal": "^5.0.1",
62
63
  "streamx": "^2.12.4",
63
64
  "unslab": "^1.3.0",
64
65
  "z32": "^1.0.0"