node-tkms 0.9.0-rc3
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/README.md +1 -0
- package/kms_lib.d.ts +405 -0
- package/kms_lib.js +2081 -0
- package/kms_lib_bg.wasm +0 -0
- package/package.json +14 -0
package/kms_lib.js
ADDED
|
@@ -0,0 +1,2081 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
let wasm;
|
|
5
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
|
+
|
|
7
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
8
|
+
|
|
9
|
+
cachedTextDecoder.decode();
|
|
10
|
+
|
|
11
|
+
let cachedUint8ArrayMemory0 = null;
|
|
12
|
+
|
|
13
|
+
function getUint8ArrayMemory0() {
|
|
14
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
15
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
16
|
+
}
|
|
17
|
+
return cachedUint8ArrayMemory0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getStringFromWasm0(ptr, len) {
|
|
21
|
+
ptr = ptr >>> 0;
|
|
22
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
|
+
}
|
|
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
|
+
let WASM_VECTOR_LEN = 0;
|
|
68
|
+
|
|
69
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
70
|
+
|
|
71
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
72
|
+
? function (arg, view) {
|
|
73
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
74
|
+
}
|
|
75
|
+
: function (arg, view) {
|
|
76
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
77
|
+
view.set(buf);
|
|
78
|
+
return {
|
|
79
|
+
read: arg.length,
|
|
80
|
+
written: buf.length
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
85
|
+
|
|
86
|
+
if (realloc === undefined) {
|
|
87
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
88
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
89
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
90
|
+
WASM_VECTOR_LEN = buf.length;
|
|
91
|
+
return ptr;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let len = arg.length;
|
|
95
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
96
|
+
|
|
97
|
+
const mem = getUint8ArrayMemory0();
|
|
98
|
+
|
|
99
|
+
let offset = 0;
|
|
100
|
+
|
|
101
|
+
for (; offset < len; offset++) {
|
|
102
|
+
const code = arg.charCodeAt(offset);
|
|
103
|
+
if (code > 0x7F) break;
|
|
104
|
+
mem[ptr + offset] = code;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (offset !== len) {
|
|
108
|
+
if (offset !== 0) {
|
|
109
|
+
arg = arg.slice(offset);
|
|
110
|
+
}
|
|
111
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
112
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
113
|
+
const ret = encodeString(arg, view);
|
|
114
|
+
|
|
115
|
+
offset += ret.written;
|
|
116
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
WASM_VECTOR_LEN = offset;
|
|
120
|
+
return ptr;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function debugString(val) {
|
|
124
|
+
// primitive types
|
|
125
|
+
const type = typeof val;
|
|
126
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
127
|
+
return `${val}`;
|
|
128
|
+
}
|
|
129
|
+
if (type == 'string') {
|
|
130
|
+
return `"${val}"`;
|
|
131
|
+
}
|
|
132
|
+
if (type == 'symbol') {
|
|
133
|
+
const description = val.description;
|
|
134
|
+
if (description == null) {
|
|
135
|
+
return 'Symbol';
|
|
136
|
+
} else {
|
|
137
|
+
return `Symbol(${description})`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (type == 'function') {
|
|
141
|
+
const name = val.name;
|
|
142
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
143
|
+
return `Function(${name})`;
|
|
144
|
+
} else {
|
|
145
|
+
return 'Function';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// objects
|
|
149
|
+
if (Array.isArray(val)) {
|
|
150
|
+
const length = val.length;
|
|
151
|
+
let debug = '[';
|
|
152
|
+
if (length > 0) {
|
|
153
|
+
debug += debugString(val[0]);
|
|
154
|
+
}
|
|
155
|
+
for(let i = 1; i < length; i++) {
|
|
156
|
+
debug += ', ' + debugString(val[i]);
|
|
157
|
+
}
|
|
158
|
+
debug += ']';
|
|
159
|
+
return debug;
|
|
160
|
+
}
|
|
161
|
+
// Test for built-in
|
|
162
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
163
|
+
let className;
|
|
164
|
+
if (builtInMatches.length > 1) {
|
|
165
|
+
className = builtInMatches[1];
|
|
166
|
+
} else {
|
|
167
|
+
// Failed to match the standard '[object ClassName]'
|
|
168
|
+
return toString.call(val);
|
|
169
|
+
}
|
|
170
|
+
if (className == 'Object') {
|
|
171
|
+
// we're a user defined class or Object
|
|
172
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
173
|
+
// easier than looping through ownProperties of `val`.
|
|
174
|
+
try {
|
|
175
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
176
|
+
} catch (_) {
|
|
177
|
+
return 'Object';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// errors
|
|
181
|
+
if (val instanceof Error) {
|
|
182
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
183
|
+
}
|
|
184
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
185
|
+
return className;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function _assertClass(instance, klass) {
|
|
189
|
+
if (!(instance instanceof klass)) {
|
|
190
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
191
|
+
}
|
|
192
|
+
return instance.ptr;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
196
|
+
ptr = ptr >>> 0;
|
|
197
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @param {PublicSigKey} pk
|
|
201
|
+
* @returns {Uint8Array}
|
|
202
|
+
*/
|
|
203
|
+
module.exports.public_sig_key_to_u8vec = function(pk) {
|
|
204
|
+
try {
|
|
205
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
206
|
+
_assertClass(pk, PublicSigKey);
|
|
207
|
+
wasm.public_sig_key_to_u8vec(retptr, pk.__wbg_ptr);
|
|
208
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
219
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
220
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
221
|
+
WASM_VECTOR_LEN = arg.length;
|
|
222
|
+
return ptr;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @param {Uint8Array} v
|
|
226
|
+
* @returns {PublicSigKey}
|
|
227
|
+
*/
|
|
228
|
+
module.exports.u8vec_to_public_sig_key = function(v) {
|
|
229
|
+
try {
|
|
230
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
231
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
232
|
+
const len0 = WASM_VECTOR_LEN;
|
|
233
|
+
wasm.u8vec_to_public_sig_key(retptr, ptr0, len0);
|
|
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);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @param {PrivateSigKey} sk
|
|
248
|
+
* @returns {Uint8Array}
|
|
249
|
+
*/
|
|
250
|
+
module.exports.private_sig_key_to_u8vec = function(sk) {
|
|
251
|
+
try {
|
|
252
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
253
|
+
_assertClass(sk, PrivateSigKey);
|
|
254
|
+
wasm.private_sig_key_to_u8vec(retptr, sk.__wbg_ptr);
|
|
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);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @param {Uint8Array} v
|
|
272
|
+
* @returns {PrivateSigKey}
|
|
273
|
+
*/
|
|
274
|
+
module.exports.u8vec_to_private_sig_key = function(v) {
|
|
275
|
+
try {
|
|
276
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
277
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
279
|
+
wasm.u8vec_to_private_sig_key(retptr, ptr0, len0);
|
|
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);
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
293
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
294
|
+
const mem = getDataViewMemory0();
|
|
295
|
+
for (let i = 0; i < array.length; i++) {
|
|
296
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
297
|
+
}
|
|
298
|
+
WASM_VECTOR_LEN = array.length;
|
|
299
|
+
return ptr;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Instantiate a new client.
|
|
303
|
+
*
|
|
304
|
+
* * `server_pks` - a list of KMS server signature public keys,
|
|
305
|
+
* which can parsed using [u8vec_to_public_sig_key].
|
|
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 {(PublicSigKey)[]} server_pks
|
|
313
|
+
* @param {string} client_address_hex
|
|
314
|
+
* @param {string} param_choice
|
|
315
|
+
* @returns {Client}
|
|
316
|
+
*/
|
|
317
|
+
module.exports.new_client = function(server_pks, client_address_hex, param_choice) {
|
|
318
|
+
try {
|
|
319
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
320
|
+
const ptr0 = passArrayJsValueToWasm0(server_pks, wasm.__wbindgen_malloc);
|
|
321
|
+
const len0 = WASM_VECTOR_LEN;
|
|
322
|
+
const ptr1 = passStringToWasm0(client_address_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
323
|
+
const len1 = WASM_VECTOR_LEN;
|
|
324
|
+
const ptr2 = passStringToWasm0(param_choice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
325
|
+
const len2 = WASM_VECTOR_LEN;
|
|
326
|
+
wasm.new_client(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
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);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
340
|
+
ptr = ptr >>> 0;
|
|
341
|
+
const mem = getDataViewMemory0();
|
|
342
|
+
const result = [];
|
|
343
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
344
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
345
|
+
}
|
|
346
|
+
return result;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* @param {Client} client
|
|
350
|
+
* @returns {(PublicSigKey)[]}
|
|
351
|
+
*/
|
|
352
|
+
module.exports.get_server_public_keys = function(client) {
|
|
353
|
+
try {
|
|
354
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
|
+
_assertClass(client, Client);
|
|
356
|
+
wasm.get_server_public_keys(retptr, client.__wbg_ptr);
|
|
357
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* @param {Client} client
|
|
369
|
+
* @returns {PrivateSigKey | undefined}
|
|
370
|
+
*/
|
|
371
|
+
module.exports.get_client_secret_key = function(client) {
|
|
372
|
+
_assertClass(client, Client);
|
|
373
|
+
const ret = wasm.get_client_secret_key(client.__wbg_ptr);
|
|
374
|
+
return ret === 0 ? undefined : PrivateSigKey.__wrap(ret);
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* @param {Client} client
|
|
379
|
+
* @returns {string}
|
|
380
|
+
*/
|
|
381
|
+
module.exports.get_client_address = function(client) {
|
|
382
|
+
let deferred1_0;
|
|
383
|
+
let deferred1_1;
|
|
384
|
+
try {
|
|
385
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
386
|
+
_assertClass(client, Client);
|
|
387
|
+
wasm.get_client_address(retptr, client.__wbg_ptr);
|
|
388
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
389
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
390
|
+
deferred1_0 = r0;
|
|
391
|
+
deferred1_1 = r1;
|
|
392
|
+
return getStringFromWasm0(r0, r1);
|
|
393
|
+
} finally {
|
|
394
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
395
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @returns {PrivateEncKey}
|
|
401
|
+
*/
|
|
402
|
+
module.exports.cryptobox_keygen = function() {
|
|
403
|
+
const ret = wasm.cryptobox_keygen();
|
|
404
|
+
return PrivateEncKey.__wrap(ret);
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @param {PrivateEncKey} sk
|
|
409
|
+
* @returns {PublicEncKey}
|
|
410
|
+
*/
|
|
411
|
+
module.exports.cryptobox_get_pk = function(sk) {
|
|
412
|
+
_assertClass(sk, PrivateEncKey);
|
|
413
|
+
const ret = wasm.cryptobox_get_pk(sk.__wbg_ptr);
|
|
414
|
+
return PublicEncKey.__wrap(ret);
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* @param {PublicEncKey} pk
|
|
419
|
+
* @returns {Uint8Array}
|
|
420
|
+
*/
|
|
421
|
+
module.exports.cryptobox_pk_to_u8vec = function(pk) {
|
|
422
|
+
try {
|
|
423
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
424
|
+
_assertClass(pk, PublicEncKey);
|
|
425
|
+
wasm.cryptobox_pk_to_u8vec(retptr, pk.__wbg_ptr);
|
|
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);
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* @param {PrivateEncKey} sk
|
|
443
|
+
* @returns {Uint8Array}
|
|
444
|
+
*/
|
|
445
|
+
module.exports.cryptobox_sk_to_u8vec = function(sk) {
|
|
446
|
+
try {
|
|
447
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
448
|
+
_assertClass(sk, PrivateEncKey);
|
|
449
|
+
wasm.cryptobox_sk_to_u8vec(retptr, sk.__wbg_ptr);
|
|
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);
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @param {Uint8Array} v
|
|
467
|
+
* @returns {PublicEncKey}
|
|
468
|
+
*/
|
|
469
|
+
module.exports.u8vec_to_cryptobox_pk = function(v) {
|
|
470
|
+
try {
|
|
471
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
472
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
473
|
+
const len0 = WASM_VECTOR_LEN;
|
|
474
|
+
wasm.u8vec_to_cryptobox_pk(retptr, ptr0, len0);
|
|
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);
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* @param {Uint8Array} v
|
|
489
|
+
* @returns {PrivateEncKey}
|
|
490
|
+
*/
|
|
491
|
+
module.exports.u8vec_to_cryptobox_sk = function(v) {
|
|
492
|
+
try {
|
|
493
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
494
|
+
const ptr0 = passArray8ToWasm0(v, wasm.__wbindgen_malloc);
|
|
495
|
+
const len0 = WASM_VECTOR_LEN;
|
|
496
|
+
wasm.u8vec_to_cryptobox_sk(retptr, ptr0, len0);
|
|
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);
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @param {Uint8Array} msg
|
|
511
|
+
* @param {PublicEncKey} their_pk
|
|
512
|
+
* @param {PrivateEncKey} my_sk
|
|
513
|
+
* @returns {CryptoBoxCt}
|
|
514
|
+
*/
|
|
515
|
+
module.exports.cryptobox_encrypt = function(msg, their_pk, my_sk) {
|
|
516
|
+
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
517
|
+
const len0 = WASM_VECTOR_LEN;
|
|
518
|
+
_assertClass(their_pk, PublicEncKey);
|
|
519
|
+
_assertClass(my_sk, PrivateEncKey);
|
|
520
|
+
const ret = wasm.cryptobox_encrypt(ptr0, len0, their_pk.__wbg_ptr, my_sk.__wbg_ptr);
|
|
521
|
+
return CryptoBoxCt.__wrap(ret);
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* @param {CryptoBoxCt} ct
|
|
526
|
+
* @param {PrivateEncKey} my_sk
|
|
527
|
+
* @param {PublicEncKey} their_pk
|
|
528
|
+
* @returns {Uint8Array}
|
|
529
|
+
*/
|
|
530
|
+
module.exports.cryptobox_decrypt = function(ct, my_sk, their_pk) {
|
|
531
|
+
try {
|
|
532
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
533
|
+
_assertClass(ct, CryptoBoxCt);
|
|
534
|
+
_assertClass(my_sk, PrivateEncKey);
|
|
535
|
+
_assertClass(their_pk, PublicEncKey);
|
|
536
|
+
wasm.cryptobox_decrypt(retptr, ct.__wbg_ptr, my_sk.__wbg_ptr, their_pk.__wbg_ptr);
|
|
537
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Process the reencryption response from JavaScript objects.
|
|
549
|
+
* The result is a byte array representing a plaintext of any length.
|
|
550
|
+
*
|
|
551
|
+
* * `client` - client that wants to perform reencryption.
|
|
552
|
+
*
|
|
553
|
+
* * `request` - the initial reencryption request JS object.
|
|
554
|
+
* It can be set to null if `verify` is false.
|
|
555
|
+
* Otherwise the caller needs to give the following JS object.
|
|
556
|
+
* Note that `client_address` and `eip712_verifying_contract` follow EIP-55.
|
|
557
|
+
* ```
|
|
558
|
+
* {
|
|
559
|
+
* signature: '15a4f9a8eb61459cfba7d103d8f911fb04ce91ecf841b34c49c0d56a70b896d20cbc31986188f91efc3842b7df215cee8acb40178daedb8b63d0ba5d199bce121c',
|
|
560
|
+
* client_address: '0x17853A630aAe15AED549B2B874de08B73C0F59c5',
|
|
561
|
+
* enc_key: '2000000000000000df2fcacb774f03187f3802a27259f45c06d33cefa68d9c53426b15ad531aa822',
|
|
562
|
+
* ciphertext_digest: '0748b542afe2353c86cb707e3d21044b0be1fd18efc7cbaa6a415af055bfb358',
|
|
563
|
+
* eip712_verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657'
|
|
564
|
+
* }
|
|
565
|
+
* ```
|
|
566
|
+
*
|
|
567
|
+
* * `eip712_domain` - the EIP-712 domain JS object.
|
|
568
|
+
* It can be set to null if `verify` is false.
|
|
569
|
+
* Otherwise the caller needs to give the following JS object.
|
|
570
|
+
* Note that `salt` is optional and `verifying_contract` follows EIP-55,
|
|
571
|
+
* additionally, `chain_id` is an array of u8.
|
|
572
|
+
* ```
|
|
573
|
+
* {
|
|
574
|
+
* name: 'Authorization token',
|
|
575
|
+
* version: '1',
|
|
576
|
+
* chain_id: [
|
|
577
|
+
* 70, 31, 0, 0, 0, 0, 0, 0, 0,
|
|
578
|
+
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
579
|
+
* 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
580
|
+
* 0, 0, 0, 0, 0
|
|
581
|
+
* ],
|
|
582
|
+
* verifying_contract: '0x66f9664f97F2b50F62D13eA064982f936dE76657',
|
|
583
|
+
* salt: []
|
|
584
|
+
* }
|
|
585
|
+
* ```
|
|
586
|
+
*
|
|
587
|
+
* * `agg_resp` - the response JS object from the gateway.
|
|
588
|
+
* It has two fields like so, both are hex encoded byte arrays.
|
|
589
|
+
* ```
|
|
590
|
+
* [
|
|
591
|
+
* {
|
|
592
|
+
* signature: '69e7e040cab157aa819015b321c012dccb1545ffefd325b359b492653f0347517e28e66c572cdc299e259024329859ff9fcb0096e1ce072af0b6e1ca1fe25ec6',
|
|
593
|
+
* payload: '0100000029...'
|
|
594
|
+
* }
|
|
595
|
+
* ]
|
|
596
|
+
* ```
|
|
597
|
+
*
|
|
598
|
+
* * `enc_pk` - The ephemeral public key.
|
|
599
|
+
*
|
|
600
|
+
* * `enc_sk` - The ephemeral secret key.
|
|
601
|
+
*
|
|
602
|
+
* * `verify` - Whether to perform signature verification for the response.
|
|
603
|
+
* It is insecure if `verify = false`!
|
|
604
|
+
* @param {Client} client
|
|
605
|
+
* @param {any} request
|
|
606
|
+
* @param {any} eip712_domain
|
|
607
|
+
* @param {any} agg_resp
|
|
608
|
+
* @param {PublicEncKey} enc_pk
|
|
609
|
+
* @param {PrivateEncKey} enc_sk
|
|
610
|
+
* @param {boolean} verify
|
|
611
|
+
* @returns {Uint8Array}
|
|
612
|
+
*/
|
|
613
|
+
module.exports.process_reencryption_resp_from_js = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
614
|
+
try {
|
|
615
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
616
|
+
_assertClass(client, Client);
|
|
617
|
+
_assertClass(enc_pk, PublicEncKey);
|
|
618
|
+
_assertClass(enc_sk, PrivateEncKey);
|
|
619
|
+
wasm.process_reencryption_resp_from_js(retptr, client.__wbg_ptr, addHeapObject(request), addHeapObject(eip712_domain), addHeapObject(agg_resp), enc_pk.__wbg_ptr, enc_sk.__wbg_ptr, verify);
|
|
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);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
/**
|
|
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
|
+
*/
|
|
666
|
+
module.exports.process_reencryption_resp = function(client, request, eip712_domain, agg_resp, enc_pk, enc_sk, verify) {
|
|
667
|
+
try {
|
|
668
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
669
|
+
_assertClass(client, Client);
|
|
670
|
+
let ptr0 = 0;
|
|
671
|
+
if (!isLikeNone(request)) {
|
|
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);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
function handleError(f, args) {
|
|
701
|
+
try {
|
|
702
|
+
return f.apply(this, args);
|
|
703
|
+
} catch (e) {
|
|
704
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* The plaintext types that can be encrypted in a fhevm ciphertext.
|
|
709
|
+
*/
|
|
710
|
+
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
|
+
|
|
712
|
+
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
713
|
+
? { register: () => {}, unregister: () => {} }
|
|
714
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
715
|
+
/**
|
|
716
|
+
* Simple client to interact with the KMS servers. This can be seen as a proof-of-concept
|
|
717
|
+
* and reference code for validating the KMS. The logic supplied by the client will be
|
|
718
|
+
* distributed across the aggregator/proxy and smart contracts.
|
|
719
|
+
*/
|
|
720
|
+
class Client {
|
|
721
|
+
|
|
722
|
+
static __wrap(ptr) {
|
|
723
|
+
ptr = ptr >>> 0;
|
|
724
|
+
const obj = Object.create(Client.prototype);
|
|
725
|
+
obj.__wbg_ptr = ptr;
|
|
726
|
+
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
727
|
+
return obj;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
__destroy_into_raw() {
|
|
731
|
+
const ptr = this.__wbg_ptr;
|
|
732
|
+
this.__wbg_ptr = 0;
|
|
733
|
+
ClientFinalization.unregister(this);
|
|
734
|
+
return ptr;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
free() {
|
|
738
|
+
const ptr = this.__destroy_into_raw();
|
|
739
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
module.exports.Client = Client;
|
|
743
|
+
|
|
744
|
+
const CryptoBoxCtFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
745
|
+
? { register: () => {}, unregister: () => {} }
|
|
746
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_cryptoboxct_free(ptr >>> 0, 1));
|
|
747
|
+
/**
|
|
748
|
+
*/
|
|
749
|
+
class CryptoBoxCt {
|
|
750
|
+
|
|
751
|
+
static __wrap(ptr) {
|
|
752
|
+
ptr = ptr >>> 0;
|
|
753
|
+
const obj = Object.create(CryptoBoxCt.prototype);
|
|
754
|
+
obj.__wbg_ptr = ptr;
|
|
755
|
+
CryptoBoxCtFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
756
|
+
return obj;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
__destroy_into_raw() {
|
|
760
|
+
const ptr = this.__wbg_ptr;
|
|
761
|
+
this.__wbg_ptr = 0;
|
|
762
|
+
CryptoBoxCtFinalization.unregister(this);
|
|
763
|
+
return ptr;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
free() {
|
|
767
|
+
const ptr = this.__destroy_into_raw();
|
|
768
|
+
wasm.__wbg_cryptoboxct_free(ptr, 0);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
module.exports.CryptoBoxCt = CryptoBoxCt;
|
|
772
|
+
|
|
773
|
+
const Eip712DomainMsgFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
774
|
+
? { register: () => {}, unregister: () => {} }
|
|
775
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_eip712domainmsg_free(ptr >>> 0, 1));
|
|
776
|
+
/**
|
|
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
|
+
*/
|
|
781
|
+
class Eip712DomainMsg {
|
|
782
|
+
|
|
783
|
+
static __wrap(ptr) {
|
|
784
|
+
ptr = ptr >>> 0;
|
|
785
|
+
const obj = Object.create(Eip712DomainMsg.prototype);
|
|
786
|
+
obj.__wbg_ptr = ptr;
|
|
787
|
+
Eip712DomainMsgFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
788
|
+
return obj;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
__destroy_into_raw() {
|
|
792
|
+
const ptr = this.__wbg_ptr;
|
|
793
|
+
this.__wbg_ptr = 0;
|
|
794
|
+
Eip712DomainMsgFinalization.unregister(this);
|
|
795
|
+
return ptr;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
free() {
|
|
799
|
+
const ptr = this.__destroy_into_raw();
|
|
800
|
+
wasm.__wbg_eip712domainmsg_free(ptr, 0);
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* @returns {string}
|
|
804
|
+
*/
|
|
805
|
+
get name() {
|
|
806
|
+
let deferred1_0;
|
|
807
|
+
let deferred1_1;
|
|
808
|
+
try {
|
|
809
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
810
|
+
wasm.__wbg_get_eip712domainmsg_name(retptr, this.__wbg_ptr);
|
|
811
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
812
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
813
|
+
deferred1_0 = r0;
|
|
814
|
+
deferred1_1 = r1;
|
|
815
|
+
return getStringFromWasm0(r0, r1);
|
|
816
|
+
} finally {
|
|
817
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
818
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* @param {string} arg0
|
|
823
|
+
*/
|
|
824
|
+
set name(arg0) {
|
|
825
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
826
|
+
const len0 = WASM_VECTOR_LEN;
|
|
827
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* @returns {string}
|
|
831
|
+
*/
|
|
832
|
+
get version() {
|
|
833
|
+
let deferred1_0;
|
|
834
|
+
let deferred1_1;
|
|
835
|
+
try {
|
|
836
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
837
|
+
wasm.__wbg_get_eip712domainmsg_version(retptr, this.__wbg_ptr);
|
|
838
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
839
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
840
|
+
deferred1_0 = r0;
|
|
841
|
+
deferred1_1 = r1;
|
|
842
|
+
return getStringFromWasm0(r0, r1);
|
|
843
|
+
} finally {
|
|
844
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
845
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* @param {string} arg0
|
|
850
|
+
*/
|
|
851
|
+
set version(arg0) {
|
|
852
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
853
|
+
const len0 = WASM_VECTOR_LEN;
|
|
854
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* @returns {Uint8Array}
|
|
858
|
+
*/
|
|
859
|
+
get chain_id() {
|
|
860
|
+
try {
|
|
861
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
862
|
+
wasm.__wbg_get_eip712domainmsg_chain_id(retptr, this.__wbg_ptr);
|
|
863
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* @param {Uint8Array} arg0
|
|
874
|
+
*/
|
|
875
|
+
set chain_id(arg0) {
|
|
876
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
877
|
+
const len0 = WASM_VECTOR_LEN;
|
|
878
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* @returns {string}
|
|
882
|
+
*/
|
|
883
|
+
get verifying_contract() {
|
|
884
|
+
let deferred1_0;
|
|
885
|
+
let deferred1_1;
|
|
886
|
+
try {
|
|
887
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
888
|
+
wasm.__wbg_get_eip712domainmsg_verifying_contract(retptr, this.__wbg_ptr);
|
|
889
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
890
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
891
|
+
deferred1_0 = r0;
|
|
892
|
+
deferred1_1 = r1;
|
|
893
|
+
return getStringFromWasm0(r0, r1);
|
|
894
|
+
} finally {
|
|
895
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
896
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* @param {string} arg0
|
|
901
|
+
*/
|
|
902
|
+
set verifying_contract(arg0) {
|
|
903
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
904
|
+
const len0 = WASM_VECTOR_LEN;
|
|
905
|
+
wasm.__wbg_set_eip712domainmsg_verifying_contract(this.__wbg_ptr, ptr0, len0);
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* @returns {Uint8Array}
|
|
909
|
+
*/
|
|
910
|
+
get salt() {
|
|
911
|
+
try {
|
|
912
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
913
|
+
wasm.__wbg_get_eip712domainmsg_salt(retptr, this.__wbg_ptr);
|
|
914
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
915
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
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);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* @param {Uint8Array} arg0
|
|
925
|
+
*/
|
|
926
|
+
set salt(arg0) {
|
|
927
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
928
|
+
const len0 = WASM_VECTOR_LEN;
|
|
929
|
+
wasm.__wbg_set_eip712domainmsg_salt(this.__wbg_ptr, ptr0, len0);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
module.exports.Eip712DomainMsg = Eip712DomainMsg;
|
|
933
|
+
|
|
934
|
+
const ParsedReencryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
935
|
+
? { register: () => {}, unregister: () => {} }
|
|
936
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parsedreencryptionrequest_free(ptr >>> 0, 1));
|
|
937
|
+
/**
|
|
938
|
+
* Validity of this struct is not checked.
|
|
939
|
+
*/
|
|
940
|
+
class ParsedReencryptionRequest {
|
|
941
|
+
|
|
942
|
+
__destroy_into_raw() {
|
|
943
|
+
const ptr = this.__wbg_ptr;
|
|
944
|
+
this.__wbg_ptr = 0;
|
|
945
|
+
ParsedReencryptionRequestFinalization.unregister(this);
|
|
946
|
+
return ptr;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
free() {
|
|
950
|
+
const ptr = this.__destroy_into_raw();
|
|
951
|
+
wasm.__wbg_parsedreencryptionrequest_free(ptr, 0);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
module.exports.ParsedReencryptionRequest = ParsedReencryptionRequest;
|
|
955
|
+
|
|
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
|
+
const PrivateEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1002
|
+
? { register: () => {}, unregister: () => {} }
|
|
1003
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_privateenckey_free(ptr >>> 0, 1));
|
|
1004
|
+
/**
|
|
1005
|
+
*/
|
|
1006
|
+
class PrivateEncKey {
|
|
1007
|
+
|
|
1008
|
+
static __wrap(ptr) {
|
|
1009
|
+
ptr = ptr >>> 0;
|
|
1010
|
+
const obj = Object.create(PrivateEncKey.prototype);
|
|
1011
|
+
obj.__wbg_ptr = ptr;
|
|
1012
|
+
PrivateEncKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1013
|
+
return obj;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
__destroy_into_raw() {
|
|
1017
|
+
const ptr = this.__wbg_ptr;
|
|
1018
|
+
this.__wbg_ptr = 0;
|
|
1019
|
+
PrivateEncKeyFinalization.unregister(this);
|
|
1020
|
+
return ptr;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
free() {
|
|
1024
|
+
const ptr = this.__destroy_into_raw();
|
|
1025
|
+
wasm.__wbg_privateenckey_free(ptr, 0);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
module.exports.PrivateEncKey = PrivateEncKey;
|
|
1029
|
+
|
|
1030
|
+
const PrivateSigKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1031
|
+
? { register: () => {}, unregister: () => {} }
|
|
1032
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_privatesigkey_free(ptr >>> 0, 1));
|
|
1033
|
+
/**
|
|
1034
|
+
*/
|
|
1035
|
+
class PrivateSigKey {
|
|
1036
|
+
|
|
1037
|
+
static __wrap(ptr) {
|
|
1038
|
+
ptr = ptr >>> 0;
|
|
1039
|
+
const obj = Object.create(PrivateSigKey.prototype);
|
|
1040
|
+
obj.__wbg_ptr = ptr;
|
|
1041
|
+
PrivateSigKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1042
|
+
return obj;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
__destroy_into_raw() {
|
|
1046
|
+
const ptr = this.__wbg_ptr;
|
|
1047
|
+
this.__wbg_ptr = 0;
|
|
1048
|
+
PrivateSigKeyFinalization.unregister(this);
|
|
1049
|
+
return ptr;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
free() {
|
|
1053
|
+
const ptr = this.__destroy_into_raw();
|
|
1054
|
+
wasm.__wbg_privatesigkey_free(ptr, 0);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
module.exports.PrivateSigKey = PrivateSigKey;
|
|
1058
|
+
|
|
1059
|
+
const PublicEncKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1060
|
+
? { register: () => {}, unregister: () => {} }
|
|
1061
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_publicenckey_free(ptr >>> 0, 1));
|
|
1062
|
+
/**
|
|
1063
|
+
*/
|
|
1064
|
+
class PublicEncKey {
|
|
1065
|
+
|
|
1066
|
+
static __wrap(ptr) {
|
|
1067
|
+
ptr = ptr >>> 0;
|
|
1068
|
+
const obj = Object.create(PublicEncKey.prototype);
|
|
1069
|
+
obj.__wbg_ptr = ptr;
|
|
1070
|
+
PublicEncKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1071
|
+
return obj;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
__destroy_into_raw() {
|
|
1075
|
+
const ptr = this.__wbg_ptr;
|
|
1076
|
+
this.__wbg_ptr = 0;
|
|
1077
|
+
PublicEncKeyFinalization.unregister(this);
|
|
1078
|
+
return ptr;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
free() {
|
|
1082
|
+
const ptr = this.__destroy_into_raw();
|
|
1083
|
+
wasm.__wbg_publicenckey_free(ptr, 0);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
module.exports.PublicEncKey = PublicEncKey;
|
|
1087
|
+
|
|
1088
|
+
const PublicSigKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1089
|
+
? { register: () => {}, unregister: () => {} }
|
|
1090
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_publicsigkey_free(ptr >>> 0, 1));
|
|
1091
|
+
/**
|
|
1092
|
+
*/
|
|
1093
|
+
class PublicSigKey {
|
|
1094
|
+
|
|
1095
|
+
static __wrap(ptr) {
|
|
1096
|
+
ptr = ptr >>> 0;
|
|
1097
|
+
const obj = Object.create(PublicSigKey.prototype);
|
|
1098
|
+
obj.__wbg_ptr = ptr;
|
|
1099
|
+
PublicSigKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1100
|
+
return obj;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
static __unwrap(jsValue) {
|
|
1104
|
+
if (!(jsValue instanceof PublicSigKey)) {
|
|
1105
|
+
return 0;
|
|
1106
|
+
}
|
|
1107
|
+
return jsValue.__destroy_into_raw();
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
__destroy_into_raw() {
|
|
1111
|
+
const ptr = this.__wbg_ptr;
|
|
1112
|
+
this.__wbg_ptr = 0;
|
|
1113
|
+
PublicSigKeyFinalization.unregister(this);
|
|
1114
|
+
return ptr;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
free() {
|
|
1118
|
+
const ptr = this.__destroy_into_raw();
|
|
1119
|
+
wasm.__wbg_publicsigkey_free(ptr, 0);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
module.exports.PublicSigKey = PublicSigKey;
|
|
1123
|
+
|
|
1124
|
+
const ReencryptionRequestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1125
|
+
? { register: () => {}, unregister: () => {} }
|
|
1126
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequest_free(ptr >>> 0, 1));
|
|
1127
|
+
/**
|
|
1128
|
+
*/
|
|
1129
|
+
class ReencryptionRequest {
|
|
1130
|
+
|
|
1131
|
+
__destroy_into_raw() {
|
|
1132
|
+
const ptr = this.__wbg_ptr;
|
|
1133
|
+
this.__wbg_ptr = 0;
|
|
1134
|
+
ReencryptionRequestFinalization.unregister(this);
|
|
1135
|
+
return ptr;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
free() {
|
|
1139
|
+
const ptr = this.__destroy_into_raw();
|
|
1140
|
+
wasm.__wbg_reencryptionrequest_free(ptr, 0);
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
1144
|
+
* @returns {Uint8Array}
|
|
1145
|
+
*/
|
|
1146
|
+
get signature() {
|
|
1147
|
+
try {
|
|
1148
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1149
|
+
wasm.__wbg_get_reencryptionrequest_signature(retptr, this.__wbg_ptr);
|
|
1150
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Signature of the serialization of \[ReencryptionRequestPayload\].
|
|
1161
|
+
* @param {Uint8Array} arg0
|
|
1162
|
+
*/
|
|
1163
|
+
set signature(arg0) {
|
|
1164
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1166
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* @returns {ReencryptionRequestPayload | undefined}
|
|
1170
|
+
*/
|
|
1171
|
+
get payload() {
|
|
1172
|
+
const ret = wasm.__wbg_get_reencryptionrequest_payload(this.__wbg_ptr);
|
|
1173
|
+
return ret === 0 ? undefined : ReencryptionRequestPayload.__wrap(ret);
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @param {ReencryptionRequestPayload | undefined} [arg0]
|
|
1177
|
+
*/
|
|
1178
|
+
set payload(arg0) {
|
|
1179
|
+
let ptr0 = 0;
|
|
1180
|
+
if (!isLikeNone(arg0)) {
|
|
1181
|
+
_assertClass(arg0, ReencryptionRequestPayload);
|
|
1182
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1183
|
+
}
|
|
1184
|
+
wasm.__wbg_set_reencryptionrequest_payload(this.__wbg_ptr, ptr0);
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* @returns {Eip712DomainMsg | undefined}
|
|
1188
|
+
*/
|
|
1189
|
+
get domain() {
|
|
1190
|
+
const ret = wasm.__wbg_get_reencryptionrequest_domain(this.__wbg_ptr);
|
|
1191
|
+
return ret === 0 ? undefined : Eip712DomainMsg.__wrap(ret);
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* @param {Eip712DomainMsg | undefined} [arg0]
|
|
1195
|
+
*/
|
|
1196
|
+
set domain(arg0) {
|
|
1197
|
+
let ptr0 = 0;
|
|
1198
|
+
if (!isLikeNone(arg0)) {
|
|
1199
|
+
_assertClass(arg0, Eip712DomainMsg);
|
|
1200
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1201
|
+
}
|
|
1202
|
+
wasm.__wbg_set_reencryptionrequest_domain(this.__wbg_ptr, ptr0);
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* The ID that identifies this request.
|
|
1206
|
+
* Future queries for the result must use this request ID.
|
|
1207
|
+
* @returns {RequestId | undefined}
|
|
1208
|
+
*/
|
|
1209
|
+
get request_id() {
|
|
1210
|
+
const ret = wasm.__wbg_get_reencryptionrequest_request_id(this.__wbg_ptr);
|
|
1211
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* The ID that identifies this request.
|
|
1215
|
+
* Future queries for the result must use this request ID.
|
|
1216
|
+
* @param {RequestId | undefined} [arg0]
|
|
1217
|
+
*/
|
|
1218
|
+
set request_id(arg0) {
|
|
1219
|
+
let ptr0 = 0;
|
|
1220
|
+
if (!isLikeNone(arg0)) {
|
|
1221
|
+
_assertClass(arg0, RequestId);
|
|
1222
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1223
|
+
}
|
|
1224
|
+
wasm.__wbg_set_reencryptionrequest_request_id(this.__wbg_ptr, ptr0);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
module.exports.ReencryptionRequest = ReencryptionRequest;
|
|
1228
|
+
|
|
1229
|
+
const ReencryptionRequestPayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1230
|
+
? { register: () => {}, unregister: () => {} }
|
|
1231
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionrequestpayload_free(ptr >>> 0, 1));
|
|
1232
|
+
/**
|
|
1233
|
+
*/
|
|
1234
|
+
class ReencryptionRequestPayload {
|
|
1235
|
+
|
|
1236
|
+
static __wrap(ptr) {
|
|
1237
|
+
ptr = ptr >>> 0;
|
|
1238
|
+
const obj = Object.create(ReencryptionRequestPayload.prototype);
|
|
1239
|
+
obj.__wbg_ptr = ptr;
|
|
1240
|
+
ReencryptionRequestPayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1241
|
+
return obj;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
__destroy_into_raw() {
|
|
1245
|
+
const ptr = this.__wbg_ptr;
|
|
1246
|
+
this.__wbg_ptr = 0;
|
|
1247
|
+
ReencryptionRequestPayloadFinalization.unregister(this);
|
|
1248
|
+
return ptr;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
free() {
|
|
1252
|
+
const ptr = this.__destroy_into_raw();
|
|
1253
|
+
wasm.__wbg_reencryptionrequestpayload_free(ptr, 0);
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Version of the request format.
|
|
1257
|
+
* @returns {number}
|
|
1258
|
+
*/
|
|
1259
|
+
get version() {
|
|
1260
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_version(this.__wbg_ptr);
|
|
1261
|
+
return ret >>> 0;
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Version of the request format.
|
|
1265
|
+
* @param {number} arg0
|
|
1266
|
+
*/
|
|
1267
|
+
set version(arg0) {
|
|
1268
|
+
wasm.__wbg_set_reencryptionrequestpayload_version(this.__wbg_ptr, arg0);
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* The client's (blockchain wallet) address,
|
|
1272
|
+
* encoded using EIP-55.
|
|
1273
|
+
* @returns {string}
|
|
1274
|
+
*/
|
|
1275
|
+
get client_address() {
|
|
1276
|
+
let deferred1_0;
|
|
1277
|
+
let deferred1_1;
|
|
1278
|
+
try {
|
|
1279
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1280
|
+
wasm.__wbg_get_eip712domainmsg_name(retptr, this.__wbg_ptr);
|
|
1281
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1282
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1283
|
+
deferred1_0 = r0;
|
|
1284
|
+
deferred1_1 = r1;
|
|
1285
|
+
return getStringFromWasm0(r0, r1);
|
|
1286
|
+
} finally {
|
|
1287
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1288
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* The client's (blockchain wallet) address,
|
|
1293
|
+
* encoded using EIP-55.
|
|
1294
|
+
* @param {string} arg0
|
|
1295
|
+
*/
|
|
1296
|
+
set client_address(arg0) {
|
|
1297
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1298
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1299
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Encoding of the user's public encryption key for this request.
|
|
1303
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1304
|
+
* Montgomery point.
|
|
1305
|
+
* @returns {Uint8Array}
|
|
1306
|
+
*/
|
|
1307
|
+
get enc_key() {
|
|
1308
|
+
try {
|
|
1309
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1310
|
+
wasm.__wbg_get_reencryptionrequestpayload_enc_key(retptr, this.__wbg_ptr);
|
|
1311
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Encoding of the user's public encryption key for this request.
|
|
1322
|
+
* Encoding using the default encoding of libsodium, i.e. the 32 bytes of a
|
|
1323
|
+
* Montgomery point.
|
|
1324
|
+
* @param {Uint8Array} arg0
|
|
1325
|
+
*/
|
|
1326
|
+
set enc_key(arg0) {
|
|
1327
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1328
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1329
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* The type of plaintext encrypted.
|
|
1333
|
+
* @returns {number}
|
|
1334
|
+
*/
|
|
1335
|
+
get fhe_type() {
|
|
1336
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_fhe_type(this.__wbg_ptr);
|
|
1337
|
+
return ret;
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* The type of plaintext encrypted.
|
|
1341
|
+
* @param {number} arg0
|
|
1342
|
+
*/
|
|
1343
|
+
set fhe_type(arg0) {
|
|
1344
|
+
wasm.__wbg_set_reencryptionrequestpayload_fhe_type(this.__wbg_ptr, arg0);
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* The key id to use for decryption. Will be the request_id used during key
|
|
1348
|
+
* generation
|
|
1349
|
+
* @returns {RequestId | undefined}
|
|
1350
|
+
*/
|
|
1351
|
+
get key_id() {
|
|
1352
|
+
const ret = wasm.__wbg_get_reencryptionrequestpayload_key_id(this.__wbg_ptr);
|
|
1353
|
+
return ret === 0 ? undefined : RequestId.__wrap(ret);
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* The key id to use for decryption. Will be the request_id used during key
|
|
1357
|
+
* generation
|
|
1358
|
+
* @param {RequestId | undefined} [arg0]
|
|
1359
|
+
*/
|
|
1360
|
+
set key_id(arg0) {
|
|
1361
|
+
let ptr0 = 0;
|
|
1362
|
+
if (!isLikeNone(arg0)) {
|
|
1363
|
+
_assertClass(arg0, RequestId);
|
|
1364
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1365
|
+
}
|
|
1366
|
+
wasm.__wbg_set_reencryptionrequestpayload_key_id(this.__wbg_ptr, ptr0);
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
1370
|
+
* When creating the payload, this field may be empty,
|
|
1371
|
+
* it is the responsibility of the gateway to fetch the
|
|
1372
|
+
* ciphertext for the given digest below.
|
|
1373
|
+
* @returns {Uint8Array | undefined}
|
|
1374
|
+
*/
|
|
1375
|
+
get ciphertext() {
|
|
1376
|
+
try {
|
|
1377
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1378
|
+
wasm.__wbg_get_reencryptionrequestpayload_ciphertext(retptr, this.__wbg_ptr);
|
|
1379
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1380
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
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);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* The actual ciphertext to decrypt, taken directly from the fhevm.
|
|
1393
|
+
* When creating the payload, this field may be empty,
|
|
1394
|
+
* it is the responsibility of the gateway to fetch the
|
|
1395
|
+
* ciphertext for the given digest below.
|
|
1396
|
+
* @param {Uint8Array | undefined} [arg0]
|
|
1397
|
+
*/
|
|
1398
|
+
set ciphertext(arg0) {
|
|
1399
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1400
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1401
|
+
wasm.__wbg_set_reencryptionrequestpayload_ciphertext(this.__wbg_ptr, ptr0, len0);
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* The SHA3 digest of the ciphertext above.
|
|
1405
|
+
* @returns {Uint8Array}
|
|
1406
|
+
*/
|
|
1407
|
+
get ciphertext_digest() {
|
|
1408
|
+
try {
|
|
1409
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1410
|
+
wasm.__wbg_get_eip712domainmsg_chain_id(retptr, this.__wbg_ptr);
|
|
1411
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* The SHA3 digest of the ciphertext above.
|
|
1422
|
+
* @param {Uint8Array} arg0
|
|
1423
|
+
*/
|
|
1424
|
+
set ciphertext_digest(arg0) {
|
|
1425
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1426
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1427
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
module.exports.ReencryptionRequestPayload = ReencryptionRequestPayload;
|
|
1431
|
+
|
|
1432
|
+
const ReencryptionResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1433
|
+
? { register: () => {}, unregister: () => {} }
|
|
1434
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponse_free(ptr >>> 0, 1));
|
|
1435
|
+
/**
|
|
1436
|
+
*/
|
|
1437
|
+
class ReencryptionResponse {
|
|
1438
|
+
|
|
1439
|
+
static __unwrap(jsValue) {
|
|
1440
|
+
if (!(jsValue instanceof ReencryptionResponse)) {
|
|
1441
|
+
return 0;
|
|
1442
|
+
}
|
|
1443
|
+
return jsValue.__destroy_into_raw();
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
__destroy_into_raw() {
|
|
1447
|
+
const ptr = this.__wbg_ptr;
|
|
1448
|
+
this.__wbg_ptr = 0;
|
|
1449
|
+
ReencryptionResponseFinalization.unregister(this);
|
|
1450
|
+
return ptr;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
free() {
|
|
1454
|
+
const ptr = this.__destroy_into_raw();
|
|
1455
|
+
wasm.__wbg_reencryptionresponse_free(ptr, 0);
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* @returns {Uint8Array}
|
|
1459
|
+
*/
|
|
1460
|
+
get signature() {
|
|
1461
|
+
try {
|
|
1462
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1463
|
+
wasm.__wbg_get_reencryptionrequest_signature(retptr, this.__wbg_ptr);
|
|
1464
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* @param {Uint8Array} arg0
|
|
1475
|
+
*/
|
|
1476
|
+
set signature(arg0) {
|
|
1477
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1478
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1479
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
1483
|
+
* @returns {ReencryptionResponsePayload | undefined}
|
|
1484
|
+
*/
|
|
1485
|
+
get payload() {
|
|
1486
|
+
const ret = wasm.__wbg_get_reencryptionresponse_payload(this.__wbg_ptr);
|
|
1487
|
+
return ret === 0 ? undefined : ReencryptionResponsePayload.__wrap(ret);
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Signature of the serialization of \[ReencryptionResponsePayload\].
|
|
1491
|
+
* @param {ReencryptionResponsePayload | undefined} [arg0]
|
|
1492
|
+
*/
|
|
1493
|
+
set payload(arg0) {
|
|
1494
|
+
let ptr0 = 0;
|
|
1495
|
+
if (!isLikeNone(arg0)) {
|
|
1496
|
+
_assertClass(arg0, ReencryptionResponsePayload);
|
|
1497
|
+
ptr0 = arg0.__destroy_into_raw();
|
|
1498
|
+
}
|
|
1499
|
+
wasm.__wbg_set_reencryptionresponse_payload(this.__wbg_ptr, ptr0);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
module.exports.ReencryptionResponse = ReencryptionResponse;
|
|
1503
|
+
|
|
1504
|
+
const ReencryptionResponsePayloadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1505
|
+
? { register: () => {}, unregister: () => {} }
|
|
1506
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_reencryptionresponsepayload_free(ptr >>> 0, 1));
|
|
1507
|
+
/**
|
|
1508
|
+
*/
|
|
1509
|
+
class ReencryptionResponsePayload {
|
|
1510
|
+
|
|
1511
|
+
static __wrap(ptr) {
|
|
1512
|
+
ptr = ptr >>> 0;
|
|
1513
|
+
const obj = Object.create(ReencryptionResponsePayload.prototype);
|
|
1514
|
+
obj.__wbg_ptr = ptr;
|
|
1515
|
+
ReencryptionResponsePayloadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1516
|
+
return obj;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
__destroy_into_raw() {
|
|
1520
|
+
const ptr = this.__wbg_ptr;
|
|
1521
|
+
this.__wbg_ptr = 0;
|
|
1522
|
+
ReencryptionResponsePayloadFinalization.unregister(this);
|
|
1523
|
+
return ptr;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
free() {
|
|
1527
|
+
const ptr = this.__destroy_into_raw();
|
|
1528
|
+
wasm.__wbg_reencryptionresponsepayload_free(ptr, 0);
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* Version of the response format.
|
|
1532
|
+
* @returns {number}
|
|
1533
|
+
*/
|
|
1534
|
+
get version() {
|
|
1535
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_version(this.__wbg_ptr);
|
|
1536
|
+
return ret >>> 0;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Version of the response format.
|
|
1540
|
+
* @param {number} arg0
|
|
1541
|
+
*/
|
|
1542
|
+
set version(arg0) {
|
|
1543
|
+
wasm.__wbg_set_reencryptionresponsepayload_version(this.__wbg_ptr, arg0);
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* The server's signature verification key.
|
|
1547
|
+
* Encoded using SEC1.
|
|
1548
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1549
|
+
* trusted keys.
|
|
1550
|
+
* @returns {Uint8Array}
|
|
1551
|
+
*/
|
|
1552
|
+
get verification_key() {
|
|
1553
|
+
try {
|
|
1554
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1555
|
+
wasm.__wbg_get_reencryptionrequest_signature(retptr, this.__wbg_ptr);
|
|
1556
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* The server's signature verification key.
|
|
1567
|
+
* Encoded using SEC1.
|
|
1568
|
+
* Needed to validate the response, but MUST also be linked to a list of
|
|
1569
|
+
* trusted keys.
|
|
1570
|
+
* @param {Uint8Array} arg0
|
|
1571
|
+
*/
|
|
1572
|
+
set verification_key(arg0) {
|
|
1573
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1574
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1575
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* The concatenation of two digests:
|
|
1579
|
+
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
1580
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1581
|
+
* @returns {Uint8Array}
|
|
1582
|
+
*/
|
|
1583
|
+
get digest() {
|
|
1584
|
+
try {
|
|
1585
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1586
|
+
wasm.__wbg_get_reencryptionrequestpayload_enc_key(retptr, this.__wbg_ptr);
|
|
1587
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* The concatenation of two digests:
|
|
1598
|
+
* (eip712_signing_hash(pk, domain) || ciphertext digest).
|
|
1599
|
+
* This is needed to ensure the response corresponds to the request.
|
|
1600
|
+
* @param {Uint8Array} arg0
|
|
1601
|
+
*/
|
|
1602
|
+
set digest(arg0) {
|
|
1603
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1604
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1605
|
+
wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr, ptr0, len0);
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* The type of plaintext encrypted.
|
|
1609
|
+
* @returns {number}
|
|
1610
|
+
*/
|
|
1611
|
+
get fhe_type() {
|
|
1612
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr);
|
|
1613
|
+
return ret;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* The type of plaintext encrypted.
|
|
1617
|
+
* @param {number} arg0
|
|
1618
|
+
*/
|
|
1619
|
+
set fhe_type(arg0) {
|
|
1620
|
+
wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr, arg0);
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1624
|
+
* sign-then-encrypt.
|
|
1625
|
+
* @returns {Uint8Array}
|
|
1626
|
+
*/
|
|
1627
|
+
get signcrypted_ciphertext() {
|
|
1628
|
+
try {
|
|
1629
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1630
|
+
wasm.__wbg_get_eip712domainmsg_chain_id(retptr, this.__wbg_ptr);
|
|
1631
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
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
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* The signcrypted payload, using a hybrid encryption approach in
|
|
1642
|
+
* sign-then-encrypt.
|
|
1643
|
+
* @param {Uint8Array} arg0
|
|
1644
|
+
*/
|
|
1645
|
+
set signcrypted_ciphertext(arg0) {
|
|
1646
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1647
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1648
|
+
wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr, ptr0, len0);
|
|
1649
|
+
}
|
|
1650
|
+
/**
|
|
1651
|
+
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
1652
|
+
* reconstruction.
|
|
1653
|
+
* @returns {number}
|
|
1654
|
+
*/
|
|
1655
|
+
get party_id() {
|
|
1656
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_party_id(this.__wbg_ptr);
|
|
1657
|
+
return ret >>> 0;
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* The ID of the MPC party doing the reencryption. Used for polynomial
|
|
1661
|
+
* reconstruction.
|
|
1662
|
+
* @param {number} arg0
|
|
1663
|
+
*/
|
|
1664
|
+
set party_id(arg0) {
|
|
1665
|
+
wasm.__wbg_set_reencryptionresponsepayload_party_id(this.__wbg_ptr, arg0);
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* The degree of the sharing scheme used.
|
|
1669
|
+
* @returns {number}
|
|
1670
|
+
*/
|
|
1671
|
+
get degree() {
|
|
1672
|
+
const ret = wasm.__wbg_get_reencryptionresponsepayload_degree(this.__wbg_ptr);
|
|
1673
|
+
return ret >>> 0;
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* The degree of the sharing scheme used.
|
|
1677
|
+
* @param {number} arg0
|
|
1678
|
+
*/
|
|
1679
|
+
set degree(arg0) {
|
|
1680
|
+
wasm.__wbg_set_reencryptionresponsepayload_degree(this.__wbg_ptr, arg0);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
module.exports.ReencryptionResponsePayload = ReencryptionResponsePayload;
|
|
1684
|
+
|
|
1685
|
+
const RequestIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1686
|
+
? { register: () => {}, unregister: () => {} }
|
|
1687
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_requestid_free(ptr >>> 0, 1));
|
|
1688
|
+
/**
|
|
1689
|
+
* Simple response to return an ID, to be used to retrieve the computed result
|
|
1690
|
+
* later on.
|
|
1691
|
+
*/
|
|
1692
|
+
class RequestId {
|
|
1693
|
+
|
|
1694
|
+
static __wrap(ptr) {
|
|
1695
|
+
ptr = ptr >>> 0;
|
|
1696
|
+
const obj = Object.create(RequestId.prototype);
|
|
1697
|
+
obj.__wbg_ptr = ptr;
|
|
1698
|
+
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1699
|
+
return obj;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
__destroy_into_raw() {
|
|
1703
|
+
const ptr = this.__wbg_ptr;
|
|
1704
|
+
this.__wbg_ptr = 0;
|
|
1705
|
+
RequestIdFinalization.unregister(this);
|
|
1706
|
+
return ptr;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
free() {
|
|
1710
|
+
const ptr = this.__destroy_into_raw();
|
|
1711
|
+
wasm.__wbg_requestid_free(ptr, 0);
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* @returns {string}
|
|
1715
|
+
*/
|
|
1716
|
+
get request_id() {
|
|
1717
|
+
let deferred1_0;
|
|
1718
|
+
let deferred1_1;
|
|
1719
|
+
try {
|
|
1720
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1721
|
+
wasm.__wbg_get_eip712domainmsg_name(retptr, this.__wbg_ptr);
|
|
1722
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1723
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1724
|
+
deferred1_0 = r0;
|
|
1725
|
+
deferred1_1 = r1;
|
|
1726
|
+
return getStringFromWasm0(r0, r1);
|
|
1727
|
+
} finally {
|
|
1728
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1729
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* @param {string} arg0
|
|
1734
|
+
*/
|
|
1735
|
+
set request_id(arg0) {
|
|
1736
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1737
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1738
|
+
wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr, ptr0, len0);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
module.exports.RequestId = RequestId;
|
|
1742
|
+
|
|
1743
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
1744
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1745
|
+
return addHeapObject(ret);
|
|
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);
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
1758
|
+
const obj = getObject(arg1);
|
|
1759
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1760
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1761
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
module.exports.__wbg_publicsigkey_unwrap = function(arg0) {
|
|
1765
|
+
const ret = PublicSigKey.__unwrap(takeObject(arg0));
|
|
1766
|
+
return ret;
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
module.exports.__wbg_reencryptionresponse_unwrap = function(arg0) {
|
|
1770
|
+
const ret = ReencryptionResponse.__unwrap(takeObject(arg0));
|
|
1771
|
+
return ret;
|
|
1772
|
+
};
|
|
1773
|
+
|
|
1774
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1775
|
+
const obj = getObject(arg1);
|
|
1776
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1777
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1778
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1779
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1780
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1781
|
+
};
|
|
1782
|
+
|
|
1783
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1784
|
+
const val = getObject(arg0);
|
|
1785
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1786
|
+
return ret;
|
|
1787
|
+
};
|
|
1788
|
+
|
|
1789
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
1790
|
+
const ret = getObject(arg0) === undefined;
|
|
1791
|
+
return ret;
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
1795
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
1796
|
+
return ret;
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
1800
|
+
const ret = getObject(arg0) === null;
|
|
1801
|
+
return ret;
|
|
1802
|
+
};
|
|
1803
|
+
|
|
1804
|
+
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
1805
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
1806
|
+
return ret;
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
1810
|
+
const v = getObject(arg0);
|
|
1811
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1812
|
+
return ret;
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
module.exports.__wbindgen_as_number = function(arg0) {
|
|
1816
|
+
const ret = +getObject(arg0);
|
|
1817
|
+
return ret;
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
|
|
1821
|
+
const ret = String(getObject(arg1));
|
|
1822
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1823
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1824
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1825
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1826
|
+
};
|
|
1827
|
+
|
|
1828
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1829
|
+
const ret = getObject(arg0);
|
|
1830
|
+
return addHeapObject(ret);
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1834
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1835
|
+
return addHeapObject(ret);
|
|
1836
|
+
};
|
|
1837
|
+
|
|
1838
|
+
module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
|
|
1839
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
1840
|
+
return addHeapObject(ret);
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
1844
|
+
const ret = new Error();
|
|
1845
|
+
return addHeapObject(ret);
|
|
1846
|
+
};
|
|
1847
|
+
|
|
1848
|
+
module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
1849
|
+
const ret = getObject(arg1).stack;
|
|
1850
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1851
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1852
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1853
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1854
|
+
};
|
|
1855
|
+
|
|
1856
|
+
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
1857
|
+
let deferred0_0;
|
|
1858
|
+
let deferred0_1;
|
|
1859
|
+
try {
|
|
1860
|
+
deferred0_0 = arg0;
|
|
1861
|
+
deferred0_1 = arg1;
|
|
1862
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1863
|
+
} finally {
|
|
1864
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1865
|
+
}
|
|
1866
|
+
};
|
|
1867
|
+
|
|
1868
|
+
module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1869
|
+
const ret = getObject(arg0).crypto;
|
|
1870
|
+
return addHeapObject(ret);
|
|
1871
|
+
};
|
|
1872
|
+
|
|
1873
|
+
module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
1874
|
+
const ret = getObject(arg0).process;
|
|
1875
|
+
return addHeapObject(ret);
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
1879
|
+
const ret = getObject(arg0).versions;
|
|
1880
|
+
return addHeapObject(ret);
|
|
1881
|
+
};
|
|
1882
|
+
|
|
1883
|
+
module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
1884
|
+
const ret = getObject(arg0).node;
|
|
1885
|
+
return addHeapObject(ret);
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1888
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
1889
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
1890
|
+
return ret;
|
|
1891
|
+
};
|
|
1892
|
+
|
|
1893
|
+
module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
1894
|
+
const ret = module.require;
|
|
1895
|
+
return addHeapObject(ret);
|
|
1896
|
+
}, arguments) };
|
|
1897
|
+
|
|
1898
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
1899
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1900
|
+
return ret;
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
1904
|
+
const ret = getObject(arg0).msCrypto;
|
|
1905
|
+
return addHeapObject(ret);
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1908
|
+
module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
1909
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
1910
|
+
}, arguments) };
|
|
1911
|
+
|
|
1912
|
+
module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
1913
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
1914
|
+
}, arguments) };
|
|
1915
|
+
|
|
1916
|
+
module.exports.__wbg_get_3baa728f9d58d3f6 = function(arg0, arg1) {
|
|
1917
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1918
|
+
return addHeapObject(ret);
|
|
1919
|
+
};
|
|
1920
|
+
|
|
1921
|
+
module.exports.__wbg_length_ae22078168b726f5 = function(arg0) {
|
|
1922
|
+
const ret = getObject(arg0).length;
|
|
1923
|
+
return ret;
|
|
1924
|
+
};
|
|
1925
|
+
|
|
1926
|
+
module.exports.__wbg_newnoargs_76313bd6ff35d0f2 = function(arg0, arg1) {
|
|
1927
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1928
|
+
return addHeapObject(ret);
|
|
1929
|
+
};
|
|
1930
|
+
|
|
1931
|
+
module.exports.__wbg_next_de3e9db4440638b2 = function(arg0) {
|
|
1932
|
+
const ret = getObject(arg0).next;
|
|
1933
|
+
return addHeapObject(ret);
|
|
1934
|
+
};
|
|
1935
|
+
|
|
1936
|
+
module.exports.__wbg_next_f9cb570345655b9a = function() { return handleError(function (arg0) {
|
|
1937
|
+
const ret = getObject(arg0).next();
|
|
1938
|
+
return addHeapObject(ret);
|
|
1939
|
+
}, arguments) };
|
|
1940
|
+
|
|
1941
|
+
module.exports.__wbg_done_bfda7aa8f252b39f = function(arg0) {
|
|
1942
|
+
const ret = getObject(arg0).done;
|
|
1943
|
+
return ret;
|
|
1944
|
+
};
|
|
1945
|
+
|
|
1946
|
+
module.exports.__wbg_value_6d39332ab4788d86 = function(arg0) {
|
|
1947
|
+
const ret = getObject(arg0).value;
|
|
1948
|
+
return addHeapObject(ret);
|
|
1949
|
+
};
|
|
1950
|
+
|
|
1951
|
+
module.exports.__wbg_iterator_888179a48810a9fe = function() {
|
|
1952
|
+
const ret = Symbol.iterator;
|
|
1953
|
+
return addHeapObject(ret);
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1956
|
+
module.exports.__wbg_get_224d16597dbbfd96 = function() { return handleError(function (arg0, arg1) {
|
|
1957
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1958
|
+
return addHeapObject(ret);
|
|
1959
|
+
}, arguments) };
|
|
1960
|
+
|
|
1961
|
+
module.exports.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
|
|
1962
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
1963
|
+
return addHeapObject(ret);
|
|
1964
|
+
}, arguments) };
|
|
1965
|
+
|
|
1966
|
+
module.exports.__wbg_self_3093d5d1f7bcb682 = function() { return handleError(function () {
|
|
1967
|
+
const ret = self.self;
|
|
1968
|
+
return addHeapObject(ret);
|
|
1969
|
+
}, arguments) };
|
|
1970
|
+
|
|
1971
|
+
module.exports.__wbg_window_3bcfc4d31bc012f8 = function() { return handleError(function () {
|
|
1972
|
+
const ret = window.window;
|
|
1973
|
+
return addHeapObject(ret);
|
|
1974
|
+
}, arguments) };
|
|
1975
|
+
|
|
1976
|
+
module.exports.__wbg_globalThis_86b222e13bdf32ed = function() { return handleError(function () {
|
|
1977
|
+
const ret = globalThis.globalThis;
|
|
1978
|
+
return addHeapObject(ret);
|
|
1979
|
+
}, arguments) };
|
|
1980
|
+
|
|
1981
|
+
module.exports.__wbg_global_e5a3fe56f8be9485 = function() { return handleError(function () {
|
|
1982
|
+
const ret = global.global;
|
|
1983
|
+
return addHeapObject(ret);
|
|
1984
|
+
}, arguments) };
|
|
1985
|
+
|
|
1986
|
+
module.exports.__wbg_isArray_8364a5371e9737d8 = function(arg0) {
|
|
1987
|
+
const ret = Array.isArray(getObject(arg0));
|
|
1988
|
+
return ret;
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
module.exports.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function(arg0) {
|
|
1992
|
+
let result;
|
|
1993
|
+
try {
|
|
1994
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1995
|
+
} catch (_) {
|
|
1996
|
+
result = false;
|
|
1997
|
+
}
|
|
1998
|
+
const ret = result;
|
|
1999
|
+
return ret;
|
|
2000
|
+
};
|
|
2001
|
+
|
|
2002
|
+
module.exports.__wbg_call_89af060b4e1523f2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2003
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
2004
|
+
return addHeapObject(ret);
|
|
2005
|
+
}, arguments) };
|
|
2006
|
+
|
|
2007
|
+
module.exports.__wbg_isSafeInteger_7f1ed56200d90674 = function(arg0) {
|
|
2008
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
2009
|
+
return ret;
|
|
2010
|
+
};
|
|
2011
|
+
|
|
2012
|
+
module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
|
|
2013
|
+
const ret = getObject(arg0).buffer;
|
|
2014
|
+
return addHeapObject(ret);
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
module.exports.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
|
|
2018
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
2019
|
+
return addHeapObject(ret);
|
|
2020
|
+
};
|
|
2021
|
+
|
|
2022
|
+
module.exports.__wbg_new_ea1883e1e5e86686 = function(arg0) {
|
|
2023
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
2024
|
+
return addHeapObject(ret);
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
|
|
2028
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
2029
|
+
};
|
|
2030
|
+
|
|
2031
|
+
module.exports.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
|
|
2032
|
+
const ret = getObject(arg0).length;
|
|
2033
|
+
return ret;
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
module.exports.__wbg_instanceof_Uint8Array_247a91427532499e = function(arg0) {
|
|
2037
|
+
let result;
|
|
2038
|
+
try {
|
|
2039
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
2040
|
+
} catch (_) {
|
|
2041
|
+
result = false;
|
|
2042
|
+
}
|
|
2043
|
+
const ret = result;
|
|
2044
|
+
return ret;
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2047
|
+
module.exports.__wbg_newwithlength_ec548f448387c968 = function(arg0) {
|
|
2048
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
2049
|
+
return addHeapObject(ret);
|
|
2050
|
+
};
|
|
2051
|
+
|
|
2052
|
+
module.exports.__wbg_subarray_7c2e3576afe181d1 = function(arg0, arg1, arg2) {
|
|
2053
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2054
|
+
return addHeapObject(ret);
|
|
2055
|
+
};
|
|
2056
|
+
|
|
2057
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
2058
|
+
const ret = debugString(getObject(arg1));
|
|
2059
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2060
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2061
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2062
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2063
|
+
};
|
|
2064
|
+
|
|
2065
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
2066
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2067
|
+
};
|
|
2068
|
+
|
|
2069
|
+
module.exports.__wbindgen_memory = function() {
|
|
2070
|
+
const ret = wasm.memory;
|
|
2071
|
+
return addHeapObject(ret);
|
|
2072
|
+
};
|
|
2073
|
+
|
|
2074
|
+
const path = require('path').join(__dirname, 'kms_lib_bg.wasm');
|
|
2075
|
+
const bytes = require('fs').readFileSync(path);
|
|
2076
|
+
|
|
2077
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
|
2078
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
2079
|
+
wasm = wasmInstance.exports;
|
|
2080
|
+
module.exports.__wasm = wasm;
|
|
2081
|
+
|