@wireapp/core-crypto 9.3.0 → 9.3.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "9.3.0",
3
+ "version": "9.3.2",
4
4
  "author": "Wire CoreCrypto team <team.corecrypto@wire.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -247,9 +247,9 @@ export const __wbg_get_decryptedmessage_senderClientId: (a: number) => number;
247
247
  export const __wbg_get_decryptedmessage_identity: (a: number) => number;
248
248
  export const __wbg_get_decryptedmessage_commitDelay: (a: number) => [number, bigint];
249
249
  export const __wbg_get_decryptedmessage_message: (a: number) => [number, number];
250
- export const secretkey_new: (a: number, b: number) => number;
251
250
  export const welcome_new: (a: number, b: number) => number;
252
251
  export const keypackage_new: (a: number, b: number) => number;
252
+ export const secretkey_new: (a: number, b: number) => number;
253
253
  export const conversationid_new: (a: number, b: number) => number;
254
254
  export const groupinfo_new: (a: number, b: number) => number;
255
255
  export const externalsenderkey_new: (a: number, b: number) => number;
@@ -268,11 +268,11 @@ export const __wbindgen_exn_store: (a: number) => void;
268
268
  export const __externref_table_alloc: () => number;
269
269
  export const __wbindgen_export_4: WebAssembly.Table;
270
270
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
271
- export const __wbindgen_export_6: WebAssembly.Table;
272
271
  export const __externref_drop_slice: (a: number, b: number) => void;
272
+ export const __wbindgen_export_7: WebAssembly.Table;
273
273
  export const __externref_table_dealloc: (a: number) => void;
274
- export const closure1026_externref_shim: (a: number, b: number, c: any) => void;
275
- export const closure2905_externref_shim: (a: number, b: number, c: any) => void;
274
+ export const closure2906_externref_shim: (a: number, b: number, c: any) => void;
276
275
  export const closure2597_externref_shim: (a: number, b: number, c: any) => void;
277
- export const closure3007_externref_shim: (a: number, b: number, c: any, d: any) => void;
276
+ export const closure1026_externref_shim: (a: number, b: number, c: any) => void;
277
+ export const closure3008_externref_shim: (a: number, b: number, c: any, d: any) => void;
278
278
  export const __wbindgen_start: () => void;
package/src/corecrypto.js CHANGED
@@ -1,19 +1,3 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __toESM = (mod, isNodeMode, target) => {
7
- target = mod != null ? __create(__getProtoOf(mod)) : {};
8
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
- for (let key of __getOwnPropNames(mod))
10
- if (!__hasOwnProp.call(to, key))
11
- __defProp(to, key, {
12
- get: () => mod[key],
13
- enumerable: true
14
- });
15
- return to;
16
- };
17
1
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
18
2
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
19
3
  }) : x)(function(x) {
@@ -327,8 +311,18 @@ ${val.stack}`;
327
311
  }
328
312
  return className;
329
313
  }
314
+ function getArrayJsValueFromWasm0(ptr, len) {
315
+ ptr = ptr >>> 0;
316
+ const mem = getDataViewMemory0();
317
+ const result = [];
318
+ for (let i = ptr;i < ptr + 4 * len; i += 4) {
319
+ result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
320
+ }
321
+ wasm.__externref_drop_slice(ptr, len);
322
+ return result;
323
+ }
330
324
  var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((state) => {
331
- wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
325
+ wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b);
332
326
  });
333
327
  function makeMutClosure(arg0, arg1, dtor, f) {
334
328
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
@@ -340,7 +334,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
340
334
  return f(a, state.b, ...args);
341
335
  } finally {
342
336
  if (--state.cnt === 0) {
343
- wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
337
+ wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
344
338
  CLOSURE_DTORS.unregister(state);
345
339
  } else {
346
340
  state.a = a;
@@ -351,16 +345,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
351
345
  CLOSURE_DTORS.register(real, state, state);
352
346
  return real;
353
347
  }
354
- function getArrayJsValueFromWasm0(ptr, len) {
355
- ptr = ptr >>> 0;
356
- const mem = getDataViewMemory0();
357
- const result = [];
358
- for (let i = ptr;i < ptr + 4 * len; i += 4) {
359
- result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
360
- }
361
- wasm.__externref_drop_slice(ptr, len);
362
- return result;
363
- }
364
348
  function _assertClass(instance, klass) {
365
349
  if (!(instance instanceof klass)) {
366
350
  throw new Error(`expected instance of ${klass.name}`);
@@ -438,17 +422,17 @@ function build_metadata() {
438
422
  const ret = wasm.build_metadata();
439
423
  return BuildMetadata.__wrap(ret);
440
424
  }
441
- function __wbg_adapter_8(arg0, arg1, arg2) {
442
- wasm.closure1026_externref_shim(arg0, arg1, arg2);
443
- }
444
- function __wbg_adapter_19(arg0, arg1, arg2) {
445
- wasm.closure2905_externref_shim(arg0, arg1, arg2);
425
+ function __wbg_adapter_16(arg0, arg1, arg2) {
426
+ wasm.closure2906_externref_shim(arg0, arg1, arg2);
446
427
  }
447
- function __wbg_adapter_30(arg0, arg1, arg2) {
428
+ function __wbg_adapter_23(arg0, arg1, arg2) {
448
429
  wasm.closure2597_externref_shim(arg0, arg1, arg2);
449
430
  }
431
+ function __wbg_adapter_26(arg0, arg1, arg2) {
432
+ wasm.closure1026_externref_shim(arg0, arg1, arg2);
433
+ }
450
434
  function __wbg_adapter_511(arg0, arg1, arg2, arg3) {
451
- wasm.closure3007_externref_shim(arg0, arg1, arg2, arg3);
435
+ wasm.closure3008_externref_shim(arg0, arg1, arg2, arg3);
452
436
  }
453
437
  var Ciphersuite = Object.freeze({
454
438
  MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519: 1,
@@ -2914,7 +2898,7 @@ function __wbg_get_imports() {
2914
2898
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2915
2899
  }
2916
2900
  };
2917
- imports.wbg.__wbg_execute_ceed124e81aadaf1 = function() {
2901
+ imports.wbg.__wbg_execute_2b5645696ac713e6 = function() {
2918
2902
  return handleError(function(arg0, arg1) {
2919
2903
  const ret = arg0.execute(CoreCryptoContext.__wrap(arg1));
2920
2904
  return ret;
@@ -3546,10 +3530,6 @@ function __wbg_get_imports() {
3546
3530
  const ret = WireIdentity.__wrap(arg0);
3547
3531
  return ret;
3548
3532
  };
3549
- imports.wbg.__wbindgen_cast_0c43e13425ebdddc = function(arg0, arg1) {
3550
- const ret = makeMutClosure(arg0, arg1, 2904, __wbg_adapter_19);
3551
- return ret;
3552
- };
3553
3533
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
3554
3534
  const ret = getStringFromWasm0(arg0, arg1);
3555
3535
  return ret;
@@ -3577,7 +3557,7 @@ function __wbg_get_imports() {
3577
3557
  return ret;
3578
3558
  };
3579
3559
  imports.wbg.__wbindgen_cast_77ac86d8075f2f98 = function(arg0, arg1) {
3580
- const ret = makeMutClosure(arg0, arg1, 1025, __wbg_adapter_8);
3560
+ const ret = makeMutClosure(arg0, arg1, 1025, __wbg_adapter_26);
3581
3561
  return ret;
3582
3562
  };
3583
3563
  imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
@@ -3586,8 +3566,12 @@ function __wbg_get_imports() {
3586
3566
  const ret = v0;
3587
3567
  return ret;
3588
3568
  };
3569
+ imports.wbg.__wbindgen_cast_9366269b35ccbb69 = function(arg0, arg1) {
3570
+ const ret = makeMutClosure(arg0, arg1, 2905, __wbg_adapter_16);
3571
+ return ret;
3572
+ };
3589
3573
  imports.wbg.__wbindgen_cast_a834b411bd2663eb = function(arg0, arg1) {
3590
- const ret = makeMutClosure(arg0, arg1, 2596, __wbg_adapter_30);
3574
+ const ret = makeMutClosure(arg0, arg1, 2596, __wbg_adapter_23);
3591
3575
  return ret;
3592
3576
  };
3593
3577
  imports.wbg.__wbindgen_cast_b77aa29fa8fe8560 = function(arg0, arg1) {
@@ -4246,14 +4230,7 @@ class CoreCrypto2 {
4246
4230
  return await CoreCryptoError.asyncMapErr(this.#cc.get_device_identities(conversationId, deviceIds));
4247
4231
  }
4248
4232
  async getUserIdentities(conversationId, userIds) {
4249
- const map = await CoreCryptoError.asyncMapErr(this.#cc.get_user_identities(conversationId, userIds));
4250
- const mapFixed = new Map;
4251
- for (const [userId, identities] of map) {
4252
- mapFixed.set(userId, identities.flatMap((identity) => {
4253
- return identity ? [identity] : [];
4254
- }));
4255
- }
4256
- return mapFixed;
4233
+ return await CoreCryptoError.asyncMapErr(this.#cc.get_user_identities(conversationId, userIds));
4257
4234
  }
4258
4235
  async registerEpochObserver(observer) {
4259
4236
  const shim = new EpochObserverShim(observer);