tkms 0.9.0-rc11 → 0.9.0-rc21
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/kms_lib.d.ts +266 -301
- package/kms_lib.js +696 -916
- package/kms_lib_bg.wasm +0 -0
- package/package.json +1 -1
package/kms_lib.js
CHANGED
|
@@ -18,48 +18,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
18
18
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const heap = new Array(128).fill(undefined);
|
|
22
|
-
|
|
23
|
-
heap.push(undefined, null, true, false);
|
|
24
|
-
|
|
25
|
-
let heap_next = heap.length;
|
|
26
|
-
|
|
27
|
-
function addHeapObject(obj) {
|
|
28
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
29
|
-
const idx = heap_next;
|
|
30
|
-
heap_next = heap[idx];
|
|
31
|
-
|
|
32
|
-
heap[idx] = obj;
|
|
33
|
-
return idx;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function getObject(idx) { return heap[idx]; }
|
|
37
|
-
|
|
38
|
-
function dropObject(idx) {
|
|
39
|
-
if (idx < 132) return;
|
|
40
|
-
heap[idx] = heap_next;
|
|
41
|
-
heap_next = idx;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function takeObject(idx) {
|
|
45
|
-
const ret = getObject(idx);
|
|
46
|
-
dropObject(idx);
|
|
47
|
-
return ret;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function isLikeNone(x) {
|
|
51
|
-
return x === undefined || x === null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let cachedDataViewMemory0 = null;
|
|
55
|
-
|
|
56
|
-
function getDataViewMemory0() {
|
|
57
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
58
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
59
|
-
}
|
|
60
|
-
return cachedDataViewMemory0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
21
|
let WASM_VECTOR_LEN = 0;
|
|
64
22
|
|
|
65
23
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -116,6 +74,19 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
116
74
|
return ptr;
|
|
117
75
|
}
|
|
118
76
|
|
|
77
|
+
function isLikeNone(x) {
|
|
78
|
+
return x === undefined || x === null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let cachedDataViewMemory0 = null;
|
|
82
|
+
|
|
83
|
+
function getDataViewMemory0() {
|
|
84
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
85
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
86
|
+
}
|
|
87
|
+
return cachedDataViewMemory0;
|
|
88
|
+
}
|
|
89
|
+
|
|
119
90
|
function debugString(val) {
|
|
120
91
|
// primitive types
|
|
121
92
|
const type = typeof val;
|
|
@@ -200,137 +171,108 @@ function _assertClass(instance, klass) {
|
|
|
200
171
|
return instance.ptr;
|
|
201
172
|
}
|
|
202
173
|
/**
|
|
203
|
-
* @param {PublicSigKey} pk
|
|
204
|
-
* @returns {Uint8Array}
|
|
205
|
-
*/
|
|
174
|
+
* @param {PublicSigKey} pk
|
|
175
|
+
* @returns {Uint8Array}
|
|
176
|
+
*/
|
|
206
177
|
export function public_sig_key_to_u8vec(pk) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
213
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
214
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
215
|
-
return v1;
|
|
216
|
-
} finally {
|
|
217
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
218
|
-
}
|
|
178
|
+
_assertClass(pk, PublicSigKey);
|
|
179
|
+
const ret = wasm.public_sig_key_to_u8vec(pk.__wbg_ptr);
|
|
180
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
181
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
182
|
+
return v1;
|
|
219
183
|
}
|
|
220
184
|
|
|
185
|
+
function takeFromExternrefTable0(idx) {
|
|
186
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
187
|
+
wasm.__externref_table_dealloc(idx);
|
|
188
|
+
return value;
|
|
189
|
+
}
|
|
221
190
|
/**
|
|
222
|
-
* @param {Uint8Array} v
|
|
223
|
-
* @returns {PublicSigKey}
|
|
224
|
-
*/
|
|
191
|
+
* @param {Uint8Array} v
|
|
192
|
+
* @returns {PublicSigKey}
|
|
193
|
+
*/
|
|
225
194
|
export function u8vec_to_public_sig_key(v) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
232
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
233
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
234
|
-
if (r2) {
|
|
235
|
-
throw takeObject(r1);
|
|
236
|
-
}
|
|
237
|
-
return PublicSigKey.__wrap(r0);
|
|
238
|
-
} finally {
|
|
239
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
195
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
196
|
+
const len0 = WASM_VECTOR_LEN;
|
|
197
|
+
const ret = wasm.u8vec_to_public_sig_key(ptr0, len0);
|
|
198
|
+
if (ret[2]) {
|
|
199
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
240
200
|
}
|
|
201
|
+
return PublicSigKey.__wrap(ret[0]);
|
|
241
202
|
}
|
|
242
203
|
|
|
243
204
|
/**
|
|
244
|
-
* @param {PrivateSigKey} sk
|
|
245
|
-
* @returns {Uint8Array}
|
|
246
|
-
*/
|
|
205
|
+
* @param {PrivateSigKey} sk
|
|
206
|
+
* @returns {Uint8Array}
|
|
207
|
+
*/
|
|
247
208
|
export function private_sig_key_to_u8vec(sk) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (r3) {
|
|
257
|
-
throw takeObject(r2);
|
|
258
|
-
}
|
|
259
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
260
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
261
|
-
return v1;
|
|
262
|
-
} finally {
|
|
263
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
264
|
-
}
|
|
209
|
+
_assertClass(sk, PrivateSigKey);
|
|
210
|
+
const ret = wasm.private_sig_key_to_u8vec(sk.__wbg_ptr);
|
|
211
|
+
if (ret[3]) {
|
|
212
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
213
|
+
}
|
|
214
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
215
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
216
|
+
return v1;
|
|
265
217
|
}
|
|
266
218
|
|
|
267
219
|
/**
|
|
268
|
-
* @param {Uint8Array} v
|
|
269
|
-
* @returns {PrivateSigKey}
|
|
270
|
-
*/
|
|
220
|
+
* @param {Uint8Array} v
|
|
221
|
+
* @returns {PrivateSigKey}
|
|
222
|
+
*/
|
|
271
223
|
export function u8vec_to_private_sig_key(v) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
278
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
279
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
280
|
-
if (r2) {
|
|
281
|
-
throw takeObject(r1);
|
|
282
|
-
}
|
|
283
|
-
return PrivateSigKey.__wrap(r0);
|
|
284
|
-
} finally {
|
|
285
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
224
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
225
|
+
const len0 = WASM_VECTOR_LEN;
|
|
226
|
+
const ret = wasm.u8vec_to_private_sig_key(ptr0, len0);
|
|
227
|
+
if (ret[2]) {
|
|
228
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
286
229
|
}
|
|
230
|
+
return PrivateSigKey.__wrap(ret[0]);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function addToExternrefTable0(obj) {
|
|
234
|
+
const idx = wasm.__externref_table_alloc();
|
|
235
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
236
|
+
return idx;
|
|
287
237
|
}
|
|
288
238
|
|
|
289
239
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
290
240
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
291
241
|
const mem = getDataViewMemory0();
|
|
292
242
|
for (let i = 0; i < array.length; i++) {
|
|
293
|
-
mem.setUint32(ptr + 4 * i,
|
|
243
|
+
mem.setUint32(ptr + 4 * i, addToExternrefTable0(array[i]), true);
|
|
294
244
|
}
|
|
295
245
|
WASM_VECTOR_LEN = array.length;
|
|
296
246
|
return ptr;
|
|
297
247
|
}
|
|
298
248
|
/**
|
|
299
|
-
* Instantiate a new client.
|
|
300
|
-
*
|
|
301
|
-
* * `
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
* * `client_address_hex` - the client (wallet) address in hex,
|
|
305
|
-
* must be prefixed with "0x".
|
|
306
|
-
*
|
|
307
|
-
* * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
|
|
308
|
-
* The "default" parameter choice is selected if no matching string is found.
|
|
309
|
-
* @param {(string)[]} server_addrs
|
|
310
|
-
* @param {string} client_address_hex
|
|
311
|
-
* @param {string} param_choice
|
|
312
|
-
* @returns {Client}
|
|
313
|
-
*/
|
|
249
|
+
* Instantiate a new client.
|
|
250
|
+
*
|
|
251
|
+
* * `server_addrs` - a list of KMS server EIP-55 addresses,
|
|
252
|
+
* must be prefixed with "0x".
|
|
253
|
+
*
|
|
254
|
+
* * `client_address_hex` - the client (wallet) address in hex,
|
|
255
|
+
* must be prefixed with "0x".
|
|
256
|
+
*
|
|
257
|
+
* * `param_choice` - the parameter choice, which can be either `"test"` or `"default"`.
|
|
258
|
+
* The "default" parameter choice is selected if no matching string is found.
|
|
259
|
+
* @param {(string)[]} server_addrs
|
|
260
|
+
* @param {string} client_address_hex
|
|
261
|
+
* @param {string} param_choice
|
|
262
|
+
* @returns {Client}
|
|
263
|
+
*/
|
|
314
264
|
export function new_client(server_addrs, client_address_hex, param_choice) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
327
|
-
if (r2) {
|
|
328
|
-
throw takeObject(r1);
|
|
329
|
-
}
|
|
330
|
-
return Client.__wrap(r0);
|
|
331
|
-
} finally {
|
|
332
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
333
|
-
}
|
|
265
|
+
const ptr0 = passArrayJsValueToWasm0(server_addrs, wasm.__wbindgen_malloc);
|
|
266
|
+
const len0 = WASM_VECTOR_LEN;
|
|
267
|
+
const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
268
|
+
const len1 = WASM_VECTOR_LEN;
|
|
269
|
+
const ptr2 = passStringToWasm0(param_choice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
270
|
+
const len2 = WASM_VECTOR_LEN;
|
|
271
|
+
const ret = wasm.new_client(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
272
|
+
if (ret[2]) {
|
|
273
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
274
|
+
}
|
|
275
|
+
return Client.__wrap(ret[0]);
|
|
334
276
|
}
|
|
335
277
|
|
|
336
278
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
@@ -338,33 +280,27 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
338
280
|
const mem = getDataViewMemory0();
|
|
339
281
|
const result = [];
|
|
340
282
|
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
341
|
-
result.push(
|
|
283
|
+
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
342
284
|
}
|
|
285
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
343
286
|
return result;
|
|
344
287
|
}
|
|
345
288
|
/**
|
|
346
|
-
* @param {Client} client
|
|
347
|
-
* @returns {(string)[]}
|
|
348
|
-
*/
|
|
289
|
+
* @param {Client} client
|
|
290
|
+
* @returns {(string)[]}
|
|
291
|
+
*/
|
|
349
292
|
export function get_server_addrs(client) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
356
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
357
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
358
|
-
return v1;
|
|
359
|
-
} finally {
|
|
360
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
361
|
-
}
|
|
293
|
+
_assertClass(client, Client);
|
|
294
|
+
const ret = wasm.get_server_addrs(client.__wbg_ptr);
|
|
295
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
296
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
297
|
+
return v1;
|
|
362
298
|
}
|
|
363
299
|
|
|
364
300
|
/**
|
|
365
|
-
* @param {Client} client
|
|
366
|
-
* @returns {PrivateSigKey | undefined}
|
|
367
|
-
*/
|
|
301
|
+
* @param {Client} client
|
|
302
|
+
* @returns {PrivateSigKey | undefined}
|
|
303
|
+
*/
|
|
368
304
|
export function get_client_secret_key(client) {
|
|
369
305
|
_assertClass(client, Client);
|
|
370
306
|
const ret = wasm.get_client_secret_key(client.__wbg_ptr);
|
|
@@ -372,39 +308,35 @@ export function get_client_secret_key(client) {
|
|
|
372
308
|
}
|
|
373
309
|
|
|
374
310
|
/**
|
|
375
|
-
* @param {Client} client
|
|
376
|
-
* @returns {string}
|
|
377
|
-
*/
|
|
311
|
+
* @param {Client} client
|
|
312
|
+
* @returns {string}
|
|
313
|
+
*/
|
|
378
314
|
export function get_client_address(client) {
|
|
379
315
|
let deferred1_0;
|
|
380
316
|
let deferred1_1;
|
|
381
317
|
try {
|
|
382
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
383
318
|
_assertClass(client, Client);
|
|
384
|
-
wasm.get_client_address(
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
deferred1_1 = r1;
|
|
389
|
-
return getStringFromWasm0(r0, r1);
|
|
319
|
+
const ret = wasm.get_client_address(client.__wbg_ptr);
|
|
320
|
+
deferred1_0 = ret[0];
|
|
321
|
+
deferred1_1 = ret[1];
|
|
322
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
390
323
|
} finally {
|
|
391
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
392
324
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
393
325
|
}
|
|
394
326
|
}
|
|
395
327
|
|
|
396
328
|
/**
|
|
397
|
-
* @returns {PrivateEncKey}
|
|
398
|
-
*/
|
|
329
|
+
* @returns {PrivateEncKey}
|
|
330
|
+
*/
|
|
399
331
|
export function cryptobox_keygen() {
|
|
400
332
|
const ret = wasm.cryptobox_keygen();
|
|
401
333
|
return PrivateEncKey.__wrap(ret);
|
|
402
334
|
}
|
|
403
335
|
|
|
404
336
|
/**
|
|
405
|
-
* @param {PrivateEncKey} sk
|
|
406
|
-
* @returns {PublicEncKey}
|
|
407
|
-
*/
|
|
337
|
+
* @param {PrivateEncKey} sk
|
|
338
|
+
* @returns {PublicEncKey}
|
|
339
|
+
*/
|
|
408
340
|
export function cryptobox_get_pk(sk) {
|
|
409
341
|
_assertClass(sk, PrivateEncKey);
|
|
410
342
|
const ret = wasm.cryptobox_get_pk(sk.__wbg_ptr);
|
|
@@ -412,103 +344,69 @@ export function cryptobox_get_pk(sk) {
|
|
|
412
344
|
}
|
|
413
345
|
|
|
414
346
|
/**
|
|
415
|
-
* @param {PublicEncKey} pk
|
|
416
|
-
* @returns {Uint8Array}
|
|
417
|
-
*/
|
|
347
|
+
* @param {PublicEncKey} pk
|
|
348
|
+
* @returns {Uint8Array}
|
|
349
|
+
*/
|
|
418
350
|
export function cryptobox_pk_to_u8vec(pk) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
if (r3) {
|
|
428
|
-
throw takeObject(r2);
|
|
429
|
-
}
|
|
430
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
431
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
432
|
-
return v1;
|
|
433
|
-
} finally {
|
|
434
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
435
|
-
}
|
|
351
|
+
_assertClass(pk, PublicEncKey);
|
|
352
|
+
const ret = wasm.cryptobox_pk_to_u8vec(pk.__wbg_ptr);
|
|
353
|
+
if (ret[3]) {
|
|
354
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
355
|
+
}
|
|
356
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
357
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
358
|
+
return v1;
|
|
436
359
|
}
|
|
437
360
|
|
|
438
361
|
/**
|
|
439
|
-
* @param {PrivateEncKey} sk
|
|
440
|
-
* @returns {Uint8Array}
|
|
441
|
-
*/
|
|
362
|
+
* @param {PrivateEncKey} sk
|
|
363
|
+
* @returns {Uint8Array}
|
|
364
|
+
*/
|
|
442
365
|
export function cryptobox_sk_to_u8vec(sk) {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
448
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
449
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
450
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
451
|
-
if (r3) {
|
|
452
|
-
throw takeObject(r2);
|
|
453
|
-
}
|
|
454
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
455
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
456
|
-
return v1;
|
|
457
|
-
} finally {
|
|
458
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
366
|
+
_assertClass(sk, PrivateEncKey);
|
|
367
|
+
const ret = wasm.cryptobox_sk_to_u8vec(sk.__wbg_ptr);
|
|
368
|
+
if (ret[3]) {
|
|
369
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
459
370
|
}
|
|
371
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
372
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
373
|
+
return v1;
|
|
460
374
|
}
|
|
461
375
|
|
|
462
376
|
/**
|
|
463
|
-
* @param {Uint8Array} v
|
|
464
|
-
* @returns {PublicEncKey}
|
|
465
|
-
*/
|
|
377
|
+
* @param {Uint8Array} v
|
|
378
|
+
* @returns {PublicEncKey}
|
|
379
|
+
*/
|
|
466
380
|
export function u8vec_to_cryptobox_pk(v) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
473
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
474
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
475
|
-
if (r2) {
|
|
476
|
-
throw takeObject(r1);
|
|
477
|
-
}
|
|
478
|
-
return PublicEncKey.__wrap(r0);
|
|
479
|
-
} finally {
|
|
480
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
381
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
382
|
+
const len0 = WASM_VECTOR_LEN;
|
|
383
|
+
const ret = wasm.u8vec_to_cryptobox_pk(ptr0, len0);
|
|
384
|
+
if (ret[2]) {
|
|
385
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
481
386
|
}
|
|
387
|
+
return PublicEncKey.__wrap(ret[0]);
|
|
482
388
|
}
|
|
483
389
|
|
|
484
390
|
/**
|
|
485
|
-
* @param {Uint8Array} v
|
|
486
|
-
* @returns {PrivateEncKey}
|
|
487
|
-
*/
|
|
391
|
+
* @param {Uint8Array} v
|
|
392
|
+
* @returns {PrivateEncKey}
|
|
393
|
+
*/
|
|
488
394
|
export function u8vec_to_cryptobox_sk(v) {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
495
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
496
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
497
|
-
if (r2) {
|
|
498
|
-
throw takeObject(r1);
|
|
499
|
-
}
|
|
500
|
-
return PrivateEncKey.__wrap(r0);
|
|
501
|
-
} finally {
|
|
502
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
395
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
396
|
+
const len0 = WASM_VECTOR_LEN;
|
|
397
|
+
const ret = wasm.u8vec_to_cryptobox_sk(ptr0, len0);
|
|
398
|
+
if (ret[2]) {
|
|
399
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
503
400
|
}
|
|
401
|
+
return PrivateEncKey.__wrap(ret[0]);
|
|
504
402
|
}
|
|
505
403
|
|
|
506
404
|
/**
|
|
507
|
-
* @param {Uint8Array} msg
|
|
508
|
-
* @param {PublicEncKey} their_pk
|
|
509
|
-
* @param {PrivateEncKey} my_sk
|
|
510
|
-
* @returns {CryptoBoxCt}
|
|
511
|
-
*/
|
|
405
|
+
* @param {Uint8Array} msg
|
|
406
|
+
* @param {PublicEncKey} their_pk
|
|
407
|
+
* @param {PrivateEncKey} my_sk
|
|
408
|
+
* @returns {CryptoBoxCt}
|
|
409
|
+
*/
|
|
512
410
|
export function cryptobox_encrypt(msg, their_pk, my_sk) {
|
|
513
411
|
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
514
412
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -519,201 +417,178 @@ export function cryptobox_encrypt(msg, their_pk, my_sk) {
|
|
|
519
417
|
}
|
|
520
418
|
|
|
521
419
|
/**
|
|
522
|
-
* @param {CryptoBoxCt} ct
|
|
523
|
-
* @param {PrivateEncKey} my_sk
|
|
524
|
-
* @param {PublicEncKey} their_pk
|
|
525
|
-
* @returns {Uint8Array}
|
|
526
|
-
*/
|
|
420
|
+
* @param {CryptoBoxCt} ct
|
|
421
|
+
* @param {PrivateEncKey} my_sk
|
|
422
|
+
* @param {PublicEncKey} their_pk
|
|
423
|
+
* @returns {Uint8Array}
|
|
424
|
+
*/
|
|
527
425
|
export function cryptobox_decrypt(ct, my_sk, their_pk) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
536
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
537
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
538
|
-
return v1;
|
|
539
|
-
} finally {
|
|
540
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
541
|
-
}
|
|
426
|
+
_assertClass(ct, CryptoBoxCt);
|
|
427
|
+
_assertClass(my_sk, PrivateEncKey);
|
|
428
|
+
_assertClass(their_pk, PublicEncKey);
|
|
429
|
+
const ret = wasm.cryptobox_decrypt(ct.__wbg_ptr, my_sk.__wbg_ptr, their_pk.__wbg_ptr);
|
|
430
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
431
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
432
|
+
return v1;
|
|
542
433
|
}
|
|
543
434
|
|
|
544
435
|
/**
|
|
545
|
-
* Process the reencryption response from JavaScript objects.
|
|
546
|
-
* The result is a byte array representing a plaintext of any length
|
|
547
|
-
*
|
|
548
|
-
|
|
549
|
-
*
|
|
550
|
-
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
577
|
-
* 0, 0, 0, 0, 0
|
|
578
|
-
*
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
|
|
596
|
-
*
|
|
597
|
-
|
|
598
|
-
*
|
|
599
|
-
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
* @param {
|
|
603
|
-
* @param {any}
|
|
604
|
-
* @param {any}
|
|
605
|
-
* @param {
|
|
606
|
-
* @param {
|
|
607
|
-
* @param {
|
|
608
|
-
* @
|
|
609
|
-
|
|
436
|
+
* Process the reencryption response from JavaScript objects.
|
|
437
|
+
* The returned result is a byte array representing a plaintext of any length,
|
|
438
|
+
* postprocessing is returned to turn it into an integer.
|
|
439
|
+
*
|
|
440
|
+
* * `client` - client that wants to perform reencryption.
|
|
441
|
+
*
|
|
442
|
+
* * `request` - the initial reencryption request JS object.
|
|
443
|
+
* It can be set to null if `verify` is false.
|
|
444
|
+
* Otherwise the caller needs to give the following JS object.
|
|
445
|
+
* Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
|
|
446
|
+
* ```
|
|
447
|
+
* {
|
|
448
|
+
* signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
|
|
449
|
+
* client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
|
|
450
|
+
* enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
|
|
451
|
+
* ciphertext_handle: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
|
|
452
|
+
* eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
|
|
453
|
+
* }
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* * `eip712_domain` - the EIP-712 domain JS object.
|
|
457
|
+
* It can be set to null if `verify` is false.
|
|
458
|
+
* Otherwise the caller needs to give the following JS object.
|
|
459
|
+
* Note that `salt` is optional and `verifying_contract` follows EIP-55,
|
|
460
|
+
* additionally, `chain_id` is an array of u8.
|
|
461
|
+
* ```
|
|
462
|
+
* {
|
|
463
|
+
* name: 'Authorization token',
|
|
464
|
+
* version: '1',
|
|
465
|
+
* chain_id: [
|
|
466
|
+
* 70, 31, 0, 0, 0, 0, 0, 0, 0,
|
|
467
|
+
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
468
|
+
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
469
|
+
* 0, 0, 0, 0, 0
|
|
470
|
+
* ],
|
|
471
|
+
* verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657',
|
|
472
|
+
* salt: []
|
|
473
|
+
* }
|
|
474
|
+
* ```
|
|
475
|
+
*
|
|
476
|
+
* * `agg_resp` - the response JS object from the gateway.
|
|
477
|
+
* It has two fields like so, both are hex encoded byte arrays.
|
|
478
|
+
* ```
|
|
479
|
+
* [
|
|
480
|
+
* {
|
|
481
|
+
* signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
|
|
482
|
+
* payload: '0100000029...'
|
|
483
|
+
* }
|
|
484
|
+
* ]
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
487
|
+
* * `enc_pk` - The ephemeral public key.
|
|
488
|
+
*
|
|
489
|
+
* * `enc_sk` - The ephemeral secret key.
|
|
490
|
+
*
|
|
491
|
+
* * `verify` - Whether to perform signature verification for the response.
|
|
492
|
+
* It is insecure if `verify = false`!
|
|
493
|
+
* @param {Client} client
|
|
494
|
+
* @param {any} request
|
|
495
|
+
* @param {any} eip712_domain
|
|
496
|
+
* @param {any} agg_resp
|
|
497
|
+
* @param {PublicEncKey} enc_pk
|
|
498
|
+
* @param {PrivateEncKey} enc_sk
|
|
499
|
+
* @param {boolean} verify
|
|
500
|
+
* @returns {Uint8Array}
|
|
501
|
+
*/
|
|
610
502
|
export function process_reencryption_resp_from_js(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
if (r3) {
|
|
622
|
-
throw takeObject(r2);
|
|
623
|
-
}
|
|
624
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
625
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
626
|
-
return v1;
|
|
627
|
-
} finally {
|
|
628
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
629
|
-
}
|
|
503
|
+
_assertClass(client, Client);
|
|
504
|
+
_assertClass(enc_pk, PublicEncKey);
|
|
505
|
+
_assertClass(enc_sk, PrivateEncKey);
|
|
506
|
+
const ret = wasm.process_reencryption_resp_from_js(client.__wbg_ptr, request, eip712_domain, agg_resp, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
507
|
+
if (ret[3]) {
|
|
508
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
509
|
+
}
|
|
510
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
511
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
512
|
+
return v1;
|
|
630
513
|
}
|
|
631
514
|
|
|
632
515
|
/**
|
|
633
|
-
* Process the reencryption response from Rust objects.
|
|
634
|
-
* Consider using [process_reencryption_resp_from_js]
|
|
635
|
-
* when using the JS API.
|
|
636
|
-
* The result is a byte array representing a plaintext of any length.
|
|
637
|
-
*
|
|
638
|
-
* * `client` - client that wants to perform reencryption.
|
|
639
|
-
*
|
|
640
|
-
* * `request` - the initial reencryption request.
|
|
641
|
-
* Must be given if `verify` is true.
|
|
642
|
-
*
|
|
643
|
-
* * `eip712_domain` - the EIP-712 domain.
|
|
644
|
-
* Must be given if `verify` is true.
|
|
645
|
-
*
|
|
646
|
-
* * `agg_resp` - the vector of reencryption responses.
|
|
647
|
-
*
|
|
648
|
-
* * `enc_pk` - The ephemeral public key.
|
|
649
|
-
*
|
|
650
|
-
* * `enc_sk` - The ephemeral secret key.
|
|
651
|
-
*
|
|
652
|
-
* * `verify` - Whether to perform signature verification for the response.
|
|
653
|
-
* It is insecure if `verify = false`!
|
|
654
|
-
* @param {Client} client
|
|
655
|
-
* @param {ParsedReencryptionRequest | undefined} request
|
|
656
|
-
* @param {Eip712DomainMsg | undefined} eip712_domain
|
|
657
|
-
* @param {(ReencryptionResponse)[]} agg_resp
|
|
658
|
-
* @param {PublicEncKey} enc_pk
|
|
659
|
-
* @param {PrivateEncKey} enc_sk
|
|
660
|
-
* @param {boolean} verify
|
|
661
|
-
* @returns {Uint8Array}
|
|
662
|
-
*/
|
|
516
|
+
* Process the reencryption response from Rust objects.
|
|
517
|
+
* Consider using [process_reencryption_resp_from_js]
|
|
518
|
+
* when using the JS API.
|
|
519
|
+
* The result is a byte array representing a plaintext of any length.
|
|
520
|
+
*
|
|
521
|
+
* * `client` - client that wants to perform reencryption.
|
|
522
|
+
*
|
|
523
|
+
* * `request` - the initial reencryption request.
|
|
524
|
+
* Must be given if `verify` is true.
|
|
525
|
+
*
|
|
526
|
+
* * `eip712_domain` - the EIP-712 domain.
|
|
527
|
+
* Must be given if `verify` is true.
|
|
528
|
+
*
|
|
529
|
+
* * `agg_resp` - the vector of reencryption responses.
|
|
530
|
+
*
|
|
531
|
+
* * `enc_pk` - The ephemeral public key.
|
|
532
|
+
*
|
|
533
|
+
* * `enc_sk` - The ephemeral secret key.
|
|
534
|
+
*
|
|
535
|
+
* * `verify` - Whether to perform signature verification for the response.
|
|
536
|
+
* It is insecure if `verify = false`!
|
|
537
|
+
* @param {Client} client
|
|
538
|
+
* @param {ParsedReencryptionRequest | undefined} request
|
|
539
|
+
* @param {Eip712DomainMsg | undefined} eip712_domain
|
|
540
|
+
* @param {(ReencryptionResponse)[]} agg_resp
|
|
541
|
+
* @param {PublicEncKey} enc_pk
|
|
542
|
+
* @param {PrivateEncKey} enc_sk
|
|
543
|
+
* @param {boolean} verify
|
|
544
|
+
* @returns {Uint8Array}
|
|
545
|
+
*/
|
|
663
546
|
export function process_reencryption_resp(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
if (r3) {
|
|
687
|
-
throw takeObject(r2);
|
|
688
|
-
}
|
|
689
|
-
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
690
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
691
|
-
return v4;
|
|
692
|
-
} finally {
|
|
693
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
694
|
-
}
|
|
547
|
+
_assertClass(client, Client);
|
|
548
|
+
let ptr0 = 0;
|
|
549
|
+
if (!isLikeNone(request)) {
|
|
550
|
+
_assertClass(request, ParsedReencryptionRequest);
|
|
551
|
+
ptr0 = request.__destroy_into_raw();
|
|
552
|
+
}
|
|
553
|
+
let ptr1 = 0;
|
|
554
|
+
if (!isLikeNone(eip712_domain)) {
|
|
555
|
+
_assertClass(eip712_domain, Eip712DomainMsg);
|
|
556
|
+
ptr1 = eip712_domain.__destroy_into_raw();
|
|
557
|
+
}
|
|
558
|
+
const ptr2 = passArrayJsValueToWasm0(agg_resp, wasm.__wbindgen_malloc);
|
|
559
|
+
const len2 = WASM_VECTOR_LEN;
|
|
560
|
+
_assertClass(enc_pk, PublicEncKey);
|
|
561
|
+
_assertClass(enc_sk, PrivateEncKey);
|
|
562
|
+
const ret = wasm.process_reencryption_resp(client.__wbg_ptr, ptr0, ptr1, ptr2, len2, enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
563
|
+
if (ret[3]) {
|
|
564
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
565
|
+
}
|
|
566
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
567
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
568
|
+
return v4;
|
|
695
569
|
}
|
|
696
570
|
|
|
697
571
|
function handleError(f, args) {
|
|
698
572
|
try {
|
|
699
573
|
return f.apply(this, args);
|
|
700
574
|
} catch (e) {
|
|
701
|
-
|
|
575
|
+
const idx = addToExternrefTable0(e);
|
|
576
|
+
wasm.__wbindgen_exn_store(idx);
|
|
702
577
|
}
|
|
703
578
|
}
|
|
704
579
|
/**
|
|
705
|
-
* The plaintext types that can be encrypted in a fhevm ciphertext.
|
|
706
|
-
*/
|
|
580
|
+
* The plaintext types that can be encrypted in a fhevm ciphertext.
|
|
581
|
+
*/
|
|
707
582
|
export const FheType = Object.freeze({ Ebool:0,"0":"Ebool",Euint4:1,"1":"Euint4",Euint8:2,"2":"Euint8",Euint16:3,"3":"Euint16",Euint32:4,"4":"Euint32",Euint64:5,"5":"Euint64",Euint128:6,"6":"Euint128",Euint160:7,"7":"Euint160",Euint256:8,"8":"Euint256",Euint512:9,"9":"Euint512",Euint1024:10,"10":"Euint1024",Euint2048:11,"11":"Euint2048", });
|
|
708
583
|
|
|
709
584
|
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
710
585
|
? { register: () => {}, unregister: () => {} }
|
|
711
586
|
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
712
587
|
/**
|
|
713
|
-
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
714
|
-
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
715
|
-
* distributed across the aggregator/proxy and smart contracts.
|
|
716
|
-
*/
|
|
588
|
+
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
589
|
+
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
590
|
+
* distributed across the aggregator/proxy and smart contracts.
|
|
591
|
+
*/
|
|
717
592
|
export class Client {
|
|
718
593
|
|
|
719
594
|
static __wrap(ptr) {
|
|
@@ -740,8 +615,7 @@ export class Client {
|
|
|
740
615
|
const CryptoBoxCtFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
741
616
|
? { register: () => {}, unregister: () => {} }
|
|
742
617
|
: new FinalizationRegistry(ptr => wasm.__wbg_cryptoboxct_free(ptr >>> 0, 1));
|
|
743
|
-
|
|
744
|
-
*/
|
|
618
|
+
|
|
745
619
|
export class CryptoBoxCt {
|
|
746
620
|
|
|
747
621
|
static __wrap(ptr) {
|
|
@@ -769,10 +643,10 @@ const Eip712DomainMsgFinalization = (typeof FinalizationRegistry === 'undefined'
|
|
|
769
643
|
? { register: () => {}, unregister: () => {} }
|
|
770
644
|
: new FinalizationRegistry(ptr => wasm.__wbg_eip712domainmsg_free(ptr >>> 0, 1));
|
|
771
645
|
/**
|
|
772
|
-
* <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
|
|
773
|
-
* eventually chain_id, verifying_contract and salt will be parsed in to
|
|
774
|
-
* solidity types
|
|
775
|
-
*/
|
|
646
|
+
* <https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator>
|
|
647
|
+
* eventually chain_id, verifying_contract and salt will be parsed in to
|
|
648
|
+
* solidity types
|
|
649
|
+
*/
|
|
776
650
|
export class Eip712DomainMsg {
|
|
777
651
|
|
|
778
652
|
static __wrap(ptr) {
|
|
@@ -795,132 +669,109 @@ export class Eip712DomainMsg {
|
|
|
795
669
|
wasm.__wbg_eip712domainmsg_free(ptr, 0);
|
|
796
670
|
}
|
|
797
671
|
/**
|
|
798
|
-
|
|
799
|
-
|
|
672
|
+
* @returns {string}
|
|
673
|
+
*/
|
|
800
674
|
get name() {
|
|
801
675
|
let deferred1_0;
|
|
802
676
|
let deferred1_1;
|
|
803
677
|
try {
|
|
804
|
-
const
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
deferred1_0 = r0;
|
|
809
|
-
deferred1_1 = r1;
|
|
810
|
-
return getStringFromWasm0(r0, r1);
|
|
678
|
+
const ret = wasm.__wbg_get_eip712domainmsg_name(this.__wbg_ptr);
|
|
679
|
+
deferred1_0 = ret[0];
|
|
680
|
+
deferred1_1 = ret[1];
|
|
681
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
811
682
|
} finally {
|
|
812
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
813
683
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
814
684
|
}
|
|
815
685
|
}
|
|
816
686
|
/**
|
|
817
|
-
|
|
818
|
-
|
|
687
|
+
* @param {string} arg0
|
|
688
|
+
*/
|
|
819
689
|
set name(arg0) {
|
|
820
690
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
821
691
|
const len0 = WASM_VECTOR_LEN;
|
|
822
692
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
823
693
|
}
|
|
824
694
|
/**
|
|
825
|
-
|
|
826
|
-
|
|
695
|
+
* @returns {string}
|
|
696
|
+
*/
|
|
827
697
|
get version() {
|
|
828
698
|
let deferred1_0;
|
|
829
699
|
let deferred1_1;
|
|
830
700
|
try {
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
deferred1_0 = r0;
|
|
836
|
-
deferred1_1 = r1;
|
|
837
|
-
return getStringFromWasm0(r0, r1);
|
|
701
|
+
const ret = wasm.__wbg_get_eip712domainmsg_version(this.__wbg_ptr);
|
|
702
|
+
deferred1_0 = ret[0];
|
|
703
|
+
deferred1_1 = ret[1];
|
|
704
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
838
705
|
} finally {
|
|
839
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
840
706
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
841
707
|
}
|
|
842
708
|
}
|
|
843
709
|
/**
|
|
844
|
-
|
|
845
|
-
|
|
710
|
+
* @param {string} arg0
|
|
711
|
+
*/
|
|
846
712
|
set version(arg0) {
|
|
847
713
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
848
714
|
const len0 = WASM_VECTOR_LEN;
|
|
849
715
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
850
716
|
}
|
|
851
717
|
/**
|
|
852
|
-
|
|
853
|
-
|
|
718
|
+
* @returns {Uint8Array}
|
|
719
|
+
*/
|
|
854
720
|
get chain_id() {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
860
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
861
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
862
|
-
return v1;
|
|
863
|
-
} finally {
|
|
864
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
865
|
-
}
|
|
721
|
+
const ret = wasm.__wbg_get_eip712domainmsg_chain_id(this.__wbg_ptr);
|
|
722
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
723
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
724
|
+
return v1;
|
|
866
725
|
}
|
|
867
726
|
/**
|
|
868
|
-
|
|
869
|
-
|
|
727
|
+
* @param {Uint8Array} arg0
|
|
728
|
+
*/
|
|
870
729
|
set chain_id(arg0) {
|
|
871
730
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
872
731
|
const len0 = WASM_VECTOR_LEN;
|
|
873
732
|
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
874
733
|
}
|
|
875
734
|
/**
|
|
876
|
-
|
|
877
|
-
|
|
735
|
+
* @returns {string}
|
|
736
|
+
*/
|
|
878
737
|
get verifying_contract() {
|
|
879
738
|
let deferred1_0;
|
|
880
739
|
let deferred1_1;
|
|
881
740
|
try {
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
deferred1_0 = r0;
|
|
887
|
-
deferred1_1 = r1;
|
|
888
|
-
return getStringFromWasm0(r0, r1);
|
|
741
|
+
const ret = wasm.__wbg_get_eip712domainmsg_verifying_contract(this.__wbg_ptr);
|
|
742
|
+
deferred1_0 = ret[0];
|
|
743
|
+
deferred1_1 = ret[1];
|
|
744
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
889
745
|
} finally {
|
|
890
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
891
746
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
892
747
|
}
|
|
893
748
|
}
|
|
894
749
|
/**
|
|
895
|
-
|
|
896
|
-
|
|
750
|
+
* @param {string} arg0
|
|
751
|
+
*/
|
|
897
752
|
set verifying_contract(arg0) {
|
|
898
753
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
899
754
|
const len0 = WASM_VECTOR_LEN;
|
|
900
755
|
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
901
756
|
}
|
|
902
757
|
/**
|
|
903
|
-
|
|
904
|
-
|
|
758
|
+
* @returns {Uint8Array | undefined}
|
|
759
|
+
*/
|
|
905
760
|
get salt() {
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
912
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
913
|
-
return v1;
|
|
914
|
-
} finally {
|
|
915
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
761
|
+
const ret = wasm.__wbg_get_eip712domainmsg_salt(this.__wbg_ptr);
|
|
762
|
+
let v1;
|
|
763
|
+
if (ret[0] !== 0) {
|
|
764
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
765
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
916
766
|
}
|
|
767
|
+
return v1;
|
|
917
768
|
}
|
|
918
769
|
/**
|
|
919
|
-
|
|
920
|
-
|
|
770
|
+
* @param {Uint8Array | undefined} [arg0]
|
|
771
|
+
*/
|
|
921
772
|
set salt(arg0) {
|
|
922
|
-
|
|
923
|
-
|
|
773
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
774
|
+
var len0 = WASM_VECTOR_LEN;
|
|
924
775
|
wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
|
|
925
776
|
}
|
|
926
777
|
}
|
|
@@ -929,8 +780,8 @@ const ParsedReencryptionRequestFinalization = (typeof FinalizationRegistry === '
|
|
|
929
780
|
? { register: () => {}, unregister: () => {} }
|
|
930
781
|
: new FinalizationRegistry(ptr => wasm.__wbg_parsedreencryptionrequest_free(ptr >>> 0, 1));
|
|
931
782
|
/**
|
|
932
|
-
* Validity of this struct is not checked.
|
|
933
|
-
*/
|
|
783
|
+
* Validity of this struct is not checked.
|
|
784
|
+
*/
|
|
934
785
|
export class ParsedReencryptionRequest {
|
|
935
786
|
|
|
936
787
|
__destroy_into_raw() {
|
|
@@ -949,8 +800,7 @@ export class ParsedReencryptionRequest {
|
|
|
949
800
|
const PlaintextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
950
801
|
? { register: () => {}, unregister: () => {} }
|
|
951
802
|
: new FinalizationRegistry(ptr => wasm.__wbg_plaintext_free(ptr >>> 0, 1));
|
|
952
|
-
|
|
953
|
-
*/
|
|
803
|
+
|
|
954
804
|
export class Plaintext {
|
|
955
805
|
|
|
956
806
|
__destroy_into_raw() {
|
|
@@ -965,24 +815,17 @@ export class Plaintext {
|
|
|
965
815
|
wasm.__wbg_plaintext_free(ptr, 0);
|
|
966
816
|
}
|
|
967
817
|
/**
|
|
968
|
-
|
|
969
|
-
|
|
818
|
+
* @returns {Uint8Array}
|
|
819
|
+
*/
|
|
970
820
|
get bytes() {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
976
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
977
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
978
|
-
return v1;
|
|
979
|
-
} finally {
|
|
980
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
981
|
-
}
|
|
821
|
+
const ret = wasm.__wbg_get_plaintext_bytes(this.__wbg_ptr);
|
|
822
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
823
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
824
|
+
return v1;
|
|
982
825
|
}
|
|
983
826
|
/**
|
|
984
|
-
|
|
985
|
-
|
|
827
|
+
* @param {Uint8Array} arg0
|
|
828
|
+
*/
|
|
986
829
|
set bytes(arg0) {
|
|
987
830
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
988
831
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -993,8 +836,7 @@ export class Plaintext {
|
|
|
993
836
|
const PrivateEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
994
837
|
? { register: () => {}, unregister: () => {} }
|
|
995
838
|
: new FinalizationRegistry(ptr => wasm.__wbg_privateenckey_free(ptr >>> 0, 1));
|
|
996
|
-
|
|
997
|
-
*/
|
|
839
|
+
|
|
998
840
|
export class PrivateEncKey {
|
|
999
841
|
|
|
1000
842
|
static __wrap(ptr) {
|
|
@@ -1021,8 +863,7 @@ export class PrivateEncKey {
|
|
|
1021
863
|
const PrivateSigKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1022
864
|
? { register: () => {}, unregister: () => {} }
|
|
1023
865
|
: new FinalizationRegistry(ptr => wasm.__wbg_privatesigkey_free(ptr >>> 0, 1));
|
|
1024
|
-
|
|
1025
|
-
*/
|
|
866
|
+
|
|
1026
867
|
export class PrivateSigKey {
|
|
1027
868
|
|
|
1028
869
|
static __wrap(ptr) {
|
|
@@ -1049,8 +890,7 @@ export class PrivateSigKey {
|
|
|
1049
890
|
const PublicEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1050
891
|
? { register: () => {}, unregister: () => {} }
|
|
1051
892
|
: new FinalizationRegistry(ptr => wasm.__wbg_publicenckey_free(ptr >>> 0, 1));
|
|
1052
|
-
|
|
1053
|
-
*/
|
|
893
|
+
|
|
1054
894
|
export class PublicEncKey {
|
|
1055
895
|
|
|
1056
896
|
static __wrap(ptr) {
|
|
@@ -1077,8 +917,7 @@ export class PublicEncKey {
|
|
|
1077
917
|
const PublicSigKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1078
918
|
? { register: () => {}, unregister: () => {} }
|
|
1079
919
|
: new FinalizationRegistry(ptr => wasm.__wbg_publicsigkey_free(ptr >>> 0, 1));
|
|
1080
|
-
|
|
1081
|
-
*/
|
|
920
|
+
|
|
1082
921
|
export class PublicSigKey {
|
|
1083
922
|
|
|
1084
923
|
static __wrap(ptr) {
|
|
@@ -1105,8 +944,7 @@ export class PublicSigKey {
|
|
|
1105
944
|
const ReencryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1106
945
|
? { register: () => {}, unregister: () => {} }
|
|
1107
946
|
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequest_free(ptr >>> 0, 1));
|
|
1108
|
-
|
|
1109
|
-
*/
|
|
947
|
+
|
|
1110
948
|
export class ReencryptionRequest {
|
|
1111
949
|
|
|
1112
950
|
__destroy_into_raw() {
|
|
@@ -1121,41 +959,34 @@ export class ReencryptionRequest {
|
|
|
1121
959
|
wasm.__wbg_reencryptionrequest_free(ptr, 0);
|
|
1122
960
|
}
|
|
1123
961
|
/**
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
962
|
+
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
963
|
+
* @returns {Uint8Array}
|
|
964
|
+
*/
|
|
1127
965
|
get signature() {
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1133
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1134
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1135
|
-
return v1;
|
|
1136
|
-
} finally {
|
|
1137
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1138
|
-
}
|
|
966
|
+
const ret = wasm.__wbg_get_reencryptionrequest_signature(this.__wbg_ptr);
|
|
967
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
968
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
969
|
+
return v1;
|
|
1139
970
|
}
|
|
1140
971
|
/**
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
972
|
+
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
973
|
+
* @param {Uint8Array} arg0
|
|
974
|
+
*/
|
|
1144
975
|
set signature(arg0) {
|
|
1145
976
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1146
977
|
const len0 = WASM_VECTOR_LEN;
|
|
1147
978
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1148
979
|
}
|
|
1149
980
|
/**
|
|
1150
|
-
|
|
1151
|
-
|
|
981
|
+
* @returns {ReencryptionRequestPayload | undefined}
|
|
982
|
+
*/
|
|
1152
983
|
get payload() {
|
|
1153
984
|
const ret = wasm.__wbg_get_reencryptionrequest_payload(this.__wbg_ptr);
|
|
1154
985
|
return ret === 0 ? undefined : ReencryptionRequestPayload.__wrap(ret);
|
|
1155
986
|
}
|
|
1156
987
|
/**
|
|
1157
|
-
|
|
1158
|
-
|
|
988
|
+
* @param {ReencryptionRequestPayload | undefined} [arg0]
|
|
989
|
+
*/
|
|
1159
990
|
set payload(arg0) {
|
|
1160
991
|
let ptr0 = 0;
|
|
1161
992
|
if (!isLikeNone(arg0)) {
|
|
@@ -1165,15 +996,15 @@ export class ReencryptionRequest {
|
|
|
1165
996
|
wasm.__wbg_set_reencryptionrequest_payload(this.__wbg_ptr, ptr0);
|
|
1166
997
|
}
|
|
1167
998
|
/**
|
|
1168
|
-
|
|
1169
|
-
|
|
999
|
+
* @returns {Eip712DomainMsg | undefined}
|
|
1000
|
+
*/
|
|
1170
1001
|
get domain() {
|
|
1171
1002
|
const ret = wasm.__wbg_get_reencryptionrequest_domain(this.__wbg_ptr);
|
|
1172
1003
|
return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
|
|
1173
1004
|
}
|
|
1174
1005
|
/**
|
|
1175
|
-
|
|
1176
|
-
|
|
1006
|
+
* @param {Eip712DomainMsg | undefined} [arg0]
|
|
1007
|
+
*/
|
|
1177
1008
|
set domain(arg0) {
|
|
1178
1009
|
let ptr0 = 0;
|
|
1179
1010
|
if (!isLikeNone(arg0)) {
|
|
@@ -1183,19 +1014,19 @@ export class ReencryptionRequest {
|
|
|
1183
1014
|
wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
1184
1015
|
}
|
|
1185
1016
|
/**
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1017
|
+
* The ID that identifies this request.
|
|
1018
|
+
* Future queries for the result must use this request ID.
|
|
1019
|
+
* @returns {RequestId | undefined}
|
|
1020
|
+
*/
|
|
1190
1021
|
get request_id() {
|
|
1191
1022
|
const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
|
|
1192
1023
|
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1193
1024
|
}
|
|
1194
1025
|
/**
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1026
|
+
* The ID that identifies this request.
|
|
1027
|
+
* Future queries for the result must use this request ID.
|
|
1028
|
+
* @param {RequestId | undefined} [arg0]
|
|
1029
|
+
*/
|
|
1199
1030
|
set request_id(arg0) {
|
|
1200
1031
|
let ptr0 = 0;
|
|
1201
1032
|
if (!isLikeNone(arg0)) {
|
|
@@ -1209,8 +1040,7 @@ export class ReencryptionRequest {
|
|
|
1209
1040
|
const ReencryptionRequestPayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1210
1041
|
? { register: () => {}, unregister: () => {} }
|
|
1211
1042
|
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequestpayload_free(ptr >>> 0, 1));
|
|
1212
|
-
|
|
1213
|
-
*/
|
|
1043
|
+
|
|
1214
1044
|
export class ReencryptionRequestPayload {
|
|
1215
1045
|
|
|
1216
1046
|
static __wrap(ptr) {
|
|
@@ -1233,110 +1063,99 @@ export class ReencryptionRequestPayload {
|
|
|
1233
1063
|
wasm.__wbg_reencryptionrequestpayload_free(ptr, 0);
|
|
1234
1064
|
}
|
|
1235
1065
|
/**
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1066
|
+
* Version of the request format.
|
|
1067
|
+
* @returns {number}
|
|
1068
|
+
*/
|
|
1239
1069
|
get version() {
|
|
1240
1070
|
const ret = wasm.__wbg_get_reencryptionrequestpayload_version(this.__wbg_ptr);
|
|
1241
1071
|
return ret >>> 0;
|
|
1242
1072
|
}
|
|
1243
1073
|
/**
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1074
|
+
* Version of the request format.
|
|
1075
|
+
* @param {number} arg0
|
|
1076
|
+
*/
|
|
1247
1077
|
set version(arg0) {
|
|
1248
1078
|
wasm.__wbg_set_reencryptionrequestpayload_version(this.__wbg_ptr, arg0);
|
|
1249
1079
|
}
|
|
1250
1080
|
/**
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1081
|
+
* The client's (blockchain wallet) address,
|
|
1082
|
+
* encoded using EIP-55.
|
|
1083
|
+
* @returns {string}
|
|
1084
|
+
*/
|
|
1255
1085
|
get client_address() {
|
|
1256
1086
|
let deferred1_0;
|
|
1257
1087
|
let deferred1_1;
|
|
1258
1088
|
try {
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
deferred1_0 = r0;
|
|
1264
|
-
deferred1_1 = r1;
|
|
1265
|
-
return getStringFromWasm0(r0, r1);
|
|
1089
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_client_address(this.__wbg_ptr);
|
|
1090
|
+
deferred1_0 = ret[0];
|
|
1091
|
+
deferred1_1 = ret[1];
|
|
1092
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1266
1093
|
} finally {
|
|
1267
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1268
1094
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1269
1095
|
}
|
|
1270
1096
|
}
|
|
1271
1097
|
/**
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1098
|
+
* The client's (blockchain wallet) address,
|
|
1099
|
+
* encoded using EIP-55.
|
|
1100
|
+
* @param {string} arg0
|
|
1101
|
+
*/
|
|
1276
1102
|
set client_address(arg0) {
|
|
1277
1103
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1278
1104
|
const len0 = WASM_VECTOR_LEN;
|
|
1279
1105
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1280
1106
|
}
|
|
1281
1107
|
/**
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1108
|
+
* Encoding of the user's public encryption key for this request.
|
|
1109
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1110
|
+
* Montgomery point.
|
|
1111
|
+
* @returns {Uint8Array}
|
|
1112
|
+
*/
|
|
1287
1113
|
get enc_key() {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1293
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1294
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1295
|
-
return v1;
|
|
1296
|
-
} finally {
|
|
1297
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1298
|
-
}
|
|
1114
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_enc_key(this.__wbg_ptr);
|
|
1115
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1116
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1117
|
+
return v1;
|
|
1299
1118
|
}
|
|
1300
1119
|
/**
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1120
|
+
* Encoding of the user's public encryption key for this request.
|
|
1121
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1122
|
+
* Montgomery point.
|
|
1123
|
+
* @param {Uint8Array} arg0
|
|
1124
|
+
*/
|
|
1306
1125
|
set enc_key(arg0) {
|
|
1307
1126
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1308
1127
|
const len0 = WASM_VECTOR_LEN;
|
|
1309
1128
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1310
1129
|
}
|
|
1311
1130
|
/**
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1131
|
+
* The type of plaintext encrypted.
|
|
1132
|
+
* @returns {number}
|
|
1133
|
+
*/
|
|
1315
1134
|
get fhe_type() {
|
|
1316
1135
|
const ret = wasm.__wbg_get_reencryptionrequestpayload_fhe_type(this.__wbg_ptr);
|
|
1317
1136
|
return ret;
|
|
1318
1137
|
}
|
|
1319
1138
|
/**
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1139
|
+
* The type of plaintext encrypted.
|
|
1140
|
+
* @param {number} arg0
|
|
1141
|
+
*/
|
|
1323
1142
|
set fhe_type(arg0) {
|
|
1324
1143
|
wasm.__wbg_set_reencryptionrequestpayload_fhe_type(this.__wbg_ptr, arg0);
|
|
1325
1144
|
}
|
|
1326
1145
|
/**
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1146
|
+
* The key id to use for decryption. Will be the request_id used during key
|
|
1147
|
+
* generation
|
|
1148
|
+
* @returns {RequestId | undefined}
|
|
1149
|
+
*/
|
|
1331
1150
|
get key_id() {
|
|
1332
1151
|
const ret = wasm.__wbg_get_reencryptionrequestpayload_key_id(this.__wbg_ptr);
|
|
1333
1152
|
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1334
1153
|
}
|
|
1335
1154
|
/**
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1155
|
+
* The key id to use for decryption. Will be the request_id used during key
|
|
1156
|
+
* generation
|
|
1157
|
+
* @param {RequestId | undefined} [arg0]
|
|
1158
|
+
*/
|
|
1340
1159
|
set key_id(arg0) {
|
|
1341
1160
|
let ptr0 = 0;
|
|
1342
1161
|
if (!isLikeNone(arg0)) {
|
|
@@ -1346,61 +1165,47 @@ export class ReencryptionRequestPayload {
|
|
|
1346
1165
|
wasm.__wbg_set_reencryptionrequestpayload_key_id(this.__wbg_ptr, ptr0);
|
|
1347
1166
|
}
|
|
1348
1167
|
/**
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1168
|
+
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
1169
|
+
* When creating the payload, this field may be empty,
|
|
1170
|
+
* it is the responsibility of the gateway to fetch the
|
|
1171
|
+
* ciphertext for the given digest below.
|
|
1172
|
+
* @returns {Uint8Array | undefined}
|
|
1173
|
+
*/
|
|
1355
1174
|
get ciphertext() {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
let v1;
|
|
1362
|
-
if (r0 !== 0) {
|
|
1363
|
-
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1364
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1365
|
-
}
|
|
1366
|
-
return v1;
|
|
1367
|
-
} finally {
|
|
1368
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1175
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext(this.__wbg_ptr);
|
|
1176
|
+
let v1;
|
|
1177
|
+
if (ret[0] !== 0) {
|
|
1178
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1179
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1369
1180
|
}
|
|
1181
|
+
return v1;
|
|
1370
1182
|
}
|
|
1371
1183
|
/**
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1184
|
+
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
1185
|
+
* When creating the payload, this field may be empty,
|
|
1186
|
+
* it is the responsibility of the gateway to fetch the
|
|
1187
|
+
* ciphertext for the given digest below.
|
|
1188
|
+
* @param {Uint8Array | undefined} [arg0]
|
|
1189
|
+
*/
|
|
1378
1190
|
set ciphertext(arg0) {
|
|
1379
1191
|
var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1380
1192
|
var len0 = WASM_VECTOR_LEN;
|
|
1381
|
-
wasm.
|
|
1193
|
+
wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
|
|
1382
1194
|
}
|
|
1383
1195
|
/**
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1196
|
+
* The SHA3 digest of the ciphertext above.
|
|
1197
|
+
* @returns {Uint8Array}
|
|
1198
|
+
*/
|
|
1387
1199
|
get ciphertext_digest() {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1393
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1394
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1395
|
-
return v1;
|
|
1396
|
-
} finally {
|
|
1397
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1398
|
-
}
|
|
1200
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_ciphertext_digest(this.__wbg_ptr);
|
|
1201
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1202
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1203
|
+
return v1;
|
|
1399
1204
|
}
|
|
1400
1205
|
/**
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1206
|
+
* The SHA3 digest of the ciphertext above.
|
|
1207
|
+
* @param {Uint8Array} arg0
|
|
1208
|
+
*/
|
|
1404
1209
|
set ciphertext_digest(arg0) {
|
|
1405
1210
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1406
1211
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -1411,8 +1216,7 @@ export class ReencryptionRequestPayload {
|
|
|
1411
1216
|
const ReencryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1412
1217
|
? { register: () => {}, unregister: () => {} }
|
|
1413
1218
|
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponse_free(ptr >>> 0, 1));
|
|
1414
|
-
|
|
1415
|
-
*/
|
|
1219
|
+
|
|
1416
1220
|
export class ReencryptionResponse {
|
|
1417
1221
|
|
|
1418
1222
|
static __unwrap(jsValue) {
|
|
@@ -1434,41 +1238,34 @@ export class ReencryptionResponse {
|
|
|
1434
1238
|
wasm.__wbg_reencryptionresponse_free(ptr, 0);
|
|
1435
1239
|
}
|
|
1436
1240
|
/**
|
|
1437
|
-
|
|
1438
|
-
|
|
1241
|
+
* @returns {Uint8Array}
|
|
1242
|
+
*/
|
|
1439
1243
|
get signature() {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1445
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1446
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1447
|
-
return v1;
|
|
1448
|
-
} finally {
|
|
1449
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1450
|
-
}
|
|
1244
|
+
const ret = wasm.__wbg_get_reencryptionresponse_signature(this.__wbg_ptr);
|
|
1245
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1246
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1247
|
+
return v1;
|
|
1451
1248
|
}
|
|
1452
1249
|
/**
|
|
1453
|
-
|
|
1454
|
-
|
|
1250
|
+
* @param {Uint8Array} arg0
|
|
1251
|
+
*/
|
|
1455
1252
|
set signature(arg0) {
|
|
1456
1253
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1457
1254
|
const len0 = WASM_VECTOR_LEN;
|
|
1458
1255
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1459
1256
|
}
|
|
1460
1257
|
/**
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1258
|
+
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
1259
|
+
* @returns {ReencryptionResponsePayload | undefined}
|
|
1260
|
+
*/
|
|
1464
1261
|
get payload() {
|
|
1465
1262
|
const ret = wasm.__wbg_get_reencryptionresponse_payload(this.__wbg_ptr);
|
|
1466
1263
|
return ret === 0 ? undefined : ReencryptionResponsePayload.__wrap(ret);
|
|
1467
1264
|
}
|
|
1468
1265
|
/**
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1266
|
+
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
1267
|
+
* @param {ReencryptionResponsePayload | undefined} [arg0]
|
|
1268
|
+
*/
|
|
1472
1269
|
set payload(arg0) {
|
|
1473
1270
|
let ptr0 = 0;
|
|
1474
1271
|
if (!isLikeNone(arg0)) {
|
|
@@ -1482,8 +1279,7 @@ export class ReencryptionResponse {
|
|
|
1482
1279
|
const ReencryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1483
1280
|
? { register: () => {}, unregister: () => {} }
|
|
1484
1281
|
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1485
|
-
|
|
1486
|
-
*/
|
|
1282
|
+
|
|
1487
1283
|
export class ReencryptionResponsePayload {
|
|
1488
1284
|
|
|
1489
1285
|
static __wrap(ptr) {
|
|
@@ -1506,154 +1302,133 @@ export class ReencryptionResponsePayload {
|
|
|
1506
1302
|
wasm.__wbg_reencryptionresponsepayload_free(ptr, 0);
|
|
1507
1303
|
}
|
|
1508
1304
|
/**
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1305
|
+
* Version of the response format.
|
|
1306
|
+
* @returns {number}
|
|
1307
|
+
*/
|
|
1512
1308
|
get version() {
|
|
1513
1309
|
const ret = wasm.__wbg_get_reencryptionresponsepayload_version(this.__wbg_ptr);
|
|
1514
1310
|
return ret >>> 0;
|
|
1515
1311
|
}
|
|
1516
1312
|
/**
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1313
|
+
* Version of the response format.
|
|
1314
|
+
* @param {number} arg0
|
|
1315
|
+
*/
|
|
1520
1316
|
set version(arg0) {
|
|
1521
1317
|
wasm.__wbg_set_reencryptionresponsepayload_version(this.__wbg_ptr, arg0);
|
|
1522
1318
|
}
|
|
1523
1319
|
/**
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1320
|
+
* The server's signature verification key.
|
|
1321
|
+
* Encoded using SEC1.
|
|
1322
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1323
|
+
* trusted keys.
|
|
1324
|
+
* @returns {Uint8Array}
|
|
1325
|
+
*/
|
|
1530
1326
|
get verification_key() {
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1536
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1537
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1538
|
-
return v1;
|
|
1539
|
-
} finally {
|
|
1540
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1541
|
-
}
|
|
1327
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_verification_key(this.__wbg_ptr);
|
|
1328
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1329
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1330
|
+
return v1;
|
|
1542
1331
|
}
|
|
1543
1332
|
/**
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1333
|
+
* The server's signature verification key.
|
|
1334
|
+
* Encoded using SEC1.
|
|
1335
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1336
|
+
* trusted keys.
|
|
1337
|
+
* @param {Uint8Array} arg0
|
|
1338
|
+
*/
|
|
1550
1339
|
set verification_key(arg0) {
|
|
1551
1340
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1552
1341
|
const len0 = WASM_VECTOR_LEN;
|
|
1553
1342
|
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1554
1343
|
}
|
|
1555
1344
|
/**
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1345
|
+
* The concatenation of two digests:
|
|
1346
|
+
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
1347
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1348
|
+
* @returns {Uint8Array}
|
|
1349
|
+
*/
|
|
1561
1350
|
get digest() {
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1567
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1568
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1569
|
-
return v1;
|
|
1570
|
-
} finally {
|
|
1571
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1572
|
-
}
|
|
1351
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_digest(this.__wbg_ptr);
|
|
1352
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1353
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1354
|
+
return v1;
|
|
1573
1355
|
}
|
|
1574
1356
|
/**
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1357
|
+
* The concatenation of two digests:
|
|
1358
|
+
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
1359
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1360
|
+
* @param {Uint8Array} arg0
|
|
1361
|
+
*/
|
|
1580
1362
|
set digest(arg0) {
|
|
1581
1363
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1582
1364
|
const len0 = WASM_VECTOR_LEN;
|
|
1583
1365
|
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1584
1366
|
}
|
|
1585
1367
|
/**
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1368
|
+
* The type of plaintext encrypted.
|
|
1369
|
+
* @returns {number}
|
|
1370
|
+
*/
|
|
1589
1371
|
get fhe_type() {
|
|
1590
1372
|
const ret = wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr);
|
|
1591
1373
|
return ret;
|
|
1592
1374
|
}
|
|
1593
1375
|
/**
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1376
|
+
* The type of plaintext encrypted.
|
|
1377
|
+
* @param {number} arg0
|
|
1378
|
+
*/
|
|
1597
1379
|
set fhe_type(arg0) {
|
|
1598
1380
|
wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr, arg0);
|
|
1599
1381
|
}
|
|
1600
1382
|
/**
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1383
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1384
|
+
* sign-then-encrypt.
|
|
1385
|
+
* @returns {Uint8Array}
|
|
1386
|
+
*/
|
|
1605
1387
|
get signcrypted_ciphertext() {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1611
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1612
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1613
|
-
return v1;
|
|
1614
|
-
} finally {
|
|
1615
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1616
|
-
}
|
|
1388
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertext(this.__wbg_ptr);
|
|
1389
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1390
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1391
|
+
return v1;
|
|
1617
1392
|
}
|
|
1618
1393
|
/**
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1394
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1395
|
+
* sign-then-encrypt.
|
|
1396
|
+
* @param {Uint8Array} arg0
|
|
1397
|
+
*/
|
|
1623
1398
|
set signcrypted_ciphertext(arg0) {
|
|
1624
1399
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1625
1400
|
const len0 = WASM_VECTOR_LEN;
|
|
1626
1401
|
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1627
1402
|
}
|
|
1628
1403
|
/**
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1404
|
+
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
1405
|
+
* reconstruction.
|
|
1406
|
+
* @returns {number}
|
|
1407
|
+
*/
|
|
1633
1408
|
get party_id() {
|
|
1634
1409
|
const ret = wasm.__wbg_get_reencryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
1635
1410
|
return ret >>> 0;
|
|
1636
1411
|
}
|
|
1637
1412
|
/**
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1413
|
+
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
1414
|
+
* reconstruction.
|
|
1415
|
+
* @param {number} arg0
|
|
1416
|
+
*/
|
|
1642
1417
|
set party_id(arg0) {
|
|
1643
1418
|
wasm.__wbg_set_reencryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1644
1419
|
}
|
|
1645
1420
|
/**
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1421
|
+
* The degree of the sharing scheme used.
|
|
1422
|
+
* @returns {number}
|
|
1423
|
+
*/
|
|
1649
1424
|
get degree() {
|
|
1650
1425
|
const ret = wasm.__wbg_get_reencryptionresponsepayload_degree(this.__wbg_ptr);
|
|
1651
1426
|
return ret >>> 0;
|
|
1652
1427
|
}
|
|
1653
1428
|
/**
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1429
|
+
* The degree of the sharing scheme used.
|
|
1430
|
+
* @param {number} arg0
|
|
1431
|
+
*/
|
|
1657
1432
|
set degree(arg0) {
|
|
1658
1433
|
wasm.__wbg_set_reencryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1659
1434
|
}
|
|
@@ -1663,9 +1438,9 @@ const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1663
1438
|
? { register: () => {}, unregister: () => {} }
|
|
1664
1439
|
: new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
|
|
1665
1440
|
/**
|
|
1666
|
-
* Simple response to return an ID, to be used to retrieve the computed result
|
|
1667
|
-
* later on.
|
|
1668
|
-
*/
|
|
1441
|
+
* Simple response to return an ID, to be used to retrieve the computed result
|
|
1442
|
+
* later on.
|
|
1443
|
+
*/
|
|
1669
1444
|
export class RequestId {
|
|
1670
1445
|
|
|
1671
1446
|
static __wrap(ptr) {
|
|
@@ -1688,27 +1463,23 @@ export class RequestId {
|
|
|
1688
1463
|
wasm.__wbg_requestid_free(ptr, 0);
|
|
1689
1464
|
}
|
|
1690
1465
|
/**
|
|
1691
|
-
|
|
1692
|
-
|
|
1466
|
+
* @returns {string}
|
|
1467
|
+
*/
|
|
1693
1468
|
get request_id() {
|
|
1694
1469
|
let deferred1_0;
|
|
1695
1470
|
let deferred1_1;
|
|
1696
1471
|
try {
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
deferred1_0 = r0;
|
|
1702
|
-
deferred1_1 = r1;
|
|
1703
|
-
return getStringFromWasm0(r0, r1);
|
|
1472
|
+
const ret = wasm.__wbg_get_requestid_request_id(this.__wbg_ptr);
|
|
1473
|
+
deferred1_0 = ret[0];
|
|
1474
|
+
deferred1_1 = ret[1];
|
|
1475
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1704
1476
|
} finally {
|
|
1705
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1706
1477
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1707
1478
|
}
|
|
1708
1479
|
}
|
|
1709
1480
|
/**
|
|
1710
|
-
|
|
1711
|
-
|
|
1481
|
+
* @param {string} arg0
|
|
1482
|
+
*/
|
|
1712
1483
|
set request_id(arg0) {
|
|
1713
1484
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1714
1485
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -1724,7 +1495,7 @@ async function __wbg_load(module, imports) {
|
|
|
1724
1495
|
|
|
1725
1496
|
} catch (e) {
|
|
1726
1497
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
1727
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve
|
|
1498
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1728
1499
|
|
|
1729
1500
|
} else {
|
|
1730
1501
|
throw e;
|
|
@@ -1752,84 +1523,77 @@ function __wbg_get_imports() {
|
|
|
1752
1523
|
imports.wbg = {};
|
|
1753
1524
|
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1754
1525
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1755
|
-
return
|
|
1526
|
+
return ret;
|
|
1756
1527
|
};
|
|
1757
|
-
imports.wbg.
|
|
1758
|
-
|
|
1528
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
1529
|
+
const obj = arg1;
|
|
1530
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1531
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1532
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1533
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1534
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1759
1535
|
};
|
|
1760
1536
|
imports.wbg.__wbg_reencryptionresponse_unwrap = function(arg0) {
|
|
1761
|
-
const ret = ReencryptionResponse.__unwrap(
|
|
1537
|
+
const ret = ReencryptionResponse.__unwrap(arg0);
|
|
1762
1538
|
return ret;
|
|
1763
1539
|
};
|
|
1764
1540
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
1765
|
-
const obj =
|
|
1541
|
+
const obj = arg1;
|
|
1766
1542
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1767
1543
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1768
1544
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1769
1545
|
};
|
|
1770
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
1771
|
-
const obj = getObject(arg1);
|
|
1772
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1773
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1774
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1775
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1776
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1777
|
-
};
|
|
1778
1546
|
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
1779
|
-
const val =
|
|
1547
|
+
const val = arg0;
|
|
1780
1548
|
const ret = typeof(val) === 'object' && val !== null;
|
|
1781
1549
|
return ret;
|
|
1782
1550
|
};
|
|
1783
1551
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
1784
|
-
const ret =
|
|
1552
|
+
const ret = arg0 === undefined;
|
|
1785
1553
|
return ret;
|
|
1786
1554
|
};
|
|
1787
1555
|
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
1788
|
-
const ret =
|
|
1556
|
+
const ret = arg0 in arg1;
|
|
1789
1557
|
return ret;
|
|
1790
1558
|
};
|
|
1791
1559
|
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
1792
|
-
const ret =
|
|
1560
|
+
const ret = arg0 === null;
|
|
1793
1561
|
return ret;
|
|
1794
1562
|
};
|
|
1795
1563
|
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
1796
|
-
const ret =
|
|
1564
|
+
const ret = arg0 == arg1;
|
|
1797
1565
|
return ret;
|
|
1798
1566
|
};
|
|
1799
1567
|
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
1800
|
-
const v =
|
|
1568
|
+
const v = arg0;
|
|
1801
1569
|
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1802
1570
|
return ret;
|
|
1803
1571
|
};
|
|
1804
1572
|
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
1805
|
-
const ret = +
|
|
1573
|
+
const ret = +arg0;
|
|
1806
1574
|
return ret;
|
|
1807
1575
|
};
|
|
1808
1576
|
imports.wbg.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
|
|
1809
|
-
const ret = String(
|
|
1577
|
+
const ret = String(arg1);
|
|
1810
1578
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1811
1579
|
const len1 = WASM_VECTOR_LEN;
|
|
1812
1580
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1813
1581
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1814
1582
|
};
|
|
1815
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1816
|
-
const ret = getObject(arg0);
|
|
1817
|
-
return addHeapObject(ret);
|
|
1818
|
-
};
|
|
1819
1583
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1820
1584
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1821
|
-
return
|
|
1585
|
+
return ret;
|
|
1822
1586
|
};
|
|
1823
1587
|
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
|
|
1824
|
-
const ret =
|
|
1825
|
-
return
|
|
1588
|
+
const ret = arg0[arg1];
|
|
1589
|
+
return ret;
|
|
1826
1590
|
};
|
|
1827
1591
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
1828
1592
|
const ret = new Error();
|
|
1829
|
-
return
|
|
1593
|
+
return ret;
|
|
1830
1594
|
};
|
|
1831
1595
|
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
1832
|
-
const ret =
|
|
1596
|
+
const ret = arg1.stack;
|
|
1833
1597
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1834
1598
|
const len1 = WASM_VECTOR_LEN;
|
|
1835
1599
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
@@ -1847,160 +1611,160 @@ function __wbg_get_imports() {
|
|
|
1847
1611
|
}
|
|
1848
1612
|
};
|
|
1849
1613
|
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1850
|
-
const ret =
|
|
1851
|
-
return
|
|
1614
|
+
const ret = arg0.crypto;
|
|
1615
|
+
return ret;
|
|
1852
1616
|
};
|
|
1853
1617
|
imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
1854
|
-
const ret =
|
|
1855
|
-
return
|
|
1618
|
+
const ret = arg0.process;
|
|
1619
|
+
return ret;
|
|
1856
1620
|
};
|
|
1857
1621
|
imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
1858
|
-
const ret =
|
|
1859
|
-
return
|
|
1622
|
+
const ret = arg0.versions;
|
|
1623
|
+
return ret;
|
|
1860
1624
|
};
|
|
1861
1625
|
imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
1862
|
-
const ret =
|
|
1863
|
-
return
|
|
1626
|
+
const ret = arg0.node;
|
|
1627
|
+
return ret;
|
|
1864
1628
|
};
|
|
1865
1629
|
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
1866
|
-
const ret = typeof(
|
|
1630
|
+
const ret = typeof(arg0) === 'string';
|
|
1867
1631
|
return ret;
|
|
1868
1632
|
};
|
|
1869
1633
|
imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
1870
1634
|
const ret = module.require;
|
|
1871
|
-
return
|
|
1635
|
+
return ret;
|
|
1872
1636
|
}, arguments) };
|
|
1873
1637
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
1874
|
-
const ret = typeof(
|
|
1638
|
+
const ret = typeof(arg0) === 'function';
|
|
1875
1639
|
return ret;
|
|
1876
1640
|
};
|
|
1877
1641
|
imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
1878
|
-
const ret =
|
|
1879
|
-
return
|
|
1642
|
+
const ret = arg0.msCrypto;
|
|
1643
|
+
return ret;
|
|
1880
1644
|
};
|
|
1881
1645
|
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
1882
|
-
|
|
1646
|
+
arg0.randomFillSync(arg1);
|
|
1883
1647
|
}, arguments) };
|
|
1884
1648
|
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
1885
|
-
|
|
1649
|
+
arg0.getRandomValues(arg1);
|
|
1886
1650
|
}, arguments) };
|
|
1887
|
-
imports.wbg.
|
|
1888
|
-
const ret =
|
|
1889
|
-
return
|
|
1651
|
+
imports.wbg.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
|
|
1652
|
+
const ret = arg0[arg1 >>> 0];
|
|
1653
|
+
return ret;
|
|
1890
1654
|
};
|
|
1891
|
-
imports.wbg.
|
|
1892
|
-
const ret =
|
|
1655
|
+
imports.wbg.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
|
|
1656
|
+
const ret = arg0.length;
|
|
1893
1657
|
return ret;
|
|
1894
1658
|
};
|
|
1895
|
-
imports.wbg.
|
|
1659
|
+
imports.wbg.__wbg_newnoargs_1ede4bf2ebbaaf43 = function(arg0, arg1) {
|
|
1896
1660
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1897
|
-
return
|
|
1661
|
+
return ret;
|
|
1898
1662
|
};
|
|
1899
|
-
imports.wbg.
|
|
1900
|
-
const ret =
|
|
1901
|
-
return
|
|
1663
|
+
imports.wbg.__wbg_next_13b477da1eaa3897 = function(arg0) {
|
|
1664
|
+
const ret = arg0.next;
|
|
1665
|
+
return ret;
|
|
1902
1666
|
};
|
|
1903
|
-
imports.wbg.
|
|
1904
|
-
const ret =
|
|
1905
|
-
return
|
|
1667
|
+
imports.wbg.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
|
|
1668
|
+
const ret = arg0.next();
|
|
1669
|
+
return ret;
|
|
1906
1670
|
}, arguments) };
|
|
1907
|
-
imports.wbg.
|
|
1908
|
-
const ret =
|
|
1671
|
+
imports.wbg.__wbg_done_983b5ffcaec8c583 = function(arg0) {
|
|
1672
|
+
const ret = arg0.done;
|
|
1909
1673
|
return ret;
|
|
1910
1674
|
};
|
|
1911
|
-
imports.wbg.
|
|
1912
|
-
const ret =
|
|
1913
|
-
return
|
|
1675
|
+
imports.wbg.__wbg_value_2ab8a198c834c26a = function(arg0) {
|
|
1676
|
+
const ret = arg0.value;
|
|
1677
|
+
return ret;
|
|
1914
1678
|
};
|
|
1915
|
-
imports.wbg.
|
|
1679
|
+
imports.wbg.__wbg_iterator_695d699a44d6234c = function() {
|
|
1916
1680
|
const ret = Symbol.iterator;
|
|
1917
|
-
return
|
|
1681
|
+
return ret;
|
|
1918
1682
|
};
|
|
1919
|
-
imports.wbg.
|
|
1920
|
-
const ret = Reflect.get(
|
|
1921
|
-
return
|
|
1683
|
+
imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
|
|
1684
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1685
|
+
return ret;
|
|
1922
1686
|
}, arguments) };
|
|
1923
|
-
imports.wbg.
|
|
1924
|
-
const ret =
|
|
1925
|
-
return
|
|
1687
|
+
imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
|
|
1688
|
+
const ret = arg0.call(arg1);
|
|
1689
|
+
return ret;
|
|
1926
1690
|
}, arguments) };
|
|
1927
|
-
imports.wbg.
|
|
1691
|
+
imports.wbg.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () {
|
|
1928
1692
|
const ret = self.self;
|
|
1929
|
-
return
|
|
1693
|
+
return ret;
|
|
1930
1694
|
}, arguments) };
|
|
1931
|
-
imports.wbg.
|
|
1695
|
+
imports.wbg.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () {
|
|
1932
1696
|
const ret = window.window;
|
|
1933
|
-
return
|
|
1697
|
+
return ret;
|
|
1934
1698
|
}, arguments) };
|
|
1935
|
-
imports.wbg.
|
|
1699
|
+
imports.wbg.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () {
|
|
1936
1700
|
const ret = globalThis.globalThis;
|
|
1937
|
-
return
|
|
1701
|
+
return ret;
|
|
1938
1702
|
}, arguments) };
|
|
1939
|
-
imports.wbg.
|
|
1703
|
+
imports.wbg.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () {
|
|
1940
1704
|
const ret = global.global;
|
|
1941
|
-
return
|
|
1705
|
+
return ret;
|
|
1942
1706
|
}, arguments) };
|
|
1943
|
-
imports.wbg.
|
|
1944
|
-
const ret = Array.isArray(
|
|
1707
|
+
imports.wbg.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
|
|
1708
|
+
const ret = Array.isArray(arg0);
|
|
1945
1709
|
return ret;
|
|
1946
1710
|
};
|
|
1947
|
-
imports.wbg.
|
|
1711
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
|
|
1948
1712
|
let result;
|
|
1949
1713
|
try {
|
|
1950
|
-
result =
|
|
1714
|
+
result = arg0 instanceof ArrayBuffer;
|
|
1951
1715
|
} catch (_) {
|
|
1952
1716
|
result = false;
|
|
1953
1717
|
}
|
|
1954
1718
|
const ret = result;
|
|
1955
1719
|
return ret;
|
|
1956
1720
|
};
|
|
1957
|
-
imports.wbg.
|
|
1958
|
-
const ret =
|
|
1959
|
-
return
|
|
1721
|
+
imports.wbg.__wbg_call_3bfa248576352471 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1722
|
+
const ret = arg0.call(arg1, arg2);
|
|
1723
|
+
return ret;
|
|
1960
1724
|
}, arguments) };
|
|
1961
|
-
imports.wbg.
|
|
1962
|
-
const ret = Number.isSafeInteger(
|
|
1725
|
+
imports.wbg.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
|
|
1726
|
+
const ret = Number.isSafeInteger(arg0);
|
|
1963
1727
|
return ret;
|
|
1964
1728
|
};
|
|
1965
|
-
imports.wbg.
|
|
1966
|
-
const ret =
|
|
1967
|
-
return
|
|
1729
|
+
imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
|
|
1730
|
+
const ret = arg0.buffer;
|
|
1731
|
+
return ret;
|
|
1968
1732
|
};
|
|
1969
|
-
imports.wbg.
|
|
1970
|
-
const ret = new Uint8Array(
|
|
1971
|
-
return
|
|
1733
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function(arg0, arg1, arg2) {
|
|
1734
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1735
|
+
return ret;
|
|
1972
1736
|
};
|
|
1973
|
-
imports.wbg.
|
|
1974
|
-
const ret = new Uint8Array(
|
|
1975
|
-
return
|
|
1737
|
+
imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) {
|
|
1738
|
+
const ret = new Uint8Array(arg0);
|
|
1739
|
+
return ret;
|
|
1976
1740
|
};
|
|
1977
|
-
imports.wbg.
|
|
1978
|
-
|
|
1741
|
+
imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
|
|
1742
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
1979
1743
|
};
|
|
1980
|
-
imports.wbg.
|
|
1981
|
-
const ret =
|
|
1744
|
+
imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
|
|
1745
|
+
const ret = arg0.length;
|
|
1982
1746
|
return ret;
|
|
1983
1747
|
};
|
|
1984
|
-
imports.wbg.
|
|
1748
|
+
imports.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
|
|
1985
1749
|
let result;
|
|
1986
1750
|
try {
|
|
1987
|
-
result =
|
|
1751
|
+
result = arg0 instanceof Uint8Array;
|
|
1988
1752
|
} catch (_) {
|
|
1989
1753
|
result = false;
|
|
1990
1754
|
}
|
|
1991
1755
|
const ret = result;
|
|
1992
1756
|
return ret;
|
|
1993
1757
|
};
|
|
1994
|
-
imports.wbg.
|
|
1758
|
+
imports.wbg.__wbg_newwithlength_76462a666eca145f = function(arg0) {
|
|
1995
1759
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
1996
|
-
return
|
|
1760
|
+
return ret;
|
|
1997
1761
|
};
|
|
1998
|
-
imports.wbg.
|
|
1999
|
-
const ret =
|
|
2000
|
-
return
|
|
1762
|
+
imports.wbg.__wbg_subarray_975a06f9dbd16995 = function(arg0, arg1, arg2) {
|
|
1763
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1764
|
+
return ret;
|
|
2001
1765
|
};
|
|
2002
1766
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
2003
|
-
const ret = debugString(
|
|
1767
|
+
const ret = debugString(arg1);
|
|
2004
1768
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2005
1769
|
const len1 = WASM_VECTOR_LEN;
|
|
2006
1770
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
@@ -2011,7 +1775,17 @@ function __wbg_get_imports() {
|
|
|
2011
1775
|
};
|
|
2012
1776
|
imports.wbg.__wbindgen_memory = function() {
|
|
2013
1777
|
const ret = wasm.memory;
|
|
2014
|
-
return
|
|
1778
|
+
return ret;
|
|
1779
|
+
};
|
|
1780
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
1781
|
+
const table = wasm.__wbindgen_export_2;
|
|
1782
|
+
const offset = table.grow(4);
|
|
1783
|
+
table.set(0, undefined);
|
|
1784
|
+
table.set(offset + 0, undefined);
|
|
1785
|
+
table.set(offset + 1, null);
|
|
1786
|
+
table.set(offset + 2, true);
|
|
1787
|
+
table.set(offset + 3, false);
|
|
1788
|
+
;
|
|
2015
1789
|
};
|
|
2016
1790
|
|
|
2017
1791
|
return imports;
|
|
@@ -2028,7 +1802,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
2028
1802
|
cachedUint8ArrayMemory0 = null;
|
|
2029
1803
|
|
|
2030
1804
|
|
|
2031
|
-
|
|
1805
|
+
wasm.__wbindgen_start();
|
|
2032
1806
|
return wasm;
|
|
2033
1807
|
}
|
|
2034
1808
|
|
|
@@ -2036,10 +1810,13 @@ function initSync(module) {
|
|
|
2036
1810
|
if (wasm !== undefined) return wasm;
|
|
2037
1811
|
|
|
2038
1812
|
|
|
2039
|
-
if (typeof module !== 'undefined'
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
1813
|
+
if (typeof module !== 'undefined') {
|
|
1814
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1815
|
+
({module} = module)
|
|
1816
|
+
} else {
|
|
1817
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
2043
1820
|
|
|
2044
1821
|
const imports = __wbg_get_imports();
|
|
2045
1822
|
|
|
@@ -2058,10 +1835,13 @@ async function __wbg_init(module_or_path) {
|
|
|
2058
1835
|
if (wasm !== undefined) return wasm;
|
|
2059
1836
|
|
|
2060
1837
|
|
|
2061
|
-
if (typeof module_or_path !== 'undefined'
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
1838
|
+
if (typeof module_or_path !== 'undefined') {
|
|
1839
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1840
|
+
({module_or_path} = module_or_path)
|
|
1841
|
+
} else {
|
|
1842
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
2065
1845
|
|
|
2066
1846
|
if (typeof module_or_path === 'undefined') {
|
|
2067
1847
|
module_or_path = new URL('kms_lib_bg.wasm', import.meta.url);
|