@dotrino/identity 0.94.0 → 0.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/index.js +22 -0
- package/vault/core.js +319 -9
- package/vault/index.html +3 -0
- package/vault/peerStore.js +15 -2
- package/vault/vault.js +38 -1
- package/vault/vendor/opaque/VERSION.txt +6 -0
- package/vault/vendor/opaque/build/opaque.js +588 -0
- package/vault/vendor/opaque/build/wasm-bytes.js +2 -0
- package/vault/vendor/opaque/src/index.js +123 -0
- package/vault/vendor/proxy-client/VERSION.txt +1 -1
- package/vault/vendor/proxy-client/client.js +23 -1
- package/vault/vendor/vault/VERSION.txt +5 -1
- package/vault/vendor/vault/b64.js +36 -0
- package/vault/vendor/vault/index.js +126 -3
- package/vault/vendor/vault/loginClient.js +216 -0
- package/vault/vendor/vault/passwordLogins.js +469 -0
- package/vault/vendor/vault/protocol.js +13 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
function addToExternrefTable0(obj) {
|
|
4
|
+
const idx = wasm.__externref_table_alloc();
|
|
5
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
6
|
+
return idx;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function handleError(f, args) {
|
|
10
|
+
try {
|
|
11
|
+
return f.apply(this, args);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
const idx = addToExternrefTable0(e);
|
|
14
|
+
wasm.__wbindgen_exn_store(idx);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
19
|
+
|
|
20
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
21
|
+
|
|
22
|
+
let cachedUint8ArrayMemory0 = null;
|
|
23
|
+
|
|
24
|
+
function getUint8ArrayMemory0() {
|
|
25
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
26
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
27
|
+
}
|
|
28
|
+
return cachedUint8ArrayMemory0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getStringFromWasm0(ptr, len) {
|
|
32
|
+
ptr = ptr >>> 0;
|
|
33
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function isLikeNone(x) {
|
|
37
|
+
return x === undefined || x === null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let WASM_VECTOR_LEN = 0;
|
|
41
|
+
|
|
42
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
43
|
+
|
|
44
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
45
|
+
? function (arg, view) {
|
|
46
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
47
|
+
}
|
|
48
|
+
: function (arg, view) {
|
|
49
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
50
|
+
view.set(buf);
|
|
51
|
+
return {
|
|
52
|
+
read: arg.length,
|
|
53
|
+
written: buf.length
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
58
|
+
|
|
59
|
+
if (realloc === undefined) {
|
|
60
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
61
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
62
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
63
|
+
WASM_VECTOR_LEN = buf.length;
|
|
64
|
+
return ptr;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let len = arg.length;
|
|
68
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
69
|
+
|
|
70
|
+
const mem = getUint8ArrayMemory0();
|
|
71
|
+
|
|
72
|
+
let offset = 0;
|
|
73
|
+
|
|
74
|
+
for (; offset < len; offset++) {
|
|
75
|
+
const code = arg.charCodeAt(offset);
|
|
76
|
+
if (code > 0x7F) break;
|
|
77
|
+
mem[ptr + offset] = code;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (offset !== len) {
|
|
81
|
+
if (offset !== 0) {
|
|
82
|
+
arg = arg.slice(offset);
|
|
83
|
+
}
|
|
84
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
85
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
86
|
+
const ret = encodeString(arg, view);
|
|
87
|
+
|
|
88
|
+
offset += ret.written;
|
|
89
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
WASM_VECTOR_LEN = offset;
|
|
93
|
+
return ptr;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function takeFromExternrefTable0(idx) {
|
|
97
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
98
|
+
wasm.__externref_table_dealloc(idx);
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Lo que el servidor guarda de un usuario. No contiene la contraseña ni nada con qué
|
|
103
|
+
* probarla sin la preparación del servidor.
|
|
104
|
+
* @param {string} upload
|
|
105
|
+
* @returns {string}
|
|
106
|
+
*/
|
|
107
|
+
export function serverRegistrationFinish(upload) {
|
|
108
|
+
let deferred3_0;
|
|
109
|
+
let deferred3_1;
|
|
110
|
+
try {
|
|
111
|
+
const ptr0 = passStringToWasm0(upload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
112
|
+
const len0 = WASM_VECTOR_LEN;
|
|
113
|
+
const ret = wasm.serverRegistrationFinish(ptr0, len0);
|
|
114
|
+
var ptr2 = ret[0];
|
|
115
|
+
var len2 = ret[1];
|
|
116
|
+
if (ret[3]) {
|
|
117
|
+
ptr2 = 0; len2 = 0;
|
|
118
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
119
|
+
}
|
|
120
|
+
deferred3_0 = ptr2;
|
|
121
|
+
deferred3_1 = len2;
|
|
122
|
+
return getStringFromWasm0(ptr2, len2);
|
|
123
|
+
} finally {
|
|
124
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @returns {string}
|
|
130
|
+
*/
|
|
131
|
+
export function suiteId() {
|
|
132
|
+
let deferred1_0;
|
|
133
|
+
let deferred1_1;
|
|
134
|
+
try {
|
|
135
|
+
const ret = wasm.suiteId();
|
|
136
|
+
deferred1_0 = ret[0];
|
|
137
|
+
deferred1_1 = ret[1];
|
|
138
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
139
|
+
} finally {
|
|
140
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Genera la preparación del servidor: la semilla del OPRF y su par de llaves. Es SECRETA.
|
|
146
|
+
* @returns {string}
|
|
147
|
+
*/
|
|
148
|
+
export function serverCreateSetup() {
|
|
149
|
+
let deferred1_0;
|
|
150
|
+
let deferred1_1;
|
|
151
|
+
try {
|
|
152
|
+
const ret = wasm.serverCreateSetup();
|
|
153
|
+
deferred1_0 = ret[0];
|
|
154
|
+
deferred1_1 = ret[1];
|
|
155
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
156
|
+
} finally {
|
|
157
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} state
|
|
163
|
+
* @param {string} response
|
|
164
|
+
* @param {string} password
|
|
165
|
+
* @param {string | null} [client_identifier]
|
|
166
|
+
* @param {string | null} [server_identifier]
|
|
167
|
+
* @returns {object}
|
|
168
|
+
*/
|
|
169
|
+
export function clientRegistrationFinish(state, response, password, client_identifier, server_identifier) {
|
|
170
|
+
const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
171
|
+
const len0 = WASM_VECTOR_LEN;
|
|
172
|
+
const ptr1 = passStringToWasm0(response, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
173
|
+
const len1 = WASM_VECTOR_LEN;
|
|
174
|
+
const ptr2 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
175
|
+
const len2 = WASM_VECTOR_LEN;
|
|
176
|
+
var ptr3 = isLikeNone(client_identifier) ? 0 : passStringToWasm0(client_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
177
|
+
var len3 = WASM_VECTOR_LEN;
|
|
178
|
+
var ptr4 = isLikeNone(server_identifier) ? 0 : passStringToWasm0(server_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
179
|
+
var len4 = WASM_VECTOR_LEN;
|
|
180
|
+
const ret = wasm.clientRegistrationFinish(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
181
|
+
if (ret[2]) {
|
|
182
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
183
|
+
}
|
|
184
|
+
return takeFromExternrefTable0(ret[0]);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Sin registro (`record` ausente) responde igual, con uno inventado: desde fuera no se
|
|
189
|
+
* distingue un usuario que no existe de una contraseña equivocada.
|
|
190
|
+
* @param {string} setup
|
|
191
|
+
* @param {string | null | undefined} record
|
|
192
|
+
* @param {string} request
|
|
193
|
+
* @param {string} credential_id
|
|
194
|
+
* @param {string | null} [client_identifier]
|
|
195
|
+
* @param {string | null} [server_identifier]
|
|
196
|
+
* @returns {object}
|
|
197
|
+
*/
|
|
198
|
+
export function serverLoginStart(setup, record, request, credential_id, client_identifier, server_identifier) {
|
|
199
|
+
const ptr0 = passStringToWasm0(setup, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
200
|
+
const len0 = WASM_VECTOR_LEN;
|
|
201
|
+
var ptr1 = isLikeNone(record) ? 0 : passStringToWasm0(record, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
202
|
+
var len1 = WASM_VECTOR_LEN;
|
|
203
|
+
const ptr2 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
204
|
+
const len2 = WASM_VECTOR_LEN;
|
|
205
|
+
const ptr3 = passStringToWasm0(credential_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
206
|
+
const len3 = WASM_VECTOR_LEN;
|
|
207
|
+
var ptr4 = isLikeNone(client_identifier) ? 0 : passStringToWasm0(client_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
208
|
+
var len4 = WASM_VECTOR_LEN;
|
|
209
|
+
var ptr5 = isLikeNone(server_identifier) ? 0 : passStringToWasm0(server_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
210
|
+
var len5 = WASM_VECTOR_LEN;
|
|
211
|
+
const ret = wasm.serverLoginStart(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
212
|
+
if (ret[2]) {
|
|
213
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
214
|
+
}
|
|
215
|
+
return takeFromExternrefTable0(ret[0]);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @param {string} state
|
|
220
|
+
* @param {string} finalization
|
|
221
|
+
* @param {string | null} [client_identifier]
|
|
222
|
+
* @param {string | null} [server_identifier]
|
|
223
|
+
* @returns {object}
|
|
224
|
+
*/
|
|
225
|
+
export function serverLoginFinish(state, finalization, client_identifier, server_identifier) {
|
|
226
|
+
const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
227
|
+
const len0 = WASM_VECTOR_LEN;
|
|
228
|
+
const ptr1 = passStringToWasm0(finalization, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
|
+
const len1 = WASM_VECTOR_LEN;
|
|
230
|
+
var ptr2 = isLikeNone(client_identifier) ? 0 : passStringToWasm0(client_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
|
+
var len2 = WASM_VECTOR_LEN;
|
|
232
|
+
var ptr3 = isLikeNone(server_identifier) ? 0 : passStringToWasm0(server_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
|
+
var len3 = WASM_VECTOR_LEN;
|
|
234
|
+
const ret = wasm.serverLoginFinish(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
235
|
+
if (ret[2]) {
|
|
236
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
237
|
+
}
|
|
238
|
+
return takeFromExternrefTable0(ret[0]);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @param {string} setup
|
|
243
|
+
* @param {string} request
|
|
244
|
+
* @param {string} credential_id
|
|
245
|
+
* @returns {string}
|
|
246
|
+
*/
|
|
247
|
+
export function serverRegistrationResponse(setup, request, credential_id) {
|
|
248
|
+
let deferred5_0;
|
|
249
|
+
let deferred5_1;
|
|
250
|
+
try {
|
|
251
|
+
const ptr0 = passStringToWasm0(setup, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
253
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
|
+
const len1 = WASM_VECTOR_LEN;
|
|
255
|
+
const ptr2 = passStringToWasm0(credential_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
const len2 = WASM_VECTOR_LEN;
|
|
257
|
+
const ret = wasm.serverRegistrationResponse(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
258
|
+
var ptr4 = ret[0];
|
|
259
|
+
var len4 = ret[1];
|
|
260
|
+
if (ret[3]) {
|
|
261
|
+
ptr4 = 0; len4 = 0;
|
|
262
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
263
|
+
}
|
|
264
|
+
deferred5_0 = ptr4;
|
|
265
|
+
deferred5_1 = len4;
|
|
266
|
+
return getStringFromWasm0(ptr4, len4);
|
|
267
|
+
} finally {
|
|
268
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @param {string} password
|
|
274
|
+
* @returns {object}
|
|
275
|
+
*/
|
|
276
|
+
export function clientLoginStart(password) {
|
|
277
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
279
|
+
const ret = wasm.clientLoginStart(ptr0, len0);
|
|
280
|
+
if (ret[2]) {
|
|
281
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
282
|
+
}
|
|
283
|
+
return takeFromExternrefTable0(ret[0]);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @param {string} state
|
|
288
|
+
* @param {string} response
|
|
289
|
+
* @param {string} password
|
|
290
|
+
* @param {string | null} [client_identifier]
|
|
291
|
+
* @param {string | null} [server_identifier]
|
|
292
|
+
* @returns {object}
|
|
293
|
+
*/
|
|
294
|
+
export function clientLoginFinish(state, response, password, client_identifier, server_identifier) {
|
|
295
|
+
const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
296
|
+
const len0 = WASM_VECTOR_LEN;
|
|
297
|
+
const ptr1 = passStringToWasm0(response, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
298
|
+
const len1 = WASM_VECTOR_LEN;
|
|
299
|
+
const ptr2 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
300
|
+
const len2 = WASM_VECTOR_LEN;
|
|
301
|
+
var ptr3 = isLikeNone(client_identifier) ? 0 : passStringToWasm0(client_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
302
|
+
var len3 = WASM_VECTOR_LEN;
|
|
303
|
+
var ptr4 = isLikeNone(server_identifier) ? 0 : passStringToWasm0(server_identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
304
|
+
var len4 = WASM_VECTOR_LEN;
|
|
305
|
+
const ret = wasm.clientLoginFinish(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
306
|
+
if (ret[2]) {
|
|
307
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
308
|
+
}
|
|
309
|
+
return takeFromExternrefTable0(ret[0]);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @param {string} setup
|
|
314
|
+
* @returns {string}
|
|
315
|
+
*/
|
|
316
|
+
export function serverPublicKey(setup) {
|
|
317
|
+
let deferred3_0;
|
|
318
|
+
let deferred3_1;
|
|
319
|
+
try {
|
|
320
|
+
const ptr0 = passStringToWasm0(setup, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
321
|
+
const len0 = WASM_VECTOR_LEN;
|
|
322
|
+
const ret = wasm.serverPublicKey(ptr0, len0);
|
|
323
|
+
var ptr2 = ret[0];
|
|
324
|
+
var len2 = ret[1];
|
|
325
|
+
if (ret[3]) {
|
|
326
|
+
ptr2 = 0; len2 = 0;
|
|
327
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
328
|
+
}
|
|
329
|
+
deferred3_0 = ptr2;
|
|
330
|
+
deferred3_1 = len2;
|
|
331
|
+
return getStringFromWasm0(ptr2, len2);
|
|
332
|
+
} finally {
|
|
333
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @param {string} password
|
|
339
|
+
* @returns {object}
|
|
340
|
+
*/
|
|
341
|
+
export function clientRegistrationStart(password) {
|
|
342
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
|
+
const len0 = WASM_VECTOR_LEN;
|
|
344
|
+
const ret = wasm.clientRegistrationStart(ptr0, len0);
|
|
345
|
+
if (ret[2]) {
|
|
346
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
347
|
+
}
|
|
348
|
+
return takeFromExternrefTable0(ret[0]);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
async function __wbg_load(module, imports) {
|
|
352
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
353
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
354
|
+
try {
|
|
355
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
356
|
+
|
|
357
|
+
} catch (e) {
|
|
358
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
359
|
+
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);
|
|
360
|
+
|
|
361
|
+
} else {
|
|
362
|
+
throw e;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const bytes = await module.arrayBuffer();
|
|
368
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
369
|
+
|
|
370
|
+
} else {
|
|
371
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
372
|
+
|
|
373
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
374
|
+
return { instance, module };
|
|
375
|
+
|
|
376
|
+
} else {
|
|
377
|
+
return instance;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function __wbg_get_imports() {
|
|
383
|
+
const imports = {};
|
|
384
|
+
imports.wbg = {};
|
|
385
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
386
|
+
const ret = arg0.buffer;
|
|
387
|
+
return ret;
|
|
388
|
+
};
|
|
389
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
390
|
+
const ret = arg0.call(arg1);
|
|
391
|
+
return ret;
|
|
392
|
+
}, arguments) };
|
|
393
|
+
imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
394
|
+
const ret = arg0.call(arg1, arg2);
|
|
395
|
+
return ret;
|
|
396
|
+
}, arguments) };
|
|
397
|
+
imports.wbg.__wbg_crypto_86f2631e91b51511 = function(arg0) {
|
|
398
|
+
const ret = arg0.crypto;
|
|
399
|
+
return ret;
|
|
400
|
+
};
|
|
401
|
+
imports.wbg.__wbg_getRandomValues_b3f15fcbfabb0f8b = function() { return handleError(function (arg0, arg1) {
|
|
402
|
+
arg0.getRandomValues(arg1);
|
|
403
|
+
}, arguments) };
|
|
404
|
+
imports.wbg.__wbg_msCrypto_d562bbe83e0d4b91 = function(arg0) {
|
|
405
|
+
const ret = arg0.msCrypto;
|
|
406
|
+
return ret;
|
|
407
|
+
};
|
|
408
|
+
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
409
|
+
const ret = new Object();
|
|
410
|
+
return ret;
|
|
411
|
+
};
|
|
412
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
413
|
+
const ret = new Uint8Array(arg0);
|
|
414
|
+
return ret;
|
|
415
|
+
};
|
|
416
|
+
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
417
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
418
|
+
return ret;
|
|
419
|
+
};
|
|
420
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
421
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
422
|
+
return ret;
|
|
423
|
+
};
|
|
424
|
+
imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
425
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
426
|
+
return ret;
|
|
427
|
+
};
|
|
428
|
+
imports.wbg.__wbg_node_e1f24f89a7336c2e = function(arg0) {
|
|
429
|
+
const ret = arg0.node;
|
|
430
|
+
return ret;
|
|
431
|
+
};
|
|
432
|
+
imports.wbg.__wbg_process_3975fd6c72f520aa = function(arg0) {
|
|
433
|
+
const ret = arg0.process;
|
|
434
|
+
return ret;
|
|
435
|
+
};
|
|
436
|
+
imports.wbg.__wbg_randomFillSync_f8c153b79f285817 = function() { return handleError(function (arg0, arg1) {
|
|
437
|
+
arg0.randomFillSync(arg1);
|
|
438
|
+
}, arguments) };
|
|
439
|
+
imports.wbg.__wbg_require_b74f47fc2d022fd6 = function() { return handleError(function () {
|
|
440
|
+
const ret = module.require;
|
|
441
|
+
return ret;
|
|
442
|
+
}, arguments) };
|
|
443
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
444
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
445
|
+
};
|
|
446
|
+
imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
447
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
448
|
+
return ret;
|
|
449
|
+
}, arguments) };
|
|
450
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
451
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
452
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
453
|
+
};
|
|
454
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
455
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
456
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
457
|
+
};
|
|
458
|
+
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
459
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
460
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
461
|
+
};
|
|
462
|
+
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
463
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
464
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
465
|
+
};
|
|
466
|
+
imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
467
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
468
|
+
return ret;
|
|
469
|
+
};
|
|
470
|
+
imports.wbg.__wbg_versions_4e31226f5e8dc909 = function(arg0) {
|
|
471
|
+
const ret = arg0.versions;
|
|
472
|
+
return ret;
|
|
473
|
+
};
|
|
474
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
475
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
476
|
+
return ret;
|
|
477
|
+
};
|
|
478
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
479
|
+
const table = wasm.__wbindgen_export_2;
|
|
480
|
+
const offset = table.grow(4);
|
|
481
|
+
table.set(0, undefined);
|
|
482
|
+
table.set(offset + 0, undefined);
|
|
483
|
+
table.set(offset + 1, null);
|
|
484
|
+
table.set(offset + 2, true);
|
|
485
|
+
table.set(offset + 3, false);
|
|
486
|
+
;
|
|
487
|
+
};
|
|
488
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
489
|
+
const ret = typeof(arg0) === 'function';
|
|
490
|
+
return ret;
|
|
491
|
+
};
|
|
492
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
493
|
+
const val = arg0;
|
|
494
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
495
|
+
return ret;
|
|
496
|
+
};
|
|
497
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
498
|
+
const ret = typeof(arg0) === 'string';
|
|
499
|
+
return ret;
|
|
500
|
+
};
|
|
501
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
502
|
+
const ret = arg0 === undefined;
|
|
503
|
+
return ret;
|
|
504
|
+
};
|
|
505
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
506
|
+
const ret = wasm.memory;
|
|
507
|
+
return ret;
|
|
508
|
+
};
|
|
509
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
510
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
511
|
+
return ret;
|
|
512
|
+
};
|
|
513
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
514
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
return imports;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function __wbg_init_memory(imports, memory) {
|
|
521
|
+
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function __wbg_finalize_init(instance, module) {
|
|
525
|
+
wasm = instance.exports;
|
|
526
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
527
|
+
cachedUint8ArrayMemory0 = null;
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
wasm.__wbindgen_start();
|
|
531
|
+
return wasm;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function initSync(module) {
|
|
535
|
+
if (wasm !== undefined) return wasm;
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
if (typeof module !== 'undefined') {
|
|
539
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
540
|
+
({module} = module)
|
|
541
|
+
} else {
|
|
542
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
const imports = __wbg_get_imports();
|
|
547
|
+
|
|
548
|
+
__wbg_init_memory(imports);
|
|
549
|
+
|
|
550
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
551
|
+
module = new WebAssembly.Module(module);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
555
|
+
|
|
556
|
+
return __wbg_finalize_init(instance, module);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
async function __wbg_init(module_or_path) {
|
|
560
|
+
if (wasm !== undefined) return wasm;
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
if (typeof module_or_path !== 'undefined') {
|
|
564
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
565
|
+
({module_or_path} = module_or_path)
|
|
566
|
+
} else {
|
|
567
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
if (typeof module_or_path === 'undefined') {
|
|
572
|
+
module_or_path = new URL('opaque_bg.wasm', import.meta.url);
|
|
573
|
+
}
|
|
574
|
+
const imports = __wbg_get_imports();
|
|
575
|
+
|
|
576
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
577
|
+
module_or_path = fetch(module_or_path);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
__wbg_init_memory(imports);
|
|
581
|
+
|
|
582
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
583
|
+
|
|
584
|
+
return __wbg_finalize_init(instance, module);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export { initSync };
|
|
588
|
+
export default __wbg_init;
|