@wireapp/core-crypto 0.6.0 → 0.6.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": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "CoreCrypto bindings for the Web",
5
5
  "type": "module",
6
6
  "module": "platforms/web/corecrypto.js",
@@ -226,9 +226,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
226
226
  return real;
227
227
  }
228
228
  function __wbg_adapter_52(arg0, arg1, arg2) {
229
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbc1e83b65f289d81(arg0, arg1, addHeapObject(arg2));
230
+ }
231
+ function __wbg_adapter_55(arg0, arg1, arg2) {
229
232
  try {
230
233
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
231
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h07d37b19e83c7ae3(retptr, arg0, arg1, addHeapObject(arg2));
234
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7f871b07edcecab4(retptr, arg0, arg1, addHeapObject(arg2));
232
235
  var r0 = getInt32Memory0()[retptr / 4 + 0];
233
236
  var r1 = getInt32Memory0()[retptr / 4 + 1];
234
237
  if (r1) {
@@ -239,9 +242,6 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
239
242
  wasm$1.__wbindgen_add_to_stack_pointer(16);
240
243
  }
241
244
  }
242
- function __wbg_adapter_55(arg0, arg1, arg2) {
243
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hde4447b48c9e13f3(arg0, arg1, addHeapObject(arg2));
244
- }
245
245
  function _assertClass(instance, klass) {
246
246
  if (!(instance instanceof klass)) {
247
247
  throw new Error(`expected instance of ${klass.name}`);
@@ -290,8 +290,8 @@ function handleError(f, args) {
290
290
  function getArrayU8FromWasm0(ptr, len) {
291
291
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
292
292
  }
293
- function __wbg_adapter_268(arg0, arg1, arg2, arg3) {
294
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h1934ea7100a9edf0(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
293
+ function __wbg_adapter_270(arg0, arg1, arg2, arg3) {
294
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h642728bf8a354f9a(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
295
295
  }
296
296
  /**
297
297
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -2417,6 +2417,10 @@ function getImports() {
2417
2417
  return addHeapObject(ret);
2418
2418
  }, arguments);
2419
2419
  };
2420
+ imports.wbg.__wbg_push_49c286f04dd3bf59 = function (arg0, arg1) {
2421
+ const ret = getObject(arg0).push(getObject(arg1));
2422
+ return ret;
2423
+ };
2420
2424
  imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function (arg0, arg1) {
2421
2425
  try {
2422
2426
  var state0 = { a: arg0, b: arg1 };
@@ -2424,7 +2428,7 @@ function getImports() {
2424
2428
  const a = state0.a;
2425
2429
  state0.a = 0;
2426
2430
  try {
2427
- return __wbg_adapter_268(a, state0.b, arg0, arg1);
2431
+ return __wbg_adapter_270(a, state0.b, arg0, arg1);
2428
2432
  }
2429
2433
  finally {
2430
2434
  state0.a = a;
@@ -2441,9 +2445,9 @@ function getImports() {
2441
2445
  const ret = FfiWireE2EIdentity.__wrap(arg0);
2442
2446
  return addHeapObject(ret);
2443
2447
  };
2444
- imports.wbg.__wbg_push_49c286f04dd3bf59 = function (arg0, arg1) {
2445
- const ret = getObject(arg0).push(getObject(arg1));
2446
- return ret;
2448
+ imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2449
+ const ret = BigInt.asUintN(64, arg0);
2450
+ return addHeapObject(ret);
2447
2451
  };
2448
2452
  imports.wbg.__wbg_new_f841cc6f2098f4b5 = function () {
2449
2453
  const ret = new Map();
@@ -2453,10 +2457,6 @@ function getImports() {
2453
2457
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2454
2458
  return addHeapObject(ret);
2455
2459
  };
2456
- imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2457
- const ret = BigInt.asUintN(64, arg0);
2458
- return addHeapObject(ret);
2459
- };
2460
2460
  imports.wbg.__wbg_setonsuccess_925a7718d3f62bc1 = function (arg0, arg1) {
2461
2461
  getObject(arg0).onsuccess = getObject(arg1);
2462
2462
  };
@@ -2529,18 +2529,30 @@ function getImports() {
2529
2529
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2530
2530
  return addHeapObject(ret);
2531
2531
  };
2532
+ imports.wbg.__wbg_instanceof_Promise_4333c4e5587e8936 = function (arg0) {
2533
+ let result;
2534
+ try {
2535
+ result = getObject(arg0) instanceof Promise;
2536
+ }
2537
+ catch {
2538
+ result = false;
2539
+ }
2540
+ const ret = result;
2541
+ return ret;
2542
+ };
2543
+ imports.wbg.__wbg_then_f753623316e2873a = function (arg0, arg1, arg2) {
2544
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2545
+ return addHeapObject(ret);
2546
+ };
2547
+ imports.wbg.__wbg_warn_e57696dbb3977030 = function (arg0) {
2548
+ console.warn(getObject(arg0));
2549
+ };
2532
2550
  imports.wbg.__wbg_call_96878afb7a8201ca = function () {
2533
2551
  return handleError(function (arg0, arg1, arg2, arg3) {
2534
2552
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
2535
2553
  return addHeapObject(ret);
2536
2554
  }, arguments);
2537
2555
  };
2538
- imports.wbg.__wbg_call_99043a1e2a9e5916 = function () {
2539
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2540
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2541
- return addHeapObject(ret);
2542
- }, arguments);
2543
- };
2544
2556
  imports.wbg.__wbg_now_78244d2ced74c026 = function () {
2545
2557
  const ret = performance.now();
2546
2558
  return ret;
@@ -2783,6 +2795,12 @@ function getImports() {
2783
2795
  const ret = new Function(getStringFromWasm0(arg0, arg1));
2784
2796
  return addHeapObject(ret);
2785
2797
  };
2798
+ imports.wbg.__wbg_call_99043a1e2a9e5916 = function () {
2799
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2800
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2801
+ return addHeapObject(ret);
2802
+ }, arguments);
2803
+ };
2786
2804
  imports.wbg.__wbg_set_6aa458a4ebdb65cb = function () {
2787
2805
  return handleError(function (arg0, arg1, arg2) {
2788
2806
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
@@ -2950,10 +2968,6 @@ function getImports() {
2950
2968
  const ret = getObject(arg0).then(getObject(arg1));
2951
2969
  return addHeapObject(ret);
2952
2970
  };
2953
- imports.wbg.__wbg_then_f753623316e2873a = function (arg0, arg1, arg2) {
2954
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2955
- return addHeapObject(ret);
2956
- };
2957
2971
  imports.wbg.__wbg_resolve_fd40f858d9db1a04 = function (arg0) {
2958
2972
  const ret = Promise.resolve(getObject(arg0));
2959
2973
  return addHeapObject(ret);
@@ -3018,12 +3032,12 @@ function getImports() {
3018
3032
  return addHeapObject(ret);
3019
3033
  }, arguments);
3020
3034
  };
3021
- imports.wbg.__wbindgen_closure_wrapper4410 = function (arg0, arg1, arg2) {
3022
- const ret = makeMutClosure(arg0, arg1, 143, __wbg_adapter_52);
3035
+ imports.wbg.__wbindgen_closure_wrapper1524 = function (arg0, arg1, arg2) {
3036
+ const ret = makeMutClosure(arg0, arg1, 144, __wbg_adapter_52);
3023
3037
  return addHeapObject(ret);
3024
3038
  };
3025
- imports.wbg.__wbindgen_closure_wrapper4895 = function (arg0, arg1, arg2) {
3026
- const ret = makeMutClosure(arg0, arg1, 143, __wbg_adapter_55);
3039
+ imports.wbg.__wbindgen_closure_wrapper4412 = function (arg0, arg1, arg2) {
3040
+ const ret = makeMutClosure(arg0, arg1, 144, __wbg_adapter_55);
3027
3041
  return addHeapObject(ret);
3028
3042
  };
3029
3043
  return imports;
@@ -3083,7 +3097,7 @@ var exports = /*#__PURE__*/Object.freeze({
3083
3097
  var wasm = async (opt = {}) => {
3084
3098
  let {importHook, serverPath} = opt;
3085
3099
 
3086
- let path = "assets/core_crypto_ffi-49b28313.wasm";
3100
+ let path = "assets/core_crypto_ffi-75ec2ae1.wasm";
3087
3101
 
3088
3102
  if (serverPath != null) {
3089
3103
  path = serverPath + /[^\/\\]*$/.exec(path)[0];
@@ -3475,9 +3489,11 @@ class CoreCrypto {
3475
3489
  }
3476
3490
  try {
3477
3491
  const ffiDecryptedMessage = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").decrypt_message(conversationId, payload));
3478
- const commitDelay = ffiDecryptedMessage.commit_delay ?
3479
- ffiDecryptedMessage.commit_delay * 1000 :
3480
- undefined;
3492
+ const ffiCommitDelay = ffiDecryptedMessage.commit_delay;
3493
+ let commitDelay = undefined;
3494
+ if (typeof ffiCommitDelay === "number" && ffiCommitDelay >= 0) {
3495
+ commitDelay = ffiCommitDelay * 1000;
3496
+ }
3481
3497
  const ret = {
3482
3498
  message: ffiDecryptedMessage.message,
3483
3499
  proposals: ffiDecryptedMessage.proposals,