@lib-q/prf 0.0.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.
@@ -0,0 +1,1572 @@
1
+ /* @ts-self-types="./lib_q_prf.d.ts" */
2
+
3
+ /**
4
+ * Algorithm identifiers for cryptographic operations
5
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64}
6
+ */
7
+ const Algorithm = Object.freeze({
8
+ MlKem512: 0, "0": "MlKem512",
9
+ MlKem768: 1, "1": "MlKem768",
10
+ MlKem1024: 2, "2": "MlKem1024",
11
+ CbKem348864: 3, "3": "CbKem348864",
12
+ CbKem460896: 4, "4": "CbKem460896",
13
+ CbKem6688128: 5, "5": "CbKem6688128",
14
+ CbKem6960119: 6, "6": "CbKem6960119",
15
+ CbKem8192128: 7, "7": "CbKem8192128",
16
+ Hqc128: 8, "8": "Hqc128",
17
+ Hqc192: 9, "9": "Hqc192",
18
+ Hqc256: 10, "10": "Hqc256",
19
+ MlDsa44: 11, "11": "MlDsa44",
20
+ MlDsa65: 12, "12": "MlDsa65",
21
+ MlDsa87: 13, "13": "MlDsa87",
22
+ FnDsa: 14, "14": "FnDsa",
23
+ FnDsa512: 15, "15": "FnDsa512",
24
+ FnDsa1024: 16, "16": "FnDsa1024",
25
+ SlhDsaSha256128fRobust: 17, "17": "SlhDsaSha256128fRobust",
26
+ SlhDsaSha256192fRobust: 18, "18": "SlhDsaSha256192fRobust",
27
+ SlhDsaSha256256fRobust: 19, "19": "SlhDsaSha256256fRobust",
28
+ SlhDsaShake256128fRobust: 20, "20": "SlhDsaShake256128fRobust",
29
+ SlhDsaShake256192fRobust: 21, "21": "SlhDsaShake256192fRobust",
30
+ SlhDsaShake256256fRobust: 22, "22": "SlhDsaShake256256fRobust",
31
+ Shake128: 23, "23": "Shake128",
32
+ Shake256: 24, "24": "Shake256",
33
+ CShake128: 25, "25": "CShake128",
34
+ CShake256: 26, "26": "CShake256",
35
+ Sha3_224: 27, "27": "Sha3_224",
36
+ Sha3_256: 28, "28": "Sha3_256",
37
+ Sha3_384: 29, "29": "Sha3_384",
38
+ Sha3_512: 30, "30": "Sha3_512",
39
+ Keccak224: 31, "31": "Keccak224",
40
+ Keccak256: 32, "32": "Keccak256",
41
+ Keccak384: 33, "33": "Keccak384",
42
+ Keccak512: 34, "34": "Keccak512",
43
+ Kt128: 35, "35": "Kt128",
44
+ Kt256: 36, "36": "Kt256",
45
+ TurboShake128: 37, "37": "TurboShake128",
46
+ TurboShake256: 38, "38": "TurboShake256",
47
+ Kmac128: 39, "39": "Kmac128",
48
+ Kmac256: 40, "40": "Kmac256",
49
+ TupleHash128: 41, "41": "TupleHash128",
50
+ TupleHash256: 42, "42": "TupleHash256",
51
+ ParallelHash128: 43, "43": "ParallelHash128",
52
+ ParallelHash256: 44, "44": "ParallelHash256",
53
+ Sha224: 45, "45": "Sha224",
54
+ Sha256: 46, "46": "Sha256",
55
+ Sha384: 47, "47": "Sha384",
56
+ Sha512: 48, "48": "Sha512",
57
+ Sha512_224: 49, "49": "Sha512_224",
58
+ Sha512_256: 50, "50": "Sha512_256",
59
+ Saturnin: 51, "51": "Saturnin",
60
+ Shake256Aead: 52, "52": "Shake256Aead",
61
+ DuplexSpongeAead: 53, "53": "DuplexSpongeAead",
62
+ TweakAead: 54, "54": "TweakAead",
63
+ RomulusN: 55, "55": "RomulusN",
64
+ RomulusM: 56, "56": "RomulusM",
65
+ /**
66
+ * Privacy-protocol identifiers (not standalone KEM/sig/hash providers).
67
+ */
68
+ LatticeRingSignature: 57, "57": "LatticeRingSignature",
69
+ LatticeBlindIssuance: 58, "58": "LatticeBlindIssuance",
70
+ LatticeAnonymousToken: 59, "59": "LatticeAnonymousToken",
71
+ LatticeNullifierRegistry: 60, "60": "LatticeNullifierRegistry",
72
+ /**
73
+ * Witness-derived nullifier mode (SHAKE256 over opening witness wire; see `lib-q-lattice-zkp`).
74
+ */
75
+ LatticeWitnessNullifier: 61, "61": "LatticeWitnessNullifier",
76
+ /**
77
+ * DualRing-LB (CCS 2021 Alg. 3 aggregated verify on Ajtai openings, `lib-q-ring-sig`).
78
+ */
79
+ LatticeDualRingLb: 62, "62": "LatticeDualRingLb",
80
+ /**
81
+ * ML-KEM-768 layered encapsulation with Saturnin AEAD per hop (mix-layer transport).
82
+ */
83
+ MixOnionRouting: 63, "63": "MixOnionRouting",
84
+ /**
85
+ * SHAKE256 session token and stateless retry-cookie derivation for resumption handshakes.
86
+ */
87
+ SessionResumptionBinding: 64, "64": "SessionResumptionBinding",
88
+ });
89
+ exports.Algorithm = Algorithm;
90
+
91
+ /**
92
+ * Algorithm categories
93
+ * @enum {0 | 1 | 2 | 3 | 4}
94
+ */
95
+ const AlgorithmCategory = Object.freeze({
96
+ Kem: 0, "0": "Kem",
97
+ Signature: 1, "1": "Signature",
98
+ Hash: 2, "2": "Hash",
99
+ Aead: 3, "3": "Aead",
100
+ /**
101
+ * Anonymous credentials, mix-layer transport helpers, and related ZKP-adjacent protocols.
102
+ */
103
+ PrivacyProtocol: 4, "4": "PrivacyProtocol",
104
+ });
105
+ exports.AlgorithmCategory = AlgorithmCategory;
106
+
107
+ /**
108
+ * WASM-compatible hash result
109
+ */
110
+ class HashResultWasm {
111
+ __destroy_into_raw() {
112
+ const ptr = this.__wbg_ptr;
113
+ this.__wbg_ptr = 0;
114
+ HashResultWasmFinalization.unregister(this);
115
+ return ptr;
116
+ }
117
+ free() {
118
+ const ptr = this.__destroy_into_raw();
119
+ wasm.__wbg_hashresultwasm_free(ptr, 0);
120
+ }
121
+ /**
122
+ * @returns {string}
123
+ */
124
+ get algorithm() {
125
+ let deferred1_0;
126
+ let deferred1_1;
127
+ try {
128
+ const ret = wasm.hashresultwasm_algorithm(this.__wbg_ptr);
129
+ deferred1_0 = ret[0];
130
+ deferred1_1 = ret[1];
131
+ return getStringFromWasm0(ret[0], ret[1]);
132
+ } finally {
133
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
134
+ }
135
+ }
136
+ /**
137
+ * @returns {Uint8Array}
138
+ */
139
+ get hash() {
140
+ const ret = wasm.hashresultwasm_hash(this.__wbg_ptr);
141
+ return ret;
142
+ }
143
+ /**
144
+ * @param {Uint8Array} hash
145
+ * @param {string} algorithm
146
+ */
147
+ constructor(hash, algorithm) {
148
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
149
+ const len0 = WASM_VECTOR_LEN;
150
+ const ret = wasm.hashresultwasm_new(hash, ptr0, len0);
151
+ this.__wbg_ptr = ret;
152
+ HashResultWasmFinalization.register(this, this.__wbg_ptr, this);
153
+ return this;
154
+ }
155
+ }
156
+ if (Symbol.dispose) HashResultWasm.prototype[Symbol.dispose] = HashResultWasm.prototype.free;
157
+ exports.HashResultWasm = HashResultWasm;
158
+
159
+ /**
160
+ * KEM keypair with automatic memory zeroization
161
+ */
162
+ class KemKeypair {
163
+ __destroy_into_raw() {
164
+ const ptr = this.__wbg_ptr;
165
+ this.__wbg_ptr = 0;
166
+ KemKeypairFinalization.unregister(this);
167
+ return ptr;
168
+ }
169
+ free() {
170
+ const ptr = this.__destroy_into_raw();
171
+ wasm.__wbg_kemkeypair_free(ptr, 0);
172
+ }
173
+ /**
174
+ * Create a new KEM keypair from bytes for WASM
175
+ * @param {Uint8Array} public_key
176
+ * @param {Uint8Array} secret_key
177
+ */
178
+ constructor(public_key, secret_key) {
179
+ const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
180
+ const len0 = WASM_VECTOR_LEN;
181
+ const ptr1 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
182
+ const len1 = WASM_VECTOR_LEN;
183
+ const ret = wasm.kemkeypair_new_wasm(ptr0, len0, ptr1, len1);
184
+ this.__wbg_ptr = ret;
185
+ KemKeypairFinalization.register(this, this.__wbg_ptr, this);
186
+ return this;
187
+ }
188
+ /**
189
+ * Get the public key as bytes for WASM
190
+ * @returns {Uint8Array}
191
+ */
192
+ public_key_bytes() {
193
+ const ret = wasm.kemkeypair_public_key_bytes(this.__wbg_ptr);
194
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
195
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
196
+ return v1;
197
+ }
198
+ /**
199
+ * Copy the secret key into a new `Uint8Array` for WASM (avoids returning an owned non-zeroizing `Vec<u8>`).
200
+ * @returns {Uint8Array}
201
+ */
202
+ secret_key_bytes() {
203
+ const ret = wasm.kemkeypair_secret_key_bytes(this.__wbg_ptr);
204
+ return ret;
205
+ }
206
+ }
207
+ if (Symbol.dispose) KemKeypair.prototype[Symbol.dispose] = KemKeypair.prototype.free;
208
+ exports.KemKeypair = KemKeypair;
209
+
210
+ /**
211
+ * KEM public key
212
+ */
213
+ class KemPublicKey {
214
+ __destroy_into_raw() {
215
+ const ptr = this.__wbg_ptr;
216
+ this.__wbg_ptr = 0;
217
+ KemPublicKeyFinalization.unregister(this);
218
+ return ptr;
219
+ }
220
+ free() {
221
+ const ptr = this.__destroy_into_raw();
222
+ wasm.__wbg_kempublickey_free(ptr, 0);
223
+ }
224
+ /**
225
+ * Get the key data as bytes for WASM
226
+ * @returns {Uint8Array}
227
+ */
228
+ bytes() {
229
+ const ret = wasm.kempublickey_bytes(this.__wbg_ptr);
230
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
231
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
232
+ return v1;
233
+ }
234
+ /**
235
+ * Create a new KEM public key from bytes for WASM
236
+ * @param {Uint8Array} data
237
+ */
238
+ constructor(data) {
239
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
240
+ const len0 = WASM_VECTOR_LEN;
241
+ const ret = wasm.kempublickey_new_from_bytes(ptr0, len0);
242
+ this.__wbg_ptr = ret;
243
+ KemPublicKeyFinalization.register(this, this.__wbg_ptr, this);
244
+ return this;
245
+ }
246
+ }
247
+ if (Symbol.dispose) KemPublicKey.prototype[Symbol.dispose] = KemPublicKey.prototype.free;
248
+ exports.KemPublicKey = KemPublicKey;
249
+
250
+ /**
251
+ * KEM secret key with automatic memory zeroization
252
+ */
253
+ class KemSecretKey {
254
+ __destroy_into_raw() {
255
+ const ptr = this.__wbg_ptr;
256
+ this.__wbg_ptr = 0;
257
+ KemSecretKeyFinalization.unregister(this);
258
+ return ptr;
259
+ }
260
+ free() {
261
+ const ptr = this.__destroy_into_raw();
262
+ wasm.__wbg_kemsecretkey_free(ptr, 0);
263
+ }
264
+ /**
265
+ * Copy the key material into a new `Uint8Array` for WASM (avoids returning an owned non-zeroizing `Vec<u8>`).
266
+ * @returns {Uint8Array}
267
+ */
268
+ bytes() {
269
+ const ret = wasm.kemsecretkey_bytes(this.__wbg_ptr);
270
+ return ret;
271
+ }
272
+ /**
273
+ * Create a new KEM secret key from bytes for WASM
274
+ * @param {Uint8Array} data
275
+ */
276
+ constructor(data) {
277
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
278
+ const len0 = WASM_VECTOR_LEN;
279
+ const ret = wasm.kemsecretkey_new_from_bytes(ptr0, len0);
280
+ this.__wbg_ptr = ret;
281
+ KemSecretKeyFinalization.register(this, this.__wbg_ptr, this);
282
+ return this;
283
+ }
284
+ }
285
+ if (Symbol.dispose) KemSecretKey.prototype[Symbol.dispose] = KemSecretKey.prototype.free;
286
+ exports.KemSecretKey = KemSecretKey;
287
+
288
+ /**
289
+ * Secure WASM AEAD Context
290
+ *
291
+ * This context provides secure AEAD operations with:
292
+ * - Consistent error handling using Result<T, JsValue>
293
+ * - Security validation for all inputs
294
+ * - Protection against timing attacks
295
+ * - Memory safety with automatic cleanup
296
+ */
297
+ class SecureWasmAeadContext {
298
+ __destroy_into_raw() {
299
+ const ptr = this.__wbg_ptr;
300
+ this.__wbg_ptr = 0;
301
+ SecureWasmAeadContextFinalization.unregister(this);
302
+ return ptr;
303
+ }
304
+ free() {
305
+ const ptr = this.__destroy_into_raw();
306
+ wasm.__wbg_securewasmaeadcontext_free(ptr, 0);
307
+ }
308
+ /**
309
+ * Decrypt data (Layer A `Result` ABI only; see [`crate::AeadDecryptSemantic`] for Layer B).
310
+ * @param {string} algorithm
311
+ * @param {Uint8Array} key
312
+ * @param {Uint8Array} nonce
313
+ * @param {Uint8Array} ciphertext
314
+ * @param {Uint8Array | null} [associated_data]
315
+ * @returns {any}
316
+ */
317
+ decrypt(algorithm, key, nonce, ciphertext, associated_data) {
318
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
319
+ const len0 = WASM_VECTOR_LEN;
320
+ const ret = wasm.securewasmaeadcontext_decrypt(this.__wbg_ptr, ptr0, len0, key, nonce, ciphertext, isLikeNone(associated_data) ? 0 : addToExternrefTable0(associated_data));
321
+ if (ret[2]) {
322
+ throw takeFromExternrefTable0(ret[1]);
323
+ }
324
+ return takeFromExternrefTable0(ret[0]);
325
+ }
326
+ /**
327
+ * Encrypt data
328
+ * @param {string} algorithm
329
+ * @param {Uint8Array} key
330
+ * @param {Uint8Array} nonce
331
+ * @param {Uint8Array} plaintext
332
+ * @param {Uint8Array | null} [associated_data]
333
+ * @returns {any}
334
+ */
335
+ encrypt(algorithm, key, nonce, plaintext, associated_data) {
336
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
337
+ const len0 = WASM_VECTOR_LEN;
338
+ const ret = wasm.securewasmaeadcontext_encrypt(this.__wbg_ptr, ptr0, len0, key, nonce, plaintext, isLikeNone(associated_data) ? 0 : addToExternrefTable0(associated_data));
339
+ if (ret[2]) {
340
+ throw takeFromExternrefTable0(ret[1]);
341
+ }
342
+ return takeFromExternrefTable0(ret[0]);
343
+ }
344
+ /**
345
+ * Get supported algorithms
346
+ * @returns {any}
347
+ */
348
+ get_supported_algorithms() {
349
+ const ret = wasm.securewasmaeadcontext_get_supported_algorithms(this.__wbg_ptr);
350
+ if (ret[2]) {
351
+ throw takeFromExternrefTable0(ret[1]);
352
+ }
353
+ return takeFromExternrefTable0(ret[0]);
354
+ }
355
+ /**
356
+ * Create a new secure WASM AEAD context
357
+ */
358
+ constructor() {
359
+ const ret = wasm.securewasmaeadcontext_new();
360
+ if (ret[2]) {
361
+ throw takeFromExternrefTable0(ret[1]);
362
+ }
363
+ this.__wbg_ptr = ret[0];
364
+ SecureWasmAeadContextFinalization.register(this, this.__wbg_ptr, this);
365
+ return this;
366
+ }
367
+ }
368
+ if (Symbol.dispose) SecureWasmAeadContext.prototype[Symbol.dispose] = SecureWasmAeadContext.prototype.free;
369
+ exports.SecureWasmAeadContext = SecureWasmAeadContext;
370
+
371
+ /**
372
+ * Secure WASM Hash Context
373
+ *
374
+ * This context provides secure hash operations with:
375
+ * - Consistent error handling using Result<T, JsValue>
376
+ * - Security validation for all inputs
377
+ * - Protection against timing attacks
378
+ * - Memory safety with automatic cleanup
379
+ */
380
+ class SecureWasmHashContext {
381
+ __destroy_into_raw() {
382
+ const ptr = this.__wbg_ptr;
383
+ this.__wbg_ptr = 0;
384
+ SecureWasmHashContextFinalization.unregister(this);
385
+ return ptr;
386
+ }
387
+ free() {
388
+ const ptr = this.__destroy_into_raw();
389
+ wasm.__wbg_securewasmhashcontext_free(ptr, 0);
390
+ }
391
+ /**
392
+ * Get supported algorithms
393
+ * @returns {any}
394
+ */
395
+ get_supported_algorithms() {
396
+ const ret = wasm.securewasmhashcontext_get_supported_algorithms(this.__wbg_ptr);
397
+ if (ret[2]) {
398
+ throw takeFromExternrefTable0(ret[1]);
399
+ }
400
+ return takeFromExternrefTable0(ret[0]);
401
+ }
402
+ /**
403
+ * Hash data
404
+ * @param {string} algorithm
405
+ * @param {Uint8Array} data
406
+ * @returns {any}
407
+ */
408
+ hash(algorithm, data) {
409
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
410
+ const len0 = WASM_VECTOR_LEN;
411
+ const ret = wasm.securewasmhashcontext_hash(this.__wbg_ptr, ptr0, len0, data);
412
+ if (ret[2]) {
413
+ throw takeFromExternrefTable0(ret[1]);
414
+ }
415
+ return takeFromExternrefTable0(ret[0]);
416
+ }
417
+ /**
418
+ * Create a new secure WASM hash context
419
+ */
420
+ constructor() {
421
+ const ret = wasm.securewasmhashcontext_new();
422
+ if (ret[2]) {
423
+ throw takeFromExternrefTable0(ret[1]);
424
+ }
425
+ this.__wbg_ptr = ret[0];
426
+ SecureWasmHashContextFinalization.register(this, this.__wbg_ptr, this);
427
+ return this;
428
+ }
429
+ }
430
+ if (Symbol.dispose) SecureWasmHashContext.prototype[Symbol.dispose] = SecureWasmHashContext.prototype.free;
431
+ exports.SecureWasmHashContext = SecureWasmHashContext;
432
+
433
+ /**
434
+ * Secure WASM KEM Context
435
+ *
436
+ * This context provides secure KEM operations with:
437
+ * - Consistent error handling using Result<T, JsValue>
438
+ * - Security validation for all inputs
439
+ * - Protection against timing attacks
440
+ * - Memory safety with automatic cleanup
441
+ */
442
+ class SecureWasmKemContext {
443
+ __destroy_into_raw() {
444
+ const ptr = this.__wbg_ptr;
445
+ this.__wbg_ptr = 0;
446
+ SecureWasmKemContextFinalization.unregister(this);
447
+ return ptr;
448
+ }
449
+ free() {
450
+ const ptr = this.__destroy_into_raw();
451
+ wasm.__wbg_securewasmkemcontext_free(ptr, 0);
452
+ }
453
+ /**
454
+ * Decapsulate a shared secret
455
+ * @param {string} algorithm
456
+ * @param {Uint8Array} private_key
457
+ * @param {Uint8Array} ciphertext
458
+ * @returns {any}
459
+ */
460
+ decapsulate(algorithm, private_key, ciphertext) {
461
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
462
+ const len0 = WASM_VECTOR_LEN;
463
+ const ret = wasm.securewasmkemcontext_decapsulate(this.__wbg_ptr, ptr0, len0, private_key, ciphertext);
464
+ if (ret[2]) {
465
+ throw takeFromExternrefTable0(ret[1]);
466
+ }
467
+ return takeFromExternrefTable0(ret[0]);
468
+ }
469
+ /**
470
+ * Encapsulate a shared secret
471
+ * @param {string} algorithm
472
+ * @param {Uint8Array} public_key
473
+ * @param {Uint8Array | null} [randomness]
474
+ * @returns {any}
475
+ */
476
+ encapsulate(algorithm, public_key, randomness) {
477
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
478
+ const len0 = WASM_VECTOR_LEN;
479
+ const ret = wasm.securewasmkemcontext_encapsulate(this.__wbg_ptr, ptr0, len0, public_key, isLikeNone(randomness) ? 0 : addToExternrefTable0(randomness));
480
+ if (ret[2]) {
481
+ throw takeFromExternrefTable0(ret[1]);
482
+ }
483
+ return takeFromExternrefTable0(ret[0]);
484
+ }
485
+ /**
486
+ * Generate a KEM keypair
487
+ * @param {string} algorithm
488
+ * @param {Uint8Array | null} [randomness]
489
+ * @returns {any}
490
+ */
491
+ generate_keypair(algorithm, randomness) {
492
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
493
+ const len0 = WASM_VECTOR_LEN;
494
+ const ret = wasm.securewasmkemcontext_generate_keypair(this.__wbg_ptr, ptr0, len0, isLikeNone(randomness) ? 0 : addToExternrefTable0(randomness));
495
+ if (ret[2]) {
496
+ throw takeFromExternrefTable0(ret[1]);
497
+ }
498
+ return takeFromExternrefTable0(ret[0]);
499
+ }
500
+ /**
501
+ * Get supported algorithms
502
+ * @returns {any}
503
+ */
504
+ get_supported_algorithms() {
505
+ const ret = wasm.securewasmkemcontext_get_supported_algorithms(this.__wbg_ptr);
506
+ if (ret[2]) {
507
+ throw takeFromExternrefTable0(ret[1]);
508
+ }
509
+ return takeFromExternrefTable0(ret[0]);
510
+ }
511
+ /**
512
+ * Create a new secure WASM KEM context
513
+ */
514
+ constructor() {
515
+ const ret = wasm.securewasmkemcontext_new();
516
+ if (ret[2]) {
517
+ throw takeFromExternrefTable0(ret[1]);
518
+ }
519
+ this.__wbg_ptr = ret[0];
520
+ SecureWasmKemContextFinalization.register(this, this.__wbg_ptr, this);
521
+ return this;
522
+ }
523
+ }
524
+ if (Symbol.dispose) SecureWasmKemContext.prototype[Symbol.dispose] = SecureWasmKemContext.prototype.free;
525
+ exports.SecureWasmKemContext = SecureWasmKemContext;
526
+
527
+ /**
528
+ * Secure WASM Signature Context
529
+ *
530
+ * This context provides secure signature operations with:
531
+ * - Consistent error handling using Result<T, JsValue>
532
+ * - Security validation for all inputs
533
+ * - Protection against timing attacks
534
+ * - Memory safety with automatic cleanup
535
+ */
536
+ class SecureWasmSignatureContext {
537
+ __destroy_into_raw() {
538
+ const ptr = this.__wbg_ptr;
539
+ this.__wbg_ptr = 0;
540
+ SecureWasmSignatureContextFinalization.unregister(this);
541
+ return ptr;
542
+ }
543
+ free() {
544
+ const ptr = this.__destroy_into_raw();
545
+ wasm.__wbg_securewasmsignaturecontext_free(ptr, 0);
546
+ }
547
+ /**
548
+ * Generate a signature keypair
549
+ * @param {string} algorithm
550
+ * @param {Uint8Array | null} [randomness]
551
+ * @returns {any}
552
+ */
553
+ generate_keypair(algorithm, randomness) {
554
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
555
+ const len0 = WASM_VECTOR_LEN;
556
+ const ret = wasm.securewasmsignaturecontext_generate_keypair(this.__wbg_ptr, ptr0, len0, isLikeNone(randomness) ? 0 : addToExternrefTable0(randomness));
557
+ if (ret[2]) {
558
+ throw takeFromExternrefTable0(ret[1]);
559
+ }
560
+ return takeFromExternrefTable0(ret[0]);
561
+ }
562
+ /**
563
+ * Get supported algorithms
564
+ * @returns {any}
565
+ */
566
+ get_supported_algorithms() {
567
+ const ret = wasm.securewasmsignaturecontext_get_supported_algorithms(this.__wbg_ptr);
568
+ if (ret[2]) {
569
+ throw takeFromExternrefTable0(ret[1]);
570
+ }
571
+ return takeFromExternrefTable0(ret[0]);
572
+ }
573
+ /**
574
+ * Create a new secure WASM signature context
575
+ */
576
+ constructor() {
577
+ const ret = wasm.securewasmsignaturecontext_new();
578
+ if (ret[2]) {
579
+ throw takeFromExternrefTable0(ret[1]);
580
+ }
581
+ this.__wbg_ptr = ret[0];
582
+ SecureWasmSignatureContextFinalization.register(this, this.__wbg_ptr, this);
583
+ return this;
584
+ }
585
+ /**
586
+ * Sign a message
587
+ * @param {string} algorithm
588
+ * @param {Uint8Array} private_key
589
+ * @param {Uint8Array} message
590
+ * @param {Uint8Array | null} [randomness]
591
+ * @returns {any}
592
+ */
593
+ sign(algorithm, private_key, message, randomness) {
594
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
595
+ const len0 = WASM_VECTOR_LEN;
596
+ const ret = wasm.securewasmsignaturecontext_sign(this.__wbg_ptr, ptr0, len0, private_key, message, isLikeNone(randomness) ? 0 : addToExternrefTable0(randomness));
597
+ if (ret[2]) {
598
+ throw takeFromExternrefTable0(ret[1]);
599
+ }
600
+ return takeFromExternrefTable0(ret[0]);
601
+ }
602
+ /**
603
+ * Verify a signature
604
+ * @param {string} algorithm
605
+ * @param {Uint8Array} public_key
606
+ * @param {Uint8Array} message
607
+ * @param {Uint8Array} signature
608
+ * @returns {any}
609
+ */
610
+ verify(algorithm, public_key, message, signature) {
611
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
612
+ const len0 = WASM_VECTOR_LEN;
613
+ const ret = wasm.securewasmsignaturecontext_verify(this.__wbg_ptr, ptr0, len0, public_key, message, signature);
614
+ if (ret[2]) {
615
+ throw takeFromExternrefTable0(ret[1]);
616
+ }
617
+ return takeFromExternrefTable0(ret[0]);
618
+ }
619
+ }
620
+ if (Symbol.dispose) SecureWasmSignatureContext.prototype[Symbol.dispose] = SecureWasmSignatureContext.prototype.free;
621
+ exports.SecureWasmSignatureContext = SecureWasmSignatureContext;
622
+
623
+ /**
624
+ * Security levels for cryptographic algorithms
625
+ * @enum {1 | 3 | 4 | 5}
626
+ */
627
+ const SecurityLevel = Object.freeze({
628
+ Level1: 1, "1": "Level1",
629
+ Level3: 3, "3": "Level3",
630
+ Level4: 4, "4": "Level4",
631
+ Level5: 5, "5": "Level5",
632
+ });
633
+ exports.SecurityLevel = SecurityLevel;
634
+
635
+ /**
636
+ * Signature keypair with automatic memory zeroization
637
+ */
638
+ class SigKeypair {
639
+ __destroy_into_raw() {
640
+ const ptr = this.__wbg_ptr;
641
+ this.__wbg_ptr = 0;
642
+ SigKeypairFinalization.unregister(this);
643
+ return ptr;
644
+ }
645
+ free() {
646
+ const ptr = this.__destroy_into_raw();
647
+ wasm.__wbg_sigkeypair_free(ptr, 0);
648
+ }
649
+ }
650
+ if (Symbol.dispose) SigKeypair.prototype[Symbol.dispose] = SigKeypair.prototype.free;
651
+ exports.SigKeypair = SigKeypair;
652
+
653
+ /**
654
+ * Signature public key
655
+ */
656
+ class SigPublicKey {
657
+ __destroy_into_raw() {
658
+ const ptr = this.__wbg_ptr;
659
+ this.__wbg_ptr = 0;
660
+ SigPublicKeyFinalization.unregister(this);
661
+ return ptr;
662
+ }
663
+ free() {
664
+ const ptr = this.__destroy_into_raw();
665
+ wasm.__wbg_sigpublickey_free(ptr, 0);
666
+ }
667
+ }
668
+ if (Symbol.dispose) SigPublicKey.prototype[Symbol.dispose] = SigPublicKey.prototype.free;
669
+ exports.SigPublicKey = SigPublicKey;
670
+
671
+ /**
672
+ * Signature secret key with automatic memory zeroization
673
+ */
674
+ class SigSecretKey {
675
+ __destroy_into_raw() {
676
+ const ptr = this.__wbg_ptr;
677
+ this.__wbg_ptr = 0;
678
+ SigSecretKeyFinalization.unregister(this);
679
+ return ptr;
680
+ }
681
+ free() {
682
+ const ptr = this.__destroy_into_raw();
683
+ wasm.__wbg_sigsecretkey_free(ptr, 0);
684
+ }
685
+ }
686
+ if (Symbol.dispose) SigSecretKey.prototype[Symbol.dispose] = SigSecretKey.prototype.free;
687
+ exports.SigSecretKey = SigSecretKey;
688
+
689
+ /**
690
+ * WASM-compatible AEAD context wrapper
691
+ *
692
+ * This wrapper provides JavaScript-compatible bindings for AEAD operations:
693
+ * - Integrates with the new modular architecture
694
+ * - Includes security validation
695
+ * - Provides consistent error handling
696
+ * - Supports all AEAD algorithms
697
+ */
698
+ class WasmAeadContext {
699
+ __destroy_into_raw() {
700
+ const ptr = this.__wbg_ptr;
701
+ this.__wbg_ptr = 0;
702
+ WasmAeadContextFinalization.unregister(this);
703
+ return ptr;
704
+ }
705
+ free() {
706
+ const ptr = this.__destroy_into_raw();
707
+ wasm.__wbg_wasmaeadcontext_free(ptr, 0);
708
+ }
709
+ }
710
+ if (Symbol.dispose) WasmAeadContext.prototype[Symbol.dispose] = WasmAeadContext.prototype.free;
711
+ exports.WasmAeadContext = WasmAeadContext;
712
+
713
+ /**
714
+ * WASM-compatible CryptoProvider wrapper
715
+ *
716
+ * This wrapper provides JavaScript-compatible bindings for the crypto provider:
717
+ * - Integrates with the new modular architecture
718
+ * - Provides consistent error handling
719
+ * - Supports all cryptographic operations
720
+ */
721
+ class WasmCryptoProvider {
722
+ __destroy_into_raw() {
723
+ const ptr = this.__wbg_ptr;
724
+ this.__wbg_ptr = 0;
725
+ WasmCryptoProviderFinalization.unregister(this);
726
+ return ptr;
727
+ }
728
+ free() {
729
+ const ptr = this.__destroy_into_raw();
730
+ wasm.__wbg_wasmcryptoprovider_free(ptr, 0);
731
+ }
732
+ }
733
+ if (Symbol.dispose) WasmCryptoProvider.prototype[Symbol.dispose] = WasmCryptoProvider.prototype.free;
734
+ exports.WasmCryptoProvider = WasmCryptoProvider;
735
+
736
+ /**
737
+ * WASM-compatible Hash context wrapper
738
+ *
739
+ * This wrapper provides JavaScript-compatible bindings for hash operations:
740
+ * - Integrates with the new modular architecture
741
+ * - Includes security validation
742
+ * - Provides consistent error handling
743
+ * - Supports all hash algorithms
744
+ */
745
+ class WasmHashContext {
746
+ __destroy_into_raw() {
747
+ const ptr = this.__wbg_ptr;
748
+ this.__wbg_ptr = 0;
749
+ WasmHashContextFinalization.unregister(this);
750
+ return ptr;
751
+ }
752
+ free() {
753
+ const ptr = this.__destroy_into_raw();
754
+ wasm.__wbg_wasmhashcontext_free(ptr, 0);
755
+ }
756
+ }
757
+ if (Symbol.dispose) WasmHashContext.prototype[Symbol.dispose] = WasmHashContext.prototype.free;
758
+ exports.WasmHashContext = WasmHashContext;
759
+
760
+ /**
761
+ * WASM-compatible KEM context wrapper
762
+ *
763
+ * This wrapper provides JavaScript-compatible bindings for KEM operations:
764
+ * - Integrates with the new modular architecture
765
+ * - Includes security validation
766
+ * - Provides consistent error handling
767
+ * - Supports all KEM algorithms
768
+ */
769
+ class WasmKemContext {
770
+ __destroy_into_raw() {
771
+ const ptr = this.__wbg_ptr;
772
+ this.__wbg_ptr = 0;
773
+ WasmKemContextFinalization.unregister(this);
774
+ return ptr;
775
+ }
776
+ free() {
777
+ const ptr = this.__destroy_into_raw();
778
+ wasm.__wbg_wasmkemcontext_free(ptr, 0);
779
+ }
780
+ }
781
+ if (Symbol.dispose) WasmKemContext.prototype[Symbol.dispose] = WasmKemContext.prototype.free;
782
+ exports.WasmKemContext = WasmKemContext;
783
+
784
+ /**
785
+ * Generic WASM key pair implementation
786
+ */
787
+ class WasmKeyPairImpl {
788
+ __destroy_into_raw() {
789
+ const ptr = this.__wbg_ptr;
790
+ this.__wbg_ptr = 0;
791
+ WasmKeyPairImplFinalization.unregister(this);
792
+ return ptr;
793
+ }
794
+ free() {
795
+ const ptr = this.__destroy_into_raw();
796
+ wasm.__wbg_wasmkeypairimpl_free(ptr, 0);
797
+ }
798
+ /**
799
+ * @param {Uint8Array} public_key
800
+ * @param {Uint8Array} secret_key
801
+ */
802
+ constructor(public_key, secret_key) {
803
+ const ret = wasm.wasmkeypairimpl_new(public_key, secret_key);
804
+ this.__wbg_ptr = ret;
805
+ WasmKeyPairImplFinalization.register(this, this.__wbg_ptr, this);
806
+ return this;
807
+ }
808
+ /**
809
+ * @returns {Uint8Array}
810
+ */
811
+ get public_key() {
812
+ const ret = wasm.wasmkeypairimpl_public_key(this.__wbg_ptr);
813
+ return ret;
814
+ }
815
+ /**
816
+ * @returns {Uint8Array}
817
+ */
818
+ get secret_key() {
819
+ const ret = wasm.wasmkeypairimpl_secret_key(this.__wbg_ptr);
820
+ return ret;
821
+ }
822
+ }
823
+ if (Symbol.dispose) WasmKeyPairImpl.prototype[Symbol.dispose] = WasmKeyPairImpl.prototype.free;
824
+ exports.WasmKeyPairImpl = WasmKeyPairImpl;
825
+
826
+ /**
827
+ * WASM-compatible provider factory
828
+ *
829
+ * This factory provides JavaScript-compatible bindings for creating providers:
830
+ * - Integrates with the new modular architecture
831
+ * - Provides consistent error handling
832
+ * - Supports all provider creation operations
833
+ */
834
+ class WasmProviderFactory {
835
+ __destroy_into_raw() {
836
+ const ptr = this.__wbg_ptr;
837
+ this.__wbg_ptr = 0;
838
+ WasmProviderFactoryFinalization.unregister(this);
839
+ return ptr;
840
+ }
841
+ free() {
842
+ const ptr = this.__destroy_into_raw();
843
+ wasm.__wbg_wasmproviderfactory_free(ptr, 0);
844
+ }
845
+ /**
846
+ * Create a new provider manager
847
+ * @returns {WasmProviderManager}
848
+ */
849
+ static create_provider_manager() {
850
+ const ret = wasm.wasmproviderfactory_create_provider_manager();
851
+ return WasmProviderManager.__wrap(ret);
852
+ }
853
+ /**
854
+ * Create a provider manager with specific configuration
855
+ * @param {string} config
856
+ * @returns {WasmProviderManager}
857
+ */
858
+ static create_provider_manager_with_config(config) {
859
+ const ptr0 = passStringToWasm0(config, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
860
+ const len0 = WASM_VECTOR_LEN;
861
+ const ret = wasm.wasmproviderfactory_create_provider_manager_with_config(ptr0, len0);
862
+ if (ret[2]) {
863
+ throw takeFromExternrefTable0(ret[1]);
864
+ }
865
+ return WasmProviderManager.__wrap(ret[0]);
866
+ }
867
+ /**
868
+ * Get available provider types
869
+ * @returns {string}
870
+ */
871
+ static get_available_providers() {
872
+ let deferred1_0;
873
+ let deferred1_1;
874
+ try {
875
+ const ret = wasm.wasmproviderfactory_get_available_providers();
876
+ deferred1_0 = ret[0];
877
+ deferred1_1 = ret[1];
878
+ return getStringFromWasm0(ret[0], ret[1]);
879
+ } finally {
880
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
881
+ }
882
+ }
883
+ /**
884
+ * Validate provider configuration
885
+ * @param {string} config
886
+ * @returns {boolean}
887
+ */
888
+ static validate_provider_config(config) {
889
+ const ptr0 = passStringToWasm0(config, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
890
+ const len0 = WASM_VECTOR_LEN;
891
+ const ret = wasm.wasmproviderfactory_validate_provider_config(ptr0, len0);
892
+ if (ret[2]) {
893
+ throw takeFromExternrefTable0(ret[1]);
894
+ }
895
+ return ret[0] !== 0;
896
+ }
897
+ }
898
+ if (Symbol.dispose) WasmProviderFactory.prototype[Symbol.dispose] = WasmProviderFactory.prototype.free;
899
+ exports.WasmProviderFactory = WasmProviderFactory;
900
+
901
+ /**
902
+ * WASM-compatible provider manager
903
+ *
904
+ * This manager provides JavaScript-compatible bindings for provider operations:
905
+ * - Integrates with the new modular architecture
906
+ * - Includes security validation
907
+ * - Provides consistent error handling
908
+ * - Supports all provider operations
909
+ */
910
+ class WasmProviderManager {
911
+ static __wrap(ptr) {
912
+ const obj = Object.create(WasmProviderManager.prototype);
913
+ obj.__wbg_ptr = ptr;
914
+ WasmProviderManagerFinalization.register(obj, obj.__wbg_ptr, obj);
915
+ return obj;
916
+ }
917
+ __destroy_into_raw() {
918
+ const ptr = this.__wbg_ptr;
919
+ this.__wbg_ptr = 0;
920
+ WasmProviderManagerFinalization.unregister(this);
921
+ return ptr;
922
+ }
923
+ free() {
924
+ const ptr = this.__destroy_into_raw();
925
+ wasm.__wbg_wasmprovidermanager_free(ptr, 0);
926
+ }
927
+ }
928
+ if (Symbol.dispose) WasmProviderManager.prototype[Symbol.dispose] = WasmProviderManager.prototype.free;
929
+ exports.WasmProviderManager = WasmProviderManager;
930
+
931
+ /**
932
+ * WASM-compatible Signature context wrapper
933
+ *
934
+ * This wrapper provides JavaScript-compatible bindings for signature operations:
935
+ * - Integrates with the new modular architecture
936
+ * - Includes security validation
937
+ * - Provides consistent error handling
938
+ * - Supports all signature algorithms
939
+ */
940
+ class WasmSignatureContext {
941
+ __destroy_into_raw() {
942
+ const ptr = this.__wbg_ptr;
943
+ this.__wbg_ptr = 0;
944
+ WasmSignatureContextFinalization.unregister(this);
945
+ return ptr;
946
+ }
947
+ free() {
948
+ const ptr = this.__destroy_into_raw();
949
+ wasm.__wbg_wasmsignaturecontext_free(ptr, 0);
950
+ }
951
+ /**
952
+ * Generate a keypair for the specified algorithm
953
+ * @param {string} algorithm
954
+ * @param {Uint8Array | null} [randomness]
955
+ * @returns {any}
956
+ */
957
+ generate_keypair(algorithm, randomness) {
958
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
959
+ const len0 = WASM_VECTOR_LEN;
960
+ const ret = wasm.wasmsignaturecontext_generate_keypair(this.__wbg_ptr, ptr0, len0, isLikeNone(randomness) ? 0 : addToExternrefTable0(randomness));
961
+ if (ret[2]) {
962
+ throw takeFromExternrefTable0(ret[1]);
963
+ }
964
+ return takeFromExternrefTable0(ret[0]);
965
+ }
966
+ /**
967
+ * Check if an algorithm is supported
968
+ * @param {string} algorithm
969
+ * @returns {boolean}
970
+ */
971
+ is_algorithm_supported(algorithm) {
972
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
973
+ const len0 = WASM_VECTOR_LEN;
974
+ const ret = wasm.wasmsignaturecontext_is_algorithm_supported(this.__wbg_ptr, ptr0, len0);
975
+ return ret !== 0;
976
+ }
977
+ /**
978
+ * Get the security level of the context
979
+ * @returns {number}
980
+ */
981
+ security_level() {
982
+ const ret = wasm.wasmsignaturecontext_security_level(this.__wbg_ptr);
983
+ return ret >>> 0;
984
+ }
985
+ /**
986
+ * Sign a message using the given secret key
987
+ * @param {string} algorithm
988
+ * @param {Uint8Array} secret_key_data
989
+ * @param {Uint8Array} message
990
+ * @param {Uint8Array | null} [randomness]
991
+ * @returns {Uint8Array}
992
+ */
993
+ sign(algorithm, secret_key_data, message, randomness) {
994
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
995
+ const len0 = WASM_VECTOR_LEN;
996
+ const ret = wasm.wasmsignaturecontext_sign(this.__wbg_ptr, ptr0, len0, secret_key_data, message, isLikeNone(randomness) ? 0 : addToExternrefTable0(randomness));
997
+ if (ret[3]) {
998
+ throw takeFromExternrefTable0(ret[2]);
999
+ }
1000
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1001
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1002
+ return v2;
1003
+ }
1004
+ /**
1005
+ * Get supported algorithms
1006
+ * @returns {string}
1007
+ */
1008
+ supported_algorithms() {
1009
+ let deferred1_0;
1010
+ let deferred1_1;
1011
+ try {
1012
+ const ret = wasm.wasmsignaturecontext_supported_algorithms(this.__wbg_ptr);
1013
+ deferred1_0 = ret[0];
1014
+ deferred1_1 = ret[1];
1015
+ return getStringFromWasm0(ret[0], ret[1]);
1016
+ } finally {
1017
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1018
+ }
1019
+ }
1020
+ /**
1021
+ * Verify a signature using the given public key
1022
+ * @param {string} algorithm
1023
+ * @param {Uint8Array} public_key_data
1024
+ * @param {Uint8Array} message
1025
+ * @param {Uint8Array} signature
1026
+ * @returns {boolean}
1027
+ */
1028
+ verify(algorithm, public_key_data, message, signature) {
1029
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1030
+ const len0 = WASM_VECTOR_LEN;
1031
+ const ret = wasm.wasmsignaturecontext_verify(this.__wbg_ptr, ptr0, len0, public_key_data, message, signature);
1032
+ if (ret[2]) {
1033
+ throw takeFromExternrefTable0(ret[1]);
1034
+ }
1035
+ return ret[0] !== 0;
1036
+ }
1037
+ }
1038
+ if (Symbol.dispose) WasmSignatureContext.prototype[Symbol.dispose] = WasmSignatureContext.prototype.free;
1039
+ exports.WasmSignatureContext = WasmSignatureContext;
1040
+
1041
+ /**
1042
+ * Convert bytes to hexadecimal string
1043
+ *
1044
+ * This function provides secure hex encoding for WASM:
1045
+ * - Uses constant-time operations where possible
1046
+ * - Handles large data efficiently
1047
+ * - Returns JavaScript string
1048
+ * @param {Uint8Array} data
1049
+ * @returns {string}
1050
+ */
1051
+ function bytes_to_hex(data) {
1052
+ let deferred1_0;
1053
+ let deferred1_1;
1054
+ try {
1055
+ const ret = wasm.bytes_to_hex(data);
1056
+ deferred1_0 = ret[0];
1057
+ deferred1_1 = ret[1];
1058
+ return getStringFromWasm0(ret[0], ret[1]);
1059
+ } finally {
1060
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1061
+ }
1062
+ }
1063
+ exports.bytes_to_hex = bytes_to_hex;
1064
+
1065
+ /**
1066
+ * Get library information for WASM
1067
+ *
1068
+ * This function provides library metadata for JavaScript consumption
1069
+ * @returns {string}
1070
+ */
1071
+ function get_library_info() {
1072
+ let deferred1_0;
1073
+ let deferred1_1;
1074
+ try {
1075
+ const ret = wasm.get_library_info();
1076
+ deferred1_0 = ret[0];
1077
+ deferred1_1 = ret[1];
1078
+ return getStringFromWasm0(ret[0], ret[1]);
1079
+ } finally {
1080
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1081
+ }
1082
+ }
1083
+ exports.get_library_info = get_library_info;
1084
+
1085
+ /**
1086
+ * Get supported algorithms by category
1087
+ *
1088
+ * This function provides algorithm information for JavaScript
1089
+ * @returns {string}
1090
+ */
1091
+ function get_supported_algorithms() {
1092
+ let deferred1_0;
1093
+ let deferred1_1;
1094
+ try {
1095
+ const ret = wasm.get_supported_algorithms();
1096
+ deferred1_0 = ret[0];
1097
+ deferred1_1 = ret[1];
1098
+ return getStringFromWasm0(ret[0], ret[1]);
1099
+ } finally {
1100
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1101
+ }
1102
+ }
1103
+ exports.get_supported_algorithms = get_supported_algorithms;
1104
+
1105
+ /**
1106
+ * Gold PRF on the 256-bit pilot parameters; inputs are **big-endian** 32-byte field elements.
1107
+ * Returns hex-encoded 32-byte little-endian output residue.
1108
+ * @param {string} key_be_hex
1109
+ * @param {string} x_be_hex
1110
+ * @returns {any}
1111
+ */
1112
+ function goldPrfU256BeHex(key_be_hex, x_be_hex) {
1113
+ const ptr0 = passStringToWasm0(key_be_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1114
+ const len0 = WASM_VECTOR_LEN;
1115
+ const ptr1 = passStringToWasm0(x_be_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1116
+ const len1 = WASM_VECTOR_LEN;
1117
+ const ret = wasm.goldPrfU256BeHex(ptr0, len0, ptr1, len1);
1118
+ if (ret[2]) {
1119
+ throw takeFromExternrefTable0(ret[1]);
1120
+ }
1121
+ return takeFromExternrefTable0(ret[0]);
1122
+ }
1123
+ exports.goldPrfU256BeHex = goldPrfU256BeHex;
1124
+
1125
+ /**
1126
+ * Convert hexadecimal string to bytes
1127
+ *
1128
+ * This function provides secure hex decoding for WASM:
1129
+ * - Validates hex string format
1130
+ * - Handles errors gracefully
1131
+ * - Returns Uint8Array
1132
+ * @param {string} hex
1133
+ * @returns {Uint8Array}
1134
+ */
1135
+ function hex_to_bytes(hex) {
1136
+ const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1137
+ const len0 = WASM_VECTOR_LEN;
1138
+ const ret = wasm.hex_to_bytes(ptr0, len0);
1139
+ if (ret[2]) {
1140
+ throw takeFromExternrefTable0(ret[1]);
1141
+ }
1142
+ return takeFromExternrefTable0(ret[0]);
1143
+ }
1144
+ exports.hex_to_bytes = hex_to_bytes;
1145
+
1146
+ /**
1147
+ * Check if a feature is available
1148
+ *
1149
+ * This function allows JavaScript to check feature availability
1150
+ * @param {string} feature
1151
+ * @returns {boolean}
1152
+ */
1153
+ function is_feature_available(feature) {
1154
+ const ptr0 = passStringToWasm0(feature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1155
+ const len0 = WASM_VECTOR_LEN;
1156
+ const ret = wasm.is_feature_available(ptr0, len0);
1157
+ return ret !== 0;
1158
+ }
1159
+ exports.is_feature_available = is_feature_available;
1160
+
1161
+ /**
1162
+ * Legendre PRF on the 256-bit pilot modulus; `key` and `x` are **big-endian** 32-byte field elements (64 hex chars each).
1163
+ * @param {string} key_be_hex
1164
+ * @param {string} x_be_hex
1165
+ * @returns {number}
1166
+ */
1167
+ function legendrePrfU256BeHex(key_be_hex, x_be_hex) {
1168
+ const ptr0 = passStringToWasm0(key_be_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1169
+ const len0 = WASM_VECTOR_LEN;
1170
+ const ptr1 = passStringToWasm0(x_be_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1171
+ const len1 = WASM_VECTOR_LEN;
1172
+ const ret = wasm.legendrePrfU256BeHex(ptr0, len0, ptr1, len1);
1173
+ if (ret[2]) {
1174
+ throw takeFromExternrefTable0(ret[1]);
1175
+ }
1176
+ return ret[0];
1177
+ }
1178
+ exports.legendrePrfU256BeHex = legendrePrfU256BeHex;
1179
+
1180
+ /**
1181
+ * Generate cryptographically secure random bytes for WASM
1182
+ *
1183
+ * This function provides secure random generation in WASM environments:
1184
+ * - Uses the browser's crypto.getRandomValues() API
1185
+ * - Validates input size to prevent DoS attacks
1186
+ * - Returns Uint8Array for direct JavaScript consumption
1187
+ * @param {number} length
1188
+ * @returns {Uint8Array}
1189
+ */
1190
+ function random_bytes(length) {
1191
+ const ret = wasm.random_bytes(length);
1192
+ if (ret[2]) {
1193
+ throw takeFromExternrefTable0(ret[1]);
1194
+ }
1195
+ return takeFromExternrefTable0(ret[0]);
1196
+ }
1197
+ exports.random_bytes = random_bytes;
1198
+
1199
+ /**
1200
+ * Validate input data for WASM operations
1201
+ *
1202
+ * This function provides comprehensive input validation:
1203
+ * - Checks for null/undefined values
1204
+ * - Validates data size limits
1205
+ * - Ensures data is not empty when required
1206
+ * @param {Uint8Array} data
1207
+ * @param {number | null} [min_size]
1208
+ * @param {number | null} [max_size]
1209
+ * @returns {boolean}
1210
+ */
1211
+ function validate_input(data, min_size, max_size) {
1212
+ const ret = wasm.validate_input(data, isLikeNone(min_size) ? Number.MAX_SAFE_INTEGER : (min_size) >>> 0, isLikeNone(max_size) ? Number.MAX_SAFE_INTEGER : (max_size) >>> 0);
1213
+ if (ret[2]) {
1214
+ throw takeFromExternrefTable0(ret[1]);
1215
+ }
1216
+ return ret[0] !== 0;
1217
+ }
1218
+ exports.validate_input = validate_input;
1219
+ function __wbg_get_imports() {
1220
+ const import0 = {
1221
+ __proto__: null,
1222
+ __wbg_Error_bce6d499ff0a4aff: function(arg0, arg1) {
1223
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1224
+ return ret;
1225
+ },
1226
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1227
+ const ret = String(arg1);
1228
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1229
+ const len1 = WASM_VECTOR_LEN;
1230
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1231
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1232
+ },
1233
+ __wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
1234
+ const ret = debugString(arg1);
1235
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1236
+ const len1 = WASM_VECTOR_LEN;
1237
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1238
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1239
+ },
1240
+ __wbg___wbindgen_is_string_dde0fd9020db4434: function(arg0) {
1241
+ const ret = typeof(arg0) === 'string';
1242
+ return ret;
1243
+ },
1244
+ __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
1245
+ throw new Error(getStringFromWasm0(arg0, arg1));
1246
+ },
1247
+ __wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
1248
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1249
+ }, arguments); },
1250
+ __wbg_get_index_c051becca25aa6d8: function(arg0, arg1) {
1251
+ const ret = arg0[arg1 >>> 0];
1252
+ return ret;
1253
+ },
1254
+ __wbg_length_56fcd3e2b7e0299d: function(arg0) {
1255
+ const ret = arg0.length;
1256
+ return ret;
1257
+ },
1258
+ __wbg_new_02d162bc6cf02f60: function() {
1259
+ const ret = new Object();
1260
+ return ret;
1261
+ },
1262
+ __wbg_new_070df68d66325372: function() {
1263
+ const ret = new Map();
1264
+ return ret;
1265
+ },
1266
+ __wbg_new_310879b66b6e95e1: function() {
1267
+ const ret = new Array();
1268
+ return ret;
1269
+ },
1270
+ __wbg_new_with_length_99887c91eae4abab: function(arg0) {
1271
+ const ret = new Uint8Array(arg0 >>> 0);
1272
+ return ret;
1273
+ },
1274
+ __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
1275
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1276
+ },
1277
+ __wbg_set_24d0fa9e104112f9: function(arg0, arg1, arg2) {
1278
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
1279
+ },
1280
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1281
+ arg0[arg1] = arg2;
1282
+ },
1283
+ __wbg_set_78ea6a19f4818587: function(arg0, arg1, arg2) {
1284
+ arg0[arg1 >>> 0] = arg2;
1285
+ },
1286
+ __wbg_set_facb7a5914e0fa39: function(arg0, arg1, arg2) {
1287
+ const ret = arg0.set(arg1, arg2);
1288
+ return ret;
1289
+ },
1290
+ __wbg_set_index_6216eb6926d2fbc6: function(arg0, arg1, arg2) {
1291
+ arg0[arg1 >>> 0] = arg2;
1292
+ },
1293
+ __wbindgen_cast_0000000000000001: function(arg0) {
1294
+ // Cast intrinsic for `F64 -> Externref`.
1295
+ const ret = arg0;
1296
+ return ret;
1297
+ },
1298
+ __wbindgen_cast_0000000000000002: function(arg0) {
1299
+ // Cast intrinsic for `I64 -> Externref`.
1300
+ const ret = arg0;
1301
+ return ret;
1302
+ },
1303
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1304
+ // Cast intrinsic for `Ref(String) -> Externref`.
1305
+ const ret = getStringFromWasm0(arg0, arg1);
1306
+ return ret;
1307
+ },
1308
+ __wbindgen_cast_0000000000000004: function(arg0) {
1309
+ // Cast intrinsic for `U64 -> Externref`.
1310
+ const ret = BigInt.asUintN(64, arg0);
1311
+ return ret;
1312
+ },
1313
+ __wbindgen_init_externref_table: function() {
1314
+ const table = wasm.__wbindgen_externrefs;
1315
+ const offset = table.grow(4);
1316
+ table.set(0, undefined);
1317
+ table.set(offset + 0, undefined);
1318
+ table.set(offset + 1, null);
1319
+ table.set(offset + 2, true);
1320
+ table.set(offset + 3, false);
1321
+ },
1322
+ };
1323
+ return {
1324
+ __proto__: null,
1325
+ "./lib_q_prf_bg.js": import0,
1326
+ };
1327
+ }
1328
+
1329
+ const HashResultWasmFinalization = (typeof FinalizationRegistry === 'undefined')
1330
+ ? { register: () => {}, unregister: () => {} }
1331
+ : new FinalizationRegistry(ptr => wasm.__wbg_hashresultwasm_free(ptr, 1));
1332
+ const KemKeypairFinalization = (typeof FinalizationRegistry === 'undefined')
1333
+ ? { register: () => {}, unregister: () => {} }
1334
+ : new FinalizationRegistry(ptr => wasm.__wbg_kemkeypair_free(ptr, 1));
1335
+ const KemPublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1336
+ ? { register: () => {}, unregister: () => {} }
1337
+ : new FinalizationRegistry(ptr => wasm.__wbg_kempublickey_free(ptr, 1));
1338
+ const KemSecretKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1339
+ ? { register: () => {}, unregister: () => {} }
1340
+ : new FinalizationRegistry(ptr => wasm.__wbg_kemsecretkey_free(ptr, 1));
1341
+ const SecureWasmAeadContextFinalization = (typeof FinalizationRegistry === 'undefined')
1342
+ ? { register: () => {}, unregister: () => {} }
1343
+ : new FinalizationRegistry(ptr => wasm.__wbg_securewasmaeadcontext_free(ptr, 1));
1344
+ const SecureWasmHashContextFinalization = (typeof FinalizationRegistry === 'undefined')
1345
+ ? { register: () => {}, unregister: () => {} }
1346
+ : new FinalizationRegistry(ptr => wasm.__wbg_securewasmhashcontext_free(ptr, 1));
1347
+ const SecureWasmKemContextFinalization = (typeof FinalizationRegistry === 'undefined')
1348
+ ? { register: () => {}, unregister: () => {} }
1349
+ : new FinalizationRegistry(ptr => wasm.__wbg_securewasmkemcontext_free(ptr, 1));
1350
+ const SecureWasmSignatureContextFinalization = (typeof FinalizationRegistry === 'undefined')
1351
+ ? { register: () => {}, unregister: () => {} }
1352
+ : new FinalizationRegistry(ptr => wasm.__wbg_securewasmsignaturecontext_free(ptr, 1));
1353
+ const SigKeypairFinalization = (typeof FinalizationRegistry === 'undefined')
1354
+ ? { register: () => {}, unregister: () => {} }
1355
+ : new FinalizationRegistry(ptr => wasm.__wbg_sigkeypair_free(ptr, 1));
1356
+ const SigPublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1357
+ ? { register: () => {}, unregister: () => {} }
1358
+ : new FinalizationRegistry(ptr => wasm.__wbg_sigpublickey_free(ptr, 1));
1359
+ const SigSecretKeyFinalization = (typeof FinalizationRegistry === 'undefined')
1360
+ ? { register: () => {}, unregister: () => {} }
1361
+ : new FinalizationRegistry(ptr => wasm.__wbg_sigsecretkey_free(ptr, 1));
1362
+ const WasmAeadContextFinalization = (typeof FinalizationRegistry === 'undefined')
1363
+ ? { register: () => {}, unregister: () => {} }
1364
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmaeadcontext_free(ptr, 1));
1365
+ const WasmCryptoProviderFinalization = (typeof FinalizationRegistry === 'undefined')
1366
+ ? { register: () => {}, unregister: () => {} }
1367
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcryptoprovider_free(ptr, 1));
1368
+ const WasmHashContextFinalization = (typeof FinalizationRegistry === 'undefined')
1369
+ ? { register: () => {}, unregister: () => {} }
1370
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmhashcontext_free(ptr, 1));
1371
+ const WasmKemContextFinalization = (typeof FinalizationRegistry === 'undefined')
1372
+ ? { register: () => {}, unregister: () => {} }
1373
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmkemcontext_free(ptr, 1));
1374
+ const WasmKeyPairImplFinalization = (typeof FinalizationRegistry === 'undefined')
1375
+ ? { register: () => {}, unregister: () => {} }
1376
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmkeypairimpl_free(ptr, 1));
1377
+ const WasmProviderFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
1378
+ ? { register: () => {}, unregister: () => {} }
1379
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmproviderfactory_free(ptr, 1));
1380
+ const WasmProviderManagerFinalization = (typeof FinalizationRegistry === 'undefined')
1381
+ ? { register: () => {}, unregister: () => {} }
1382
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmprovidermanager_free(ptr, 1));
1383
+ const WasmSignatureContextFinalization = (typeof FinalizationRegistry === 'undefined')
1384
+ ? { register: () => {}, unregister: () => {} }
1385
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmsignaturecontext_free(ptr, 1));
1386
+
1387
+ function addToExternrefTable0(obj) {
1388
+ const idx = wasm.__externref_table_alloc();
1389
+ wasm.__wbindgen_externrefs.set(idx, obj);
1390
+ return idx;
1391
+ }
1392
+
1393
+ function debugString(val) {
1394
+ // primitive types
1395
+ const type = typeof val;
1396
+ if (type == 'number' || type == 'boolean' || val == null) {
1397
+ return `${val}`;
1398
+ }
1399
+ if (type == 'string') {
1400
+ return `"${val}"`;
1401
+ }
1402
+ if (type == 'symbol') {
1403
+ const description = val.description;
1404
+ if (description == null) {
1405
+ return 'Symbol';
1406
+ } else {
1407
+ return `Symbol(${description})`;
1408
+ }
1409
+ }
1410
+ if (type == 'function') {
1411
+ const name = val.name;
1412
+ if (typeof name == 'string' && name.length > 0) {
1413
+ return `Function(${name})`;
1414
+ } else {
1415
+ return 'Function';
1416
+ }
1417
+ }
1418
+ // objects
1419
+ if (Array.isArray(val)) {
1420
+ const length = val.length;
1421
+ let debug = '[';
1422
+ if (length > 0) {
1423
+ debug += debugString(val[0]);
1424
+ }
1425
+ for(let i = 1; i < length; i++) {
1426
+ debug += ', ' + debugString(val[i]);
1427
+ }
1428
+ debug += ']';
1429
+ return debug;
1430
+ }
1431
+ // Test for built-in
1432
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1433
+ let className;
1434
+ if (builtInMatches && builtInMatches.length > 1) {
1435
+ className = builtInMatches[1];
1436
+ } else {
1437
+ // Failed to match the standard '[object ClassName]'
1438
+ return toString.call(val);
1439
+ }
1440
+ if (className == 'Object') {
1441
+ // we're a user defined class or Object
1442
+ // JSON.stringify avoids problems with cycles, and is generally much
1443
+ // easier than looping through ownProperties of `val`.
1444
+ try {
1445
+ return 'Object(' + JSON.stringify(val) + ')';
1446
+ } catch (_) {
1447
+ return 'Object';
1448
+ }
1449
+ }
1450
+ // errors
1451
+ if (val instanceof Error) {
1452
+ return `${val.name}: ${val.message}\n${val.stack}`;
1453
+ }
1454
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1455
+ return className;
1456
+ }
1457
+
1458
+ function getArrayU8FromWasm0(ptr, len) {
1459
+ ptr = ptr >>> 0;
1460
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1461
+ }
1462
+
1463
+ let cachedDataViewMemory0 = null;
1464
+ function getDataViewMemory0() {
1465
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1466
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1467
+ }
1468
+ return cachedDataViewMemory0;
1469
+ }
1470
+
1471
+ function getStringFromWasm0(ptr, len) {
1472
+ return decodeText(ptr >>> 0, len);
1473
+ }
1474
+
1475
+ let cachedUint8ArrayMemory0 = null;
1476
+ function getUint8ArrayMemory0() {
1477
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1478
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1479
+ }
1480
+ return cachedUint8ArrayMemory0;
1481
+ }
1482
+
1483
+ function handleError(f, args) {
1484
+ try {
1485
+ return f.apply(this, args);
1486
+ } catch (e) {
1487
+ const idx = addToExternrefTable0(e);
1488
+ wasm.__wbindgen_exn_store(idx);
1489
+ }
1490
+ }
1491
+
1492
+ function isLikeNone(x) {
1493
+ return x === undefined || x === null;
1494
+ }
1495
+
1496
+ function passArray8ToWasm0(arg, malloc) {
1497
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1498
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1499
+ WASM_VECTOR_LEN = arg.length;
1500
+ return ptr;
1501
+ }
1502
+
1503
+ function passStringToWasm0(arg, malloc, realloc) {
1504
+ if (realloc === undefined) {
1505
+ const buf = cachedTextEncoder.encode(arg);
1506
+ const ptr = malloc(buf.length, 1) >>> 0;
1507
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1508
+ WASM_VECTOR_LEN = buf.length;
1509
+ return ptr;
1510
+ }
1511
+
1512
+ let len = arg.length;
1513
+ let ptr = malloc(len, 1) >>> 0;
1514
+
1515
+ const mem = getUint8ArrayMemory0();
1516
+
1517
+ let offset = 0;
1518
+
1519
+ for (; offset < len; offset++) {
1520
+ const code = arg.charCodeAt(offset);
1521
+ if (code > 0x7F) break;
1522
+ mem[ptr + offset] = code;
1523
+ }
1524
+ if (offset !== len) {
1525
+ if (offset !== 0) {
1526
+ arg = arg.slice(offset);
1527
+ }
1528
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1529
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1530
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1531
+
1532
+ offset += ret.written;
1533
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1534
+ }
1535
+
1536
+ WASM_VECTOR_LEN = offset;
1537
+ return ptr;
1538
+ }
1539
+
1540
+ function takeFromExternrefTable0(idx) {
1541
+ const value = wasm.__wbindgen_externrefs.get(idx);
1542
+ wasm.__externref_table_dealloc(idx);
1543
+ return value;
1544
+ }
1545
+
1546
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1547
+ cachedTextDecoder.decode();
1548
+ function decodeText(ptr, len) {
1549
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1550
+ }
1551
+
1552
+ const cachedTextEncoder = new TextEncoder();
1553
+
1554
+ if (!('encodeInto' in cachedTextEncoder)) {
1555
+ cachedTextEncoder.encodeInto = function (arg, view) {
1556
+ const buf = cachedTextEncoder.encode(arg);
1557
+ view.set(buf);
1558
+ return {
1559
+ read: arg.length,
1560
+ written: buf.length
1561
+ };
1562
+ };
1563
+ }
1564
+
1565
+ let WASM_VECTOR_LEN = 0;
1566
+
1567
+ const wasmPath = `${__dirname}/lib_q_prf_bg.wasm`;
1568
+ const wasmBytes = require('fs').readFileSync(wasmPath);
1569
+ const wasmModule = new WebAssembly.Module(wasmBytes);
1570
+ let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
1571
+ let wasm = wasmInstance.exports;
1572
+ wasm.__wbindgen_start();