hpke 0.3.0 → 0.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hpke",
3
3
  "description": "hybrid public key encryption",
4
- "version": "0.3.0",
4
+ "version": "0.5.0",
5
5
  "license": "MPL-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -11,17 +11,17 @@
11
11
  "build:browser:wasm": "wasm-pack build -t web --release --out-dir pkg/web",
12
12
  "build:node:wasm": "wasm-pack build -t nodejs --release --out-dir pkg/node",
13
13
  "build:browser:ts": "esbuild pkg/web/index.ts --bundle --outdir=pkg/web --loader:.wasm=binary --minify --sourcemap --format=esm --out-extension:.js=.mjs",
14
- "build:node:ts": "esbuild pkg/node/index.ts pkg/node/index.spec.ts --outdir=pkg/node --sourcemap --loader:.wasm=binary --format=cjs",
15
14
  "build:browser": "run-s build:browser:wasm build:browser:ts",
16
- "build:node": "run-s build:node:wasm build:node:ts",
15
+ "build:node": "run-s build:node:wasm",
17
16
  "build": "run-s build:node build:browser",
18
- "test": "mocha pkg/node/index.spec.js"
17
+ "test": "ts-mocha pkg/node/index.spec.ts"
19
18
  },
20
19
  "browser": "./pkg/web/index.mjs",
21
- "main": "./pkg/node/index.js",
20
+ "main": "./pkg/node/hpke_dispatch.js",
22
21
  "types": "./pkg/node/hpke_dispatch.d.ts",
23
22
  "files": [
24
- "pkg/node/*", "pkg/web/*"
23
+ "pkg/node/*",
24
+ "pkg/web/*"
25
25
  ],
26
26
  "sideEffects": false,
27
27
  "keywords": [
@@ -33,11 +33,13 @@
33
33
  "@types/chai": "^4.3.1",
34
34
  "@types/mocha": "^9.1.1",
35
35
  "@types/node": "^18.0.4",
36
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
36
37
  "chai": "^4.3.6",
37
38
  "esbuild": "^0.14.49",
38
39
  "mocha": "^10.0.0",
39
40
  "npm-run-all": "^4.1.5",
40
41
  "prettier": "^2.7.1",
42
+ "ts-mocha": "^10.0.0",
41
43
  "typescript": "^4.7.4",
42
44
  "wasm-pack": "^0.10.3"
43
45
  }
@@ -2,32 +2,6 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  *
5
- *`base_mode_open` provides an interface to [`hpke::single_shot_open`]
6
- *that does not require compile time selection of an algorithm. Instead,
7
- *the selected algorithm is provided through the [`Config`] passed as
8
- *the first argument.
9
- *
10
- *Requires the `base-mode-open` crate feature to be enabled.
11
- *
12
- *# Errors
13
- *
14
- *This will return an `Result::Err` variant if:
15
- *
16
- ** we are unable to deserialize the private key or encapsulated key
17
- ** there is an error in key decapsulation
18
- ** there is an error in decryption
19
- *
20
- * @param {Config} config
21
- * @param {Uint8Array} private_key
22
- * @param {Uint8Array} encapped_key
23
- * @param {Uint8Array} info
24
- * @param {Uint8Array} ciphertext
25
- * @param {Uint8Array} aad
26
- * @returns {Uint8Array}
27
- */
28
- export function base_mode_open(config: Config, private_key: Uint8Array, encapped_key: Uint8Array, info: Uint8Array, ciphertext: Uint8Array, aad: Uint8Array): Uint8Array;
29
- /**
30
- *
31
5
  *`base_mode_seal` provides an interface to [`hpke::single_shot_seal`]
32
6
  *that does not require compile time selection of an
33
7
  *algorithm. Instead, the selected algorithm is provided through the
@@ -54,6 +28,32 @@ export function base_mode_open(config: Config, private_key: Uint8Array, encapped
54
28
  export function base_mode_seal(config: Config, recipient_public_key: Uint8Array, info: Uint8Array, plaintext: Uint8Array, aad: Uint8Array): EncappedKeyAndCiphertext;
55
29
  /**
56
30
  *
31
+ *`base_mode_open` provides an interface to [`hpke::single_shot_open`]
32
+ *that does not require compile time selection of an algorithm. Instead,
33
+ *the selected algorithm is provided through the [`Config`] passed as
34
+ *the first argument.
35
+ *
36
+ *Requires the `base-mode-open` crate feature to be enabled.
37
+ *
38
+ *# Errors
39
+ *
40
+ *This will return an `Result::Err` variant if:
41
+ *
42
+ ** we are unable to deserialize the private key or encapsulated key
43
+ ** there is an error in key decapsulation
44
+ ** there is an error in decryption
45
+ *
46
+ * @param {Config} config
47
+ * @param {Uint8Array} private_key
48
+ * @param {Uint8Array} encapped_key
49
+ * @param {Uint8Array} info
50
+ * @param {Uint8Array} ciphertext
51
+ * @param {Uint8Array} aad
52
+ * @returns {Uint8Array}
53
+ */
54
+ export function base_mode_open(config: Config, private_key: Uint8Array, encapped_key: Uint8Array, info: Uint8Array, ciphertext: Uint8Array, aad: Uint8Array): Uint8Array;
55
+ /**
56
+ *
57
57
  *Aead represents an authenticated encryption with additional data
58
58
  *encryption function, as per [RFC9180§7.3](https://www.rfc-editor.org/rfc/rfc9180.html#section-7.3)
59
59
  */
@@ -36,23 +36,30 @@ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true
36
36
 
37
37
  cachedTextDecoder.decode();
38
38
 
39
- let cachegetUint8Memory0 = null;
39
+ let cachedUint8Memory0 = new Uint8Array();
40
+
40
41
  function getUint8Memory0() {
41
- if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
42
- cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
42
+ if (cachedUint8Memory0.byteLength === 0) {
43
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
43
44
  }
44
- return cachegetUint8Memory0;
45
+ return cachedUint8Memory0;
45
46
  }
46
47
 
47
48
  function getStringFromWasm0(ptr, len) {
48
49
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
49
50
  }
50
51
 
51
- function _assertClass(instance, klass) {
52
- if (!(instance instanceof klass)) {
53
- throw new Error(`expected instance of ${klass.name}`);
52
+ let cachedInt32Memory0 = new Int32Array();
53
+
54
+ function getInt32Memory0() {
55
+ if (cachedInt32Memory0.byteLength === 0) {
56
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
54
57
  }
55
- return instance.ptr;
58
+ return cachedInt32Memory0;
59
+ }
60
+
61
+ function getArrayU8FromWasm0(ptr, len) {
62
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
56
63
  }
57
64
 
58
65
  let WASM_VECTOR_LEN = 0;
@@ -64,67 +71,57 @@ function passArray8ToWasm0(arg, malloc) {
64
71
  return ptr;
65
72
  }
66
73
 
67
- let cachegetInt32Memory0 = null;
68
- function getInt32Memory0() {
69
- if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
70
- cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
74
+ function _assertClass(instance, klass) {
75
+ if (!(instance instanceof klass)) {
76
+ throw new Error(`expected instance of ${klass.name}`);
71
77
  }
72
- return cachegetInt32Memory0;
73
- }
74
-
75
- function getArrayU8FromWasm0(ptr, len) {
76
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
78
+ return instance.ptr;
77
79
  }
78
80
  /**
79
81
  *
80
- *`base_mode_open` provides an interface to [`hpke::single_shot_open`]
81
- *that does not require compile time selection of an algorithm. Instead,
82
- *the selected algorithm is provided through the [`Config`] passed as
83
- *the first argument.
82
+ *`base_mode_seal` provides an interface to [`hpke::single_shot_seal`]
83
+ *that does not require compile time selection of an
84
+ *algorithm. Instead, the selected algorithm is provided through the
85
+ *[`Config`] passed as the first argument.
84
86
  *
85
- *Requires the `base-mode-open` crate feature to be enabled.
87
+ *Requires the `base-mode-seal` crate feature to be enabled.
86
88
  *
87
89
  *# Errors
88
90
  *
89
91
  *This will return an `Result::Err` variant if:
90
92
  *
91
- ** we are unable to deserialize the private key or encapsulated key
92
- ** there is an error in key decapsulation
93
- ** there is an error in decryption
93
+ ** we are unable to deserialize the recipient public key
94
+ ** there is an error in key encapsultion
95
+ ** there is an error in encryption
96
+ *
94
97
  *
95
98
  * @param {Config} config
96
- * @param {Uint8Array} private_key
97
- * @param {Uint8Array} encapped_key
99
+ * @param {Uint8Array} recipient_public_key
98
100
  * @param {Uint8Array} info
99
- * @param {Uint8Array} ciphertext
101
+ * @param {Uint8Array} plaintext
100
102
  * @param {Uint8Array} aad
101
- * @returns {Uint8Array}
103
+ * @returns {EncappedKeyAndCiphertext}
102
104
  */
103
- module.exports.base_mode_open = function(config, private_key, encapped_key, info, ciphertext, aad) {
105
+ module.exports.base_mode_seal = function(config, recipient_public_key, info, plaintext, aad) {
104
106
  try {
105
107
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
106
108
  _assertClass(config, Config);
107
- const ptr0 = passArray8ToWasm0(private_key, wasm.__wbindgen_malloc);
109
+ const ptr0 = passArray8ToWasm0(recipient_public_key, wasm.__wbindgen_malloc);
108
110
  const len0 = WASM_VECTOR_LEN;
109
- const ptr1 = passArray8ToWasm0(encapped_key, wasm.__wbindgen_malloc);
111
+ const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
110
112
  const len1 = WASM_VECTOR_LEN;
111
- const ptr2 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
113
+ const ptr2 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);
112
114
  const len2 = WASM_VECTOR_LEN;
113
- const ptr3 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
115
+ const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
114
116
  const len3 = WASM_VECTOR_LEN;
115
- const ptr4 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
116
- const len4 = WASM_VECTOR_LEN;
117
- wasm.base_mode_open(retptr, config.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
117
+ wasm.base_mode_seal(retptr, config.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
118
118
  var r0 = getInt32Memory0()[retptr / 4 + 0];
119
119
  var r1 = getInt32Memory0()[retptr / 4 + 1];
120
120
  var r2 = getInt32Memory0()[retptr / 4 + 2];
121
- var r3 = getInt32Memory0()[retptr / 4 + 3];
122
- if (r3) {
123
- throw takeObject(r2);
121
+ if (r2) {
122
+ throw takeObject(r1);
124
123
  }
125
- var v5 = getArrayU8FromWasm0(r0, r1).slice();
126
- wasm.__wbindgen_free(r0, r1 * 1);
127
- return v5;
124
+ return EncappedKeyAndCiphertext.__wrap(r0);
128
125
  } finally {
129
126
  wasm.__wbindgen_add_to_stack_pointer(16);
130
127
  }
@@ -132,49 +129,54 @@ module.exports.base_mode_open = function(config, private_key, encapped_key, info
132
129
 
133
130
  /**
134
131
  *
135
- *`base_mode_seal` provides an interface to [`hpke::single_shot_seal`]
136
- *that does not require compile time selection of an
137
- *algorithm. Instead, the selected algorithm is provided through the
138
- *[`Config`] passed as the first argument.
132
+ *`base_mode_open` provides an interface to [`hpke::single_shot_open`]
133
+ *that does not require compile time selection of an algorithm. Instead,
134
+ *the selected algorithm is provided through the [`Config`] passed as
135
+ *the first argument.
139
136
  *
140
- *Requires the `base-mode-seal` crate feature to be enabled.
137
+ *Requires the `base-mode-open` crate feature to be enabled.
141
138
  *
142
139
  *# Errors
143
140
  *
144
141
  *This will return an `Result::Err` variant if:
145
142
  *
146
- ** we are unable to deserialize the recipient public key
147
- ** there is an error in key encapsultion
148
- ** there is an error in encryption
149
- *
143
+ ** we are unable to deserialize the private key or encapsulated key
144
+ ** there is an error in key decapsulation
145
+ ** there is an error in decryption
150
146
  *
151
147
  * @param {Config} config
152
- * @param {Uint8Array} recipient_public_key
148
+ * @param {Uint8Array} private_key
149
+ * @param {Uint8Array} encapped_key
153
150
  * @param {Uint8Array} info
154
- * @param {Uint8Array} plaintext
151
+ * @param {Uint8Array} ciphertext
155
152
  * @param {Uint8Array} aad
156
- * @returns {EncappedKeyAndCiphertext}
153
+ * @returns {Uint8Array}
157
154
  */
158
- module.exports.base_mode_seal = function(config, recipient_public_key, info, plaintext, aad) {
155
+ module.exports.base_mode_open = function(config, private_key, encapped_key, info, ciphertext, aad) {
159
156
  try {
160
157
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
161
158
  _assertClass(config, Config);
162
- const ptr0 = passArray8ToWasm0(recipient_public_key, wasm.__wbindgen_malloc);
159
+ const ptr0 = passArray8ToWasm0(private_key, wasm.__wbindgen_malloc);
163
160
  const len0 = WASM_VECTOR_LEN;
164
- const ptr1 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
161
+ const ptr1 = passArray8ToWasm0(encapped_key, wasm.__wbindgen_malloc);
165
162
  const len1 = WASM_VECTOR_LEN;
166
- const ptr2 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);
163
+ const ptr2 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
167
164
  const len2 = WASM_VECTOR_LEN;
168
- const ptr3 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
165
+ const ptr3 = passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
169
166
  const len3 = WASM_VECTOR_LEN;
170
- wasm.base_mode_seal(retptr, config.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
167
+ const ptr4 = passArray8ToWasm0(aad, wasm.__wbindgen_malloc);
168
+ const len4 = WASM_VECTOR_LEN;
169
+ wasm.base_mode_open(retptr, config.ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
171
170
  var r0 = getInt32Memory0()[retptr / 4 + 0];
172
171
  var r1 = getInt32Memory0()[retptr / 4 + 1];
173
172
  var r2 = getInt32Memory0()[retptr / 4 + 2];
174
- if (r2) {
175
- throw takeObject(r1);
173
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
174
+ if (r3) {
175
+ throw takeObject(r2);
176
176
  }
177
- return EncappedKeyAndCiphertext.__wrap(r0);
177
+ var v5 = getArrayU8FromWasm0(r0, r1).slice();
178
+ wasm.__wbindgen_free(r0, r1 * 1);
179
+ return v5;
178
180
  } finally {
179
181
  wasm.__wbindgen_add_to_stack_pointer(16);
180
182
  }
@@ -268,6 +270,7 @@ class Config {
268
270
  }
269
271
  /**
270
272
  * the [authenticated encryption with additional data encryption function](crate::Aead) to be used
273
+ * @returns {number}
271
274
  */
272
275
  get aead() {
273
276
  const ret = wasm.__wbg_get_config_aead(this.ptr);
@@ -282,6 +285,7 @@ class Config {
282
285
  }
283
286
  /**
284
287
  * the [key derivation function](crate::Kdf) to be used
288
+ * @returns {number}
285
289
  */
286
290
  get kdf() {
287
291
  const ret = wasm.__wbg_get_config_kdf(this.ptr);
@@ -296,6 +300,7 @@ class Config {
296
300
  }
297
301
  /**
298
302
  * the [asymmetric key encapsulation mechanism](crate::Kem) to be used
303
+ * @returns {number}
299
304
  */
300
305
  get kem() {
301
306
  const ret = wasm.__wbg_get_config_kem(this.ptr);
@@ -459,6 +464,7 @@ class EncappedKeyAndCiphertext {
459
464
  }
460
465
  /**
461
466
  * the encapsulated encryption key
467
+ * @returns {Uint8Array}
462
468
  */
463
469
  get encapped_key() {
464
470
  try {
@@ -484,6 +490,7 @@ class EncappedKeyAndCiphertext {
484
490
  }
485
491
  /**
486
492
  * the ciphertext, encrypted with the key
493
+ * @returns {Uint8Array}
487
494
  */
488
495
  get ciphertext() {
489
496
  try {
@@ -588,6 +595,7 @@ class Keypair {
588
595
  }
589
596
  /**
590
597
  * the public key for this keypair
598
+ * @returns {Uint8Array}
591
599
  */
592
600
  get public_key() {
593
601
  try {
@@ -613,6 +621,7 @@ class Keypair {
613
621
  }
614
622
  /**
615
623
  * the private key for this keypair,
624
+ * @returns {Uint8Array}
616
625
  */
617
626
  get private_key() {
618
627
  try {
@@ -647,29 +656,17 @@ class Keypair {
647
656
  }
648
657
  module.exports.Keypair = Keypair;
649
658
 
650
- module.exports.__wbg_hpkeerror_new = function(arg0) {
651
- const ret = HpkeError.__wrap(arg0);
652
- return addHeapObject(ret);
653
- };
654
-
655
659
  module.exports.__wbg_idlookuperror_new = function(arg0) {
656
660
  const ret = IdLookupError.__wrap(arg0);
657
661
  return addHeapObject(ret);
658
662
  };
659
663
 
660
- module.exports.__wbg_randomFillSync_654a7797990fb8db = function() { return handleError(function (arg0, arg1, arg2) {
661
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
662
- }, arguments) };
663
-
664
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
665
- takeObject(arg0);
664
+ module.exports.__wbg_hpkeerror_new = function(arg0) {
665
+ const ret = HpkeError.__wrap(arg0);
666
+ return addHeapObject(ret);
666
667
  };
667
668
 
668
- module.exports.__wbg_getRandomValues_fb6b088efb6bead2 = function() { return handleError(function (arg0, arg1) {
669
- getObject(arg0).getRandomValues(getObject(arg1));
670
- }, arguments) };
671
-
672
- module.exports.__wbg_process_70251ed1291754d5 = function(arg0) {
669
+ module.exports.__wbg_process_0cc2ada8524d6f83 = function(arg0) {
673
670
  const ret = getObject(arg0).process;
674
671
  return addHeapObject(ret);
675
672
  };
@@ -680,12 +677,12 @@ module.exports.__wbindgen_is_object = function(arg0) {
680
677
  return ret;
681
678
  };
682
679
 
683
- module.exports.__wbg_versions_b23f2588cdb2ddbb = function(arg0) {
680
+ module.exports.__wbg_versions_c11acceab27a6c87 = function(arg0) {
684
681
  const ret = getObject(arg0).versions;
685
682
  return addHeapObject(ret);
686
683
  };
687
684
 
688
- module.exports.__wbg_node_61b8c9a82499895d = function(arg0) {
685
+ module.exports.__wbg_node_7ff1ce49caf23815 = function(arg0) {
689
686
  const ret = getObject(arg0).node;
690
687
  return addHeapObject(ret);
691
688
  };
@@ -695,32 +692,44 @@ module.exports.__wbindgen_is_string = function(arg0) {
695
692
  return ret;
696
693
  };
697
694
 
698
- module.exports.__wbg_crypto_2f56257a38275dbd = function(arg0) {
695
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
696
+ takeObject(arg0);
697
+ };
698
+
699
+ module.exports.__wbg_crypto_2036bed7c44c25e7 = function(arg0) {
699
700
  const ret = getObject(arg0).crypto;
700
701
  return addHeapObject(ret);
701
702
  };
702
703
 
703
- module.exports.__wbg_msCrypto_d07655bf62361f21 = function(arg0) {
704
+ module.exports.__wbg_msCrypto_a21fc88caf1ecdc8 = function(arg0) {
704
705
  const ret = getObject(arg0).msCrypto;
705
706
  return addHeapObject(ret);
706
707
  };
707
708
 
708
- module.exports.__wbg_static_accessor_NODE_MODULE_33b45247c55045b0 = function() {
709
+ module.exports.__wbg_static_accessor_NODE_MODULE_cf6401cc1091279e = function() {
709
710
  const ret = module;
710
711
  return addHeapObject(ret);
711
712
  };
712
713
 
713
- module.exports.__wbg_require_2a93bc09fee45aca = function() { return handleError(function (arg0, arg1, arg2) {
714
+ module.exports.__wbg_require_a746e79b322b9336 = function() { return handleError(function (arg0, arg1, arg2) {
714
715
  const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
715
716
  return addHeapObject(ret);
716
717
  }, arguments) };
717
718
 
718
- module.exports.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {
719
+ module.exports.__wbg_getRandomValues_b99eec4244a475bb = function() { return handleError(function (arg0, arg1) {
720
+ getObject(arg0).getRandomValues(getObject(arg1));
721
+ }, arguments) };
722
+
723
+ module.exports.__wbg_randomFillSync_065afffde01daa66 = function() { return handleError(function (arg0, arg1, arg2) {
724
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
725
+ }, arguments) };
726
+
727
+ module.exports.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
719
728
  const ret = new Function(getStringFromWasm0(arg0, arg1));
720
729
  return addHeapObject(ret);
721
730
  };
722
731
 
723
- module.exports.__wbg_call_ae78342adc33730a = function() { return handleError(function (arg0, arg1) {
732
+ module.exports.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
724
733
  const ret = getObject(arg0).call(getObject(arg1));
725
734
  return addHeapObject(ret);
726
735
  }, arguments) };
@@ -730,22 +739,22 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
730
739
  return addHeapObject(ret);
731
740
  };
732
741
 
733
- module.exports.__wbg_self_99737b4dcdf6f0d8 = function() { return handleError(function () {
742
+ module.exports.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
734
743
  const ret = self.self;
735
744
  return addHeapObject(ret);
736
745
  }, arguments) };
737
746
 
738
- module.exports.__wbg_window_9b61fbbf3564c4fb = function() { return handleError(function () {
747
+ module.exports.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
739
748
  const ret = window.window;
740
749
  return addHeapObject(ret);
741
750
  }, arguments) };
742
751
 
743
- module.exports.__wbg_globalThis_8e275ef40caea3a3 = function() { return handleError(function () {
752
+ module.exports.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
744
753
  const ret = globalThis.globalThis;
745
754
  return addHeapObject(ret);
746
755
  }, arguments) };
747
756
 
748
- module.exports.__wbg_global_5de1e0f82bddcd27 = function() { return handleError(function () {
757
+ module.exports.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
749
758
  const ret = global.global;
750
759
  return addHeapObject(ret);
751
760
  }, arguments) };
@@ -755,31 +764,31 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
755
764
  return ret;
756
765
  };
757
766
 
758
- module.exports.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
767
+ module.exports.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
759
768
  const ret = getObject(arg0).buffer;
760
769
  return addHeapObject(ret);
761
770
  };
762
771
 
763
- module.exports.__wbg_new_cc9018bd6f283b6f = function(arg0) {
772
+ module.exports.__wbg_new_8c3f0052272a457a = function(arg0) {
764
773
  const ret = new Uint8Array(getObject(arg0));
765
774
  return addHeapObject(ret);
766
775
  };
767
776
 
768
- module.exports.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
777
+ module.exports.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
769
778
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
770
779
  };
771
780
 
772
- module.exports.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
781
+ module.exports.__wbg_length_9e1ae1900cb0fbd5 = function(arg0) {
773
782
  const ret = getObject(arg0).length;
774
783
  return ret;
775
784
  };
776
785
 
777
- module.exports.__wbg_newwithlength_8f0657faca9f1422 = function(arg0) {
786
+ module.exports.__wbg_newwithlength_f5933855e4f48a19 = function(arg0) {
778
787
  const ret = new Uint8Array(arg0 >>> 0);
779
788
  return addHeapObject(ret);
780
789
  };
781
790
 
782
- module.exports.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {
791
+ module.exports.__wbg_subarray_58ad4efbb5bcb886 = function(arg0, arg1, arg2) {
783
792
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
784
793
  return addHeapObject(ret);
785
794
  };
Binary file
@@ -1,24 +1,12 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function base_mode_open(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): void;
5
- export function __wbg_config_free(a: number): void;
6
- export function __wbg_get_config_aead(a: number): number;
7
- export function __wbg_set_config_aead(a: number, b: number): void;
8
- export function __wbg_get_config_kdf(a: number): number;
9
- export function __wbg_set_config_kdf(a: number, b: number): void;
10
- export function __wbg_get_config_kem(a: number): number;
11
- export function __wbg_set_config_kem(a: number, b: number): void;
12
- export function config_base_mode_seal(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): void;
13
- export function config_base_mode_open(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): void;
14
- export function config_try_from_ids(a: number, b: number, c: number, d: number): void;
15
4
  export function __wbg_keypair_free(a: number): void;
16
5
  export function __wbg_get_keypair_public_key(a: number, b: number): void;
17
6
  export function __wbg_set_keypair_public_key(a: number, b: number, c: number): void;
18
7
  export function __wbg_get_keypair_private_key(a: number, b: number): void;
19
8
  export function __wbg_set_keypair_private_key(a: number, b: number, c: number): void;
20
9
  export function keypair_new(a: number): number;
21
- export function base_mode_seal(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): void;
22
10
  export function __wbg_encappedkeyandciphertext_free(a: number): void;
23
11
  export function __wbg_get_encappedkeyandciphertext_encapped_key(a: number, b: number): void;
24
12
  export function __wbg_set_encappedkeyandciphertext_encapped_key(a: number, b: number, c: number): void;
@@ -26,7 +14,19 @@ export function __wbg_get_encappedkeyandciphertext_ciphertext(a: number, b: numb
26
14
  export function __wbg_set_encappedkeyandciphertext_ciphertext(a: number, b: number, c: number): void;
27
15
  export function __wbg_idlookuperror_free(a: number): void;
28
16
  export function __wbg_hpkeerror_free(a: number): void;
17
+ export function base_mode_seal(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): void;
18
+ export function base_mode_open(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): void;
19
+ export function __wbg_config_free(a: number): void;
20
+ export function __wbg_get_config_aead(a: number): number;
21
+ export function __wbg_set_config_aead(a: number, b: number): void;
22
+ export function __wbg_get_config_kdf(a: number): number;
23
+ export function __wbg_set_config_kdf(a: number, b: number): void;
24
+ export function __wbg_get_config_kem(a: number): number;
25
+ export function __wbg_set_config_kem(a: number, b: number): void;
26
+ export function config_base_mode_seal(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): void;
27
+ export function config_base_mode_open(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): void;
28
+ export function config_try_from_ids(a: number, b: number, c: number, d: number): void;
29
29
  export function __wbindgen_add_to_stack_pointer(a: number): number;
30
- export function __wbindgen_malloc(a: number): number;
31
30
  export function __wbindgen_free(a: number, b: number): void;
31
+ export function __wbindgen_malloc(a: number): number;
32
32
  export function __wbindgen_exn_store(a: number): void;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hpke-dispatch",
3
3
  "description": "runtime algorithmic selection for hybrid public key encryption",
4
- "version": "0.3.0",
4
+ "version": "0.5.0",
5
5
  "license": "MPL-2.0",
6
6
  "repository": {
7
7
  "type": "git",