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