@wireapp/core-crypto 0.6.0-rc.4 → 0.6.0-rc.6
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.
@@ -1,98 +1,85 @@
|
|
1
|
-
/******************************************************************************
|
2
|
-
Copyright (c) Microsoft Corporation.
|
3
|
-
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
5
|
-
purpose with or without fee is hereby granted.
|
6
|
-
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
14
|
-
***************************************************************************** */
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
23
|
-
if (kind === "m")
|
24
|
-
|
25
|
-
if (
|
26
|
-
|
1
|
+
/******************************************************************************
|
2
|
+
Copyright (c) Microsoft Corporation.
|
3
|
+
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
5
|
+
purpose with or without fee is hereby granted.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
***************************************************************************** */
|
15
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
16
|
+
if (kind === "a" && !f)
|
17
|
+
throw new TypeError("Private accessor was defined without a getter");
|
18
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
19
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
21
|
+
}
|
22
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
23
|
+
if (kind === "m")
|
24
|
+
throw new TypeError("Private method is not writable");
|
25
|
+
if (kind === "a" && !f)
|
26
|
+
throw new TypeError("Private accessor was defined without a setter");
|
27
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
28
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
27
30
|
}
|
28
31
|
|
29
32
|
let wasm$1;
|
30
|
-
|
31
|
-
const heap = new Array(32).fill(undefined);
|
32
|
-
|
33
|
+
const heap = new Array(128).fill(undefined);
|
33
34
|
heap.push(undefined, null, true, false);
|
34
|
-
|
35
35
|
function getObject(idx) { return heap[idx]; }
|
36
|
-
|
37
36
|
let heap_next = heap.length;
|
38
|
-
|
39
|
-
function addHeapObject(obj) {
|
40
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
41
|
-
const idx = heap_next;
|
42
|
-
heap_next = heap[idx];
|
43
|
-
|
44
|
-
heap[idx] = obj;
|
45
|
-
return idx;
|
46
|
-
}
|
47
|
-
|
48
37
|
function dropObject(idx) {
|
49
|
-
if (idx <
|
38
|
+
if (idx < 132)
|
39
|
+
return;
|
50
40
|
heap[idx] = heap_next;
|
51
41
|
heap_next = idx;
|
52
42
|
}
|
53
|
-
|
54
43
|
function takeObject(idx) {
|
55
44
|
const ret = getObject(idx);
|
56
45
|
dropObject(idx);
|
57
46
|
return ret;
|
58
47
|
}
|
59
|
-
|
48
|
+
function addHeapObject(obj) {
|
49
|
+
if (heap_next === heap.length)
|
50
|
+
heap.push(heap.length + 1);
|
51
|
+
const idx = heap_next;
|
52
|
+
heap_next = heap[idx];
|
53
|
+
heap[idx] = obj;
|
54
|
+
return idx;
|
55
|
+
}
|
60
56
|
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
61
|
-
|
62
57
|
cachedTextDecoder.decode();
|
63
|
-
|
64
|
-
let cachedUint8Memory0 = new Uint8Array();
|
65
|
-
|
58
|
+
let cachedUint8Memory0 = null;
|
66
59
|
function getUint8Memory0() {
|
67
|
-
if (cachedUint8Memory0.byteLength === 0) {
|
60
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
68
61
|
cachedUint8Memory0 = new Uint8Array(wasm$1.memory.buffer);
|
69
62
|
}
|
70
63
|
return cachedUint8Memory0;
|
71
64
|
}
|
72
|
-
|
73
65
|
function getStringFromWasm0(ptr, len) {
|
74
66
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
75
67
|
}
|
76
|
-
|
77
68
|
let WASM_VECTOR_LEN = 0;
|
78
|
-
|
79
69
|
const cachedTextEncoder = new TextEncoder('utf-8');
|
80
|
-
|
81
70
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
82
71
|
? function (arg, view) {
|
83
|
-
|
84
|
-
}
|
72
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
73
|
+
}
|
85
74
|
: function (arg, view) {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
});
|
93
|
-
|
75
|
+
const buf = cachedTextEncoder.encode(arg);
|
76
|
+
view.set(buf);
|
77
|
+
return {
|
78
|
+
read: arg.length,
|
79
|
+
written: buf.length
|
80
|
+
};
|
81
|
+
});
|
94
82
|
function passStringToWasm0(arg, malloc, realloc) {
|
95
|
-
|
96
83
|
if (realloc === undefined) {
|
97
84
|
const buf = cachedTextEncoder.encode(arg);
|
98
85
|
const ptr = malloc(buf.length);
|
@@ -100,20 +87,16 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
100
87
|
WASM_VECTOR_LEN = buf.length;
|
101
88
|
return ptr;
|
102
89
|
}
|
103
|
-
|
104
90
|
let len = arg.length;
|
105
91
|
let ptr = malloc(len);
|
106
|
-
|
107
92
|
const mem = getUint8Memory0();
|
108
|
-
|
109
93
|
let offset = 0;
|
110
|
-
|
111
94
|
for (; offset < len; offset++) {
|
112
95
|
const code = arg.charCodeAt(offset);
|
113
|
-
if (code > 0x7F)
|
96
|
+
if (code > 0x7F)
|
97
|
+
break;
|
114
98
|
mem[ptr + offset] = code;
|
115
99
|
}
|
116
|
-
|
117
100
|
if (offset !== len) {
|
118
101
|
if (offset !== 0) {
|
119
102
|
arg = arg.slice(offset);
|
@@ -121,50 +104,40 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
121
104
|
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
122
105
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
123
106
|
const ret = encodeString(arg, view);
|
124
|
-
|
125
107
|
offset += ret.written;
|
126
108
|
}
|
127
|
-
|
128
109
|
WASM_VECTOR_LEN = offset;
|
129
110
|
return ptr;
|
130
111
|
}
|
131
|
-
|
132
112
|
function isLikeNone(x) {
|
133
113
|
return x === undefined || x === null;
|
134
114
|
}
|
135
|
-
|
136
|
-
let cachedInt32Memory0 = new Int32Array();
|
137
|
-
|
115
|
+
let cachedInt32Memory0 = null;
|
138
116
|
function getInt32Memory0() {
|
139
|
-
if (cachedInt32Memory0.byteLength === 0) {
|
117
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
140
118
|
cachedInt32Memory0 = new Int32Array(wasm$1.memory.buffer);
|
141
119
|
}
|
142
120
|
return cachedInt32Memory0;
|
143
121
|
}
|
144
|
-
|
145
|
-
let cachedFloat64Memory0 = new Float64Array();
|
146
|
-
|
122
|
+
let cachedFloat64Memory0 = null;
|
147
123
|
function getFloat64Memory0() {
|
148
|
-
if (cachedFloat64Memory0.byteLength === 0) {
|
124
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
149
125
|
cachedFloat64Memory0 = new Float64Array(wasm$1.memory.buffer);
|
150
126
|
}
|
151
127
|
return cachedFloat64Memory0;
|
152
128
|
}
|
153
|
-
|
154
|
-
let cachedBigInt64Memory0 = new BigInt64Array();
|
155
|
-
|
129
|
+
let cachedBigInt64Memory0 = null;
|
156
130
|
function getBigInt64Memory0() {
|
157
|
-
if (cachedBigInt64Memory0.byteLength === 0) {
|
131
|
+
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
158
132
|
cachedBigInt64Memory0 = new BigInt64Array(wasm$1.memory.buffer);
|
159
133
|
}
|
160
134
|
return cachedBigInt64Memory0;
|
161
135
|
}
|
162
|
-
|
163
136
|
function debugString(val) {
|
164
137
|
// primitive types
|
165
138
|
const type = typeof val;
|
166
139
|
if (type == 'number' || type == 'boolean' || val == null) {
|
167
|
-
return
|
140
|
+
return `${val}`;
|
168
141
|
}
|
169
142
|
if (type == 'string') {
|
170
143
|
return `"${val}"`;
|
@@ -173,7 +146,8 @@ function debugString(val) {
|
|
173
146
|
const description = val.description;
|
174
147
|
if (description == null) {
|
175
148
|
return 'Symbol';
|
176
|
-
}
|
149
|
+
}
|
150
|
+
else {
|
177
151
|
return `Symbol(${description})`;
|
178
152
|
}
|
179
153
|
}
|
@@ -181,7 +155,8 @@ function debugString(val) {
|
|
181
155
|
const name = val.name;
|
182
156
|
if (typeof name == 'string' && name.length > 0) {
|
183
157
|
return `Function(${name})`;
|
184
|
-
}
|
158
|
+
}
|
159
|
+
else {
|
185
160
|
return 'Function';
|
186
161
|
}
|
187
162
|
}
|
@@ -192,7 +167,7 @@ function debugString(val) {
|
|
192
167
|
if (length > 0) {
|
193
168
|
debug += debugString(val[0]);
|
194
169
|
}
|
195
|
-
for(let i = 1; i < length; i++) {
|
170
|
+
for (let i = 1; i < length; i++) {
|
196
171
|
debug += ', ' + debugString(val[i]);
|
197
172
|
}
|
198
173
|
debug += ']';
|
@@ -203,7 +178,8 @@ function debugString(val) {
|
|
203
178
|
let className;
|
204
179
|
if (builtInMatches.length > 1) {
|
205
180
|
className = builtInMatches[1];
|
206
|
-
}
|
181
|
+
}
|
182
|
+
else {
|
207
183
|
// Failed to match the standard '[object ClassName]'
|
208
184
|
return toString.call(val);
|
209
185
|
}
|
@@ -213,7 +189,8 @@ function debugString(val) {
|
|
213
189
|
// easier than looping through ownProperties of `val`.
|
214
190
|
try {
|
215
191
|
return 'Object(' + JSON.stringify(val) + ')';
|
216
|
-
}
|
192
|
+
}
|
193
|
+
catch (_) {
|
217
194
|
return 'Object';
|
218
195
|
}
|
219
196
|
}
|
@@ -224,7 +201,6 @@ function debugString(val) {
|
|
224
201
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
225
202
|
return className;
|
226
203
|
}
|
227
|
-
|
228
204
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
229
205
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
230
206
|
const real = (...args) => {
|
@@ -236,53 +212,49 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
236
212
|
state.a = 0;
|
237
213
|
try {
|
238
214
|
return f(a, state.b, ...args);
|
239
|
-
}
|
215
|
+
}
|
216
|
+
finally {
|
240
217
|
if (--state.cnt === 0) {
|
241
218
|
wasm$1.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
242
|
-
|
243
|
-
|
219
|
+
}
|
220
|
+
else {
|
244
221
|
state.a = a;
|
245
222
|
}
|
246
223
|
}
|
247
224
|
};
|
248
225
|
real.original = state;
|
249
|
-
|
250
226
|
return real;
|
251
227
|
}
|
252
228
|
function __wbg_adapter_52(arg0, arg1, arg2) {
|
253
229
|
try {
|
254
230
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
255
|
-
wasm$1.
|
231
|
+
wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h017e8b5914b4ce6e(retptr, arg0, arg1, addHeapObject(arg2));
|
256
232
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
257
233
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
258
234
|
if (r1) {
|
259
235
|
throw takeObject(r0);
|
260
236
|
}
|
261
|
-
}
|
237
|
+
}
|
238
|
+
finally {
|
262
239
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
263
240
|
}
|
264
241
|
}
|
265
|
-
|
266
242
|
function __wbg_adapter_55(arg0, arg1, arg2) {
|
267
|
-
wasm$1.
|
243
|
+
wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2cd85c49913904d9(arg0, arg1, addHeapObject(arg2));
|
268
244
|
}
|
269
|
-
|
270
245
|
function _assertClass(instance, klass) {
|
271
246
|
if (!(instance instanceof klass)) {
|
272
247
|
throw new Error(`expected instance of ${klass.name}`);
|
273
248
|
}
|
274
249
|
return instance.ptr;
|
275
250
|
}
|
276
|
-
|
277
|
-
let cachedUint32Memory0 = new Uint32Array();
|
278
|
-
|
251
|
+
let cachedUint32Memory0 = null;
|
279
252
|
function getUint32Memory0() {
|
280
|
-
if (cachedUint32Memory0.byteLength === 0) {
|
253
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
281
254
|
cachedUint32Memory0 = new Uint32Array(wasm$1.memory.buffer);
|
282
255
|
}
|
283
256
|
return cachedUint32Memory0;
|
284
257
|
}
|
285
|
-
|
286
258
|
function passArrayJsValueToWasm0(array, malloc) {
|
287
259
|
const ptr = malloc(array.length * 4);
|
288
260
|
const mem = getUint32Memory0();
|
@@ -292,14 +264,12 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
292
264
|
WASM_VECTOR_LEN = array.length;
|
293
265
|
return ptr;
|
294
266
|
}
|
295
|
-
|
296
267
|
function passArray8ToWasm0(arg, malloc) {
|
297
268
|
const ptr = malloc(arg.length * 1);
|
298
269
|
getUint8Memory0().set(arg, ptr / 1);
|
299
270
|
WASM_VECTOR_LEN = arg.length;
|
300
271
|
return ptr;
|
301
272
|
}
|
302
|
-
|
303
273
|
function getArrayJsValueFromWasm0(ptr, len) {
|
304
274
|
const mem = getUint32Memory0();
|
305
275
|
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
@@ -320,90 +290,86 @@ function version() {
|
|
320
290
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
321
291
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
322
292
|
return getStringFromWasm0(r0, r1);
|
323
|
-
}
|
293
|
+
}
|
294
|
+
finally {
|
324
295
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
325
296
|
wasm$1.__wbindgen_free(r0, r1);
|
326
297
|
}
|
327
298
|
}
|
328
|
-
|
329
299
|
function handleError(f, args) {
|
330
300
|
try {
|
331
301
|
return f.apply(this, args);
|
332
|
-
}
|
302
|
+
}
|
303
|
+
catch (e) {
|
333
304
|
wasm$1.__wbindgen_exn_store(addHeapObject(e));
|
334
305
|
}
|
335
306
|
}
|
336
|
-
|
337
307
|
function getArrayU8FromWasm0(ptr, len) {
|
338
308
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
339
309
|
}
|
340
|
-
function
|
341
|
-
wasm$1.
|
310
|
+
function __wbg_adapter_263(arg0, arg1, arg2, arg3) {
|
311
|
+
wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h8cd39efe380c2d83(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
342
312
|
}
|
343
|
-
|
344
313
|
/**
|
345
314
|
* see [core_crypto::prelude::MlsWirePolicy]
|
346
315
|
*/
|
347
316
|
const WirePolicy$1 = Object.freeze({
|
348
|
-
/**
|
349
|
-
* Handshake messages are never encrypted
|
350
|
-
*/
|
351
|
-
Plaintext:1,"1":"Plaintext",
|
352
|
-
/**
|
353
|
-
* Handshake messages are always encrypted
|
354
|
-
*/
|
355
|
-
Ciphertext:2,"2":"Ciphertext",
|
317
|
+
/**
|
318
|
+
* Handshake messages are never encrypted
|
319
|
+
*/
|
320
|
+
Plaintext: 1, "1": "Plaintext",
|
321
|
+
/**
|
322
|
+
* Handshake messages are always encrypted
|
323
|
+
*/
|
324
|
+
Ciphertext: 2, "2": "Ciphertext",
|
325
|
+
});
|
356
326
|
/**
|
357
327
|
* see [core_crypto::prelude::CiphersuiteName]
|
358
328
|
*/
|
359
329
|
const Ciphersuite$1 = Object.freeze({
|
360
|
-
/**
|
361
|
-
* DH KEM x25519 | AES-GCM 128 | SHA2-256 | Ed25519
|
362
|
-
*/
|
363
|
-
MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519:1,"1":"MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519",
|
364
|
-
/**
|
365
|
-
* DH KEM P256 | AES-GCM 128 | SHA2-256 | EcDSA P256
|
366
|
-
*/
|
367
|
-
MLS_128_DHKEMP256_AES128GCM_SHA256_P256:2,"2":"MLS_128_DHKEMP256_AES128GCM_SHA256_P256",
|
368
|
-
/**
|
369
|
-
* DH KEM x25519 | Chacha20Poly1305 | SHA2-256 | Ed25519
|
370
|
-
*/
|
371
|
-
MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519:3,"3":"MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519",
|
372
|
-
/**
|
373
|
-
* DH KEM x448 | AES-GCM 256 | SHA2-512 | Ed448
|
374
|
-
*/
|
375
|
-
MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448:4,"4":"MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448",
|
376
|
-
/**
|
377
|
-
* DH KEM P521 | AES-GCM 256 | SHA2-512 | EcDSA P521
|
378
|
-
*/
|
379
|
-
MLS_256_DHKEMP521_AES256GCM_SHA512_P521:5,"5":"MLS_256_DHKEMP521_AES256GCM_SHA512_P521",
|
380
|
-
/**
|
381
|
-
* DH KEM x448 | Chacha20Poly1305 | SHA2-512 | Ed448
|
382
|
-
*/
|
383
|
-
MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448:6,"6":"MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448",
|
384
|
-
/**
|
385
|
-
* DH KEM P384 | AES-GCM 256 | SHA2-384 | EcDSA P384
|
386
|
-
*/
|
387
|
-
MLS_256_DHKEMP384_AES256GCM_SHA384_P384:7,"7":"MLS_256_DHKEMP384_AES256GCM_SHA384_P384",
|
330
|
+
/**
|
331
|
+
* DH KEM x25519 | AES-GCM 128 | SHA2-256 | Ed25519
|
332
|
+
*/
|
333
|
+
MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519: 1, "1": "MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519",
|
334
|
+
/**
|
335
|
+
* DH KEM P256 | AES-GCM 128 | SHA2-256 | EcDSA P256
|
336
|
+
*/
|
337
|
+
MLS_128_DHKEMP256_AES128GCM_SHA256_P256: 2, "2": "MLS_128_DHKEMP256_AES128GCM_SHA256_P256",
|
338
|
+
/**
|
339
|
+
* DH KEM x25519 | Chacha20Poly1305 | SHA2-256 | Ed25519
|
340
|
+
*/
|
341
|
+
MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519: 3, "3": "MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519",
|
342
|
+
/**
|
343
|
+
* DH KEM x448 | AES-GCM 256 | SHA2-512 | Ed448
|
344
|
+
*/
|
345
|
+
MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448: 4, "4": "MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448",
|
346
|
+
/**
|
347
|
+
* DH KEM P521 | AES-GCM 256 | SHA2-512 | EcDSA P521
|
348
|
+
*/
|
349
|
+
MLS_256_DHKEMP521_AES256GCM_SHA512_P521: 5, "5": "MLS_256_DHKEMP521_AES256GCM_SHA512_P521",
|
350
|
+
/**
|
351
|
+
* DH KEM x448 | Chacha20Poly1305 | SHA2-512 | Ed448
|
352
|
+
*/
|
353
|
+
MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448: 6, "6": "MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448",
|
354
|
+
/**
|
355
|
+
* DH KEM P384 | AES-GCM 256 | SHA2-384 | EcDSA P384
|
356
|
+
*/
|
357
|
+
MLS_256_DHKEMP384_AES256GCM_SHA384_P384: 7, "7": "MLS_256_DHKEMP384_AES256GCM_SHA384_P384",
|
358
|
+
});
|
388
359
|
/**
|
389
360
|
* See [core_crypto::e2e_identity::types::E2eiAcmeChallenge]
|
390
361
|
*/
|
391
362
|
class AcmeChallenge {
|
392
|
-
|
393
363
|
static __wrap(ptr) {
|
394
364
|
const obj = Object.create(AcmeChallenge.prototype);
|
395
365
|
obj.ptr = ptr;
|
396
|
-
|
397
366
|
return obj;
|
398
367
|
}
|
399
|
-
|
400
368
|
__destroy_into_raw() {
|
401
369
|
const ptr = this.ptr;
|
402
370
|
this.ptr = 0;
|
403
|
-
|
404
371
|
return ptr;
|
405
372
|
}
|
406
|
-
|
407
373
|
free() {
|
408
374
|
const ptr = this.__destroy_into_raw();
|
409
375
|
wasm$1.__wbg_acmechallenge_free(ptr);
|
@@ -435,7 +401,8 @@ class AcmeChallenge {
|
|
435
401
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
436
402
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
437
403
|
return getStringFromWasm0(r0, r1);
|
438
|
-
}
|
404
|
+
}
|
405
|
+
finally {
|
439
406
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
440
407
|
wasm$1.__wbindgen_free(r0, r1);
|
441
408
|
}
|
@@ -445,21 +412,16 @@ class AcmeChallenge {
|
|
445
412
|
* See [core_crypto::e2e_identity::types::E2eiAcmeDirectory]
|
446
413
|
*/
|
447
414
|
class AcmeDirectory {
|
448
|
-
|
449
415
|
static __wrap(ptr) {
|
450
416
|
const obj = Object.create(AcmeDirectory.prototype);
|
451
417
|
obj.ptr = ptr;
|
452
|
-
|
453
418
|
return obj;
|
454
419
|
}
|
455
|
-
|
456
420
|
__destroy_into_raw() {
|
457
421
|
const ptr = this.ptr;
|
458
422
|
this.ptr = 0;
|
459
|
-
|
460
423
|
return ptr;
|
461
424
|
}
|
462
|
-
|
463
425
|
free() {
|
464
426
|
const ptr = this.__destroy_into_raw();
|
465
427
|
wasm$1.__wbg_acmedirectory_free(ptr);
|
@@ -489,7 +451,8 @@ class AcmeDirectory {
|
|
489
451
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
490
452
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
491
453
|
return getStringFromWasm0(r0, r1);
|
492
|
-
}
|
454
|
+
}
|
455
|
+
finally {
|
493
456
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
494
457
|
wasm$1.__wbindgen_free(r0, r1);
|
495
458
|
}
|
@@ -504,7 +467,8 @@ class AcmeDirectory {
|
|
504
467
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
505
468
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
506
469
|
return getStringFromWasm0(r0, r1);
|
507
|
-
}
|
470
|
+
}
|
471
|
+
finally {
|
508
472
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
509
473
|
wasm$1.__wbindgen_free(r0, r1);
|
510
474
|
}
|
@@ -519,7 +483,8 @@ class AcmeDirectory {
|
|
519
483
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
520
484
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
521
485
|
return getStringFromWasm0(r0, r1);
|
522
|
-
}
|
486
|
+
}
|
487
|
+
finally {
|
523
488
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
524
489
|
wasm$1.__wbindgen_free(r0, r1);
|
525
490
|
}
|
@@ -529,21 +494,16 @@ class AcmeDirectory {
|
|
529
494
|
* See [core_crypto::e2e_identity::types::E2eiAcmeFinalize]
|
530
495
|
*/
|
531
496
|
class AcmeFinalize {
|
532
|
-
|
533
497
|
static __wrap(ptr) {
|
534
498
|
const obj = Object.create(AcmeFinalize.prototype);
|
535
499
|
obj.ptr = ptr;
|
536
|
-
|
537
500
|
return obj;
|
538
501
|
}
|
539
|
-
|
540
502
|
__destroy_into_raw() {
|
541
503
|
const ptr = this.ptr;
|
542
504
|
this.ptr = 0;
|
543
|
-
|
544
505
|
return ptr;
|
545
506
|
}
|
546
|
-
|
547
507
|
free() {
|
548
508
|
const ptr = this.__destroy_into_raw();
|
549
509
|
wasm$1.__wbg_acmefinalize_free(ptr);
|
@@ -575,7 +535,8 @@ class AcmeFinalize {
|
|
575
535
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
576
536
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
577
537
|
return getStringFromWasm0(r0, r1);
|
578
|
-
}
|
538
|
+
}
|
539
|
+
finally {
|
579
540
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
580
541
|
wasm$1.__wbindgen_free(r0, r1);
|
581
542
|
}
|
@@ -584,14 +545,11 @@ class AcmeFinalize {
|
|
584
545
|
/**
|
585
546
|
*/
|
586
547
|
class CommitBundle {
|
587
|
-
|
588
548
|
__destroy_into_raw() {
|
589
549
|
const ptr = this.ptr;
|
590
550
|
this.ptr = 0;
|
591
|
-
|
592
551
|
return ptr;
|
593
552
|
}
|
594
|
-
|
595
553
|
free() {
|
596
554
|
const ptr = this.__destroy_into_raw();
|
597
555
|
wasm$1.__wbg_commitbundle_free(ptr);
|
@@ -622,21 +580,16 @@ class CommitBundle {
|
|
622
580
|
* see [core_crypto::prelude::MlsConversationConfiguration]
|
623
581
|
*/
|
624
582
|
class ConversationConfiguration {
|
625
|
-
|
626
583
|
static __wrap(ptr) {
|
627
584
|
const obj = Object.create(ConversationConfiguration.prototype);
|
628
585
|
obj.ptr = ptr;
|
629
|
-
|
630
586
|
return obj;
|
631
587
|
}
|
632
|
-
|
633
588
|
__destroy_into_raw() {
|
634
589
|
const ptr = this.ptr;
|
635
590
|
this.ptr = 0;
|
636
|
-
|
637
591
|
return ptr;
|
638
592
|
}
|
639
|
-
|
640
593
|
free() {
|
641
594
|
const ptr = this.__destroy_into_raw();
|
642
595
|
wasm$1.__wbg_conversationconfiguration_free(ptr);
|
@@ -657,14 +610,11 @@ class ConversationConfiguration {
|
|
657
610
|
/**
|
658
611
|
*/
|
659
612
|
class ConversationInitBundle {
|
660
|
-
|
661
613
|
__destroy_into_raw() {
|
662
614
|
const ptr = this.ptr;
|
663
615
|
this.ptr = 0;
|
664
|
-
|
665
616
|
return ptr;
|
666
617
|
}
|
667
|
-
|
668
618
|
free() {
|
669
619
|
const ptr = this.__destroy_into_raw();
|
670
620
|
wasm$1.__wbg_conversationinitbundle_free(ptr);
|
@@ -673,14 +623,14 @@ class ConversationInitBundle {
|
|
673
623
|
* @returns {Uint8Array}
|
674
624
|
*/
|
675
625
|
get conversation_id() {
|
676
|
-
const ret = wasm$1.
|
626
|
+
const ret = wasm$1.conversationinitbundle_conversation_id(this.ptr);
|
677
627
|
return takeObject(ret);
|
678
628
|
}
|
679
629
|
/**
|
680
630
|
* @returns {Uint8Array}
|
681
631
|
*/
|
682
632
|
get commit() {
|
683
|
-
const ret = wasm$1.
|
633
|
+
const ret = wasm$1.commitbundle_commit(this.ptr);
|
684
634
|
return takeObject(ret);
|
685
635
|
}
|
686
636
|
/**
|
@@ -693,22 +643,17 @@ class ConversationInitBundle {
|
|
693
643
|
}
|
694
644
|
/**
|
695
645
|
*/
|
696
|
-
|
697
|
-
|
646
|
+
let CoreCrypto$1 = class CoreCrypto {
|
698
647
|
static __wrap(ptr) {
|
699
|
-
const obj = Object.create(CoreCrypto
|
648
|
+
const obj = Object.create(CoreCrypto.prototype);
|
700
649
|
obj.ptr = ptr;
|
701
|
-
|
702
650
|
return obj;
|
703
651
|
}
|
704
|
-
|
705
652
|
__destroy_into_raw() {
|
706
653
|
const ptr = this.ptr;
|
707
654
|
this.ptr = 0;
|
708
|
-
|
709
655
|
return ptr;
|
710
656
|
}
|
711
|
-
|
712
657
|
free() {
|
713
658
|
const ptr = this.__destroy_into_raw();
|
714
659
|
wasm$1.__wbg_corecrypto_free(ptr);
|
@@ -792,8 +737,7 @@ class CoreCrypto$1 {
|
|
792
737
|
*/
|
793
738
|
set_callbacks(callbacks) {
|
794
739
|
_assertClass(callbacks, CoreCryptoWasmCallbacks);
|
795
|
-
var ptr0 = callbacks.
|
796
|
-
callbacks.ptr = 0;
|
740
|
+
var ptr0 = callbacks.__destroy_into_raw();
|
797
741
|
const ret = wasm$1.corecrypto_set_callbacks(this.ptr, ptr0);
|
798
742
|
return takeObject(ret);
|
799
743
|
}
|
@@ -840,8 +784,7 @@ class CoreCrypto$1 {
|
|
840
784
|
const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
|
841
785
|
const len0 = WASM_VECTOR_LEN;
|
842
786
|
_assertClass(config, ConversationConfiguration);
|
843
|
-
var ptr1 = config.
|
844
|
-
config.ptr = 0;
|
787
|
+
var ptr1 = config.__destroy_into_raw();
|
845
788
|
const ret = wasm$1.corecrypto_create_conversation(this.ptr, ptr0, len0, ptr1);
|
846
789
|
return takeObject(ret);
|
847
790
|
}
|
@@ -883,8 +826,7 @@ class CoreCrypto$1 {
|
|
883
826
|
const ptr0 = passArray8ToWasm0(welcome_message, wasm$1.__wbindgen_malloc);
|
884
827
|
const len0 = WASM_VECTOR_LEN;
|
885
828
|
_assertClass(custom_configuration, CustomConfiguration);
|
886
|
-
var ptr1 = custom_configuration.
|
887
|
-
custom_configuration.ptr = 0;
|
829
|
+
var ptr1 = custom_configuration.__destroy_into_raw();
|
888
830
|
const ret = wasm$1.corecrypto_process_welcome_message(this.ptr, ptr0, len0, ptr1);
|
889
831
|
return takeObject(ret);
|
890
832
|
}
|
@@ -1090,8 +1032,7 @@ class CoreCrypto$1 {
|
|
1090
1032
|
const ptr0 = passArray8ToWasm0(public_group_state, wasm$1.__wbindgen_malloc);
|
1091
1033
|
const len0 = WASM_VECTOR_LEN;
|
1092
1034
|
_assertClass(custom_configuration, CustomConfiguration);
|
1093
|
-
var ptr1 = custom_configuration.
|
1094
|
-
custom_configuration.ptr = 0;
|
1035
|
+
var ptr1 = custom_configuration.__destroy_into_raw();
|
1095
1036
|
const ret = wasm$1.corecrypto_join_by_external_commit(this.ptr, ptr0, len0, ptr1);
|
1096
1037
|
return takeObject(ret);
|
1097
1038
|
}
|
@@ -1389,11 +1330,13 @@ class CoreCrypto$1 {
|
|
1389
1330
|
var ptr1 = r0;
|
1390
1331
|
var len1 = r1;
|
1391
1332
|
if (r3) {
|
1392
|
-
ptr1 = 0;
|
1333
|
+
ptr1 = 0;
|
1334
|
+
len1 = 0;
|
1393
1335
|
throw takeObject(r2);
|
1394
1336
|
}
|
1395
1337
|
return getStringFromWasm0(ptr1, len1);
|
1396
|
-
}
|
1338
|
+
}
|
1339
|
+
finally {
|
1397
1340
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1398
1341
|
wasm$1.__wbindgen_free(ptr1, len1);
|
1399
1342
|
}
|
@@ -1412,6 +1355,14 @@ class CoreCrypto$1 {
|
|
1412
1355
|
return takeObject(ret);
|
1413
1356
|
}
|
1414
1357
|
/**
|
1358
|
+
* Returns: [`WasmCryptoResult<u32>`]
|
1359
|
+
* @returns {Promise<any>}
|
1360
|
+
*/
|
1361
|
+
proteus_last_error_code() {
|
1362
|
+
const ret = wasm$1.corecrypto_proteus_last_error_code(this.ptr);
|
1363
|
+
return takeObject(ret);
|
1364
|
+
}
|
1365
|
+
/**
|
1415
1366
|
* Returns: [`WasmCryptoResult<Vec<u8>>`]
|
1416
1367
|
*
|
1417
1368
|
* see [core_crypto::MlsCentral::export_secret_key]
|
@@ -1441,32 +1392,27 @@ class CoreCrypto$1 {
|
|
1441
1392
|
/**
|
1442
1393
|
* see [core_crypto::MlsCentral::new_acme_enrollment]
|
1443
1394
|
* @param {number} ciphersuite
|
1444
|
-
* @returns {Promise<
|
1395
|
+
* @returns {Promise<FfiWireE2EIdentity>}
|
1445
1396
|
*/
|
1446
1397
|
new_acme_enrollment(ciphersuite) {
|
1447
1398
|
const ret = wasm$1.corecrypto_new_acme_enrollment(this.ptr, ciphersuite);
|
1448
1399
|
return takeObject(ret);
|
1449
1400
|
}
|
1450
|
-
}
|
1401
|
+
};
|
1451
1402
|
/**
|
1452
1403
|
* see [core_crypto::prelude::CoreCryptoCallbacks]
|
1453
1404
|
*/
|
1454
1405
|
class CoreCryptoWasmCallbacks {
|
1455
|
-
|
1456
1406
|
static __wrap(ptr) {
|
1457
1407
|
const obj = Object.create(CoreCryptoWasmCallbacks.prototype);
|
1458
1408
|
obj.ptr = ptr;
|
1459
|
-
|
1460
1409
|
return obj;
|
1461
1410
|
}
|
1462
|
-
|
1463
1411
|
__destroy_into_raw() {
|
1464
1412
|
const ptr = this.ptr;
|
1465
1413
|
this.ptr = 0;
|
1466
|
-
|
1467
1414
|
return ptr;
|
1468
1415
|
}
|
1469
|
-
|
1470
1416
|
free() {
|
1471
1417
|
const ptr = this.__destroy_into_raw();
|
1472
1418
|
wasm$1.__wbg_corecryptowasmcallbacks_free(ptr);
|
@@ -1485,21 +1431,16 @@ class CoreCryptoWasmCallbacks {
|
|
1485
1431
|
* see [core_crypto::prelude::MlsCustomConfiguration]
|
1486
1432
|
*/
|
1487
1433
|
class CustomConfiguration {
|
1488
|
-
|
1489
1434
|
static __wrap(ptr) {
|
1490
1435
|
const obj = Object.create(CustomConfiguration.prototype);
|
1491
1436
|
obj.ptr = ptr;
|
1492
|
-
|
1493
1437
|
return obj;
|
1494
1438
|
}
|
1495
|
-
|
1496
1439
|
__destroy_into_raw() {
|
1497
1440
|
const ptr = this.ptr;
|
1498
1441
|
this.ptr = 0;
|
1499
|
-
|
1500
1442
|
return ptr;
|
1501
1443
|
}
|
1502
|
-
|
1503
1444
|
free() {
|
1504
1445
|
const ptr = this.__destroy_into_raw();
|
1505
1446
|
wasm$1.__wbg_customconfiguration_free(ptr);
|
@@ -1517,14 +1458,11 @@ class CustomConfiguration {
|
|
1517
1458
|
* see [core_crypto::prelude::decrypt::MlsConversationDecryptMessage]
|
1518
1459
|
*/
|
1519
1460
|
class DecryptedMessage {
|
1520
|
-
|
1521
1461
|
__destroy_into_raw() {
|
1522
1462
|
const ptr = this.ptr;
|
1523
1463
|
this.ptr = 0;
|
1524
|
-
|
1525
1464
|
return ptr;
|
1526
1465
|
}
|
1527
|
-
|
1528
1466
|
free() {
|
1529
1467
|
const ptr = this.__destroy_into_raw();
|
1530
1468
|
wasm$1.__wbg_decryptedmessage_free(ptr);
|
@@ -1560,7 +1498,8 @@ class DecryptedMessage {
|
|
1560
1498
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1561
1499
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1562
1500
|
return r0 === 0 ? undefined : r1 >>> 0;
|
1563
|
-
}
|
1501
|
+
}
|
1502
|
+
finally {
|
1564
1503
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1565
1504
|
}
|
1566
1505
|
}
|
@@ -1580,346 +1519,131 @@ class DecryptedMessage {
|
|
1580
1519
|
}
|
1581
1520
|
}
|
1582
1521
|
/**
|
1583
|
-
* see [core_crypto::prelude::ConversationMember]
|
1584
1522
|
*/
|
1585
|
-
class
|
1586
|
-
|
1523
|
+
class FfiWireE2EIdentity {
|
1587
1524
|
static __wrap(ptr) {
|
1588
|
-
const obj = Object.create(
|
1525
|
+
const obj = Object.create(FfiWireE2EIdentity.prototype);
|
1589
1526
|
obj.ptr = ptr;
|
1590
|
-
|
1591
1527
|
return obj;
|
1592
1528
|
}
|
1593
|
-
|
1594
1529
|
__destroy_into_raw() {
|
1595
1530
|
const ptr = this.ptr;
|
1596
1531
|
this.ptr = 0;
|
1597
|
-
|
1598
1532
|
return ptr;
|
1599
1533
|
}
|
1600
|
-
|
1601
1534
|
free() {
|
1602
1535
|
const ptr = this.__destroy_into_raw();
|
1603
|
-
wasm$1.
|
1536
|
+
wasm$1.__wbg_ffiwiree2eidentity_free(ptr);
|
1604
1537
|
}
|
1605
1538
|
/**
|
1606
|
-
*
|
1607
|
-
* @param {Uint8Array}
|
1539
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::directory_response]
|
1540
|
+
* @param {Uint8Array} directory
|
1541
|
+
* @returns {any}
|
1608
1542
|
*/
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1543
|
+
directory_response(directory) {
|
1544
|
+
try {
|
1545
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1546
|
+
const ptr0 = passArray8ToWasm0(directory, wasm$1.__wbindgen_malloc);
|
1547
|
+
const len0 = WASM_VECTOR_LEN;
|
1548
|
+
wasm$1.ffiwiree2eidentity_directory_response(retptr, this.ptr, ptr0, len0);
|
1549
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1550
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1551
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
1552
|
+
if (r2) {
|
1553
|
+
throw takeObject(r1);
|
1554
|
+
}
|
1555
|
+
return takeObject(r0);
|
1556
|
+
}
|
1557
|
+
finally {
|
1558
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1559
|
+
}
|
1612
1560
|
}
|
1613
1561
|
/**
|
1562
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_account_request]
|
1563
|
+
* @param {any} directory
|
1564
|
+
* @param {string} previous_nonce
|
1614
1565
|
* @returns {Uint8Array}
|
1615
1566
|
*/
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1567
|
+
new_account_request(directory, previous_nonce) {
|
1568
|
+
try {
|
1569
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1570
|
+
const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1571
|
+
const len0 = WASM_VECTOR_LEN;
|
1572
|
+
wasm$1.ffiwiree2eidentity_new_account_request(retptr, this.ptr, addHeapObject(directory), ptr0, len0);
|
1573
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1574
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1575
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
1576
|
+
if (r2) {
|
1577
|
+
throw takeObject(r1);
|
1578
|
+
}
|
1579
|
+
return takeObject(r0);
|
1580
|
+
}
|
1581
|
+
finally {
|
1582
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1583
|
+
}
|
1619
1584
|
}
|
1620
1585
|
/**
|
1586
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_account_response]
|
1587
|
+
* @param {Uint8Array} account
|
1621
1588
|
* @returns {Uint8Array}
|
1622
1589
|
*/
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
}
|
1639
|
-
|
1640
|
-
__destroy_into_raw() {
|
1641
|
-
const ptr = this.ptr;
|
1642
|
-
this.ptr = 0;
|
1643
|
-
|
1644
|
-
return ptr;
|
1645
|
-
}
|
1646
|
-
|
1647
|
-
free() {
|
1648
|
-
const ptr = this.__destroy_into_raw();
|
1649
|
-
wasm$1.__wbg_memberaddedmessages_free(ptr);
|
1650
|
-
}
|
1651
|
-
/**
|
1652
|
-
* @param {Uint8Array} welcome
|
1653
|
-
* @param {Uint8Array} commit
|
1654
|
-
* @param {PublicGroupStateBundle} public_group_state
|
1655
|
-
*/
|
1656
|
-
constructor(welcome, commit, public_group_state) {
|
1657
|
-
_assertClass(public_group_state, PublicGroupStateBundle);
|
1658
|
-
var ptr0 = public_group_state.ptr;
|
1659
|
-
public_group_state.ptr = 0;
|
1660
|
-
const ret = wasm$1.memberaddedmessages_new(addHeapObject(welcome), addHeapObject(commit), ptr0);
|
1661
|
-
return MemberAddedMessages.__wrap(ret);
|
1662
|
-
}
|
1663
|
-
/**
|
1664
|
-
* @returns {Uint8Array}
|
1665
|
-
*/
|
1666
|
-
get welcome() {
|
1667
|
-
const ret = wasm$1.commitbundle_commit(this.ptr);
|
1668
|
-
return takeObject(ret);
|
1590
|
+
new_account_response(account) {
|
1591
|
+
try {
|
1592
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1593
|
+
wasm$1.ffiwiree2eidentity_new_account_response(retptr, this.ptr, addHeapObject(account));
|
1594
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1595
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1596
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
1597
|
+
if (r2) {
|
1598
|
+
throw takeObject(r1);
|
1599
|
+
}
|
1600
|
+
return takeObject(r0);
|
1601
|
+
}
|
1602
|
+
finally {
|
1603
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1604
|
+
}
|
1669
1605
|
}
|
1670
1606
|
/**
|
1607
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_order_request]
|
1608
|
+
* @param {string} handle
|
1609
|
+
* @param {string} client_id
|
1610
|
+
* @param {number} expiry_days
|
1611
|
+
* @param {any} directory
|
1612
|
+
* @param {Uint8Array} account
|
1613
|
+
* @param {string} previous_nonce
|
1671
1614
|
* @returns {Uint8Array}
|
1672
1615
|
*/
|
1673
|
-
|
1674
|
-
const ret = wasm$1.conversationinitbundle_commit(this.ptr);
|
1675
|
-
return takeObject(ret);
|
1676
|
-
}
|
1677
|
-
/**
|
1678
|
-
* @returns {PublicGroupStateBundle}
|
1679
|
-
*/
|
1680
|
-
get public_group_state() {
|
1681
|
-
const ret = wasm$1.commitbundle_public_group_state(this.ptr);
|
1682
|
-
return PublicGroupStateBundle.__wrap(ret);
|
1683
|
-
}
|
1684
|
-
}
|
1685
|
-
/**
|
1686
|
-
* See [core_crypto::e2e_identity::types::E2eiNewAcmeAuthz]
|
1687
|
-
*/
|
1688
|
-
class NewAcmeAuthz {
|
1689
|
-
|
1690
|
-
static __wrap(ptr) {
|
1691
|
-
const obj = Object.create(NewAcmeAuthz.prototype);
|
1692
|
-
obj.ptr = ptr;
|
1693
|
-
|
1694
|
-
return obj;
|
1695
|
-
}
|
1696
|
-
|
1697
|
-
__destroy_into_raw() {
|
1698
|
-
const ptr = this.ptr;
|
1699
|
-
this.ptr = 0;
|
1700
|
-
|
1701
|
-
return ptr;
|
1702
|
-
}
|
1703
|
-
|
1704
|
-
free() {
|
1705
|
-
const ptr = this.__destroy_into_raw();
|
1706
|
-
wasm$1.__wbg_newacmeauthz_free(ptr);
|
1707
|
-
}
|
1708
|
-
/**
|
1709
|
-
* @param {string} identifier
|
1710
|
-
* @param {AcmeChallenge | undefined} wire_http_challenge
|
1711
|
-
* @param {AcmeChallenge | undefined} wire_oidc_challenge
|
1712
|
-
*/
|
1713
|
-
constructor(identifier, wire_http_challenge, wire_oidc_challenge) {
|
1714
|
-
const ptr0 = passStringToWasm0(identifier, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1715
|
-
const len0 = WASM_VECTOR_LEN;
|
1716
|
-
let ptr1 = 0;
|
1717
|
-
if (!isLikeNone(wire_http_challenge)) {
|
1718
|
-
_assertClass(wire_http_challenge, AcmeChallenge);
|
1719
|
-
ptr1 = wire_http_challenge.ptr;
|
1720
|
-
wire_http_challenge.ptr = 0;
|
1721
|
-
}
|
1722
|
-
let ptr2 = 0;
|
1723
|
-
if (!isLikeNone(wire_oidc_challenge)) {
|
1724
|
-
_assertClass(wire_oidc_challenge, AcmeChallenge);
|
1725
|
-
ptr2 = wire_oidc_challenge.ptr;
|
1726
|
-
wire_oidc_challenge.ptr = 0;
|
1727
|
-
}
|
1728
|
-
const ret = wasm$1.newacmeauthz_new(ptr0, len0, ptr1, ptr2);
|
1729
|
-
return NewAcmeAuthz.__wrap(ret);
|
1730
|
-
}
|
1731
|
-
/**
|
1732
|
-
* @returns {string}
|
1733
|
-
*/
|
1734
|
-
get identifier() {
|
1616
|
+
new_order_request(handle, client_id, expiry_days, directory, account, previous_nonce) {
|
1735
1617
|
try {
|
1736
1618
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1737
|
-
wasm$1.
|
1619
|
+
const ptr0 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1620
|
+
const len0 = WASM_VECTOR_LEN;
|
1621
|
+
const ptr1 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1622
|
+
const len1 = WASM_VECTOR_LEN;
|
1623
|
+
const ptr2 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1624
|
+
const len2 = WASM_VECTOR_LEN;
|
1625
|
+
wasm$1.ffiwiree2eidentity_new_order_request(retptr, this.ptr, ptr0, len0, ptr1, len1, expiry_days, addHeapObject(directory), addHeapObject(account), ptr2, len2);
|
1738
1626
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1739
1627
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1740
|
-
|
1741
|
-
|
1628
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
1629
|
+
if (r2) {
|
1630
|
+
throw takeObject(r1);
|
1631
|
+
}
|
1632
|
+
return takeObject(r0);
|
1633
|
+
}
|
1634
|
+
finally {
|
1742
1635
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1743
|
-
wasm$1.__wbindgen_free(r0, r1);
|
1744
1636
|
}
|
1745
1637
|
}
|
1746
1638
|
/**
|
1747
|
-
*
|
1748
|
-
|
1749
|
-
get wire_http_challenge() {
|
1750
|
-
const ret = wasm$1.newacmeauthz_wire_http_challenge(this.ptr);
|
1751
|
-
return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
|
1752
|
-
}
|
1753
|
-
/**
|
1754
|
-
* @returns {AcmeChallenge | undefined}
|
1755
|
-
*/
|
1756
|
-
get wire_oidc_challenge() {
|
1757
|
-
const ret = wasm$1.newacmeauthz_wire_oidc_challenge(this.ptr);
|
1758
|
-
return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
|
1759
|
-
}
|
1760
|
-
}
|
1761
|
-
/**
|
1762
|
-
* See [core_crypto::e2e_identity::types::E2eiNewAcmeOrder]
|
1763
|
-
*/
|
1764
|
-
class NewAcmeOrder {
|
1765
|
-
|
1766
|
-
static __wrap(ptr) {
|
1767
|
-
const obj = Object.create(NewAcmeOrder.prototype);
|
1768
|
-
obj.ptr = ptr;
|
1769
|
-
|
1770
|
-
return obj;
|
1771
|
-
}
|
1772
|
-
|
1773
|
-
__destroy_into_raw() {
|
1774
|
-
const ptr = this.ptr;
|
1775
|
-
this.ptr = 0;
|
1776
|
-
|
1777
|
-
return ptr;
|
1778
|
-
}
|
1779
|
-
|
1780
|
-
free() {
|
1781
|
-
const ptr = this.__destroy_into_raw();
|
1782
|
-
wasm$1.__wbg_newacmeorder_free(ptr);
|
1783
|
-
}
|
1784
|
-
/**
|
1785
|
-
* @param {Uint8Array} delegate
|
1786
|
-
* @param {(Uint8Array)[]} authorizations
|
1787
|
-
*/
|
1788
|
-
constructor(delegate, authorizations) {
|
1789
|
-
const ptr0 = passArrayJsValueToWasm0(authorizations, wasm$1.__wbindgen_malloc);
|
1790
|
-
const len0 = WASM_VECTOR_LEN;
|
1791
|
-
const ret = wasm$1.newacmeorder_new(addHeapObject(delegate), ptr0, len0);
|
1792
|
-
return NewAcmeOrder.__wrap(ret);
|
1793
|
-
}
|
1794
|
-
/**
|
1795
|
-
* @returns {Uint8Array}
|
1796
|
-
*/
|
1797
|
-
get delegate() {
|
1798
|
-
const ret = wasm$1.acmechallenge_delegate(this.ptr);
|
1799
|
-
return takeObject(ret);
|
1800
|
-
}
|
1801
|
-
/**
|
1802
|
-
* @returns {Array<any>}
|
1803
|
-
*/
|
1804
|
-
get authorizations() {
|
1805
|
-
const ret = wasm$1.newacmeorder_authorizations(this.ptr);
|
1806
|
-
return takeObject(ret);
|
1807
|
-
}
|
1808
|
-
}
|
1809
|
-
/**
|
1810
|
-
*/
|
1811
|
-
class ProposalBundle {
|
1812
|
-
|
1813
|
-
static __wrap(ptr) {
|
1814
|
-
const obj = Object.create(ProposalBundle.prototype);
|
1815
|
-
obj.ptr = ptr;
|
1816
|
-
|
1817
|
-
return obj;
|
1818
|
-
}
|
1819
|
-
|
1820
|
-
__destroy_into_raw() {
|
1821
|
-
const ptr = this.ptr;
|
1822
|
-
this.ptr = 0;
|
1823
|
-
|
1824
|
-
return ptr;
|
1825
|
-
}
|
1826
|
-
|
1827
|
-
free() {
|
1828
|
-
const ptr = this.__destroy_into_raw();
|
1829
|
-
wasm$1.__wbg_proposalbundle_free(ptr);
|
1830
|
-
}
|
1831
|
-
/**
|
1832
|
-
* @returns {Uint8Array}
|
1833
|
-
*/
|
1834
|
-
get proposal() {
|
1835
|
-
const ret = wasm$1.commitbundle_commit(this.ptr);
|
1836
|
-
return takeObject(ret);
|
1837
|
-
}
|
1838
|
-
/**
|
1839
|
-
* @returns {Uint8Array}
|
1840
|
-
*/
|
1841
|
-
get proposal_ref() {
|
1842
|
-
const ret = wasm$1.conversationinitbundle_commit(this.ptr);
|
1843
|
-
return takeObject(ret);
|
1844
|
-
}
|
1845
|
-
}
|
1846
|
-
/**
|
1847
|
-
*/
|
1848
|
-
class PublicGroupStateBundle {
|
1849
|
-
|
1850
|
-
static __wrap(ptr) {
|
1851
|
-
const obj = Object.create(PublicGroupStateBundle.prototype);
|
1852
|
-
obj.ptr = ptr;
|
1853
|
-
|
1854
|
-
return obj;
|
1855
|
-
}
|
1856
|
-
|
1857
|
-
__destroy_into_raw() {
|
1858
|
-
const ptr = this.ptr;
|
1859
|
-
this.ptr = 0;
|
1860
|
-
|
1861
|
-
return ptr;
|
1862
|
-
}
|
1863
|
-
|
1864
|
-
free() {
|
1865
|
-
const ptr = this.__destroy_into_raw();
|
1866
|
-
wasm$1.__wbg_publicgroupstatebundle_free(ptr);
|
1867
|
-
}
|
1868
|
-
/**
|
1869
|
-
* @returns {number}
|
1870
|
-
*/
|
1871
|
-
get encryption_type() {
|
1872
|
-
const ret = wasm$1.publicgroupstatebundle_encryption_type(this.ptr);
|
1873
|
-
return ret;
|
1874
|
-
}
|
1875
|
-
/**
|
1876
|
-
* @returns {number}
|
1877
|
-
*/
|
1878
|
-
get ratchet_tree_type() {
|
1879
|
-
const ret = wasm$1.publicgroupstatebundle_ratchet_tree_type(this.ptr);
|
1880
|
-
return ret;
|
1881
|
-
}
|
1882
|
-
/**
|
1883
|
-
* @returns {Uint8Array}
|
1884
|
-
*/
|
1885
|
-
get payload() {
|
1886
|
-
const ret = wasm$1.commitbundle_commit(this.ptr);
|
1887
|
-
return takeObject(ret);
|
1888
|
-
}
|
1889
|
-
}
|
1890
|
-
/**
|
1891
|
-
*/
|
1892
|
-
class WireE2eIdentity$1 {
|
1893
|
-
|
1894
|
-
static __wrap(ptr) {
|
1895
|
-
const obj = Object.create(WireE2eIdentity$1.prototype);
|
1896
|
-
obj.ptr = ptr;
|
1897
|
-
|
1898
|
-
return obj;
|
1899
|
-
}
|
1900
|
-
|
1901
|
-
__destroy_into_raw() {
|
1902
|
-
const ptr = this.ptr;
|
1903
|
-
this.ptr = 0;
|
1904
|
-
|
1905
|
-
return ptr;
|
1906
|
-
}
|
1907
|
-
|
1908
|
-
free() {
|
1909
|
-
const ptr = this.__destroy_into_raw();
|
1910
|
-
wasm$1.__wbg_wiree2eidentity_free(ptr);
|
1911
|
-
}
|
1912
|
-
/**
|
1913
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::directory_response]
|
1914
|
-
* @param {Uint8Array} directory
|
1639
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_order_response]
|
1640
|
+
* @param {Uint8Array} order
|
1915
1641
|
* @returns {any}
|
1916
1642
|
*/
|
1917
|
-
|
1643
|
+
new_order_response(order) {
|
1918
1644
|
try {
|
1919
1645
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1920
|
-
|
1921
|
-
const len0 = WASM_VECTOR_LEN;
|
1922
|
-
wasm$1.wiree2eidentity_directory_response(retptr, this.ptr, ptr0, len0);
|
1646
|
+
wasm$1.ffiwiree2eidentity_new_order_response(retptr, this.ptr, addHeapObject(order));
|
1923
1647
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1924
1648
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1925
1649
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -1927,22 +1651,26 @@ class WireE2eIdentity$1 {
|
|
1927
1651
|
throw takeObject(r1);
|
1928
1652
|
}
|
1929
1653
|
return takeObject(r0);
|
1930
|
-
}
|
1654
|
+
}
|
1655
|
+
finally {
|
1931
1656
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1932
1657
|
}
|
1933
1658
|
}
|
1934
1659
|
/**
|
1935
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
1936
|
-
* @param {
|
1660
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_authz_request]
|
1661
|
+
* @param {string} url
|
1662
|
+
* @param {Uint8Array} account
|
1937
1663
|
* @param {string} previous_nonce
|
1938
1664
|
* @returns {Uint8Array}
|
1939
1665
|
*/
|
1940
|
-
|
1666
|
+
new_authz_request(url, account, previous_nonce) {
|
1941
1667
|
try {
|
1942
1668
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1943
|
-
const ptr0 = passStringToWasm0(
|
1669
|
+
const ptr0 = passStringToWasm0(url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1944
1670
|
const len0 = WASM_VECTOR_LEN;
|
1945
|
-
wasm$1.
|
1671
|
+
const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1672
|
+
const len1 = WASM_VECTOR_LEN;
|
1673
|
+
wasm$1.ffiwiree2eidentity_new_authz_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
|
1946
1674
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1947
1675
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1948
1676
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -1950,19 +1678,20 @@ class WireE2eIdentity$1 {
|
|
1950
1678
|
throw takeObject(r1);
|
1951
1679
|
}
|
1952
1680
|
return takeObject(r0);
|
1953
|
-
}
|
1681
|
+
}
|
1682
|
+
finally {
|
1954
1683
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1955
1684
|
}
|
1956
1685
|
}
|
1957
1686
|
/**
|
1958
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
1959
|
-
* @param {Uint8Array}
|
1960
|
-
* @returns {
|
1687
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_authz_response]
|
1688
|
+
* @param {Uint8Array} authz
|
1689
|
+
* @returns {any}
|
1961
1690
|
*/
|
1962
|
-
|
1691
|
+
new_authz_response(authz) {
|
1963
1692
|
try {
|
1964
1693
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1965
|
-
wasm$1.
|
1694
|
+
wasm$1.ffiwiree2eidentity_new_authz_response(retptr, this.ptr, addHeapObject(authz));
|
1966
1695
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1967
1696
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1968
1697
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -1970,50 +1699,65 @@ class WireE2eIdentity$1 {
|
|
1970
1699
|
throw takeObject(r1);
|
1971
1700
|
}
|
1972
1701
|
return takeObject(r0);
|
1973
|
-
}
|
1702
|
+
}
|
1703
|
+
finally {
|
1974
1704
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1975
1705
|
}
|
1976
1706
|
}
|
1977
1707
|
/**
|
1978
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
1979
|
-
* @param {string}
|
1980
|
-
* @param {string}
|
1708
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::create_dpop_token]
|
1709
|
+
* @param {string} access_token_url
|
1710
|
+
* @param {string} user_id
|
1711
|
+
* @param {bigint} client_id
|
1712
|
+
* @param {string} domain
|
1713
|
+
* @param {any} client_id_challenge
|
1714
|
+
* @param {string} backend_nonce
|
1981
1715
|
* @param {number} expiry_days
|
1982
|
-
* @
|
1983
|
-
* @param {Uint8Array} account
|
1984
|
-
* @param {string} previous_nonce
|
1985
|
-
* @returns {Uint8Array}
|
1716
|
+
* @returns {string}
|
1986
1717
|
*/
|
1987
|
-
|
1718
|
+
create_dpop_token(access_token_url, user_id, client_id, domain, client_id_challenge, backend_nonce, expiry_days) {
|
1988
1719
|
try {
|
1989
1720
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1990
|
-
const ptr0 = passStringToWasm0(
|
1721
|
+
const ptr0 = passStringToWasm0(access_token_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1991
1722
|
const len0 = WASM_VECTOR_LEN;
|
1992
|
-
const ptr1 = passStringToWasm0(
|
1723
|
+
const ptr1 = passStringToWasm0(user_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1993
1724
|
const len1 = WASM_VECTOR_LEN;
|
1994
|
-
const ptr2 = passStringToWasm0(
|
1725
|
+
const ptr2 = passStringToWasm0(domain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1995
1726
|
const len2 = WASM_VECTOR_LEN;
|
1996
|
-
|
1727
|
+
const ptr3 = passStringToWasm0(backend_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1728
|
+
const len3 = WASM_VECTOR_LEN;
|
1729
|
+
wasm$1.ffiwiree2eidentity_create_dpop_token(retptr, this.ptr, ptr0, len0, ptr1, len1, client_id, ptr2, len2, addHeapObject(client_id_challenge), ptr3, len3, expiry_days);
|
1997
1730
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1998
1731
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1999
1732
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
2000
|
-
|
2001
|
-
|
1733
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
1734
|
+
var ptr4 = r0;
|
1735
|
+
var len4 = r1;
|
1736
|
+
if (r3) {
|
1737
|
+
ptr4 = 0;
|
1738
|
+
len4 = 0;
|
1739
|
+
throw takeObject(r2);
|
2002
1740
|
}
|
2003
|
-
return
|
2004
|
-
}
|
1741
|
+
return getStringFromWasm0(ptr4, len4);
|
1742
|
+
}
|
1743
|
+
finally {
|
2005
1744
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1745
|
+
wasm$1.__wbindgen_free(ptr4, len4);
|
2006
1746
|
}
|
2007
1747
|
}
|
2008
1748
|
/**
|
2009
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
2010
|
-
* @param {
|
2011
|
-
* @
|
1749
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_challenge_request]
|
1750
|
+
* @param {any} handle_challenge
|
1751
|
+
* @param {Uint8Array} account
|
1752
|
+
* @param {string} previous_nonce
|
1753
|
+
* @returns {Uint8Array}
|
2012
1754
|
*/
|
2013
|
-
|
1755
|
+
new_challenge_request(handle_challenge, account, previous_nonce) {
|
2014
1756
|
try {
|
2015
1757
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2016
|
-
wasm$1.
|
1758
|
+
const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1759
|
+
const len0 = WASM_VECTOR_LEN;
|
1760
|
+
wasm$1.ffiwiree2eidentity_new_challenge_request(retptr, this.ptr, addHeapObject(handle_challenge), addHeapObject(account), ptr0, len0);
|
2017
1761
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2018
1762
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2019
1763
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -2021,25 +1765,44 @@ class WireE2eIdentity$1 {
|
|
2021
1765
|
throw takeObject(r1);
|
2022
1766
|
}
|
2023
1767
|
return takeObject(r0);
|
2024
|
-
}
|
1768
|
+
}
|
1769
|
+
finally {
|
2025
1770
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2026
1771
|
}
|
2027
1772
|
}
|
2028
1773
|
/**
|
2029
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
2030
|
-
* @param {
|
1774
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::new_challenge_response]
|
1775
|
+
* @param {Uint8Array} challenge
|
1776
|
+
*/
|
1777
|
+
new_challenge_response(challenge) {
|
1778
|
+
try {
|
1779
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1780
|
+
wasm$1.ffiwiree2eidentity_new_challenge_response(retptr, this.ptr, addHeapObject(challenge));
|
1781
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1782
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1783
|
+
if (r1) {
|
1784
|
+
throw takeObject(r0);
|
1785
|
+
}
|
1786
|
+
}
|
1787
|
+
finally {
|
1788
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
/**
|
1792
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::check_order_request]
|
1793
|
+
* @param {string} order_url
|
2031
1794
|
* @param {Uint8Array} account
|
2032
1795
|
* @param {string} previous_nonce
|
2033
1796
|
* @returns {Uint8Array}
|
2034
1797
|
*/
|
2035
|
-
|
1798
|
+
check_order_request(order_url, account, previous_nonce) {
|
2036
1799
|
try {
|
2037
1800
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2038
|
-
const ptr0 = passStringToWasm0(
|
1801
|
+
const ptr0 = passStringToWasm0(order_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2039
1802
|
const len0 = WASM_VECTOR_LEN;
|
2040
1803
|
const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2041
1804
|
const len1 = WASM_VECTOR_LEN;
|
2042
|
-
wasm$1.
|
1805
|
+
wasm$1.ffiwiree2eidentity_check_order_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
|
2043
1806
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2044
1807
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2045
1808
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -2047,19 +1810,20 @@ class WireE2eIdentity$1 {
|
|
2047
1810
|
throw takeObject(r1);
|
2048
1811
|
}
|
2049
1812
|
return takeObject(r0);
|
2050
|
-
}
|
1813
|
+
}
|
1814
|
+
finally {
|
2051
1815
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2052
1816
|
}
|
2053
1817
|
}
|
2054
1818
|
/**
|
2055
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
2056
|
-
* @param {Uint8Array}
|
2057
|
-
* @returns {
|
1819
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::check_order_response]
|
1820
|
+
* @param {Uint8Array} order
|
1821
|
+
* @returns {Uint8Array}
|
2058
1822
|
*/
|
2059
|
-
|
1823
|
+
check_order_response(order) {
|
2060
1824
|
try {
|
2061
1825
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2062
|
-
wasm$1.
|
1826
|
+
wasm$1.ffiwiree2eidentity_check_order_response(retptr, this.ptr, addHeapObject(order));
|
2063
1827
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2064
1828
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2065
1829
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -2067,62 +1831,73 @@ class WireE2eIdentity$1 {
|
|
2067
1831
|
throw takeObject(r1);
|
2068
1832
|
}
|
2069
1833
|
return takeObject(r0);
|
2070
|
-
}
|
1834
|
+
}
|
1835
|
+
finally {
|
2071
1836
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2072
1837
|
}
|
2073
1838
|
}
|
2074
1839
|
/**
|
2075
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
2076
|
-
* @param {
|
2077
|
-
* @param {
|
2078
|
-
* @param {
|
2079
|
-
* @param {string}
|
2080
|
-
* @
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
1840
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::finalize_request]
|
1841
|
+
* @param {(Uint8Array)[]} domains
|
1842
|
+
* @param {Uint8Array} order
|
1843
|
+
* @param {Uint8Array} account
|
1844
|
+
* @param {string} previous_nonce
|
1845
|
+
* @returns {Uint8Array}
|
1846
|
+
*/
|
1847
|
+
finalize_request(domains, order, account, previous_nonce) {
|
1848
|
+
try {
|
1849
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
1850
|
+
const ptr0 = passArrayJsValueToWasm0(domains, wasm$1.__wbindgen_malloc);
|
1851
|
+
const len0 = WASM_VECTOR_LEN;
|
1852
|
+
const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1853
|
+
const len1 = WASM_VECTOR_LEN;
|
1854
|
+
wasm$1.ffiwiree2eidentity_finalize_request(retptr, this.ptr, ptr0, len0, addHeapObject(order), addHeapObject(account), ptr1, len1);
|
1855
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
1856
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
1857
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
1858
|
+
if (r2) {
|
1859
|
+
throw takeObject(r1);
|
1860
|
+
}
|
1861
|
+
return takeObject(r0);
|
1862
|
+
}
|
1863
|
+
finally {
|
1864
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
1865
|
+
}
|
1866
|
+
}
|
1867
|
+
/**
|
1868
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::finalize_response]
|
1869
|
+
* @param {Uint8Array} finalize
|
1870
|
+
* @returns {any}
|
2084
1871
|
*/
|
2085
|
-
|
1872
|
+
finalize_response(finalize) {
|
2086
1873
|
try {
|
2087
1874
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2088
|
-
|
2089
|
-
const len0 = WASM_VECTOR_LEN;
|
2090
|
-
const ptr1 = passStringToWasm0(user_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2091
|
-
const len1 = WASM_VECTOR_LEN;
|
2092
|
-
const ptr2 = passStringToWasm0(domain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2093
|
-
const len2 = WASM_VECTOR_LEN;
|
2094
|
-
const ptr3 = passStringToWasm0(backend_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2095
|
-
const len3 = WASM_VECTOR_LEN;
|
2096
|
-
wasm$1.wiree2eidentity_create_dpop_token(retptr, this.ptr, ptr0, len0, ptr1, len1, client_id, ptr2, len2, addHeapObject(client_id_challenge), ptr3, len3, expiry_days);
|
1875
|
+
wasm$1.ffiwiree2eidentity_finalize_response(retptr, this.ptr, addHeapObject(finalize));
|
2097
1876
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2098
1877
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2099
1878
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
2100
|
-
|
2101
|
-
|
2102
|
-
var len4 = r1;
|
2103
|
-
if (r3) {
|
2104
|
-
ptr4 = 0; len4 = 0;
|
2105
|
-
throw takeObject(r2);
|
1879
|
+
if (r2) {
|
1880
|
+
throw takeObject(r1);
|
2106
1881
|
}
|
2107
|
-
return
|
2108
|
-
}
|
1882
|
+
return takeObject(r0);
|
1883
|
+
}
|
1884
|
+
finally {
|
2109
1885
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2110
|
-
wasm$1.__wbindgen_free(ptr4, len4);
|
2111
1886
|
}
|
2112
1887
|
}
|
2113
1888
|
/**
|
2114
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
2115
|
-
* @param {any}
|
1889
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::certificate_request]
|
1890
|
+
* @param {any} finalize
|
2116
1891
|
* @param {Uint8Array} account
|
2117
1892
|
* @param {string} previous_nonce
|
2118
1893
|
* @returns {Uint8Array}
|
2119
1894
|
*/
|
2120
|
-
|
1895
|
+
certificate_request(finalize, account, previous_nonce) {
|
2121
1896
|
try {
|
2122
1897
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2123
1898
|
const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2124
1899
|
const len0 = WASM_VECTOR_LEN;
|
2125
|
-
wasm$1.
|
1900
|
+
wasm$1.ffiwiree2eidentity_certificate_request(retptr, this.ptr, addHeapObject(finalize), addHeapObject(account), ptr0, len0);
|
2126
1901
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2127
1902
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2128
1903
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
@@ -2130,449 +1905,612 @@ class WireE2eIdentity$1 {
|
|
2130
1905
|
throw takeObject(r1);
|
2131
1906
|
}
|
2132
1907
|
return takeObject(r0);
|
2133
|
-
}
|
1908
|
+
}
|
1909
|
+
finally {
|
2134
1910
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2135
1911
|
}
|
2136
1912
|
}
|
2137
1913
|
/**
|
2138
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::
|
2139
|
-
* @param {
|
1914
|
+
* See [core_crypto::e2e_identity::WireE2eIdentity::certificate_response]
|
1915
|
+
* @param {string} certificate_chain
|
1916
|
+
* @returns {(Uint8Array)[]}
|
2140
1917
|
*/
|
2141
|
-
|
1918
|
+
certificate_response(certificate_chain) {
|
2142
1919
|
try {
|
2143
1920
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2144
|
-
wasm$1.
|
1921
|
+
const ptr0 = passStringToWasm0(certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1922
|
+
const len0 = WASM_VECTOR_LEN;
|
1923
|
+
wasm$1.ffiwiree2eidentity_certificate_response(retptr, this.ptr, ptr0, len0);
|
2145
1924
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2146
1925
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2147
|
-
|
2148
|
-
|
1926
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
1927
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
1928
|
+
if (r3) {
|
1929
|
+
throw takeObject(r2);
|
2149
1930
|
}
|
2150
|
-
|
1931
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
1932
|
+
wasm$1.__wbindgen_free(r0, r1 * 4);
|
1933
|
+
return v1;
|
1934
|
+
}
|
1935
|
+
finally {
|
2151
1936
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2152
1937
|
}
|
2153
1938
|
}
|
1939
|
+
}
|
1940
|
+
/**
|
1941
|
+
* see [core_crypto::prelude::ConversationMember]
|
1942
|
+
*/
|
1943
|
+
class Invitee {
|
1944
|
+
static __wrap(ptr) {
|
1945
|
+
const obj = Object.create(Invitee.prototype);
|
1946
|
+
obj.ptr = ptr;
|
1947
|
+
return obj;
|
1948
|
+
}
|
1949
|
+
__destroy_into_raw() {
|
1950
|
+
const ptr = this.ptr;
|
1951
|
+
this.ptr = 0;
|
1952
|
+
return ptr;
|
1953
|
+
}
|
1954
|
+
free() {
|
1955
|
+
const ptr = this.__destroy_into_raw();
|
1956
|
+
wasm$1.__wbg_invitee_free(ptr);
|
1957
|
+
}
|
1958
|
+
/**
|
1959
|
+
* @param {Uint8Array} id
|
1960
|
+
* @param {Uint8Array} kp
|
1961
|
+
*/
|
1962
|
+
constructor(id, kp) {
|
1963
|
+
const ret = wasm$1.invitee_new(addHeapObject(id), addHeapObject(kp));
|
1964
|
+
return Invitee.__wrap(ret);
|
1965
|
+
}
|
2154
1966
|
/**
|
2155
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::check_order_request]
|
2156
|
-
* @param {string} order_url
|
2157
|
-
* @param {Uint8Array} account
|
2158
|
-
* @param {string} previous_nonce
|
2159
1967
|
* @returns {Uint8Array}
|
2160
1968
|
*/
|
2161
|
-
|
1969
|
+
get id() {
|
1970
|
+
const ret = wasm$1.invitee_id(this.ptr);
|
1971
|
+
return takeObject(ret);
|
1972
|
+
}
|
1973
|
+
/**
|
1974
|
+
* @returns {Uint8Array}
|
1975
|
+
*/
|
1976
|
+
get kp() {
|
1977
|
+
const ret = wasm$1.invitee_kp(this.ptr);
|
1978
|
+
return takeObject(ret);
|
1979
|
+
}
|
1980
|
+
}
|
1981
|
+
/**
|
1982
|
+
* see [core_crypto::prelude::MlsConversationCreationMessage]
|
1983
|
+
*/
|
1984
|
+
class MemberAddedMessages {
|
1985
|
+
static __wrap(ptr) {
|
1986
|
+
const obj = Object.create(MemberAddedMessages.prototype);
|
1987
|
+
obj.ptr = ptr;
|
1988
|
+
return obj;
|
1989
|
+
}
|
1990
|
+
__destroy_into_raw() {
|
1991
|
+
const ptr = this.ptr;
|
1992
|
+
this.ptr = 0;
|
1993
|
+
return ptr;
|
1994
|
+
}
|
1995
|
+
free() {
|
1996
|
+
const ptr = this.__destroy_into_raw();
|
1997
|
+
wasm$1.__wbg_memberaddedmessages_free(ptr);
|
1998
|
+
}
|
1999
|
+
/**
|
2000
|
+
* @param {Uint8Array} welcome
|
2001
|
+
* @param {Uint8Array} commit
|
2002
|
+
* @param {PublicGroupStateBundle} public_group_state
|
2003
|
+
*/
|
2004
|
+
constructor(welcome, commit, public_group_state) {
|
2005
|
+
_assertClass(public_group_state, PublicGroupStateBundle);
|
2006
|
+
var ptr0 = public_group_state.__destroy_into_raw();
|
2007
|
+
const ret = wasm$1.memberaddedmessages_new(addHeapObject(welcome), addHeapObject(commit), ptr0);
|
2008
|
+
return MemberAddedMessages.__wrap(ret);
|
2009
|
+
}
|
2010
|
+
/**
|
2011
|
+
* @returns {Uint8Array}
|
2012
|
+
*/
|
2013
|
+
get welcome() {
|
2014
|
+
const ret = wasm$1.conversationinitbundle_conversation_id(this.ptr);
|
2015
|
+
return takeObject(ret);
|
2016
|
+
}
|
2017
|
+
/**
|
2018
|
+
* @returns {Uint8Array}
|
2019
|
+
*/
|
2020
|
+
get commit() {
|
2021
|
+
const ret = wasm$1.commitbundle_commit(this.ptr);
|
2022
|
+
return takeObject(ret);
|
2023
|
+
}
|
2024
|
+
/**
|
2025
|
+
* @returns {PublicGroupStateBundle}
|
2026
|
+
*/
|
2027
|
+
get public_group_state() {
|
2028
|
+
const ret = wasm$1.commitbundle_public_group_state(this.ptr);
|
2029
|
+
return PublicGroupStateBundle.__wrap(ret);
|
2030
|
+
}
|
2031
|
+
}
|
2032
|
+
/**
|
2033
|
+
* See [core_crypto::e2e_identity::types::E2eiNewAcmeAuthz]
|
2034
|
+
*/
|
2035
|
+
class NewAcmeAuthz {
|
2036
|
+
static __wrap(ptr) {
|
2037
|
+
const obj = Object.create(NewAcmeAuthz.prototype);
|
2038
|
+
obj.ptr = ptr;
|
2039
|
+
return obj;
|
2040
|
+
}
|
2041
|
+
__destroy_into_raw() {
|
2042
|
+
const ptr = this.ptr;
|
2043
|
+
this.ptr = 0;
|
2044
|
+
return ptr;
|
2045
|
+
}
|
2046
|
+
free() {
|
2047
|
+
const ptr = this.__destroy_into_raw();
|
2048
|
+
wasm$1.__wbg_newacmeauthz_free(ptr);
|
2049
|
+
}
|
2050
|
+
/**
|
2051
|
+
* @param {string} identifier
|
2052
|
+
* @param {AcmeChallenge | undefined} wire_http_challenge
|
2053
|
+
* @param {AcmeChallenge | undefined} wire_oidc_challenge
|
2054
|
+
*/
|
2055
|
+
constructor(identifier, wire_http_challenge, wire_oidc_challenge) {
|
2056
|
+
const ptr0 = passStringToWasm0(identifier, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2057
|
+
const len0 = WASM_VECTOR_LEN;
|
2058
|
+
let ptr1 = 0;
|
2059
|
+
if (!isLikeNone(wire_http_challenge)) {
|
2060
|
+
_assertClass(wire_http_challenge, AcmeChallenge);
|
2061
|
+
ptr1 = wire_http_challenge.__destroy_into_raw();
|
2062
|
+
}
|
2063
|
+
let ptr2 = 0;
|
2064
|
+
if (!isLikeNone(wire_oidc_challenge)) {
|
2065
|
+
_assertClass(wire_oidc_challenge, AcmeChallenge);
|
2066
|
+
ptr2 = wire_oidc_challenge.__destroy_into_raw();
|
2067
|
+
}
|
2068
|
+
const ret = wasm$1.newacmeauthz_new(ptr0, len0, ptr1, ptr2);
|
2069
|
+
return NewAcmeAuthz.__wrap(ret);
|
2070
|
+
}
|
2071
|
+
/**
|
2072
|
+
* @returns {string}
|
2073
|
+
*/
|
2074
|
+
get identifier() {
|
2162
2075
|
try {
|
2163
2076
|
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
2164
|
-
|
2165
|
-
const len0 = WASM_VECTOR_LEN;
|
2166
|
-
const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2167
|
-
const len1 = WASM_VECTOR_LEN;
|
2168
|
-
wasm$1.wiree2eidentity_check_order_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
|
2077
|
+
wasm$1.newacmeauthz_identifier(retptr, this.ptr);
|
2169
2078
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2170
2079
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
}
|
2175
|
-
return takeObject(r0);
|
2176
|
-
} finally {
|
2080
|
+
return getStringFromWasm0(r0, r1);
|
2081
|
+
}
|
2082
|
+
finally {
|
2177
2083
|
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2084
|
+
wasm$1.__wbindgen_free(r0, r1);
|
2178
2085
|
}
|
2179
2086
|
}
|
2180
2087
|
/**
|
2181
|
-
*
|
2182
|
-
|
2088
|
+
* @returns {AcmeChallenge | undefined}
|
2089
|
+
*/
|
2090
|
+
get wire_http_challenge() {
|
2091
|
+
const ret = wasm$1.newacmeauthz_wire_http_challenge(this.ptr);
|
2092
|
+
return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
|
2093
|
+
}
|
2094
|
+
/**
|
2095
|
+
* @returns {AcmeChallenge | undefined}
|
2096
|
+
*/
|
2097
|
+
get wire_oidc_challenge() {
|
2098
|
+
const ret = wasm$1.newacmeauthz_wire_oidc_challenge(this.ptr);
|
2099
|
+
return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
|
2100
|
+
}
|
2101
|
+
}
|
2102
|
+
/**
|
2103
|
+
* See [core_crypto::e2e_identity::types::E2eiNewAcmeOrder]
|
2104
|
+
*/
|
2105
|
+
class NewAcmeOrder {
|
2106
|
+
static __wrap(ptr) {
|
2107
|
+
const obj = Object.create(NewAcmeOrder.prototype);
|
2108
|
+
obj.ptr = ptr;
|
2109
|
+
return obj;
|
2110
|
+
}
|
2111
|
+
__destroy_into_raw() {
|
2112
|
+
const ptr = this.ptr;
|
2113
|
+
this.ptr = 0;
|
2114
|
+
return ptr;
|
2115
|
+
}
|
2116
|
+
free() {
|
2117
|
+
const ptr = this.__destroy_into_raw();
|
2118
|
+
wasm$1.__wbg_newacmeorder_free(ptr);
|
2119
|
+
}
|
2120
|
+
/**
|
2121
|
+
* @param {Uint8Array} delegate
|
2122
|
+
* @param {(Uint8Array)[]} authorizations
|
2123
|
+
*/
|
2124
|
+
constructor(delegate, authorizations) {
|
2125
|
+
const ptr0 = passArrayJsValueToWasm0(authorizations, wasm$1.__wbindgen_malloc);
|
2126
|
+
const len0 = WASM_VECTOR_LEN;
|
2127
|
+
const ret = wasm$1.newacmeorder_new(addHeapObject(delegate), ptr0, len0);
|
2128
|
+
return NewAcmeOrder.__wrap(ret);
|
2129
|
+
}
|
2130
|
+
/**
|
2131
|
+
* @returns {Uint8Array}
|
2132
|
+
*/
|
2133
|
+
get delegate() {
|
2134
|
+
const ret = wasm$1.acmechallenge_delegate(this.ptr);
|
2135
|
+
return takeObject(ret);
|
2136
|
+
}
|
2137
|
+
/**
|
2138
|
+
* @returns {Array<any>}
|
2139
|
+
*/
|
2140
|
+
get authorizations() {
|
2141
|
+
const ret = wasm$1.newacmeorder_authorizations(this.ptr);
|
2142
|
+
return takeObject(ret);
|
2143
|
+
}
|
2144
|
+
}
|
2145
|
+
/**
|
2146
|
+
*/
|
2147
|
+
class ProposalBundle {
|
2148
|
+
static __wrap(ptr) {
|
2149
|
+
const obj = Object.create(ProposalBundle.prototype);
|
2150
|
+
obj.ptr = ptr;
|
2151
|
+
return obj;
|
2152
|
+
}
|
2153
|
+
__destroy_into_raw() {
|
2154
|
+
const ptr = this.ptr;
|
2155
|
+
this.ptr = 0;
|
2156
|
+
return ptr;
|
2157
|
+
}
|
2158
|
+
free() {
|
2159
|
+
const ptr = this.__destroy_into_raw();
|
2160
|
+
wasm$1.__wbg_proposalbundle_free(ptr);
|
2161
|
+
}
|
2162
|
+
/**
|
2183
2163
|
* @returns {Uint8Array}
|
2184
2164
|
*/
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
2188
|
-
wasm$1.wiree2eidentity_check_order_response(retptr, this.ptr, addHeapObject(order));
|
2189
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2190
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2191
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
2192
|
-
if (r2) {
|
2193
|
-
throw takeObject(r1);
|
2194
|
-
}
|
2195
|
-
return takeObject(r0);
|
2196
|
-
} finally {
|
2197
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2198
|
-
}
|
2165
|
+
get proposal() {
|
2166
|
+
const ret = wasm$1.invitee_id(this.ptr);
|
2167
|
+
return takeObject(ret);
|
2199
2168
|
}
|
2200
2169
|
/**
|
2201
|
-
* See [core_crypto::e2e_identity::WireE2eIdentity::finalize_request]
|
2202
|
-
* @param {(Uint8Array)[]} domains
|
2203
|
-
* @param {Uint8Array} order
|
2204
|
-
* @param {Uint8Array} account
|
2205
|
-
* @param {string} previous_nonce
|
2206
2170
|
* @returns {Uint8Array}
|
2207
2171
|
*/
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2172
|
+
get proposal_ref() {
|
2173
|
+
const ret = wasm$1.invitee_kp(this.ptr);
|
2174
|
+
return takeObject(ret);
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
/**
|
2178
|
+
*/
|
2179
|
+
class PublicGroupStateBundle {
|
2180
|
+
static __wrap(ptr) {
|
2181
|
+
const obj = Object.create(PublicGroupStateBundle.prototype);
|
2182
|
+
obj.ptr = ptr;
|
2183
|
+
return obj;
|
2184
|
+
}
|
2185
|
+
__destroy_into_raw() {
|
2186
|
+
const ptr = this.ptr;
|
2187
|
+
this.ptr = 0;
|
2188
|
+
return ptr;
|
2189
|
+
}
|
2190
|
+
free() {
|
2191
|
+
const ptr = this.__destroy_into_raw();
|
2192
|
+
wasm$1.__wbg_publicgroupstatebundle_free(ptr);
|
2226
2193
|
}
|
2227
2194
|
/**
|
2228
|
-
*
|
2229
|
-
* @param {Uint8Array} finalize
|
2230
|
-
* @returns {any}
|
2195
|
+
* @returns {number}
|
2231
2196
|
*/
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
wasm$1.wiree2eidentity_finalize_response(retptr, this.ptr, addHeapObject(finalize));
|
2236
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2237
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2238
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
2239
|
-
if (r2) {
|
2240
|
-
throw takeObject(r1);
|
2241
|
-
}
|
2242
|
-
return takeObject(r0);
|
2243
|
-
} finally {
|
2244
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2245
|
-
}
|
2197
|
+
get encryption_type() {
|
2198
|
+
const ret = wasm$1.publicgroupstatebundle_encryption_type(this.ptr);
|
2199
|
+
return ret;
|
2246
2200
|
}
|
2247
2201
|
/**
|
2248
|
-
*
|
2249
|
-
* @param {any} finalize
|
2250
|
-
* @param {Uint8Array} account
|
2251
|
-
* @param {string} previous_nonce
|
2252
|
-
* @returns {Uint8Array}
|
2202
|
+
* @returns {number}
|
2253
2203
|
*/
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2257
|
-
const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2258
|
-
const len0 = WASM_VECTOR_LEN;
|
2259
|
-
wasm$1.wiree2eidentity_certificate_request(retptr, this.ptr, addHeapObject(finalize), addHeapObject(account), ptr0, len0);
|
2260
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2261
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2262
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
2263
|
-
if (r2) {
|
2264
|
-
throw takeObject(r1);
|
2265
|
-
}
|
2266
|
-
return takeObject(r0);
|
2267
|
-
} finally {
|
2268
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2269
|
-
}
|
2204
|
+
get ratchet_tree_type() {
|
2205
|
+
const ret = wasm$1.publicgroupstatebundle_ratchet_tree_type(this.ptr);
|
2206
|
+
return ret;
|
2270
2207
|
}
|
2271
2208
|
/**
|
2272
|
-
*
|
2273
|
-
* @param {string} certificate_chain
|
2274
|
-
* @returns {(Uint8Array)[]}
|
2209
|
+
* @returns {Uint8Array}
|
2275
2210
|
*/
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
const ptr0 = passStringToWasm0(certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2280
|
-
const len0 = WASM_VECTOR_LEN;
|
2281
|
-
wasm$1.wiree2eidentity_certificate_response(retptr, this.ptr, ptr0, len0);
|
2282
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2283
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2284
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
2285
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
2286
|
-
if (r3) {
|
2287
|
-
throw takeObject(r2);
|
2288
|
-
}
|
2289
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
2290
|
-
wasm$1.__wbindgen_free(r0, r1 * 4);
|
2291
|
-
return v1;
|
2292
|
-
} finally {
|
2293
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
2294
|
-
}
|
2211
|
+
get payload() {
|
2212
|
+
const ret = wasm$1.invitee_id(this.ptr);
|
2213
|
+
return takeObject(ret);
|
2295
2214
|
}
|
2296
2215
|
}
|
2297
|
-
|
2298
2216
|
async function load(module, imports) {
|
2299
2217
|
if (typeof Response === 'function' && module instanceof Response) {
|
2300
2218
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
2301
2219
|
try {
|
2302
2220
|
return await WebAssembly.instantiateStreaming(module, imports);
|
2303
|
-
|
2304
|
-
|
2221
|
+
}
|
2222
|
+
catch (e) {
|
2305
2223
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
2306
2224
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
2307
|
-
|
2308
|
-
|
2225
|
+
}
|
2226
|
+
else {
|
2309
2227
|
throw e;
|
2310
2228
|
}
|
2311
2229
|
}
|
2312
2230
|
}
|
2313
|
-
|
2314
2231
|
const bytes = await module.arrayBuffer();
|
2315
2232
|
return await WebAssembly.instantiate(bytes, imports);
|
2316
|
-
|
2317
|
-
|
2233
|
+
}
|
2234
|
+
else {
|
2318
2235
|
const instance = await WebAssembly.instantiate(module, imports);
|
2319
|
-
|
2320
2236
|
if (instance instanceof WebAssembly.Instance) {
|
2321
2237
|
return { instance, module };
|
2322
|
-
|
2323
|
-
|
2238
|
+
}
|
2239
|
+
else {
|
2324
2240
|
return instance;
|
2325
2241
|
}
|
2326
2242
|
}
|
2327
2243
|
}
|
2328
|
-
|
2329
2244
|
function getImports() {
|
2330
2245
|
const imports = {};
|
2331
2246
|
imports.wbg = {};
|
2332
|
-
imports.wbg.
|
2247
|
+
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
2248
|
+
takeObject(arg0);
|
2249
|
+
};
|
2250
|
+
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
|
2333
2251
|
const ret = getObject(arg0);
|
2334
2252
|
return addHeapObject(ret);
|
2335
2253
|
};
|
2336
|
-
imports.wbg.
|
2337
|
-
takeObject(arg0);
|
2338
|
-
};
|
2339
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
2254
|
+
imports.wbg.__wbindgen_is_object = function (arg0) {
|
2340
2255
|
const val = getObject(arg0);
|
2341
|
-
const ret = typeof(val) === 'object' && val !== null;
|
2256
|
+
const ret = typeof (val) === 'object' && val !== null;
|
2342
2257
|
return ret;
|
2343
2258
|
};
|
2344
|
-
imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
|
2259
|
+
imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function (arg0, arg1) {
|
2345
2260
|
const ret = getObject(arg0)[getObject(arg1)];
|
2346
2261
|
return addHeapObject(ret);
|
2347
2262
|
};
|
2348
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
2263
|
+
imports.wbg.__wbindgen_is_undefined = function (arg0) {
|
2349
2264
|
const ret = getObject(arg0) === undefined;
|
2350
2265
|
return ret;
|
2351
2266
|
};
|
2352
|
-
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
2267
|
+
imports.wbg.__wbindgen_in = function (arg0, arg1) {
|
2353
2268
|
const ret = getObject(arg0) in getObject(arg1);
|
2354
2269
|
return ret;
|
2355
2270
|
};
|
2356
|
-
imports.wbg.
|
2271
|
+
imports.wbg.__wbg_objectStoreNames_f0884fed45ebc81c = function (arg0) {
|
2357
2272
|
const ret = getObject(arg0).objectStoreNames;
|
2358
2273
|
return addHeapObject(ret);
|
2359
2274
|
};
|
2360
|
-
imports.wbg.
|
2275
|
+
imports.wbg.__wbg_length_36c8debf8d623fc6 = function (arg0) {
|
2361
2276
|
const ret = getObject(arg0).length;
|
2362
2277
|
return ret;
|
2363
2278
|
};
|
2364
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
2279
|
+
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
|
2365
2280
|
const ret = getStringFromWasm0(arg0, arg1);
|
2366
2281
|
return addHeapObject(ret);
|
2367
2282
|
};
|
2368
|
-
imports.wbg.
|
2283
|
+
imports.wbg.__wbindgen_is_null = function (arg0) {
|
2284
|
+
const ret = getObject(arg0) === null;
|
2285
|
+
return ret;
|
2286
|
+
};
|
2287
|
+
imports.wbg.__wbindgen_string_get = function (arg0, arg1) {
|
2369
2288
|
const obj = getObject(arg1);
|
2370
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
2289
|
+
const ret = typeof (obj) === 'string' ? obj : undefined;
|
2371
2290
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2372
2291
|
var len0 = WASM_VECTOR_LEN;
|
2373
2292
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
2374
2293
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
2375
2294
|
};
|
2376
|
-
imports.wbg.
|
2295
|
+
imports.wbg.__wbg_length_e498fbc24f9c1d4f = function (arg0) {
|
2377
2296
|
const ret = getObject(arg0).length;
|
2378
2297
|
return ret;
|
2379
2298
|
};
|
2380
|
-
imports.wbg.
|
2381
|
-
const ret = new
|
2299
|
+
imports.wbg.__wbg_new_537b7341ce90bb31 = function (arg0) {
|
2300
|
+
const ret = new Uint8Array(getObject(arg0));
|
2301
|
+
return addHeapObject(ret);
|
2302
|
+
};
|
2303
|
+
imports.wbg.__wbg_call_9495de66fdbe016b = function () {
|
2304
|
+
return handleError(function (arg0, arg1, arg2) {
|
2305
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
2306
|
+
return addHeapObject(ret);
|
2307
|
+
}, arguments);
|
2308
|
+
};
|
2309
|
+
imports.wbg.__wbg_new_f9876326328f45ed = function () {
|
2310
|
+
const ret = new Object();
|
2311
|
+
return addHeapObject(ret);
|
2312
|
+
};
|
2313
|
+
imports.wbg.__wbg_new_f841cc6f2098f4b5 = function () {
|
2314
|
+
const ret = new Map();
|
2315
|
+
return addHeapObject(ret);
|
2316
|
+
};
|
2317
|
+
imports.wbg.__wbg_set_388c4c6422704173 = function (arg0, arg1, arg2) {
|
2318
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
2319
|
+
return addHeapObject(ret);
|
2320
|
+
};
|
2321
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
2322
|
+
const ret = BigInt.asUintN(64, arg0);
|
2323
|
+
return addHeapObject(ret);
|
2324
|
+
};
|
2325
|
+
imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
|
2326
|
+
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
2327
|
+
return addHeapObject(ret);
|
2328
|
+
};
|
2329
|
+
imports.wbg.__wbg_new_b525de17f44a8943 = function () {
|
2330
|
+
const ret = new Array();
|
2331
|
+
return addHeapObject(ret);
|
2332
|
+
};
|
2333
|
+
imports.wbg.__wbg_set_17224bc548dd1d7b = function (arg0, arg1, arg2) {
|
2334
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
2335
|
+
};
|
2336
|
+
imports.wbg.__wbg_set_20cbc34131e76824 = function (arg0, arg1, arg2) {
|
2337
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
2338
|
+
};
|
2339
|
+
imports.wbg.__wbindgen_number_new = function (arg0) {
|
2340
|
+
const ret = arg0;
|
2382
2341
|
return addHeapObject(ret);
|
2383
2342
|
};
|
2384
|
-
imports.wbg.
|
2343
|
+
imports.wbg.__wbg_push_49c286f04dd3bf59 = function (arg0, arg1) {
|
2344
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
2345
|
+
return ret;
|
2346
|
+
};
|
2347
|
+
imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function (arg0, arg1) {
|
2348
|
+
try {
|
2349
|
+
var state0 = { a: arg0, b: arg1 };
|
2350
|
+
var cb0 = (arg0, arg1) => {
|
2351
|
+
const a = state0.a;
|
2352
|
+
state0.a = 0;
|
2353
|
+
try {
|
2354
|
+
return __wbg_adapter_263(a, state0.b, arg0, arg1);
|
2355
|
+
}
|
2356
|
+
finally {
|
2357
|
+
state0.a = a;
|
2358
|
+
}
|
2359
|
+
};
|
2360
|
+
const ret = new Promise(cb0);
|
2361
|
+
return addHeapObject(ret);
|
2362
|
+
}
|
2363
|
+
finally {
|
2364
|
+
state0.a = state0.b = 0;
|
2365
|
+
}
|
2366
|
+
};
|
2367
|
+
imports.wbg.__wbg_setonsuccess_925a7718d3f62bc1 = function (arg0, arg1) {
|
2368
|
+
getObject(arg0).onsuccess = getObject(arg1);
|
2369
|
+
};
|
2370
|
+
imports.wbg.__wbg_new0_25059e40b1c02766 = function () {
|
2385
2371
|
const ret = new Date();
|
2386
2372
|
return addHeapObject(ret);
|
2387
2373
|
};
|
2388
|
-
imports.wbg.
|
2374
|
+
imports.wbg.__wbg_getTime_7c59072d1651a3cf = function (arg0) {
|
2389
2375
|
const ret = getObject(arg0).getTime();
|
2390
2376
|
return ret;
|
2391
2377
|
};
|
2392
|
-
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
2378
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
2393
2379
|
const ret = getObject(arg0) == getObject(arg1);
|
2394
2380
|
return ret;
|
2395
2381
|
};
|
2396
|
-
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
2382
|
+
imports.wbg.__wbindgen_boolean_get = function (arg0) {
|
2397
2383
|
const v = getObject(arg0);
|
2398
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
2384
|
+
const ret = typeof (v) === 'boolean' ? (v ? 1 : 0) : 2;
|
2399
2385
|
return ret;
|
2400
2386
|
};
|
2401
|
-
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
2402
|
-
const ret = typeof(getObject(arg0)) === 'bigint';
|
2387
|
+
imports.wbg.__wbindgen_is_bigint = function (arg0) {
|
2388
|
+
const ret = typeof (getObject(arg0)) === 'bigint';
|
2403
2389
|
return ret;
|
2404
2390
|
};
|
2405
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
2391
|
+
imports.wbg.__wbindgen_number_get = function (arg0, arg1) {
|
2406
2392
|
const obj = getObject(arg1);
|
2407
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
2393
|
+
const ret = typeof (obj) === 'number' ? obj : undefined;
|
2408
2394
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
2409
2395
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
2410
2396
|
};
|
2411
|
-
imports.wbg.
|
2397
|
+
imports.wbg.__wbg_isSafeInteger_8c4789029e885159 = function (arg0) {
|
2412
2398
|
const ret = Number.isSafeInteger(getObject(arg0));
|
2413
2399
|
return ret;
|
2414
2400
|
};
|
2415
|
-
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
2401
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
|
2416
2402
|
const v = getObject(arg1);
|
2417
|
-
const ret = typeof(v) === 'bigint' ? v : undefined;
|
2418
|
-
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ?
|
2403
|
+
const ret = typeof (v) === 'bigint' ? v : undefined;
|
2404
|
+
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
2419
2405
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
2420
2406
|
};
|
2421
|
-
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
2407
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function (arg0) {
|
2422
2408
|
const ret = arg0;
|
2423
2409
|
return addHeapObject(ret);
|
2424
2410
|
};
|
2425
|
-
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
2411
|
+
imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) {
|
2426
2412
|
const ret = getObject(arg0) === getObject(arg1);
|
2427
2413
|
return ret;
|
2428
2414
|
};
|
2429
|
-
imports.wbg.
|
2430
|
-
const ret =
|
2415
|
+
imports.wbg.__wbindgen_error_new = function (arg0, arg1) {
|
2416
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
2431
2417
|
return addHeapObject(ret);
|
2432
2418
|
};
|
2433
|
-
imports.wbg.
|
2419
|
+
imports.wbg.__wbg_isArray_39d28997bf6b96b4 = function (arg0) {
|
2434
2420
|
const ret = Array.isArray(getObject(arg0));
|
2435
2421
|
return ret;
|
2436
2422
|
};
|
2437
|
-
imports.wbg.
|
2423
|
+
imports.wbg.__wbg_iterator_55f114446221aa5a = function () {
|
2438
2424
|
const ret = Symbol.iterator;
|
2439
2425
|
return addHeapObject(ret);
|
2440
2426
|
};
|
2441
|
-
imports.wbg.
|
2427
|
+
imports.wbg.__wbg_get_27fe3dac1c4d0224 = function (arg0, arg1) {
|
2442
2428
|
const ret = getObject(arg0)[arg1 >>> 0];
|
2443
2429
|
return addHeapObject(ret);
|
2444
2430
|
};
|
2445
|
-
imports.wbg.__wbg_corecrypto_new = function(arg0) {
|
2431
|
+
imports.wbg.__wbg_corecrypto_new = function (arg0) {
|
2446
2432
|
const ret = CoreCrypto$1.__wrap(arg0);
|
2447
2433
|
return addHeapObject(ret);
|
2448
2434
|
};
|
2449
|
-
imports.wbg.
|
2450
|
-
const ret = new
|
2451
|
-
return addHeapObject(ret);
|
2452
|
-
};
|
2453
|
-
imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
|
2454
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
2455
|
-
};
|
2456
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
2457
|
-
const ret = arg0;
|
2458
|
-
return addHeapObject(ret);
|
2459
|
-
};
|
2460
|
-
imports.wbg.__wbg_wiree2eidentity_new = function(arg0) {
|
2461
|
-
const ret = WireE2eIdentity$1.__wrap(arg0);
|
2462
|
-
return addHeapObject(ret);
|
2463
|
-
};
|
2464
|
-
imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
|
2465
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
2466
|
-
return addHeapObject(ret);
|
2467
|
-
}, arguments) };
|
2468
|
-
imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
|
2469
|
-
const ret = new Uint8Array(getObject(arg0));
|
2435
|
+
imports.wbg.__wbg_new_15d3966e9981a196 = function (arg0, arg1) {
|
2436
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
2470
2437
|
return addHeapObject(ret);
|
2471
2438
|
};
|
2472
|
-
imports.wbg.
|
2473
|
-
|
2474
|
-
|
2475
|
-
var cb0 = (arg0, arg1) => {
|
2476
|
-
const a = state0.a;
|
2477
|
-
state0.a = 0;
|
2478
|
-
try {
|
2479
|
-
return __wbg_adapter_260(a, state0.b, arg0, arg1);
|
2480
|
-
} finally {
|
2481
|
-
state0.a = a;
|
2482
|
-
}
|
2483
|
-
};
|
2484
|
-
const ret = new Promise(cb0);
|
2439
|
+
imports.wbg.__wbg_call_96878afb7a8201ca = function () {
|
2440
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
2441
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
2485
2442
|
return addHeapObject(ret);
|
2486
|
-
}
|
2487
|
-
state0.a = state0.b = 0;
|
2488
|
-
}
|
2489
|
-
};
|
2490
|
-
imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
|
2491
|
-
const ret = new Array();
|
2492
|
-
return addHeapObject(ret);
|
2493
|
-
};
|
2494
|
-
imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
|
2495
|
-
const ret = getObject(arg0).push(getObject(arg1));
|
2496
|
-
return ret;
|
2497
|
-
};
|
2498
|
-
imports.wbg.__wbg_new_268f7b7dd3430798 = function() {
|
2499
|
-
const ret = new Map();
|
2500
|
-
return addHeapObject(ret);
|
2443
|
+
}, arguments);
|
2501
2444
|
};
|
2502
|
-
imports.wbg.
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
2445
|
+
imports.wbg.__wbg_call_99043a1e2a9e5916 = function () {
|
2446
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
2447
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
2448
|
+
return addHeapObject(ret);
|
2449
|
+
}, arguments);
|
2508
2450
|
};
|
2509
|
-
imports.wbg.
|
2510
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
2511
|
-
return addHeapObject(ret);
|
2512
|
-
}, arguments) };
|
2513
|
-
imports.wbg.__wbg_call_e1f72c051cdab859 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
2514
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
2515
|
-
return addHeapObject(ret);
|
2516
|
-
}, arguments) };
|
2517
|
-
imports.wbg.__wbg_reject_72477563edad55b7 = function(arg0) {
|
2451
|
+
imports.wbg.__wbg_reject_57029f54148d79c3 = function (arg0) {
|
2518
2452
|
const ret = Promise.reject(getObject(arg0));
|
2519
2453
|
return addHeapObject(ret);
|
2520
2454
|
};
|
2521
|
-
imports.wbg.__wbg_proposalbundle_new = function(arg0) {
|
2455
|
+
imports.wbg.__wbg_proposalbundle_new = function (arg0) {
|
2522
2456
|
const ret = ProposalBundle.__wrap(arg0);
|
2523
2457
|
return addHeapObject(ret);
|
2524
2458
|
};
|
2525
|
-
imports.wbg.__wbg_now_4d4a1d65c7a8c0ba = function() {
|
2459
|
+
imports.wbg.__wbg_now_4d4a1d65c7a8c0ba = function () {
|
2526
2460
|
const ret = Date.now();
|
2527
2461
|
return ret;
|
2528
2462
|
};
|
2529
|
-
imports.wbg.__wbg_now_78244d2ced74c026 = function() {
|
2463
|
+
imports.wbg.__wbg_now_78244d2ced74c026 = function () {
|
2530
2464
|
const ret = performance.now();
|
2531
2465
|
return ret;
|
2532
2466
|
};
|
2533
|
-
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
2467
|
+
imports.wbg.__wbg_new_abda76e883ba8a5f = function () {
|
2534
2468
|
const ret = new Error();
|
2535
2469
|
return addHeapObject(ret);
|
2536
2470
|
};
|
2537
|
-
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
2471
|
+
imports.wbg.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
|
2538
2472
|
const ret = getObject(arg1).stack;
|
2539
2473
|
const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2540
2474
|
const len0 = WASM_VECTOR_LEN;
|
2541
2475
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
2542
2476
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
2543
2477
|
};
|
2544
|
-
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
2478
|
+
imports.wbg.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
|
2545
2479
|
try {
|
2546
2480
|
console.error(getStringFromWasm0(arg0, arg1));
|
2547
|
-
}
|
2481
|
+
}
|
2482
|
+
finally {
|
2548
2483
|
wasm$1.__wbindgen_free(arg0, arg1);
|
2549
2484
|
}
|
2550
2485
|
};
|
2551
|
-
imports.wbg.
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2486
|
+
imports.wbg.__wbg_commit_7f934e1d9fffde34 = function () {
|
2487
|
+
return handleError(function (arg0) {
|
2488
|
+
getObject(arg0).commit();
|
2489
|
+
}, arguments);
|
2490
|
+
};
|
2491
|
+
imports.wbg.__wbg_setoncomplete_f32167d3f84be687 = function (arg0, arg1) {
|
2555
2492
|
getObject(arg0).oncomplete = getObject(arg1);
|
2556
2493
|
};
|
2557
|
-
imports.wbg.
|
2494
|
+
imports.wbg.__wbg_setonerror_7cbe775a0abc7a8e = function (arg0, arg1) {
|
2558
2495
|
getObject(arg0).onerror = getObject(arg1);
|
2559
2496
|
};
|
2560
|
-
imports.wbg.
|
2561
|
-
const ret = getObject(arg0) === null;
|
2562
|
-
return ret;
|
2563
|
-
};
|
2564
|
-
imports.wbg.__wbg_name_ebb75bfad2bf6938 = function(arg0, arg1) {
|
2497
|
+
imports.wbg.__wbg_name_31ef05f12c1d72c6 = function (arg0, arg1) {
|
2565
2498
|
const ret = getObject(arg1).name;
|
2566
2499
|
const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2567
2500
|
const len0 = WASM_VECTOR_LEN;
|
2568
2501
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
2569
2502
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
2570
2503
|
};
|
2571
|
-
imports.wbg.
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2504
|
+
imports.wbg.__wbg_transaction_a31cc90bd4f34364 = function () {
|
2505
|
+
return handleError(function (arg0, arg1, arg2) {
|
2506
|
+
const ret = getObject(arg0).transaction(getObject(arg1), takeObject(arg2));
|
2507
|
+
return addHeapObject(ret);
|
2508
|
+
}, arguments);
|
2509
|
+
};
|
2510
|
+
imports.wbg.__wbg_setonerror_019196fbce756cc0 = function (arg0, arg1) {
|
2511
|
+
getObject(arg0).onerror = getObject(arg1);
|
2512
|
+
};
|
2513
|
+
imports.wbg.__wbindgen_cb_drop = function (arg0) {
|
2576
2514
|
const obj = takeObject(arg0).original;
|
2577
2515
|
if (obj.cnt-- == 1) {
|
2578
2516
|
obj.a = 0;
|
@@ -2581,409 +2519,474 @@ function getImports() {
|
|
2581
2519
|
const ret = false;
|
2582
2520
|
return ret;
|
2583
2521
|
};
|
2584
|
-
imports.wbg.
|
2585
|
-
|
2586
|
-
return addHeapObject(ret);
|
2587
|
-
}, arguments) };
|
2588
|
-
imports.wbg.__wbg_openCursor_f055654a98eeab7f = function() { return handleError(function (arg0) {
|
2589
|
-
const ret = getObject(arg0).openCursor();
|
2590
|
-
return addHeapObject(ret);
|
2591
|
-
}, arguments) };
|
2592
|
-
imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
|
2593
|
-
getObject(arg0).onsuccess = getObject(arg1);
|
2522
|
+
imports.wbg.__wbg_close_98f3a5ab91060b8b = function (arg0) {
|
2523
|
+
getObject(arg0).close();
|
2594
2524
|
};
|
2595
|
-
imports.wbg.
|
2596
|
-
|
2525
|
+
imports.wbg.__wbg_deleteDatabase_f360deb7283ea232 = function () {
|
2526
|
+
return handleError(function (arg0, arg1, arg2) {
|
2527
|
+
const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
|
2528
|
+
return addHeapObject(ret);
|
2529
|
+
}, arguments);
|
2597
2530
|
};
|
2598
|
-
imports.wbg.
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2603
|
-
const ret = getObject(arg0).count();
|
2604
|
-
return addHeapObject(ret);
|
2605
|
-
}, arguments) };
|
2606
|
-
imports.wbg.__wbg_count_46eda68a16dbe30e = function() { return handleError(function (arg0, arg1) {
|
2607
|
-
const ret = getObject(arg0).count(getObject(arg1));
|
2608
|
-
return addHeapObject(ret);
|
2609
|
-
}, arguments) };
|
2610
|
-
imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
|
2611
|
-
const ret = getObject(arg0).delete(getObject(arg1));
|
2612
|
-
return addHeapObject(ret);
|
2613
|
-
}, arguments) };
|
2614
|
-
imports.wbg.__wbg_put_84e7fc93eee27b28 = function() { return handleError(function (arg0, arg1, arg2) {
|
2615
|
-
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
2616
|
-
return addHeapObject(ret);
|
2617
|
-
}, arguments) };
|
2618
|
-
imports.wbg.__wbg_put_f2763b05a07f3233 = function() { return handleError(function (arg0, arg1) {
|
2619
|
-
const ret = getObject(arg0).put(getObject(arg1));
|
2620
|
-
return addHeapObject(ret);
|
2621
|
-
}, arguments) };
|
2622
|
-
imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
|
2623
|
-
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
|
2624
|
-
return addHeapObject(ret);
|
2625
|
-
}, arguments) };
|
2626
|
-
imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
2627
|
-
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
2628
|
-
return addHeapObject(ret);
|
2629
|
-
}, arguments) };
|
2630
|
-
imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
|
2631
|
-
getObject(arg0).onupgradeneeded = getObject(arg1);
|
2531
|
+
imports.wbg.__wbg_put_fdcda25ee2a99b60 = function () {
|
2532
|
+
return handleError(function (arg0, arg1, arg2) {
|
2533
|
+
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
2534
|
+
return addHeapObject(ret);
|
2535
|
+
}, arguments);
|
2632
2536
|
};
|
2633
|
-
imports.wbg.
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
}
|
2645
|
-
imports.wbg.
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
}
|
2657
|
-
imports.wbg.
|
2658
|
-
|
2537
|
+
imports.wbg.__wbg_put_e078356619886001 = function () {
|
2538
|
+
return handleError(function (arg0, arg1) {
|
2539
|
+
const ret = getObject(arg0).put(getObject(arg1));
|
2540
|
+
return addHeapObject(ret);
|
2541
|
+
}, arguments);
|
2542
|
+
};
|
2543
|
+
imports.wbg.__wbg_count_5e2074144ab4e23d = function () {
|
2544
|
+
return handleError(function (arg0) {
|
2545
|
+
const ret = getObject(arg0).count();
|
2546
|
+
return addHeapObject(ret);
|
2547
|
+
}, arguments);
|
2548
|
+
};
|
2549
|
+
imports.wbg.__wbg_count_ca4ab5c7bcf928fa = function () {
|
2550
|
+
return handleError(function (arg0, arg1) {
|
2551
|
+
const ret = getObject(arg0).count(getObject(arg1));
|
2552
|
+
return addHeapObject(ret);
|
2553
|
+
}, arguments);
|
2554
|
+
};
|
2555
|
+
imports.wbg.__wbg_delete_d2905418845867ae = function () {
|
2556
|
+
return handleError(function (arg0, arg1) {
|
2557
|
+
const ret = getObject(arg0).delete(getObject(arg1));
|
2558
|
+
return addHeapObject(ret);
|
2559
|
+
}, arguments);
|
2560
|
+
};
|
2561
|
+
imports.wbg.__wbg_index_009fbb0b7b595020 = function () {
|
2562
|
+
return handleError(function (arg0, arg1, arg2) {
|
2563
|
+
const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
|
2564
|
+
return addHeapObject(ret);
|
2565
|
+
}, arguments);
|
2566
|
+
};
|
2567
|
+
imports.wbg.__wbg_get_baf4855f9a986186 = function () {
|
2568
|
+
return handleError(function (arg0, arg1) {
|
2569
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
2570
|
+
return addHeapObject(ret);
|
2571
|
+
}, arguments);
|
2572
|
+
};
|
2573
|
+
imports.wbg.__wbg_get_6b22d93eabf073bc = function () {
|
2574
|
+
return handleError(function (arg0, arg1) {
|
2575
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
2576
|
+
return addHeapObject(ret);
|
2577
|
+
}, arguments);
|
2578
|
+
};
|
2579
|
+
imports.wbg.__wbg_openCursor_54d7936e873b5120 = function () {
|
2580
|
+
return handleError(function (arg0, arg1) {
|
2581
|
+
const ret = getObject(arg0).openCursor(getObject(arg1));
|
2582
|
+
return addHeapObject(ret);
|
2583
|
+
}, arguments);
|
2584
|
+
};
|
2585
|
+
imports.wbg.__wbg_randomFillSync_6894564c2c334c42 = function () {
|
2586
|
+
return handleError(function (arg0, arg1, arg2) {
|
2587
|
+
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
2588
|
+
}, arguments);
|
2659
2589
|
};
|
2660
|
-
imports.wbg.
|
2661
|
-
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
2662
|
-
}, arguments) };
|
2663
|
-
imports.wbg.__wbg_subarray_58ad4efbb5bcb886 = function(arg0, arg1, arg2) {
|
2590
|
+
imports.wbg.__wbg_subarray_7526649b91a252a6 = function (arg0, arg1, arg2) {
|
2664
2591
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
2665
2592
|
return addHeapObject(ret);
|
2666
2593
|
};
|
2667
|
-
imports.wbg.__wbg_getRandomValues_805f1c3d65988a5a = function
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2594
|
+
imports.wbg.__wbg_getRandomValues_805f1c3d65988a5a = function () {
|
2595
|
+
return handleError(function (arg0, arg1) {
|
2596
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
2597
|
+
}, arguments);
|
2598
|
+
};
|
2599
|
+
imports.wbg.__wbg_length_27a2afe8ab42b09f = function (arg0) {
|
2671
2600
|
const ret = getObject(arg0).length;
|
2672
2601
|
return ret;
|
2673
2602
|
};
|
2674
|
-
imports.wbg.__wbg_crypto_e1d53a1d73fb10b8 = function(arg0) {
|
2603
|
+
imports.wbg.__wbg_crypto_e1d53a1d73fb10b8 = function (arg0) {
|
2675
2604
|
const ret = getObject(arg0).crypto;
|
2676
2605
|
return addHeapObject(ret);
|
2677
2606
|
};
|
2678
|
-
imports.wbg.__wbg_process_038c26bf42b093f8 = function(arg0) {
|
2607
|
+
imports.wbg.__wbg_process_038c26bf42b093f8 = function (arg0) {
|
2679
2608
|
const ret = getObject(arg0).process;
|
2680
2609
|
return addHeapObject(ret);
|
2681
2610
|
};
|
2682
|
-
imports.wbg.__wbg_versions_ab37218d2f0b24a8 = function(arg0) {
|
2611
|
+
imports.wbg.__wbg_versions_ab37218d2f0b24a8 = function (arg0) {
|
2683
2612
|
const ret = getObject(arg0).versions;
|
2684
2613
|
return addHeapObject(ret);
|
2685
2614
|
};
|
2686
|
-
imports.wbg.__wbg_node_080f4b19d15bc1fe = function(arg0) {
|
2615
|
+
imports.wbg.__wbg_node_080f4b19d15bc1fe = function (arg0) {
|
2687
2616
|
const ret = getObject(arg0).node;
|
2688
2617
|
return addHeapObject(ret);
|
2689
2618
|
};
|
2690
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
2691
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
2619
|
+
imports.wbg.__wbindgen_is_string = function (arg0) {
|
2620
|
+
const ret = typeof (getObject(arg0)) === 'string';
|
2692
2621
|
return ret;
|
2693
2622
|
};
|
2694
|
-
imports.wbg.__wbg_require_78a3dcfbdba9cbce = function
|
2695
|
-
|
2696
|
-
|
2697
|
-
|
2698
|
-
|
2699
|
-
|
2623
|
+
imports.wbg.__wbg_require_78a3dcfbdba9cbce = function () {
|
2624
|
+
return handleError(function () {
|
2625
|
+
const ret = module.require;
|
2626
|
+
return addHeapObject(ret);
|
2627
|
+
}, arguments);
|
2628
|
+
};
|
2629
|
+
imports.wbg.__wbindgen_is_function = function (arg0) {
|
2630
|
+
const ret = typeof (getObject(arg0)) === 'function';
|
2700
2631
|
return ret;
|
2701
2632
|
};
|
2702
|
-
imports.wbg.__wbg_msCrypto_6e7d3e1f92610cbb = function(arg0) {
|
2633
|
+
imports.wbg.__wbg_msCrypto_6e7d3e1f92610cbb = function (arg0) {
|
2703
2634
|
const ret = getObject(arg0).msCrypto;
|
2704
2635
|
return addHeapObject(ret);
|
2705
2636
|
};
|
2706
|
-
imports.wbg.
|
2637
|
+
imports.wbg.__wbg_newwithlength_b56c882b57805732 = function (arg0) {
|
2707
2638
|
const ret = new Uint8Array(arg0 >>> 0);
|
2708
2639
|
return addHeapObject(ret);
|
2709
2640
|
};
|
2710
|
-
imports.wbg.
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2641
|
+
imports.wbg.__wbg_next_88560ec06a094dea = function () {
|
2642
|
+
return handleError(function (arg0) {
|
2643
|
+
const ret = getObject(arg0).next();
|
2644
|
+
return addHeapObject(ret);
|
2645
|
+
}, arguments);
|
2646
|
+
};
|
2647
|
+
imports.wbg.__wbg_done_1ebec03bbd919843 = function (arg0) {
|
2715
2648
|
const ret = getObject(arg0).done;
|
2716
2649
|
return ret;
|
2717
2650
|
};
|
2718
|
-
imports.wbg.
|
2651
|
+
imports.wbg.__wbg_value_6ac8da5cc5b3efda = function (arg0) {
|
2719
2652
|
const ret = getObject(arg0).value;
|
2720
2653
|
return addHeapObject(ret);
|
2721
2654
|
};
|
2722
|
-
imports.wbg.
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2655
|
+
imports.wbg.__wbg_call_95d1ea488d03e4e8 = function () {
|
2656
|
+
return handleError(function (arg0, arg1) {
|
2657
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
2658
|
+
return addHeapObject(ret);
|
2659
|
+
}, arguments);
|
2660
|
+
};
|
2661
|
+
imports.wbg.__wbg_next_b7d530c04fd8b217 = function (arg0) {
|
2727
2662
|
const ret = getObject(arg0).next;
|
2728
2663
|
return addHeapObject(ret);
|
2729
2664
|
};
|
2730
|
-
imports.wbg.
|
2731
|
-
|
2732
|
-
|
2733
|
-
|
2734
|
-
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
2741
|
-
}
|
2742
|
-
imports.wbg.
|
2743
|
-
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2665
|
+
imports.wbg.__wbg_self_e7c1f827057f6584 = function () {
|
2666
|
+
return handleError(function () {
|
2667
|
+
const ret = self.self;
|
2668
|
+
return addHeapObject(ret);
|
2669
|
+
}, arguments);
|
2670
|
+
};
|
2671
|
+
imports.wbg.__wbg_window_a09ec664e14b1b81 = function () {
|
2672
|
+
return handleError(function () {
|
2673
|
+
const ret = window.window;
|
2674
|
+
return addHeapObject(ret);
|
2675
|
+
}, arguments);
|
2676
|
+
};
|
2677
|
+
imports.wbg.__wbg_globalThis_87cbb8506fecf3a9 = function () {
|
2678
|
+
return handleError(function () {
|
2679
|
+
const ret = globalThis.globalThis;
|
2680
|
+
return addHeapObject(ret);
|
2681
|
+
}, arguments);
|
2682
|
+
};
|
2683
|
+
imports.wbg.__wbg_global_c85a9259e621f3db = function () {
|
2684
|
+
return handleError(function () {
|
2685
|
+
const ret = global.global;
|
2686
|
+
return addHeapObject(ret);
|
2687
|
+
}, arguments);
|
2688
|
+
};
|
2689
|
+
imports.wbg.__wbg_newnoargs_2b8b6bd7753c76ba = function (arg0, arg1) {
|
2747
2690
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
2748
2691
|
return addHeapObject(ret);
|
2749
2692
|
};
|
2750
|
-
imports.wbg.
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2693
|
+
imports.wbg.__wbg_set_6aa458a4ebdb65cb = function () {
|
2694
|
+
return handleError(function (arg0, arg1, arg2) {
|
2695
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
2696
|
+
return ret;
|
2697
|
+
}, arguments);
|
2698
|
+
};
|
2699
|
+
imports.wbg.__wbindgen_memory = function () {
|
2755
2700
|
const ret = wasm$1.memory;
|
2756
2701
|
return addHeapObject(ret);
|
2757
2702
|
};
|
2758
|
-
imports.wbg.
|
2703
|
+
imports.wbg.__wbg_buffer_cf65c07de34b9a08 = function (arg0) {
|
2759
2704
|
const ret = getObject(arg0).buffer;
|
2760
2705
|
return addHeapObject(ret);
|
2761
2706
|
};
|
2762
|
-
imports.wbg.
|
2707
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_9fb2f11355ecadf5 = function (arg0, arg1, arg2) {
|
2763
2708
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
2764
2709
|
return addHeapObject(ret);
|
2765
2710
|
};
|
2766
|
-
imports.wbg.
|
2711
|
+
imports.wbg.__wbg_set_17499e8aa4003ebd = function (arg0, arg1, arg2) {
|
2767
2712
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
2768
2713
|
};
|
2769
|
-
imports.wbg.
|
2714
|
+
imports.wbg.__wbg_now_931686b195a14f9d = function () {
|
2770
2715
|
const ret = Date.now();
|
2771
2716
|
return ret;
|
2772
2717
|
};
|
2773
|
-
imports.wbg.
|
2718
|
+
imports.wbg.__wbg_target_b629c177f9bee3da = function (arg0) {
|
2774
2719
|
const ret = getObject(arg0).target;
|
2775
2720
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
2776
2721
|
};
|
2777
|
-
imports.wbg.
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2722
|
+
imports.wbg.__wbg_result_3a1fef332bc47038 = function () {
|
2723
|
+
return handleError(function (arg0) {
|
2724
|
+
const ret = getObject(arg0).result;
|
2725
|
+
return addHeapObject(ret);
|
2726
|
+
}, arguments);
|
2727
|
+
};
|
2728
|
+
imports.wbg.__wbg_contains_eab173da4886df95 = function (arg0, arg1, arg2) {
|
2782
2729
|
const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
|
2783
2730
|
return ret;
|
2784
2731
|
};
|
2785
|
-
imports.wbg.
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2732
|
+
imports.wbg.__wbg_createObjectStore_ed1e91faa3997893 = function () {
|
2733
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
2734
|
+
const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
2735
|
+
return addHeapObject(ret);
|
2736
|
+
}, arguments);
|
2737
|
+
};
|
2738
|
+
imports.wbg.__wbg_transaction_c231cf0e3feac876 = function (arg0) {
|
2790
2739
|
const ret = getObject(arg0).transaction;
|
2791
2740
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
2792
2741
|
};
|
2793
|
-
imports.wbg.
|
2742
|
+
imports.wbg.__wbg_indexNames_7ef05cac7f9faea0 = function (arg0) {
|
2794
2743
|
const ret = getObject(arg0).indexNames;
|
2795
2744
|
return addHeapObject(ret);
|
2796
2745
|
};
|
2797
|
-
imports.wbg.
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
return
|
2810
|
-
|
2811
|
-
|
2746
|
+
imports.wbg.__wbg_createIndex_308667a6a7549b87 = function () {
|
2747
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
2748
|
+
const ret = getObject(arg0).createIndex(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
|
2749
|
+
return addHeapObject(ret);
|
2750
|
+
}, arguments);
|
2751
|
+
};
|
2752
|
+
imports.wbg.__wbg_deleteIndex_4f7897daa8425a6c = function () {
|
2753
|
+
return handleError(function (arg0, arg1, arg2) {
|
2754
|
+
getObject(arg0).deleteIndex(getStringFromWasm0(arg1, arg2));
|
2755
|
+
}, arguments);
|
2756
|
+
};
|
2757
|
+
imports.wbg.__wbg_deleteObjectStore_a67245ba486fb641 = function () {
|
2758
|
+
return handleError(function (arg0, arg1, arg2) {
|
2759
|
+
getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
|
2760
|
+
}, arguments);
|
2761
|
+
};
|
2762
|
+
imports.wbg.__wbg_error_f64b8d41ed4d2fdc = function () {
|
2763
|
+
return handleError(function (arg0) {
|
2764
|
+
const ret = getObject(arg0).error;
|
2765
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
2766
|
+
}, arguments);
|
2767
|
+
};
|
2768
|
+
imports.wbg.__wbindgen_is_falsy = function (arg0) {
|
2812
2769
|
const ret = !getObject(arg0);
|
2813
2770
|
return ret;
|
2814
2771
|
};
|
2815
|
-
imports.wbg.
|
2816
|
-
|
2817
|
-
|
2818
|
-
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2772
|
+
imports.wbg.__wbg_key_4b29c4de1db73033 = function () {
|
2773
|
+
return handleError(function (arg0) {
|
2774
|
+
const ret = getObject(arg0).key;
|
2775
|
+
return addHeapObject(ret);
|
2776
|
+
}, arguments);
|
2777
|
+
};
|
2778
|
+
imports.wbg.__wbg_advance_b4ae7221325b28eb = function () {
|
2779
|
+
return handleError(function (arg0, arg1) {
|
2780
|
+
getObject(arg0).advance(arg1 >>> 0);
|
2781
|
+
}, arguments);
|
2782
|
+
};
|
2783
|
+
imports.wbg.__wbg_instanceof_IdbFactory_9c5780a46ebd3426 = function (arg0) {
|
2823
2784
|
let result;
|
2824
2785
|
try {
|
2825
2786
|
result = getObject(arg0) instanceof IDBFactory;
|
2826
|
-
}
|
2787
|
+
}
|
2788
|
+
catch {
|
2827
2789
|
result = false;
|
2828
2790
|
}
|
2829
2791
|
const ret = result;
|
2830
2792
|
return ret;
|
2831
2793
|
};
|
2832
|
-
imports.wbg.
|
2794
|
+
imports.wbg.__wbg_open_bd135117d9924392 = function () {
|
2795
|
+
return handleError(function (arg0, arg1, arg2) {
|
2796
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
|
2797
|
+
return addHeapObject(ret);
|
2798
|
+
}, arguments);
|
2799
|
+
};
|
2800
|
+
imports.wbg.__wbg_open_2f9bdc2df25fc92e = function () {
|
2801
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
2802
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
2803
|
+
return addHeapObject(ret);
|
2804
|
+
}, arguments);
|
2805
|
+
};
|
2806
|
+
imports.wbg.__wbg_setonupgradeneeded_8961be061344d04a = function (arg0, arg1) {
|
2807
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
2808
|
+
};
|
2809
|
+
imports.wbg.__wbg_toString_cec163b212643722 = function (arg0) {
|
2833
2810
|
const ret = getObject(arg0).toString();
|
2834
2811
|
return addHeapObject(ret);
|
2835
2812
|
};
|
2836
|
-
imports.wbg.
|
2813
|
+
imports.wbg.__wbg_instanceof_Window_e266f02eee43b570 = function (arg0) {
|
2837
2814
|
let result;
|
2838
2815
|
try {
|
2839
2816
|
result = getObject(arg0) instanceof Window;
|
2840
|
-
}
|
2817
|
+
}
|
2818
|
+
catch {
|
2841
2819
|
result = false;
|
2842
2820
|
}
|
2843
2821
|
const ret = result;
|
2844
2822
|
return ret;
|
2845
2823
|
};
|
2846
|
-
imports.wbg.
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2824
|
+
imports.wbg.__wbg_crypto_71b946c90b06fb5b = function () {
|
2825
|
+
return handleError(function (arg0) {
|
2826
|
+
const ret = getObject(arg0).crypto;
|
2827
|
+
return addHeapObject(ret);
|
2828
|
+
}, arguments);
|
2829
|
+
};
|
2830
|
+
imports.wbg.__wbg_getRandomValues_2a91ccd2d6c499b0 = function () {
|
2831
|
+
return handleError(function (arg0, arg1, arg2) {
|
2832
|
+
const ret = getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2));
|
2833
|
+
return addHeapObject(ret);
|
2834
|
+
}, arguments);
|
2835
|
+
};
|
2836
|
+
imports.wbg.__wbg_instanceof_Uint8Array_01cebe79ca606cca = function (arg0) {
|
2855
2837
|
let result;
|
2856
2838
|
try {
|
2857
2839
|
result = getObject(arg0) instanceof Uint8Array;
|
2858
|
-
}
|
2840
|
+
}
|
2841
|
+
catch {
|
2859
2842
|
result = false;
|
2860
2843
|
}
|
2861
2844
|
const ret = result;
|
2862
2845
|
return ret;
|
2863
2846
|
};
|
2864
|
-
imports.wbg.
|
2847
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_a69f02ee4c4f5065 = function (arg0) {
|
2865
2848
|
let result;
|
2866
2849
|
try {
|
2867
2850
|
result = getObject(arg0) instanceof ArrayBuffer;
|
2868
|
-
}
|
2851
|
+
}
|
2852
|
+
catch {
|
2869
2853
|
result = false;
|
2870
2854
|
}
|
2871
2855
|
const ret = result;
|
2872
2856
|
return ret;
|
2873
2857
|
};
|
2874
|
-
imports.wbg.
|
2858
|
+
imports.wbg.__wbg_entries_4e1315b774245952 = function (arg0) {
|
2875
2859
|
const ret = Object.entries(getObject(arg0));
|
2876
2860
|
return addHeapObject(ret);
|
2877
2861
|
};
|
2878
|
-
imports.wbg.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
|
2862
|
+
imports.wbg.__wbg_String_91fba7ded13ba54c = function (arg0, arg1) {
|
2879
2863
|
const ret = String(getObject(arg1));
|
2880
2864
|
const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2881
2865
|
const len0 = WASM_VECTOR_LEN;
|
2882
2866
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
2883
2867
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
2884
2868
|
};
|
2885
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
2869
|
+
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
|
2886
2870
|
const ret = debugString(getObject(arg1));
|
2887
2871
|
const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2888
2872
|
const len0 = WASM_VECTOR_LEN;
|
2889
2873
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
2890
2874
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
2891
2875
|
};
|
2892
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
2876
|
+
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
|
2893
2877
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
2894
2878
|
};
|
2895
|
-
imports.wbg.
|
2879
|
+
imports.wbg.__wbg_then_ec5db6d509eb475f = function (arg0, arg1) {
|
2896
2880
|
const ret = getObject(arg0).then(getObject(arg1));
|
2897
2881
|
return addHeapObject(ret);
|
2898
2882
|
};
|
2899
|
-
imports.wbg.
|
2883
|
+
imports.wbg.__wbg_resolve_fd40f858d9db1a04 = function (arg0) {
|
2900
2884
|
const ret = Promise.resolve(getObject(arg0));
|
2901
2885
|
return addHeapObject(ret);
|
2902
2886
|
};
|
2903
|
-
imports.wbg.
|
2887
|
+
imports.wbg.__wbg_get_ed3fbcc16ce7b4bb = function (arg0, arg1, arg2) {
|
2904
2888
|
const ret = getObject(arg1)[arg2 >>> 0];
|
2905
2889
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
2906
2890
|
var len0 = WASM_VECTOR_LEN;
|
2907
2891
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
2908
2892
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
2909
2893
|
};
|
2910
|
-
imports.wbg.
|
2911
|
-
|
2912
|
-
|
2913
|
-
|
2914
|
-
|
2915
|
-
|
2916
|
-
|
2917
|
-
|
2918
|
-
|
2919
|
-
|
2920
|
-
}
|
2921
|
-
imports.wbg.
|
2922
|
-
|
2923
|
-
|
2924
|
-
|
2925
|
-
|
2926
|
-
|
2927
|
-
|
2928
|
-
|
2929
|
-
|
2930
|
-
|
2894
|
+
imports.wbg.__wbg_continue_1df0825170e4d395 = function () {
|
2895
|
+
return handleError(function (arg0) {
|
2896
|
+
getObject(arg0).continue();
|
2897
|
+
}, arguments);
|
2898
|
+
};
|
2899
|
+
imports.wbg.__wbg_value_97772e372f20b04e = function () {
|
2900
|
+
return handleError(function (arg0) {
|
2901
|
+
const ret = getObject(arg0).value;
|
2902
|
+
return addHeapObject(ret);
|
2903
|
+
}, arguments);
|
2904
|
+
};
|
2905
|
+
imports.wbg.__wbg_openCursor_f07a2d20b356da80 = function () {
|
2906
|
+
return handleError(function (arg0) {
|
2907
|
+
const ret = getObject(arg0).openCursor();
|
2908
|
+
return addHeapObject(ret);
|
2909
|
+
}, arguments);
|
2910
|
+
};
|
2911
|
+
imports.wbg.__wbg_openCursor_03f95e6b2b64c86e = function () {
|
2912
|
+
return handleError(function (arg0, arg1, arg2) {
|
2913
|
+
const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
|
2914
|
+
return addHeapObject(ret);
|
2915
|
+
}, arguments);
|
2916
|
+
};
|
2917
|
+
imports.wbg.__wbg_get_18b8195859195e7e = function () {
|
2918
|
+
return handleError(function (arg0, arg1) {
|
2919
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
2920
|
+
return addHeapObject(ret);
|
2921
|
+
}, arguments);
|
2922
|
+
};
|
2923
|
+
imports.wbg.__wbg_openCursor_a00e5f8015710a1a = function () {
|
2924
|
+
return handleError(function (arg0) {
|
2925
|
+
const ret = getObject(arg0).openCursor();
|
2926
|
+
return addHeapObject(ret);
|
2927
|
+
}, arguments);
|
2928
|
+
};
|
2929
|
+
imports.wbg.__wbg_openCursor_51766f7156aa29ab = function () {
|
2930
|
+
return handleError(function (arg0, arg1) {
|
2931
|
+
const ret = getObject(arg0).openCursor(getObject(arg1));
|
2932
|
+
return addHeapObject(ret);
|
2933
|
+
}, arguments);
|
2934
|
+
};
|
2935
|
+
imports.wbg.__wbg_openCursor_4bc8942a881766b1 = function () {
|
2936
|
+
return handleError(function (arg0, arg1, arg2) {
|
2937
|
+
const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
|
2938
|
+
return addHeapObject(ret);
|
2939
|
+
}, arguments);
|
2940
|
+
};
|
2941
|
+
imports.wbg.__wbg_objectStore_cdc69f65ad4a71eb = function () {
|
2942
|
+
return handleError(function (arg0, arg1, arg2) {
|
2943
|
+
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
2944
|
+
return addHeapObject(ret);
|
2945
|
+
}, arguments);
|
2946
|
+
};
|
2947
|
+
imports.wbg.__wbindgen_closure_wrapper4326 = function (arg0, arg1, arg2) {
|
2948
|
+
const ret = makeMutClosure(arg0, arg1, 146, __wbg_adapter_52);
|
2931
2949
|
return addHeapObject(ret);
|
2932
2950
|
};
|
2933
|
-
imports.wbg.
|
2934
|
-
const ret = makeMutClosure(arg0, arg1,
|
2951
|
+
imports.wbg.__wbindgen_closure_wrapper4766 = function (arg0, arg1, arg2) {
|
2952
|
+
const ret = makeMutClosure(arg0, arg1, 146, __wbg_adapter_55);
|
2935
2953
|
return addHeapObject(ret);
|
2936
2954
|
};
|
2937
|
-
|
2938
2955
|
return imports;
|
2939
2956
|
}
|
2940
|
-
|
2941
2957
|
function finalizeInit(instance, module) {
|
2942
2958
|
wasm$1 = instance.exports;
|
2943
2959
|
init.__wbindgen_wasm_module = module;
|
2944
|
-
cachedBigInt64Memory0 =
|
2945
|
-
cachedFloat64Memory0 =
|
2946
|
-
cachedInt32Memory0 =
|
2947
|
-
cachedUint32Memory0 =
|
2948
|
-
cachedUint8Memory0 =
|
2949
|
-
|
2950
|
-
|
2960
|
+
cachedBigInt64Memory0 = null;
|
2961
|
+
cachedFloat64Memory0 = null;
|
2962
|
+
cachedInt32Memory0 = null;
|
2963
|
+
cachedUint32Memory0 = null;
|
2964
|
+
cachedUint8Memory0 = null;
|
2951
2965
|
return wasm$1;
|
2952
2966
|
}
|
2953
|
-
|
2954
2967
|
function initSync(module) {
|
2955
2968
|
const imports = getImports();
|
2956
|
-
|
2957
2969
|
if (!(module instanceof WebAssembly.Module)) {
|
2958
2970
|
module = new WebAssembly.Module(module);
|
2959
2971
|
}
|
2960
|
-
|
2961
2972
|
const instance = new WebAssembly.Instance(module, imports);
|
2962
|
-
|
2963
2973
|
return finalizeInit(instance, module);
|
2964
2974
|
}
|
2965
|
-
|
2966
2975
|
async function init(input) {
|
2967
|
-
|
2968
2976
|
const imports = getImports();
|
2969
|
-
|
2970
2977
|
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
2971
2978
|
input = fetch(input);
|
2972
2979
|
}
|
2973
|
-
|
2974
2980
|
const { instance, module } = await load(await input, imports);
|
2975
|
-
|
2976
2981
|
return finalizeInit(instance, module);
|
2977
2982
|
}
|
2978
2983
|
|
2979
2984
|
var exports = /*#__PURE__*/Object.freeze({
|
2980
2985
|
__proto__: null,
|
2981
|
-
version: version,
|
2982
|
-
WirePolicy: WirePolicy$1,
|
2983
|
-
Ciphersuite: Ciphersuite$1,
|
2984
2986
|
AcmeChallenge: AcmeChallenge,
|
2985
2987
|
AcmeDirectory: AcmeDirectory,
|
2986
2988
|
AcmeFinalize: AcmeFinalize,
|
2989
|
+
Ciphersuite: Ciphersuite$1,
|
2987
2990
|
CommitBundle: CommitBundle,
|
2988
2991
|
ConversationConfiguration: ConversationConfiguration,
|
2989
2992
|
ConversationInitBundle: ConversationInitBundle,
|
@@ -2991,21 +2994,23 @@ var exports = /*#__PURE__*/Object.freeze({
|
|
2991
2994
|
CoreCryptoWasmCallbacks: CoreCryptoWasmCallbacks,
|
2992
2995
|
CustomConfiguration: CustomConfiguration,
|
2993
2996
|
DecryptedMessage: DecryptedMessage,
|
2997
|
+
FfiWireE2EIdentity: FfiWireE2EIdentity,
|
2994
2998
|
Invitee: Invitee,
|
2995
2999
|
MemberAddedMessages: MemberAddedMessages,
|
2996
3000
|
NewAcmeAuthz: NewAcmeAuthz,
|
2997
3001
|
NewAcmeOrder: NewAcmeOrder,
|
2998
3002
|
ProposalBundle: ProposalBundle,
|
2999
3003
|
PublicGroupStateBundle: PublicGroupStateBundle,
|
3000
|
-
|
3004
|
+
WirePolicy: WirePolicy$1,
|
3005
|
+
default: init,
|
3001
3006
|
initSync: initSync,
|
3002
|
-
|
3007
|
+
version: version
|
3003
3008
|
});
|
3004
3009
|
|
3005
3010
|
var wasm = async (opt = {}) => {
|
3006
3011
|
let {importHook, serverPath} = opt;
|
3007
3012
|
|
3008
|
-
let path = "assets/core_crypto_ffi-
|
3013
|
+
let path = "assets/core_crypto_ffi-fb64c1f7.wasm";
|
3009
3014
|
|
3010
3015
|
if (serverPath != null) {
|
3011
3016
|
path = serverPath + /[^\/\\]*$/.exec(path)[0];
|
@@ -3021,7 +3026,65 @@ var wasm = async (opt = {}) => {
|
|
3021
3026
|
|
3022
3027
|
// Wire
|
3023
3028
|
// Copyright (C) 2022 Wire Swiss GmbH
|
3024
|
-
var _a, _CoreCrypto_module, _CoreCrypto_cc,
|
3029
|
+
var _a, _CoreCrypto_module, _CoreCrypto_cc, _WireE2eIdentity_e2ei;
|
3030
|
+
/**
|
3031
|
+
* Error wrapper that takes care of extracting rich error details across the FFI (through JSON parsing)
|
3032
|
+
*
|
3033
|
+
* Whenever you're supposed to get this class (that extends `Error`) you might end up with a base `Error`
|
3034
|
+
* in case the parsing of the message structure fails. This is unlikely but the case is still covered and fall backs automatically.
|
3035
|
+
* More information will be found in the base `Error.cause` to inform you why the parsing has failed.
|
3036
|
+
*
|
3037
|
+
* Please note that in this case the extra properties will not be available.
|
3038
|
+
*/
|
3039
|
+
class CoreCryptoError extends Error {
|
3040
|
+
constructor(msg, richError, ...params) {
|
3041
|
+
// @ts-ignore
|
3042
|
+
super(msg, ...params);
|
3043
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
3044
|
+
this.name = richError.errorName;
|
3045
|
+
this.rustStackTrace = richError.rustStackTrace;
|
3046
|
+
this.proteusErrorCode = richError.proteusErrorCode;
|
3047
|
+
}
|
3048
|
+
static fallback(msg, ...params) {
|
3049
|
+
console.warn("Cannot build CoreCryptoError, falling back to standard Error");
|
3050
|
+
// @ts-ignore
|
3051
|
+
return new Error(msg, ...params);
|
3052
|
+
}
|
3053
|
+
static build(msg, ...params) {
|
3054
|
+
const parts = msg.split("\n\n");
|
3055
|
+
if (parts.length < 2) {
|
3056
|
+
const cause = new Error("CoreCrypto WASM FFI Error doesn't have enough elements to build a rich error");
|
3057
|
+
return this.fallback(msg, { cause }, ...params);
|
3058
|
+
}
|
3059
|
+
const [errMsg, richErrorJSON,] = parts;
|
3060
|
+
try {
|
3061
|
+
const richError = JSON.parse(richErrorJSON);
|
3062
|
+
return new this(errMsg, richError, ...params);
|
3063
|
+
}
|
3064
|
+
catch (cause) {
|
3065
|
+
return this.fallback(msg, { cause }, ...params);
|
3066
|
+
}
|
3067
|
+
}
|
3068
|
+
static fromStdError(e) {
|
3069
|
+
const opts = {
|
3070
|
+
// @ts-ignore
|
3071
|
+
cause: e.cause || undefined,
|
3072
|
+
stack: e.stack || undefined,
|
3073
|
+
};
|
3074
|
+
return this.build(e.message, opts);
|
3075
|
+
}
|
3076
|
+
static async asyncMapErr(p) {
|
3077
|
+
const mappedErrorPromise = p.catch((e) => {
|
3078
|
+
if (e instanceof CoreCryptoError) {
|
3079
|
+
throw e;
|
3080
|
+
}
|
3081
|
+
else {
|
3082
|
+
throw this.fromStdError(e);
|
3083
|
+
}
|
3084
|
+
});
|
3085
|
+
return await mappedErrorPromise;
|
3086
|
+
}
|
3087
|
+
}
|
3025
3088
|
/**
|
3026
3089
|
* see [core_crypto::prelude::CiphersuiteName]
|
3027
3090
|
*/
|
@@ -3179,7 +3242,7 @@ class CoreCrypto {
|
|
3179
3242
|
const exports = (await wasm(wasmImportArgs));
|
3180
3243
|
__classPrivateFieldSet(this, _a, exports, "f", _CoreCrypto_module);
|
3181
3244
|
}
|
3182
|
-
const cc = await __classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto._internal_new(databaseName, key, clientId, entropySeed);
|
3245
|
+
const cc = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto._internal_new(databaseName, key, clientId, entropySeed));
|
3183
3246
|
return new this(cc);
|
3184
3247
|
}
|
3185
3248
|
/**
|
@@ -3187,14 +3250,15 @@ class CoreCrypto {
|
|
3187
3250
|
* First, calling this will set up the keystore and will allow generating proteus prekeys.
|
3188
3251
|
* Then, those keys can be traded for a clientId.
|
3189
3252
|
* Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
|
3253
|
+
* @param params - {@link CoreCryptoDeferredParams}
|
3190
3254
|
*/
|
3191
|
-
static async deferredInit(databaseName, key, entropySeed, wasmFilePath) {
|
3255
|
+
static async deferredInit({ databaseName, key, entropySeed, wasmFilePath }) {
|
3192
3256
|
if (!__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module)) {
|
3193
3257
|
const wasmImportArgs = wasmFilePath ? { importHook: () => wasmFilePath } : undefined;
|
3194
3258
|
const exports = (await wasm(wasmImportArgs));
|
3195
3259
|
__classPrivateFieldSet(this, _a, exports, "f", _CoreCrypto_module);
|
3196
3260
|
}
|
3197
|
-
const cc = await __classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.deferred_init(databaseName, key, entropySeed);
|
3261
|
+
const cc = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.deferred_init(databaseName, key, entropySeed));
|
3198
3262
|
return new this(cc);
|
3199
3263
|
}
|
3200
3264
|
/**
|
@@ -3203,7 +3267,7 @@ class CoreCrypto {
|
|
3203
3267
|
* @param clientId - {@link CoreCryptoParams#clientId} but required
|
3204
3268
|
*/
|
3205
3269
|
async mlsInit(clientId) {
|
3206
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").mls_init(clientId);
|
3270
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").mls_init(clientId));
|
3207
3271
|
}
|
3208
3272
|
/** @hidden */
|
3209
3273
|
constructor(cc) {
|
@@ -3217,7 +3281,7 @@ class CoreCrypto {
|
|
3217
3281
|
* **CAUTION**: This {@link CoreCrypto} instance won't be useable after a call to this method, but there's no way to express this requirement in TypeScript so you'll get errors instead!
|
3218
3282
|
*/
|
3219
3283
|
async wipe() {
|
3220
|
-
await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").wipe();
|
3284
|
+
await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").wipe());
|
3221
3285
|
}
|
3222
3286
|
/**
|
3223
3287
|
* Closes this {@link CoreCrypto} instance and deallocates all loaded resources
|
@@ -3225,7 +3289,7 @@ class CoreCrypto {
|
|
3225
3289
|
* **CAUTION**: This {@link CoreCrypto} instance won't be useable after a call to this method, but there's no way to express this requirement in TypeScript so you'll get errors instead!
|
3226
3290
|
*/
|
3227
3291
|
async close() {
|
3228
|
-
await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").close();
|
3292
|
+
await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").close());
|
3229
3293
|
}
|
3230
3294
|
/**
|
3231
3295
|
* Registers the callbacks for CoreCrypto to use in order to gain additional information
|
@@ -3233,8 +3297,13 @@ class CoreCrypto {
|
|
3233
3297
|
* @param callbacks - Any interface following the {@link CoreCryptoCallbacks} interface
|
3234
3298
|
*/
|
3235
3299
|
registerCallbacks(callbacks) {
|
3236
|
-
|
3237
|
-
|
3300
|
+
try {
|
3301
|
+
const wasmCallbacks = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).CoreCryptoWasmCallbacks)(callbacks.authorize, callbacks.userAuthorize, callbacks.clientIsExistingGroupUser);
|
3302
|
+
__classPrivateFieldGet(this, _CoreCrypto_cc, "f").set_callbacks(wasmCallbacks);
|
3303
|
+
}
|
3304
|
+
catch (e) {
|
3305
|
+
throw CoreCryptoError.fromStdError(e);
|
3306
|
+
}
|
3238
3307
|
}
|
3239
3308
|
/**
|
3240
3309
|
* Checks if the Client is member of a given conversation and if the MLS Group is loaded up
|
@@ -3253,7 +3322,7 @@ class CoreCrypto {
|
|
3253
3322
|
* ```
|
3254
3323
|
*/
|
3255
3324
|
async conversationExists(conversationId) {
|
3256
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").conversation_exists(conversationId);
|
3325
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").conversation_exists(conversationId));
|
3257
3326
|
}
|
3258
3327
|
/**
|
3259
3328
|
* Returns the current epoch of a conversation
|
@@ -3268,7 +3337,7 @@ class CoreCrypto {
|
|
3268
3337
|
* ```
|
3269
3338
|
*/
|
3270
3339
|
async conversationEpoch(conversationId) {
|
3271
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").conversation_epoch(conversationId);
|
3340
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").conversation_epoch(conversationId));
|
3272
3341
|
}
|
3273
3342
|
/**
|
3274
3343
|
* Wipes and destroys the local storage of a given conversation / MLS group
|
@@ -3276,7 +3345,7 @@ class CoreCrypto {
|
|
3276
3345
|
* @param conversationId - The ID of the conversation to remove
|
3277
3346
|
*/
|
3278
3347
|
async wipeConversation(conversationId) {
|
3279
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").wipe_conversation(conversationId);
|
3348
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").wipe_conversation(conversationId));
|
3280
3349
|
}
|
3281
3350
|
/**
|
3282
3351
|
* Creates a new conversation with the current client being the sole member
|
@@ -3289,10 +3358,15 @@ class CoreCrypto {
|
|
3289
3358
|
* @param configuration.custom - {@link CustomConfiguration}
|
3290
3359
|
*/
|
3291
3360
|
async createConversation(conversationId, configuration = {}) {
|
3292
|
-
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3361
|
+
try {
|
3362
|
+
const { ciphersuite, externalSenders, custom = {} } = configuration || {};
|
3363
|
+
const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(ciphersuite, externalSenders, custom?.keyRotationSpan);
|
3364
|
+
const ret = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").create_conversation(conversationId, config));
|
3365
|
+
return ret;
|
3366
|
+
}
|
3367
|
+
catch (e) {
|
3368
|
+
throw CoreCryptoError.fromStdError(e);
|
3369
|
+
}
|
3296
3370
|
}
|
3297
3371
|
/**
|
3298
3372
|
* Decrypts a message for a given conversation
|
@@ -3303,19 +3377,24 @@ class CoreCrypto {
|
|
3303
3377
|
* @returns a {@link DecryptedMessage}. Note that {@link DecryptedMessage#message} is `undefined` when the encrypted payload contains a system message such a proposal or commit
|
3304
3378
|
*/
|
3305
3379
|
async decryptMessage(conversationId, payload) {
|
3306
|
-
|
3307
|
-
|
3308
|
-
ffiDecryptedMessage.commit_delay
|
3309
|
-
|
3310
|
-
|
3311
|
-
|
3312
|
-
|
3313
|
-
|
3314
|
-
|
3315
|
-
|
3316
|
-
|
3317
|
-
|
3318
|
-
|
3380
|
+
try {
|
3381
|
+
const ffiDecryptedMessage = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").decrypt_message(conversationId, payload));
|
3382
|
+
const commitDelay = ffiDecryptedMessage.commit_delay ?
|
3383
|
+
ffiDecryptedMessage.commit_delay * 1000 :
|
3384
|
+
undefined;
|
3385
|
+
const ret = {
|
3386
|
+
message: ffiDecryptedMessage.message,
|
3387
|
+
proposals: ffiDecryptedMessage.proposals,
|
3388
|
+
isActive: ffiDecryptedMessage.is_active,
|
3389
|
+
senderClientId: ffiDecryptedMessage.sender_client_id,
|
3390
|
+
commitDelay,
|
3391
|
+
hasEpochChanged: ffiDecryptedMessage.has_epoch_changed,
|
3392
|
+
};
|
3393
|
+
return ret;
|
3394
|
+
}
|
3395
|
+
catch (e) {
|
3396
|
+
throw CoreCryptoError.fromStdError(e);
|
3397
|
+
}
|
3319
3398
|
}
|
3320
3399
|
/**
|
3321
3400
|
* Encrypts a message for a given conversation
|
@@ -3326,7 +3405,7 @@ class CoreCrypto {
|
|
3326
3405
|
* @returns The encrypted payload for the given group. This needs to be fanned out to the other members of the group.
|
3327
3406
|
*/
|
3328
3407
|
async encryptMessage(conversationId, message) {
|
3329
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").encrypt_message(conversationId, message);
|
3408
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").encrypt_message(conversationId, message));
|
3330
3409
|
}
|
3331
3410
|
/**
|
3332
3411
|
* Ingest a TLS-serialized MLS welcome message to join an existing MLS group
|
@@ -3336,21 +3415,26 @@ class CoreCrypto {
|
|
3336
3415
|
* @returns The conversation ID of the newly joined group. You can use the same ID to decrypt/encrypt messages
|
3337
3416
|
*/
|
3338
3417
|
async processWelcomeMessage(welcomeMessage, configuration = {}) {
|
3339
|
-
|
3340
|
-
|
3341
|
-
|
3418
|
+
try {
|
3419
|
+
const { keyRotationSpan, wirePolicy } = configuration || {};
|
3420
|
+
const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).CustomConfiguration)(keyRotationSpan, wirePolicy);
|
3421
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").process_welcome_message(welcomeMessage, config));
|
3422
|
+
}
|
3423
|
+
catch (e) {
|
3424
|
+
throw CoreCryptoError.fromStdError(e);
|
3425
|
+
}
|
3342
3426
|
}
|
3343
3427
|
/**
|
3344
3428
|
* @returns The client's public key
|
3345
3429
|
*/
|
3346
3430
|
async clientPublicKey() {
|
3347
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_public_key();
|
3431
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_public_key());
|
3348
3432
|
}
|
3349
3433
|
/**
|
3350
3434
|
* @returns The amount of valid, non-expired KeyPackages that are persisted in the backing storage
|
3351
3435
|
*/
|
3352
3436
|
async clientValidKeypackagesCount() {
|
3353
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_valid_keypackages_count();
|
3437
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_valid_keypackages_count());
|
3354
3438
|
}
|
3355
3439
|
/**
|
3356
3440
|
* Fetches a requested amount of keypackages
|
@@ -3359,7 +3443,7 @@ class CoreCrypto {
|
|
3359
3443
|
* @returns An array of length `amountRequested` containing TLS-serialized KeyPackages
|
3360
3444
|
*/
|
3361
3445
|
async clientKeypackages(amountRequested) {
|
3362
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_keypackages(amountRequested);
|
3446
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_keypackages(amountRequested));
|
3363
3447
|
}
|
3364
3448
|
/**
|
3365
3449
|
* Adds new clients to a conversation, assuming the current client has the right to add new clients to the conversation.
|
@@ -3374,20 +3458,25 @@ class CoreCrypto {
|
|
3374
3458
|
* @returns A {@link CommitBundle}
|
3375
3459
|
*/
|
3376
3460
|
async addClientsToConversation(conversationId, clients) {
|
3377
|
-
|
3378
|
-
|
3379
|
-
|
3380
|
-
|
3381
|
-
|
3382
|
-
|
3383
|
-
|
3384
|
-
|
3385
|
-
|
3386
|
-
|
3387
|
-
|
3388
|
-
|
3389
|
-
|
3390
|
-
|
3461
|
+
try {
|
3462
|
+
const ffiClients = clients.map((invitee) => new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).Invitee)(invitee.id, invitee.kp));
|
3463
|
+
const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").add_clients_to_conversation(conversationId, ffiClients));
|
3464
|
+
ffiClients.forEach(c => c.free());
|
3465
|
+
const pgs = ffiRet.public_group_state;
|
3466
|
+
const ret = {
|
3467
|
+
welcome: ffiRet.welcome,
|
3468
|
+
commit: ffiRet.commit,
|
3469
|
+
publicGroupState: {
|
3470
|
+
encryptionType: pgs.encryption_type,
|
3471
|
+
ratchetTreeType: pgs.ratchet_tree_type,
|
3472
|
+
payload: pgs.payload
|
3473
|
+
},
|
3474
|
+
};
|
3475
|
+
return ret;
|
3476
|
+
}
|
3477
|
+
catch (e) {
|
3478
|
+
throw CoreCryptoError.fromStdError(e);
|
3479
|
+
}
|
3391
3480
|
}
|
3392
3481
|
/**
|
3393
3482
|
* Removes the provided clients from a conversation; Assuming those clients exist and the current client is allowed
|
@@ -3403,18 +3492,23 @@ class CoreCrypto {
|
|
3403
3492
|
* @returns A {@link CommitBundle}
|
3404
3493
|
*/
|
3405
3494
|
async removeClientsFromConversation(conversationId, clientIds) {
|
3406
|
-
|
3407
|
-
|
3408
|
-
|
3409
|
-
|
3410
|
-
|
3411
|
-
|
3412
|
-
|
3413
|
-
|
3414
|
-
|
3415
|
-
|
3416
|
-
|
3417
|
-
|
3495
|
+
try {
|
3496
|
+
const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").remove_clients_from_conversation(conversationId, clientIds));
|
3497
|
+
const pgs = ffiRet.public_group_state;
|
3498
|
+
const ret = {
|
3499
|
+
welcome: ffiRet.welcome,
|
3500
|
+
commit: ffiRet.commit,
|
3501
|
+
publicGroupState: {
|
3502
|
+
encryptionType: pgs.encryption_type,
|
3503
|
+
ratchetTreeType: pgs.ratchet_tree_type,
|
3504
|
+
payload: pgs.payload
|
3505
|
+
},
|
3506
|
+
};
|
3507
|
+
return ret;
|
3508
|
+
}
|
3509
|
+
catch (e) {
|
3510
|
+
throw CoreCryptoError.fromStdError(e);
|
3511
|
+
}
|
3418
3512
|
}
|
3419
3513
|
/**
|
3420
3514
|
* Creates an update commit which forces every client to update their keypackages in the conversation
|
@@ -3428,18 +3522,23 @@ class CoreCrypto {
|
|
3428
3522
|
* @returns A {@link CommitBundle}
|
3429
3523
|
*/
|
3430
3524
|
async updateKeyingMaterial(conversationId) {
|
3431
|
-
|
3432
|
-
|
3433
|
-
|
3434
|
-
|
3435
|
-
|
3436
|
-
|
3437
|
-
|
3438
|
-
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
|
3525
|
+
try {
|
3526
|
+
const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").update_keying_material(conversationId));
|
3527
|
+
const pgs = ffiRet.public_group_state;
|
3528
|
+
const ret = {
|
3529
|
+
welcome: ffiRet.welcome,
|
3530
|
+
commit: ffiRet.commit,
|
3531
|
+
publicGroupState: {
|
3532
|
+
encryptionType: pgs.encryption_type,
|
3533
|
+
ratchetTreeType: pgs.ratchet_tree_type,
|
3534
|
+
payload: pgs.payload
|
3535
|
+
},
|
3536
|
+
};
|
3537
|
+
return ret;
|
3538
|
+
}
|
3539
|
+
catch (e) {
|
3540
|
+
throw CoreCryptoError.fromStdError(e);
|
3541
|
+
}
|
3443
3542
|
}
|
3444
3543
|
/**
|
3445
3544
|
* Commits the local pending proposals and returns the {@link CommitBundle} object containing what can result from this operation.
|
@@ -3453,20 +3552,25 @@ class CoreCrypto {
|
|
3453
3552
|
* @returns A {@link CommitBundle} or `undefined` when there was no pending proposal to commit
|
3454
3553
|
*/
|
3455
3554
|
async commitPendingProposals(conversationId) {
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3555
|
+
try {
|
3556
|
+
const ffiCommitBundle = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_pending_proposals(conversationId));
|
3557
|
+
if (!ffiCommitBundle) {
|
3558
|
+
return undefined;
|
3559
|
+
}
|
3560
|
+
const pgs = ffiCommitBundle.public_group_state;
|
3561
|
+
return {
|
3562
|
+
welcome: ffiCommitBundle.welcome,
|
3563
|
+
commit: ffiCommitBundle.commit,
|
3564
|
+
publicGroupState: {
|
3565
|
+
encryptionType: pgs.encryption_type,
|
3566
|
+
ratchetTreeType: pgs.ratchet_tree_type,
|
3567
|
+
payload: pgs.payload
|
3568
|
+
},
|
3569
|
+
};
|
3570
|
+
}
|
3571
|
+
catch (e) {
|
3572
|
+
throw CoreCryptoError.fromStdError(e);
|
3459
3573
|
}
|
3460
|
-
const pgs = ffiCommitBundle.public_group_state;
|
3461
|
-
return {
|
3462
|
-
welcome: ffiCommitBundle.welcome,
|
3463
|
-
commit: ffiCommitBundle.commit,
|
3464
|
-
publicGroupState: {
|
3465
|
-
encryptionType: pgs.encryption_type,
|
3466
|
-
ratchetTreeType: pgs.ratchet_tree_type,
|
3467
|
-
payload: pgs.payload
|
3468
|
-
},
|
3469
|
-
};
|
3470
3574
|
}
|
3471
3575
|
/**
|
3472
3576
|
* Creates a new proposal for the provided Conversation ID
|
@@ -3482,16 +3586,16 @@ class CoreCrypto {
|
|
3482
3586
|
if (!args.kp) {
|
3483
3587
|
throw new Error("kp is not contained in the proposal arguments");
|
3484
3588
|
}
|
3485
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_add_proposal(args.conversationId, args.kp);
|
3589
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_add_proposal(args.conversationId, args.kp));
|
3486
3590
|
}
|
3487
3591
|
case ProposalType.Remove: {
|
3488
3592
|
if (!args.clientId) {
|
3489
3593
|
throw new Error("clientId is not contained in the proposal arguments");
|
3490
3594
|
}
|
3491
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_remove_proposal(args.conversationId, args.clientId);
|
3595
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_remove_proposal(args.conversationId, args.clientId));
|
3492
3596
|
}
|
3493
3597
|
case ProposalType.Update: {
|
3494
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_update_proposal(args.conversationId);
|
3598
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_update_proposal(args.conversationId));
|
3495
3599
|
}
|
3496
3600
|
default:
|
3497
3601
|
throw new Error("Invalid proposal type!");
|
@@ -3500,13 +3604,13 @@ class CoreCrypto {
|
|
3500
3604
|
async newExternalProposal(externalProposalType, args) {
|
3501
3605
|
switch (externalProposalType) {
|
3502
3606
|
case ExternalProposalType.Add: {
|
3503
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_add_proposal(args.conversationId, args.epoch);
|
3607
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_add_proposal(args.conversationId, args.epoch));
|
3504
3608
|
}
|
3505
3609
|
case ExternalProposalType.Remove: {
|
3506
3610
|
if (!args.keyPackageRef) {
|
3507
3611
|
throw new Error("keyPackageRef is not contained in the external proposal arguments");
|
3508
3612
|
}
|
3509
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_remove_proposal(args.conversationId, args.epoch, args.keyPackageRef);
|
3613
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_remove_proposal(args.conversationId, args.epoch, args.keyPackageRef));
|
3510
3614
|
}
|
3511
3615
|
default:
|
3512
3616
|
throw new Error("Invalid external proposal type!");
|
@@ -3519,7 +3623,7 @@ class CoreCrypto {
|
|
3519
3623
|
* @returns TLS-serialized MLS public group state
|
3520
3624
|
*/
|
3521
3625
|
async exportGroupState(conversationId) {
|
3522
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").export_group_state(conversationId);
|
3626
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").export_group_state(conversationId));
|
3523
3627
|
}
|
3524
3628
|
/**
|
3525
3629
|
* Allows to create an external commit to "apply" to join a group through its public group state.
|
@@ -3536,20 +3640,25 @@ class CoreCrypto {
|
|
3536
3640
|
* @returns see {@link ConversationInitBundle}
|
3537
3641
|
*/
|
3538
3642
|
async joinByExternalCommit(publicGroupState, configuration = {}) {
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3643
|
+
try {
|
3644
|
+
const { keyRotationSpan, wirePolicy } = configuration || {};
|
3645
|
+
const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).CustomConfiguration)(keyRotationSpan, wirePolicy);
|
3646
|
+
const ffiInitMessage = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").join_by_external_commit(publicGroupState, config));
|
3647
|
+
const pgs = ffiInitMessage.public_group_state;
|
3648
|
+
const ret = {
|
3649
|
+
conversationId: ffiInitMessage.conversation_id,
|
3650
|
+
commit: ffiInitMessage.commit,
|
3651
|
+
publicGroupState: {
|
3652
|
+
encryptionType: pgs.encryption_type,
|
3653
|
+
ratchetTreeType: pgs.ratchet_tree_type,
|
3654
|
+
payload: pgs.payload
|
3655
|
+
},
|
3656
|
+
};
|
3657
|
+
return ret;
|
3658
|
+
}
|
3659
|
+
catch (e) {
|
3660
|
+
throw CoreCryptoError.fromStdError(e);
|
3661
|
+
}
|
3553
3662
|
}
|
3554
3663
|
/**
|
3555
3664
|
* This merges the commit generated by {@link CoreCrypto.joinByExternalCommit}, persists the group permanently
|
@@ -3558,7 +3667,7 @@ class CoreCrypto {
|
|
3558
3667
|
* @param conversationId - The ID of the conversation
|
3559
3668
|
*/
|
3560
3669
|
async mergePendingGroupFromExternalCommit(conversationId) {
|
3561
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").merge_pending_group_from_external_commit(conversationId);
|
3670
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").merge_pending_group_from_external_commit(conversationId));
|
3562
3671
|
}
|
3563
3672
|
/**
|
3564
3673
|
* In case the external commit generated by {@link CoreCrypto.joinByExternalCommit} is rejected by the Delivery Service, and we
|
@@ -3568,7 +3677,7 @@ class CoreCrypto {
|
|
3568
3677
|
* @param conversationId - The ID of the conversation
|
3569
3678
|
*/
|
3570
3679
|
async clearPendingGroupFromExternalCommit(conversationId) {
|
3571
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_group_from_external_commit(conversationId);
|
3680
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_group_from_external_commit(conversationId));
|
3572
3681
|
}
|
3573
3682
|
/**
|
3574
3683
|
* Allows to mark the latest commit produced as "accepted" and be able to safely merge it
|
@@ -3577,7 +3686,7 @@ class CoreCrypto {
|
|
3577
3686
|
* @param conversationId - The group's ID
|
3578
3687
|
*/
|
3579
3688
|
async commitAccepted(conversationId) {
|
3580
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_accepted(conversationId);
|
3689
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_accepted(conversationId));
|
3581
3690
|
}
|
3582
3691
|
/**
|
3583
3692
|
* Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions
|
@@ -3590,7 +3699,7 @@ class CoreCrypto {
|
|
3590
3699
|
* @param proposalRef - A reference to the proposal to delete. You get one when using {@link CoreCrypto.newProposal}
|
3591
3700
|
*/
|
3592
3701
|
async clearPendingProposal(conversationId, proposalRef) {
|
3593
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_proposal(conversationId, proposalRef);
|
3702
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_proposal(conversationId, proposalRef));
|
3594
3703
|
}
|
3595
3704
|
/**
|
3596
3705
|
* Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions
|
@@ -3604,7 +3713,7 @@ class CoreCrypto {
|
|
3604
3713
|
* @param conversationId - The group's ID
|
3605
3714
|
*/
|
3606
3715
|
async clearPendingCommit(conversationId) {
|
3607
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_commit(conversationId);
|
3716
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_commit(conversationId));
|
3608
3717
|
}
|
3609
3718
|
/**
|
3610
3719
|
* Derives a new key from the group
|
@@ -3616,7 +3725,7 @@ class CoreCrypto {
|
|
3616
3725
|
* @returns A `Uint8Array` representing the derived key
|
3617
3726
|
*/
|
3618
3727
|
async exportSecretKey(conversationId, keyLength) {
|
3619
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").export_secret_key(conversationId, keyLength);
|
3728
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").export_secret_key(conversationId, keyLength));
|
3620
3729
|
}
|
3621
3730
|
/**
|
3622
3731
|
* Returns all clients from group's members
|
@@ -3626,7 +3735,7 @@ class CoreCrypto {
|
|
3626
3735
|
* @returns A list of clients from the members of the group
|
3627
3736
|
*/
|
3628
3737
|
async getClientIds(conversationId) {
|
3629
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").get_client_ids(conversationId);
|
3738
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").get_client_ids(conversationId));
|
3630
3739
|
}
|
3631
3740
|
/**
|
3632
3741
|
* Allows {@link CoreCrypto} to act as a CSPRNG provider
|
@@ -3637,7 +3746,7 @@ class CoreCrypto {
|
|
3637
3746
|
* @returns A `Uint8Array` buffer that contains `length` cryptographically-secure random bytes
|
3638
3747
|
*/
|
3639
3748
|
async randomBytes(length) {
|
3640
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").random_bytes(length);
|
3749
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").random_bytes(length));
|
3641
3750
|
}
|
3642
3751
|
/**
|
3643
3752
|
* Allows to reseed {@link CoreCrypto}'s internal CSPRNG with a new seed.
|
@@ -3648,13 +3757,13 @@ class CoreCrypto {
|
|
3648
3757
|
if (seed.length !== 32) {
|
3649
3758
|
throw new Error(`The seed length needs to be exactly 32 bytes. ${seed.length} bytes provided.`);
|
3650
3759
|
}
|
3651
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed);
|
3760
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed));
|
3652
3761
|
}
|
3653
3762
|
/**
|
3654
3763
|
* Initiailizes the proteus client
|
3655
3764
|
*/
|
3656
3765
|
async proteusInit() {
|
3657
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_init();
|
3766
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_init());
|
3658
3767
|
}
|
3659
3768
|
/**
|
3660
3769
|
* Create a Proteus session using a prekey
|
@@ -3663,7 +3772,7 @@ class CoreCrypto {
|
|
3663
3772
|
* @param prekey - CBOR-encoded Proteus prekey of the other client
|
3664
3773
|
*/
|
3665
3774
|
async proteusSessionFromPrekey(sessionId, prekey) {
|
3666
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_from_prekey(sessionId, prekey);
|
3775
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_from_prekey(sessionId, prekey));
|
3667
3776
|
}
|
3668
3777
|
/**
|
3669
3778
|
* Create a Proteus session from a handshake message
|
@@ -3674,7 +3783,7 @@ class CoreCrypto {
|
|
3674
3783
|
* @returns A `Uint8Array` containing the message that was sent along with the session handshake
|
3675
3784
|
*/
|
3676
3785
|
async proteusSessionFromMessage(sessionId, envelope) {
|
3677
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_from_message(sessionId, envelope);
|
3786
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_from_message(sessionId, envelope));
|
3678
3787
|
}
|
3679
3788
|
/**
|
3680
3789
|
* Locally persists a session to the keystore
|
@@ -3684,7 +3793,7 @@ class CoreCrypto {
|
|
3684
3793
|
* @param sessionId - ID of the Proteus session
|
3685
3794
|
*/
|
3686
3795
|
async proteusSessionSave(sessionId) {
|
3687
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_save(sessionId);
|
3796
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_save(sessionId));
|
3688
3797
|
}
|
3689
3798
|
/**
|
3690
3799
|
* Deletes a session
|
@@ -3693,7 +3802,7 @@ class CoreCrypto {
|
|
3693
3802
|
* @param sessionId - ID of the Proteus session
|
3694
3803
|
*/
|
3695
3804
|
async proteusSessionDelete(sessionId) {
|
3696
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_delete(sessionId);
|
3805
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_delete(sessionId));
|
3697
3806
|
}
|
3698
3807
|
/**
|
3699
3808
|
* Checks if a session exists
|
@@ -3703,7 +3812,7 @@ class CoreCrypto {
|
|
3703
3812
|
* @returns whether the session exists or not
|
3704
3813
|
*/
|
3705
3814
|
async proteusSessionExists(sessionId) {
|
3706
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_exists(sessionId);
|
3815
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_exists(sessionId));
|
3707
3816
|
}
|
3708
3817
|
/**
|
3709
3818
|
* Decrypt an incoming message for an existing Proteus session
|
@@ -3713,7 +3822,7 @@ class CoreCrypto {
|
|
3713
3822
|
* @returns The decrypted payload contained within the message
|
3714
3823
|
*/
|
3715
3824
|
async proteusDecrypt(sessionId, ciphertext) {
|
3716
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_decrypt(sessionId, ciphertext);
|
3825
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_decrypt(sessionId, ciphertext));
|
3717
3826
|
}
|
3718
3827
|
/**
|
3719
3828
|
* Encrypt a message for a given Proteus session
|
@@ -3723,7 +3832,7 @@ class CoreCrypto {
|
|
3723
3832
|
* @returns The CBOR-serialized encrypted message
|
3724
3833
|
*/
|
3725
3834
|
async proteusEncrypt(sessionId, plaintext) {
|
3726
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_encrypt(sessionId, plaintext);
|
3835
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_encrypt(sessionId, plaintext));
|
3727
3836
|
}
|
3728
3837
|
/**
|
3729
3838
|
* Batch encryption for proteus messages
|
@@ -3734,7 +3843,7 @@ class CoreCrypto {
|
|
3734
3843
|
* @returns A map indexed by each session ID and the corresponding CBOR-serialized encrypted message for this session
|
3735
3844
|
*/
|
3736
3845
|
async proteusEncryptBatched(sessions, plaintext) {
|
3737
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_encrypt_batched(sessions, plaintext);
|
3846
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_encrypt_batched(sessions, plaintext));
|
3738
3847
|
}
|
3739
3848
|
/**
|
3740
3849
|
* Creates a new prekey with the requested ID.
|
@@ -3743,7 +3852,7 @@ class CoreCrypto {
|
|
3743
3852
|
* @returns: A CBOR-serialized version of the PreKeyBundle corresponding to the newly generated and stored PreKey
|
3744
3853
|
*/
|
3745
3854
|
async proteusNewPrekey(prekeyId) {
|
3746
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_new_prekey(prekeyId);
|
3855
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_new_prekey(prekeyId));
|
3747
3856
|
}
|
3748
3857
|
/**
|
3749
3858
|
* Creates a new prekey with an automatically generated ID..
|
@@ -3751,7 +3860,7 @@ class CoreCrypto {
|
|
3751
3860
|
* @returns: A CBOR-serialized version of the PreKeyBundle corresponding to the newly generated and stored PreKey
|
3752
3861
|
*/
|
3753
3862
|
async proteusNewPrekeyAuto() {
|
3754
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_new_prekey_auto();
|
3863
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_new_prekey_auto());
|
3755
3864
|
}
|
3756
3865
|
/**
|
3757
3866
|
* Proteus public key fingerprint
|
@@ -3760,7 +3869,7 @@ class CoreCrypto {
|
|
3760
3869
|
* @returns Hex-encoded public key string
|
3761
3870
|
*/
|
3762
3871
|
async proteusFingerprint() {
|
3763
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint();
|
3872
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint());
|
3764
3873
|
}
|
3765
3874
|
/**
|
3766
3875
|
* Proteus session local fingerprint
|
@@ -3769,7 +3878,7 @@ class CoreCrypto {
|
|
3769
3878
|
* @returns Hex-encoded public key string
|
3770
3879
|
*/
|
3771
3880
|
async proteusFingerprintLocal(sessionId) {
|
3772
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint_local(sessionId);
|
3881
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint_local(sessionId));
|
3773
3882
|
}
|
3774
3883
|
/**
|
3775
3884
|
* Proteus session remote fingerprint
|
@@ -3778,7 +3887,7 @@ class CoreCrypto {
|
|
3778
3887
|
* @returns Hex-encoded public key string
|
3779
3888
|
*/
|
3780
3889
|
async proteusFingerprintRemote(sessionId) {
|
3781
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint_remote(sessionId);
|
3890
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint_remote(sessionId));
|
3782
3891
|
}
|
3783
3892
|
/**
|
3784
3893
|
* Hex-encoded fingerprint of the given prekey
|
@@ -3787,7 +3896,12 @@ class CoreCrypto {
|
|
3787
3896
|
* @returns Hex-encoded public key string
|
3788
3897
|
**/
|
3789
3898
|
static proteusFingerprintPrekeybundle(prekey) {
|
3790
|
-
|
3899
|
+
try {
|
3900
|
+
return __classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.proteus_fingerprint_prekeybundle(prekey);
|
3901
|
+
}
|
3902
|
+
catch (e) {
|
3903
|
+
throw CoreCryptoError.fromStdError(e);
|
3904
|
+
}
|
3791
3905
|
}
|
3792
3906
|
/**
|
3793
3907
|
* Imports all the data stored by Cryptobox into the CoreCrypto keystore
|
@@ -3795,7 +3909,14 @@ class CoreCrypto {
|
|
3795
3909
|
* @param storeName - The name of the IndexedDB store where the data is stored
|
3796
3910
|
*/
|
3797
3911
|
async proteusCryptoboxMigrate(storeName) {
|
3798
|
-
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_cryptobox_migrate(storeName);
|
3912
|
+
return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_cryptobox_migrate(storeName));
|
3913
|
+
}
|
3914
|
+
/**
|
3915
|
+
* Note: this call clears out the code and resets it to 0 (aka no error)
|
3916
|
+
* @returns the last proteus error code that occured.
|
3917
|
+
*/
|
3918
|
+
async proteusLastErrorCode() {
|
3919
|
+
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_last_error_code();
|
3799
3920
|
}
|
3800
3921
|
/**
|
3801
3922
|
* Creates an enrollment instance with private key material you can use in order to fetch
|
@@ -3806,8 +3927,8 @@ class CoreCrypto {
|
|
3806
3927
|
* @param ciphersuite - For generating signing key material. Only {@link Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519} is supported currently
|
3807
3928
|
*/
|
3808
3929
|
async newAcmeEnrollment() {
|
3809
|
-
const e2ei = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_acme_enrollment(Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519);
|
3810
|
-
return new WireE2eIdentity(e2ei
|
3930
|
+
const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_acme_enrollment(Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519));
|
3931
|
+
return new WireE2eIdentity(e2ei);
|
3811
3932
|
}
|
3812
3933
|
/**
|
3813
3934
|
* Returns the current version of {@link CoreCrypto}
|
@@ -3826,13 +3947,10 @@ _a = CoreCrypto, _CoreCrypto_cc = new WeakMap();
|
|
3826
3947
|
_CoreCrypto_module = { value: void 0 };
|
3827
3948
|
class WireE2eIdentity {
|
3828
3949
|
/** @hidden */
|
3829
|
-
constructor(e2ei
|
3950
|
+
constructor(e2ei) {
|
3830
3951
|
/** @hidden */
|
3831
3952
|
_WireE2eIdentity_e2ei.set(this, void 0);
|
3832
3953
|
__classPrivateFieldSet(this, _WireE2eIdentity_e2ei, e2ei, "f");
|
3833
|
-
if (!__classPrivateFieldGet(WireE2eIdentity, _b, "f", _WireE2eIdentity_module)) {
|
3834
|
-
__classPrivateFieldSet(WireE2eIdentity, _b, module, "f", _WireE2eIdentity_module);
|
3835
|
-
}
|
3836
3954
|
}
|
3837
3955
|
/**
|
3838
3956
|
* Parses the response from `GET /acme/{provisioner-name}/directory`.
|
@@ -3843,7 +3961,12 @@ class WireE2eIdentity {
|
|
3843
3961
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
|
3844
3962
|
*/
|
3845
3963
|
directoryResponse(directory) {
|
3846
|
-
|
3964
|
+
try {
|
3965
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").directory_response(directory);
|
3966
|
+
}
|
3967
|
+
catch (e) {
|
3968
|
+
throw CoreCryptoError.fromStdError(e);
|
3969
|
+
}
|
3847
3970
|
}
|
3848
3971
|
/**
|
3849
3972
|
* For creating a new acme account. This returns a signed JWS-alike request body to send to
|
@@ -3854,7 +3977,12 @@ class WireE2eIdentity {
|
|
3854
3977
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
|
3855
3978
|
*/
|
3856
3979
|
newAccountRequest(directory, previousNonce) {
|
3857
|
-
|
3980
|
+
try {
|
3981
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_request(directory, previousNonce);
|
3982
|
+
}
|
3983
|
+
catch (e) {
|
3984
|
+
throw CoreCryptoError.fromStdError(e);
|
3985
|
+
}
|
3858
3986
|
}
|
3859
3987
|
/**
|
3860
3988
|
* Parses the response from `POST /acme/{provisioner-name}/new-account`.
|
@@ -3862,7 +3990,12 @@ class WireE2eIdentity {
|
|
3862
3990
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
|
3863
3991
|
*/
|
3864
3992
|
newAccountResponse(account) {
|
3865
|
-
|
3993
|
+
try {
|
3994
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_response(account);
|
3995
|
+
}
|
3996
|
+
catch (e) {
|
3997
|
+
throw CoreCryptoError.fromStdError(e);
|
3998
|
+
}
|
3866
3999
|
}
|
3867
4000
|
/**
|
3868
4001
|
* Creates a new acme order for the handle (userId + display name) and the clientId.
|
@@ -3876,7 +4009,12 @@ class WireE2eIdentity {
|
|
3876
4009
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
3877
4010
|
*/
|
3878
4011
|
newOrderRequest(handle, clientId, expiryDays, directory, account, previousNonce) {
|
3879
|
-
|
4012
|
+
try {
|
4013
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_request(handle, clientId, expiryDays, directory, account, previousNonce);
|
4014
|
+
}
|
4015
|
+
catch (e) {
|
4016
|
+
throw CoreCryptoError.fromStdError(e);
|
4017
|
+
}
|
3880
4018
|
}
|
3881
4019
|
/**
|
3882
4020
|
* Parses the response from `POST /acme/{provisioner-name}/new-order`.
|
@@ -3885,7 +4023,12 @@ class WireE2eIdentity {
|
|
3885
4023
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
3886
4024
|
*/
|
3887
4025
|
newOrderResponse(order) {
|
3888
|
-
|
4026
|
+
try {
|
4027
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_response(order);
|
4028
|
+
}
|
4029
|
+
catch (e) {
|
4030
|
+
throw CoreCryptoError.fromStdError(e);
|
4031
|
+
}
|
3889
4032
|
}
|
3890
4033
|
/**
|
3891
4034
|
* Creates a new authorization request.
|
@@ -3897,7 +4040,12 @@ class WireE2eIdentity {
|
|
3897
4040
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
|
3898
4041
|
*/
|
3899
4042
|
newAuthzRequest(url, account, previousNonce) {
|
3900
|
-
|
4043
|
+
try {
|
4044
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_request(url, account, previousNonce);
|
4045
|
+
}
|
4046
|
+
catch (e) {
|
4047
|
+
throw CoreCryptoError.fromStdError(e);
|
4048
|
+
}
|
3901
4049
|
}
|
3902
4050
|
/**
|
3903
4051
|
* Parses the response from `POST /acme/{provisioner-name}/authz/{authz-id}`
|
@@ -3910,7 +4058,12 @@ class WireE2eIdentity {
|
|
3910
4058
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
|
3911
4059
|
*/
|
3912
4060
|
newAuthzResponse(authz) {
|
3913
|
-
|
4061
|
+
try {
|
4062
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_response(authz);
|
4063
|
+
}
|
4064
|
+
catch (e) {
|
4065
|
+
throw CoreCryptoError.fromStdError(e);
|
4066
|
+
}
|
3914
4067
|
}
|
3915
4068
|
/**
|
3916
4069
|
* Generates a new client Dpop JWT token. It demonstrates proof of possession of the nonces
|
@@ -3929,7 +4082,12 @@ class WireE2eIdentity {
|
|
3929
4082
|
* @param expiryDays token expiry in days
|
3930
4083
|
*/
|
3931
4084
|
createDpopToken(accessTokenUrl, userId, clientId, domain, clientIdChallenge, backendNonce, expiryDays) {
|
3932
|
-
|
4085
|
+
try {
|
4086
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").create_dpop_token(accessTokenUrl, userId, clientId, domain, clientIdChallenge, backendNonce, expiryDays);
|
4087
|
+
}
|
4088
|
+
catch (e) {
|
4089
|
+
throw CoreCryptoError.fromStdError(e);
|
4090
|
+
}
|
3933
4091
|
}
|
3934
4092
|
/**
|
3935
4093
|
* Creates a new challenge request.
|
@@ -3940,7 +4098,12 @@ class WireE2eIdentity {
|
|
3940
4098
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
|
3941
4099
|
*/
|
3942
4100
|
newChallengeRequest(handleChallenge, account, previousNonce) {
|
3943
|
-
|
4101
|
+
try {
|
4102
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_challenge_request(handleChallenge, account, previousNonce);
|
4103
|
+
}
|
4104
|
+
catch (e) {
|
4105
|
+
throw CoreCryptoError.fromStdError(e);
|
4106
|
+
}
|
3944
4107
|
}
|
3945
4108
|
/**
|
3946
4109
|
* Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}`.
|
@@ -3949,7 +4112,12 @@ class WireE2eIdentity {
|
|
3949
4112
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
|
3950
4113
|
*/
|
3951
4114
|
newChallengeResponse(challenge) {
|
3952
|
-
|
4115
|
+
try {
|
4116
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_challenge_response(challenge);
|
4117
|
+
}
|
4118
|
+
catch (e) {
|
4119
|
+
throw CoreCryptoError.fromStdError(e);
|
4120
|
+
}
|
3953
4121
|
}
|
3954
4122
|
/**
|
3955
4123
|
* Verifies that the previous challenge has been completed.
|
@@ -3960,7 +4128,12 @@ class WireE2eIdentity {
|
|
3960
4128
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
3961
4129
|
*/
|
3962
4130
|
checkOrderRequest(orderUrl, account, previousNonce) {
|
3963
|
-
|
4131
|
+
try {
|
4132
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_request(orderUrl, account, previousNonce);
|
4133
|
+
}
|
4134
|
+
catch (e) {
|
4135
|
+
throw CoreCryptoError.fromStdError(e);
|
4136
|
+
}
|
3964
4137
|
}
|
3965
4138
|
/**
|
3966
4139
|
* Parses the response from `POST /acme/{provisioner-name}/order/{order-id}`.
|
@@ -3969,7 +4142,12 @@ class WireE2eIdentity {
|
|
3969
4142
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
3970
4143
|
*/
|
3971
4144
|
checkOrderResponse(order) {
|
3972
|
-
|
4145
|
+
try {
|
4146
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_response(order);
|
4147
|
+
}
|
4148
|
+
catch (e) {
|
4149
|
+
throw CoreCryptoError.fromStdError(e);
|
4150
|
+
}
|
3973
4151
|
}
|
3974
4152
|
/**
|
3975
4153
|
* Final step before fetching the certificate.
|
@@ -3981,7 +4159,12 @@ class WireE2eIdentity {
|
|
3981
4159
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
3982
4160
|
*/
|
3983
4161
|
finalizeRequest(domains, order, account, previousNonce) {
|
3984
|
-
|
4162
|
+
try {
|
4163
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_request(domains, order, account, previousNonce);
|
4164
|
+
}
|
4165
|
+
catch (e) {
|
4166
|
+
throw CoreCryptoError.fromStdError(e);
|
4167
|
+
}
|
3985
4168
|
}
|
3986
4169
|
/**
|
3987
4170
|
* Parses the response from `POST /acme/{provisioner-name}/order/{order-id}/finalize`.
|
@@ -3990,7 +4173,12 @@ class WireE2eIdentity {
|
|
3990
4173
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
|
3991
4174
|
*/
|
3992
4175
|
finalizeResponse(finalize) {
|
3993
|
-
|
4176
|
+
try {
|
4177
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_response(finalize);
|
4178
|
+
}
|
4179
|
+
catch (e) {
|
4180
|
+
throw CoreCryptoError.fromStdError(e);
|
4181
|
+
}
|
3994
4182
|
}
|
3995
4183
|
/**
|
3996
4184
|
* Creates a request for finally fetching the x509 certificate.
|
@@ -4001,7 +4189,12 @@ class WireE2eIdentity {
|
|
4001
4189
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
|
4002
4190
|
*/
|
4003
4191
|
certificateRequest(finalize, account, previousNonce) {
|
4004
|
-
|
4192
|
+
try {
|
4193
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_request(finalize, account, previousNonce);
|
4194
|
+
}
|
4195
|
+
catch (e) {
|
4196
|
+
throw CoreCryptoError.fromStdError(e);
|
4197
|
+
}
|
4005
4198
|
}
|
4006
4199
|
/**
|
4007
4200
|
* Parses the response from `POST /acme/{provisioner-name}/certificate/{certificate-id}`.
|
@@ -4010,11 +4203,14 @@ class WireE2eIdentity {
|
|
4010
4203
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
|
4011
4204
|
*/
|
4012
4205
|
certificateResponse(certificateChain) {
|
4013
|
-
|
4206
|
+
try {
|
4207
|
+
return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_response(certificateChain);
|
4208
|
+
}
|
4209
|
+
catch (e) {
|
4210
|
+
throw CoreCryptoError.fromStdError(e);
|
4211
|
+
}
|
4014
4212
|
}
|
4015
4213
|
}
|
4016
|
-
|
4017
|
-
/** @hidden */
|
4018
|
-
_WireE2eIdentity_module = { value: void 0 };
|
4214
|
+
_WireE2eIdentity_e2ei = new WeakMap();
|
4019
4215
|
|
4020
|
-
export { Ciphersuite, CoreCrypto, ExternalProposalType, ProposalType, PublicGroupStateEncryptionType, RatchetTreeType, WireE2eIdentity, WirePolicy };
|
4216
|
+
export { Ciphersuite, CoreCrypto, CoreCryptoError, ExternalProposalType, ProposalType, PublicGroupStateEncryptionType, RatchetTreeType, WireE2eIdentity, WirePolicy };
|