@ciphera-net/tessera 0.1.3
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/LICENSE +202 -0
- package/README.md +380 -0
- package/dist/blindIndex.d.ts +2 -0
- package/dist/blindIndex.js +10 -0
- package/dist/encoding.d.ts +19 -0
- package/dist/encoding.js +44 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.js +27 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +7 -0
- package/dist/opaque.d.ts +16 -0
- package/dist/opaque.js +69 -0
- package/dist/passkey.d.ts +30 -0
- package/dist/passkey.js +75 -0
- package/dist/recovery.d.ts +7 -0
- package/dist/recovery.js +19 -0
- package/dist/tessera.d.ts +109 -0
- package/dist/tessera.js +228 -0
- package/dist/transport.d.ts +39 -0
- package/dist/transport.js +1 -0
- package/dist/vault.d.ts +9 -0
- package/dist/vault.js +108 -0
- package/dist/vmk.d.ts +29 -0
- package/dist/vmk.js +117 -0
- package/dist/wasm.d.ts +10 -0
- package/dist/wasm.js +52 -0
- package/package.json +39 -0
- package/wasm/node/package.json +12 -0
- package/wasm/node/tessera.d.ts +51 -0
- package/wasm/node/tessera.js +463 -0
- package/wasm/node/tessera_bg.wasm +0 -0
- package/wasm/node/tessera_bg.wasm.d.ts +27 -0
- package/wasm/web/package.json +16 -0
- package/wasm/web/tessera.d.ts +103 -0
- package/wasm/web/tessera.js +552 -0
- package/wasm/web/tessera_bg.wasm +0 -0
- package/wasm/web/tessera_bg.wasm.d.ts +27 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
/* @ts-self-types="./tessera.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class LoginFinish {
|
|
4
|
+
static __wrap(ptr) {
|
|
5
|
+
const obj = Object.create(LoginFinish.prototype);
|
|
6
|
+
obj.__wbg_ptr = ptr;
|
|
7
|
+
LoginFinishFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
8
|
+
return obj;
|
|
9
|
+
}
|
|
10
|
+
__destroy_into_raw() {
|
|
11
|
+
const ptr = this.__wbg_ptr;
|
|
12
|
+
this.__wbg_ptr = 0;
|
|
13
|
+
LoginFinishFinalization.unregister(this);
|
|
14
|
+
return ptr;
|
|
15
|
+
}
|
|
16
|
+
free() {
|
|
17
|
+
const ptr = this.__destroy_into_raw();
|
|
18
|
+
wasm.__wbg_loginfinish_free(ptr, 0);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @returns {Uint8Array}
|
|
22
|
+
*/
|
|
23
|
+
get exportKey() {
|
|
24
|
+
const ret = wasm.loginfinish_exportKey(this.__wbg_ptr);
|
|
25
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
26
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
27
|
+
return v1;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @returns {Uint8Array}
|
|
31
|
+
*/
|
|
32
|
+
get finalization() {
|
|
33
|
+
const ret = wasm.loginfinish_finalization(this.__wbg_ptr);
|
|
34
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
35
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
36
|
+
return v1;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @returns {Uint8Array}
|
|
40
|
+
*/
|
|
41
|
+
get sessionKey() {
|
|
42
|
+
const ret = wasm.loginfinish_sessionKey(this.__wbg_ptr);
|
|
43
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
44
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
45
|
+
return v1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (Symbol.dispose) LoginFinish.prototype[Symbol.dispose] = LoginFinish.prototype.free;
|
|
49
|
+
|
|
50
|
+
export class LoginHandle {
|
|
51
|
+
__destroy_into_raw() {
|
|
52
|
+
const ptr = this.__wbg_ptr;
|
|
53
|
+
this.__wbg_ptr = 0;
|
|
54
|
+
LoginHandleFinalization.unregister(this);
|
|
55
|
+
return ptr;
|
|
56
|
+
}
|
|
57
|
+
free() {
|
|
58
|
+
const ptr = this.__destroy_into_raw();
|
|
59
|
+
wasm.__wbg_loginhandle_free(ptr, 0);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Finish login (single-use). Returns finalization (relay), session_key, export_key (CLIENT-ONLY).
|
|
63
|
+
* @param {Uint8Array} password
|
|
64
|
+
* @param {Uint8Array} response
|
|
65
|
+
* @returns {LoginFinish}
|
|
66
|
+
*/
|
|
67
|
+
finish(password, response) {
|
|
68
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
69
|
+
const len0 = WASM_VECTOR_LEN;
|
|
70
|
+
const ptr1 = passArray8ToWasm0(response, wasm.__wbindgen_malloc);
|
|
71
|
+
const len1 = WASM_VECTOR_LEN;
|
|
72
|
+
const ret = wasm.loginhandle_finish(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
73
|
+
if (ret[2]) {
|
|
74
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
75
|
+
}
|
|
76
|
+
return LoginFinish.__wrap(ret[0]);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @param {Uint8Array} password
|
|
80
|
+
*/
|
|
81
|
+
constructor(password) {
|
|
82
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
83
|
+
const len0 = WASM_VECTOR_LEN;
|
|
84
|
+
const ret = wasm.loginhandle_new(ptr0, len0);
|
|
85
|
+
if (ret[2]) {
|
|
86
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
87
|
+
}
|
|
88
|
+
this.__wbg_ptr = ret[0];
|
|
89
|
+
LoginHandleFinalization.register(this, this.__wbg_ptr, this);
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @returns {Uint8Array}
|
|
94
|
+
*/
|
|
95
|
+
get request() {
|
|
96
|
+
const ret = wasm.loginhandle_request(this.__wbg_ptr);
|
|
97
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
98
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
99
|
+
return v1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (Symbol.dispose) LoginHandle.prototype[Symbol.dispose] = LoginHandle.prototype.free;
|
|
103
|
+
|
|
104
|
+
export class RegistrationFinish {
|
|
105
|
+
static __wrap(ptr) {
|
|
106
|
+
const obj = Object.create(RegistrationFinish.prototype);
|
|
107
|
+
obj.__wbg_ptr = ptr;
|
|
108
|
+
RegistrationFinishFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
109
|
+
return obj;
|
|
110
|
+
}
|
|
111
|
+
__destroy_into_raw() {
|
|
112
|
+
const ptr = this.__wbg_ptr;
|
|
113
|
+
this.__wbg_ptr = 0;
|
|
114
|
+
RegistrationFinishFinalization.unregister(this);
|
|
115
|
+
return ptr;
|
|
116
|
+
}
|
|
117
|
+
free() {
|
|
118
|
+
const ptr = this.__destroy_into_raw();
|
|
119
|
+
wasm.__wbg_registrationfinish_free(ptr, 0);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @returns {Uint8Array}
|
|
123
|
+
*/
|
|
124
|
+
get exportKey() {
|
|
125
|
+
const ret = wasm.registrationfinish_exportKey(this.__wbg_ptr);
|
|
126
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
127
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
128
|
+
return v1;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @returns {Uint8Array}
|
|
132
|
+
*/
|
|
133
|
+
get upload() {
|
|
134
|
+
const ret = wasm.registrationfinish_upload(this.__wbg_ptr);
|
|
135
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
136
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
137
|
+
return v1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (Symbol.dispose) RegistrationFinish.prototype[Symbol.dispose] = RegistrationFinish.prototype.free;
|
|
141
|
+
|
|
142
|
+
export class RegistrationHandle {
|
|
143
|
+
__destroy_into_raw() {
|
|
144
|
+
const ptr = this.__wbg_ptr;
|
|
145
|
+
this.__wbg_ptr = 0;
|
|
146
|
+
RegistrationHandleFinalization.unregister(this);
|
|
147
|
+
return ptr;
|
|
148
|
+
}
|
|
149
|
+
free() {
|
|
150
|
+
const ptr = this.__destroy_into_raw();
|
|
151
|
+
wasm.__wbg_registrationhandle_free(ptr, 0);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Finish registration. Consumes the handle's state (single-use; a second call errors). Returns
|
|
155
|
+
* the upload to relay and the 64-byte export_key (CLIENT-ONLY — caller must never transmit it).
|
|
156
|
+
* @param {Uint8Array} password
|
|
157
|
+
* @param {Uint8Array} response
|
|
158
|
+
* @returns {RegistrationFinish}
|
|
159
|
+
*/
|
|
160
|
+
finish(password, response) {
|
|
161
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
162
|
+
const len0 = WASM_VECTOR_LEN;
|
|
163
|
+
const ptr1 = passArray8ToWasm0(response, wasm.__wbindgen_malloc);
|
|
164
|
+
const len1 = WASM_VECTOR_LEN;
|
|
165
|
+
const ret = wasm.registrationhandle_finish(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
166
|
+
if (ret[2]) {
|
|
167
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
168
|
+
}
|
|
169
|
+
return RegistrationFinish.__wrap(ret[0]);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Start registration from a password. `request` carries the RegistrationRequest to relay.
|
|
173
|
+
* @param {Uint8Array} password
|
|
174
|
+
*/
|
|
175
|
+
constructor(password) {
|
|
176
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
177
|
+
const len0 = WASM_VECTOR_LEN;
|
|
178
|
+
const ret = wasm.registrationhandle_new(ptr0, len0);
|
|
179
|
+
if (ret[2]) {
|
|
180
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
181
|
+
}
|
|
182
|
+
this.__wbg_ptr = ret[0];
|
|
183
|
+
RegistrationHandleFinalization.register(this, this.__wbg_ptr, this);
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* @returns {Uint8Array}
|
|
188
|
+
*/
|
|
189
|
+
get request() {
|
|
190
|
+
const ret = wasm.registrationhandle_request(this.__wbg_ptr);
|
|
191
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
192
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
193
|
+
return v1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (Symbol.dispose) RegistrationHandle.prototype[Symbol.dispose] = RegistrationHandle.prototype.free;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Derive the 32-byte blind index from an email. The params/normalization/salt live in the core
|
|
200
|
+
* crate (`tessera::blind_index`) as the single source of truth; this is a thin binding.
|
|
201
|
+
* @param {string} email
|
|
202
|
+
* @returns {Uint8Array}
|
|
203
|
+
*/
|
|
204
|
+
export function blindIndex(email) {
|
|
205
|
+
const ptr0 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
206
|
+
const len0 = WASM_VECTOR_LEN;
|
|
207
|
+
const ret = wasm.blindIndex(ptr0, len0);
|
|
208
|
+
if (ret[3]) {
|
|
209
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
210
|
+
}
|
|
211
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
212
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
213
|
+
return v2;
|
|
214
|
+
}
|
|
215
|
+
function __wbg_get_imports() {
|
|
216
|
+
const import0 = {
|
|
217
|
+
__proto__: null,
|
|
218
|
+
__wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
|
|
219
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
220
|
+
return ret;
|
|
221
|
+
},
|
|
222
|
+
__wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
|
|
223
|
+
const ret = typeof(arg0) === 'function';
|
|
224
|
+
return ret;
|
|
225
|
+
},
|
|
226
|
+
__wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
|
|
227
|
+
const val = arg0;
|
|
228
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
229
|
+
return ret;
|
|
230
|
+
},
|
|
231
|
+
__wbg___wbindgen_is_string_c236cabd84a4d769: function(arg0) {
|
|
232
|
+
const ret = typeof(arg0) === 'string';
|
|
233
|
+
return ret;
|
|
234
|
+
},
|
|
235
|
+
__wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
|
|
236
|
+
const ret = arg0 === undefined;
|
|
237
|
+
return ret;
|
|
238
|
+
},
|
|
239
|
+
__wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
|
|
240
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
241
|
+
},
|
|
242
|
+
__wbg_call_9c758de292015997: function() { return handleError(function (arg0, arg1, arg2) {
|
|
243
|
+
const ret = arg0.call(arg1, arg2);
|
|
244
|
+
return ret;
|
|
245
|
+
}, arguments); },
|
|
246
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
247
|
+
const ret = arg0.crypto;
|
|
248
|
+
return ret;
|
|
249
|
+
},
|
|
250
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
251
|
+
arg0.getRandomValues(arg1);
|
|
252
|
+
}, arguments); },
|
|
253
|
+
__wbg_length_4a591ecaa01354d9: function(arg0) {
|
|
254
|
+
const ret = arg0.length;
|
|
255
|
+
return ret;
|
|
256
|
+
},
|
|
257
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
258
|
+
const ret = arg0.msCrypto;
|
|
259
|
+
return ret;
|
|
260
|
+
},
|
|
261
|
+
__wbg_new_with_length_36a4998e27b014c5: function(arg0) {
|
|
262
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
263
|
+
return ret;
|
|
264
|
+
},
|
|
265
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
266
|
+
const ret = arg0.node;
|
|
267
|
+
return ret;
|
|
268
|
+
},
|
|
269
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
270
|
+
const ret = arg0.process;
|
|
271
|
+
return ret;
|
|
272
|
+
},
|
|
273
|
+
__wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
|
|
274
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
275
|
+
},
|
|
276
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
277
|
+
arg0.randomFillSync(arg1);
|
|
278
|
+
}, arguments); },
|
|
279
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
280
|
+
const ret = module.require;
|
|
281
|
+
return ret;
|
|
282
|
+
}, arguments); },
|
|
283
|
+
__wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
|
|
284
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
285
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
286
|
+
},
|
|
287
|
+
__wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
|
|
288
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
289
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
290
|
+
},
|
|
291
|
+
__wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
|
|
292
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
293
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
294
|
+
},
|
|
295
|
+
__wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
|
|
296
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
297
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
298
|
+
},
|
|
299
|
+
__wbg_subarray_4aa221f6a4f5ab22: function(arg0, arg1, arg2) {
|
|
300
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
301
|
+
return ret;
|
|
302
|
+
},
|
|
303
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
304
|
+
const ret = arg0.versions;
|
|
305
|
+
return ret;
|
|
306
|
+
},
|
|
307
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
308
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
309
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
310
|
+
return ret;
|
|
311
|
+
},
|
|
312
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
313
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
314
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
315
|
+
return ret;
|
|
316
|
+
},
|
|
317
|
+
__wbindgen_init_externref_table: function() {
|
|
318
|
+
const table = wasm.__wbindgen_externrefs;
|
|
319
|
+
const offset = table.grow(4);
|
|
320
|
+
table.set(0, undefined);
|
|
321
|
+
table.set(offset + 0, undefined);
|
|
322
|
+
table.set(offset + 1, null);
|
|
323
|
+
table.set(offset + 2, true);
|
|
324
|
+
table.set(offset + 3, false);
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
return {
|
|
328
|
+
__proto__: null,
|
|
329
|
+
"./tessera_bg.js": import0,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const LoginFinishFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
334
|
+
? { register: () => {}, unregister: () => {} }
|
|
335
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_loginfinish_free(ptr, 1));
|
|
336
|
+
const LoginHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
337
|
+
? { register: () => {}, unregister: () => {} }
|
|
338
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_loginhandle_free(ptr, 1));
|
|
339
|
+
const RegistrationFinishFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
340
|
+
? { register: () => {}, unregister: () => {} }
|
|
341
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_registrationfinish_free(ptr, 1));
|
|
342
|
+
const RegistrationHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
343
|
+
? { register: () => {}, unregister: () => {} }
|
|
344
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_registrationhandle_free(ptr, 1));
|
|
345
|
+
|
|
346
|
+
function addToExternrefTable0(obj) {
|
|
347
|
+
const idx = wasm.__externref_table_alloc();
|
|
348
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
349
|
+
return idx;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
353
|
+
ptr = ptr >>> 0;
|
|
354
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function getStringFromWasm0(ptr, len) {
|
|
358
|
+
return decodeText(ptr >>> 0, len);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
let cachedUint8ArrayMemory0 = null;
|
|
362
|
+
function getUint8ArrayMemory0() {
|
|
363
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
364
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
365
|
+
}
|
|
366
|
+
return cachedUint8ArrayMemory0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function handleError(f, args) {
|
|
370
|
+
try {
|
|
371
|
+
return f.apply(this, args);
|
|
372
|
+
} catch (e) {
|
|
373
|
+
const idx = addToExternrefTable0(e);
|
|
374
|
+
wasm.__wbindgen_exn_store(idx);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function isLikeNone(x) {
|
|
379
|
+
return x === undefined || x === null;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
383
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
384
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
385
|
+
WASM_VECTOR_LEN = arg.length;
|
|
386
|
+
return ptr;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
390
|
+
if (realloc === undefined) {
|
|
391
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
392
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
393
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
394
|
+
WASM_VECTOR_LEN = buf.length;
|
|
395
|
+
return ptr;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
let len = arg.length;
|
|
399
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
400
|
+
|
|
401
|
+
const mem = getUint8ArrayMemory0();
|
|
402
|
+
|
|
403
|
+
let offset = 0;
|
|
404
|
+
|
|
405
|
+
for (; offset < len; offset++) {
|
|
406
|
+
const code = arg.charCodeAt(offset);
|
|
407
|
+
if (code > 0x7F) break;
|
|
408
|
+
mem[ptr + offset] = code;
|
|
409
|
+
}
|
|
410
|
+
if (offset !== len) {
|
|
411
|
+
if (offset !== 0) {
|
|
412
|
+
arg = arg.slice(offset);
|
|
413
|
+
}
|
|
414
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
415
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
416
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
417
|
+
|
|
418
|
+
offset += ret.written;
|
|
419
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
WASM_VECTOR_LEN = offset;
|
|
423
|
+
return ptr;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function takeFromExternrefTable0(idx) {
|
|
427
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
428
|
+
wasm.__externref_table_dealloc(idx);
|
|
429
|
+
return value;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
433
|
+
cachedTextDecoder.decode();
|
|
434
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
435
|
+
let numBytesDecoded = 0;
|
|
436
|
+
function decodeText(ptr, len) {
|
|
437
|
+
numBytesDecoded += len;
|
|
438
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
439
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
440
|
+
cachedTextDecoder.decode();
|
|
441
|
+
numBytesDecoded = len;
|
|
442
|
+
}
|
|
443
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const cachedTextEncoder = new TextEncoder();
|
|
447
|
+
|
|
448
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
449
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
450
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
451
|
+
view.set(buf);
|
|
452
|
+
return {
|
|
453
|
+
read: arg.length,
|
|
454
|
+
written: buf.length
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
let WASM_VECTOR_LEN = 0;
|
|
460
|
+
|
|
461
|
+
let wasmModule, wasmInstance, wasm;
|
|
462
|
+
function __wbg_finalize_init(instance, module) {
|
|
463
|
+
wasmInstance = instance;
|
|
464
|
+
wasm = instance.exports;
|
|
465
|
+
wasmModule = module;
|
|
466
|
+
cachedUint8ArrayMemory0 = null;
|
|
467
|
+
wasm.__wbindgen_start();
|
|
468
|
+
return wasm;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
async function __wbg_load(module, imports) {
|
|
472
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
473
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
474
|
+
try {
|
|
475
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
476
|
+
} catch (e) {
|
|
477
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
478
|
+
|
|
479
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
480
|
+
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);
|
|
481
|
+
|
|
482
|
+
} else { throw e; }
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const bytes = await module.arrayBuffer();
|
|
487
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
488
|
+
} else {
|
|
489
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
490
|
+
|
|
491
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
492
|
+
return { instance, module };
|
|
493
|
+
} else {
|
|
494
|
+
return instance;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function expectedResponseType(type) {
|
|
499
|
+
switch (type) {
|
|
500
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
501
|
+
}
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function initSync(module) {
|
|
507
|
+
if (wasm !== undefined) return wasm;
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
if (module !== undefined) {
|
|
511
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
512
|
+
({module} = module)
|
|
513
|
+
} else {
|
|
514
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const imports = __wbg_get_imports();
|
|
519
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
520
|
+
module = new WebAssembly.Module(module);
|
|
521
|
+
}
|
|
522
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
523
|
+
return __wbg_finalize_init(instance, module);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
async function __wbg_init(module_or_path) {
|
|
527
|
+
if (wasm !== undefined) return wasm;
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
if (module_or_path !== undefined) {
|
|
531
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
532
|
+
({module_or_path} = module_or_path)
|
|
533
|
+
} else {
|
|
534
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if (module_or_path === undefined) {
|
|
539
|
+
module_or_path = new URL('tessera_bg.wasm', import.meta.url);
|
|
540
|
+
}
|
|
541
|
+
const imports = __wbg_get_imports();
|
|
542
|
+
|
|
543
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
544
|
+
module_or_path = fetch(module_or_path);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
548
|
+
|
|
549
|
+
return __wbg_finalize_init(instance, module);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_loginfinish_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_loginhandle_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_registrationfinish_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_registrationhandle_free: (a: number, b: number) => void;
|
|
8
|
+
export const blindIndex: (a: number, b: number) => [number, number, number, number];
|
|
9
|
+
export const loginfinish_exportKey: (a: number) => [number, number];
|
|
10
|
+
export const loginfinish_finalization: (a: number) => [number, number];
|
|
11
|
+
export const loginfinish_sessionKey: (a: number) => [number, number];
|
|
12
|
+
export const loginhandle_finish: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
13
|
+
export const loginhandle_new: (a: number, b: number) => [number, number, number];
|
|
14
|
+
export const loginhandle_request: (a: number) => [number, number];
|
|
15
|
+
export const registrationfinish_exportKey: (a: number) => [number, number];
|
|
16
|
+
export const registrationfinish_upload: (a: number) => [number, number];
|
|
17
|
+
export const registrationhandle_finish: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
18
|
+
export const registrationhandle_new: (a: number, b: number) => [number, number, number];
|
|
19
|
+
export const registrationhandle_request: (a: number) => [number, number];
|
|
20
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
21
|
+
export const __externref_table_alloc: () => number;
|
|
22
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
23
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
24
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
25
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
26
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
27
|
+
export const __wbindgen_start: () => void;
|