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