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