@ping-app/ping-openmls-sdk 0.10.1 → 0.10.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/wasm/ping_wasm.js CHANGED
@@ -432,6 +432,46 @@ export class PingClient {
432
432
  wasm.__wbindgen_add_to_stack_pointer(16);
433
433
  }
434
434
  }
435
+ /**
436
+ * `exportConversationSecret` together with the MLS epoch the secret was
437
+ * exported at, from one read under one lock in the core
438
+ * (`MessagingClient::export_conversation_secret_with_epoch`): resolves
439
+ * `{ epoch: number, secret: Uint8Array }`, and the pair can never disagree
440
+ * across a Commit.
441
+ *
442
+ * Same derivation, same arguments and the same errors as
443
+ * `exportConversationSecret`; at one epoch both return the same bytes. The
444
+ * same boundary rule too: the core's `Zeroizing` copy is wiped when it
445
+ * drops here, the `Uint8Array` is the caller's to clear (`u8.fill(0)`).
446
+ * `epoch` is a plain number (an epoch beyond `Number.MAX_SAFE_INTEGER` is
447
+ * refused, never rounded).
448
+ * @param {Uint8Array} conv_id
449
+ * @param {string} label
450
+ * @param {Uint8Array} context
451
+ * @param {number} length
452
+ * @returns {any}
453
+ */
454
+ exportConversationSecretWithEpoch(conv_id, label, context, length) {
455
+ try {
456
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
457
+ const ptr0 = passArray8ToWasm0(conv_id, wasm.__wbindgen_export);
458
+ const len0 = WASM_VECTOR_LEN;
459
+ const ptr1 = passStringToWasm0(label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
460
+ const len1 = WASM_VECTOR_LEN;
461
+ const ptr2 = passArray8ToWasm0(context, wasm.__wbindgen_export);
462
+ const len2 = WASM_VECTOR_LEN;
463
+ wasm.pingclient_exportConversationSecretWithEpoch(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, length);
464
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
465
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
466
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
467
+ if (r2) {
468
+ throw takeObject(r1);
469
+ }
470
+ return takeObject(r0);
471
+ } finally {
472
+ wasm.__wbindgen_add_to_stack_pointer(16);
473
+ }
474
+ }
435
475
  /**
436
476
  * [CR-7] Export the MLS state snapshot for one conversation.
437
477
  * @param {Uint8Array} conv_id
@@ -2343,7 +2383,7 @@ function __wbg_get_imports() {
2343
2383
  __wbg__wbg_cb_unref_be22cc64ae6946a0: function(arg0) {
2344
2384
  getObject(arg0)._wbg_cb_unref();
2345
2385
  },
2346
- __wbg_applyBatch_406d7dbd1084b3f8: function(arg0, arg1, arg2, arg3, arg4) {
2386
+ __wbg_applyBatch_49455bfc62c24da5: function(arg0, arg1, arg2, arg3, arg4) {
2347
2387
  const ret = getObject(arg0).applyBatch(getStringFromWasm0(arg1, arg2), takeObject(arg3), takeObject(arg4));
2348
2388
  return addHeapObject(ret);
2349
2389
  },
@@ -2359,11 +2399,11 @@ function __wbg_get_imports() {
2359
2399
  const ret = getObject(arg0).crypto;
2360
2400
  return addHeapObject(ret);
2361
2401
  },
2362
- __wbg_del_77ee30f11147a08a: function(arg0, arg1, arg2, arg3, arg4) {
2402
+ __wbg_del_5d543e37d6646ef8: function(arg0, arg1, arg2, arg3, arg4) {
2363
2403
  const ret = getObject(arg0).del(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2364
2404
  return addHeapObject(ret);
2365
2405
  },
2366
- __wbg_discoverDevices_48997fecdd635ffe: function(arg0, arg1) {
2406
+ __wbg_discoverDevices_a5117e18236c0bc2: function(arg0, arg1) {
2367
2407
  const ret = getObject(arg0).discoverDevices(takeObject(arg1));
2368
2408
  return addHeapObject(ret);
2369
2409
  },
@@ -2386,15 +2426,15 @@ function __wbg_get_imports() {
2386
2426
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2387
2427
  }
2388
2428
  },
2389
- __wbg_fetchLogHeads_e78f7b7086790e4e: function(arg0) {
2429
+ __wbg_fetchLogHeads_21ae8776237c0351: function(arg0) {
2390
2430
  const ret = getObject(arg0).fetchLogHeads();
2391
2431
  return addHeapObject(ret);
2392
2432
  },
2393
- __wbg_fetchLogSince_9160c59aa2abdb21: function(arg0, arg1, arg2) {
2433
+ __wbg_fetchLogSince_28f5fbd4105bd3cd: function(arg0, arg1, arg2) {
2394
2434
  const ret = getObject(arg0).fetchLogSince(takeObject(arg1), arg2 >>> 0);
2395
2435
  return addHeapObject(ret);
2396
2436
  },
2397
- __wbg_fetchSince_b12814c52b08f8cf: function(arg0, arg1, arg2, arg3) {
2437
+ __wbg_fetchSince_a6a1dce942b3a4ed: function(arg0, arg1, arg2, arg3) {
2398
2438
  const ret = getObject(arg0).fetchSince(takeObject(arg1), takeObject(arg2), arg3 >>> 0);
2399
2439
  return addHeapObject(ret);
2400
2440
  },
@@ -2415,10 +2455,6 @@ function __wbg_get_imports() {
2415
2455
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
2416
2456
  return addHeapObject(ret);
2417
2457
  }, arguments); },
2418
- __wbg_get_aa5df4f67a22a0ad: function(arg0, arg1, arg2, arg3, arg4) {
2419
- const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2420
- return addHeapObject(ret);
2421
- },
2422
2458
  __wbg_get_c0c8f8d7da0c03dd: function(arg0, arg1) {
2423
2459
  const ret = getObject(arg0)[arg1 >>> 0];
2424
2460
  return addHeapObject(ret);
@@ -2427,6 +2463,10 @@ function __wbg_get_imports() {
2427
2463
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
2428
2464
  return addHeapObject(ret);
2429
2465
  }, arguments); },
2466
+ __wbg_get_fda3c223a9e9bd0c: function(arg0, arg1, arg2, arg3, arg4) {
2467
+ const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2468
+ return addHeapObject(ret);
2469
+ },
2430
2470
  __wbg_get_unchecked_e20b893aeafc3fca: function(arg0, arg1) {
2431
2471
  const ret = getObject(arg0)[arg1 >>> 0];
2432
2472
  return addHeapObject(ret);
@@ -2475,11 +2515,11 @@ function __wbg_get_imports() {
2475
2515
  const ret = getObject(arg0).length;
2476
2516
  return ret;
2477
2517
  },
2478
- __wbg_listEntries_7b924b3e7ff2b526: function(arg0, arg1, arg2, arg3, arg4) {
2518
+ __wbg_listEntries_67448432badf0048: function(arg0, arg1, arg2, arg3, arg4) {
2479
2519
  const ret = getObject(arg0).listEntries(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2480
2520
  return addHeapObject(ret);
2481
2521
  },
2482
- __wbg_listKeys_ffe3a9798e88abde: function(arg0, arg1, arg2, arg3, arg4) {
2522
+ __wbg_listKeys_58b63137eca68a71: function(arg0, arg1, arg2, arg3, arg4) {
2483
2523
  const ret = getObject(arg0).listKeys(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2484
2524
  return addHeapObject(ret);
2485
2525
  },
@@ -2514,7 +2554,7 @@ function __wbg_get_imports() {
2514
2554
  const a = state0.a;
2515
2555
  state0.a = 0;
2516
2556
  try {
2517
- return __wasm_bindgen_func_elem_4230(a, state0.b, arg0, arg1);
2557
+ return __wasm_bindgen_func_elem_4235(a, state0.b, arg0, arg1);
2518
2558
  } finally {
2519
2559
  state0.a = a;
2520
2560
  }
@@ -2560,7 +2600,7 @@ function __wbg_get_imports() {
2560
2600
  const ret = getObject(arg0).push(getObject(arg1));
2561
2601
  return ret;
2562
2602
  },
2563
- __wbg_put_053c25b07020914f: function(arg0, arg1, arg2, arg3, arg4, arg5) {
2603
+ __wbg_put_6fae0d33b0377492: function(arg0, arg1, arg2, arg3, arg4, arg5) {
2564
2604
  const ret = getObject(arg0).put(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), takeObject(arg5));
2565
2605
  return addHeapObject(ret);
2566
2606
  },
@@ -2582,21 +2622,25 @@ function __wbg_get_imports() {
2582
2622
  const ret = Promise.resolve(getObject(arg0));
2583
2623
  return addHeapObject(ret);
2584
2624
  },
2585
- __wbg_sendBatch_642a94f23a738334: function(arg0, arg1) {
2625
+ __wbg_sendBatch_2c2929270b2a95a5: function(arg0, arg1) {
2586
2626
  const ret = getObject(arg0).sendBatch(takeObject(arg1));
2587
2627
  return addHeapObject(ret);
2588
2628
  },
2589
- __wbg_send_50a83d84aca86680: function(arg0, arg1) {
2629
+ __wbg_send_fd5dc20e2f35b75e: function(arg0, arg1) {
2590
2630
  const ret = getObject(arg0).send(takeObject(arg1));
2591
2631
  return addHeapObject(ret);
2592
2632
  },
2593
- __wbg_setNextWelcomeRecipients_a3c6e79d35538d0d: function(arg0, arg1, arg2) {
2633
+ __wbg_setNextWelcomeRecipients_d349893dfc2640c6: function(arg0, arg1, arg2) {
2594
2634
  const ret = getObject(arg0).setNextWelcomeRecipients(takeObject(arg1), takeObject(arg2));
2595
2635
  return addHeapObject(ret);
2596
2636
  },
2597
2637
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2598
2638
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2599
2639
  },
2640
+ __wbg_set_8155bb79a948541b: function() { return handleError(function (arg0, arg1, arg2) {
2641
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2642
+ return ret;
2643
+ }, arguments); },
2600
2644
  __wbg_set_a80955eb93b145c6: function(arg0, arg1, arg2) {
2601
2645
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2602
2646
  },
@@ -2645,7 +2689,7 @@ function __wbg_get_imports() {
2645
2689
  },
2646
2690
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2647
2691
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1048, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2648
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_4215);
2692
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_4220);
2649
2693
  return addHeapObject(ret);
2650
2694
  },
2651
2695
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -2689,10 +2733,10 @@ function __wbg_get_imports() {
2689
2733
  };
2690
2734
  }
2691
2735
 
2692
- function __wasm_bindgen_func_elem_4215(arg0, arg1, arg2) {
2736
+ function __wasm_bindgen_func_elem_4220(arg0, arg1, arg2) {
2693
2737
  try {
2694
2738
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2695
- wasm.__wasm_bindgen_func_elem_4215(retptr, arg0, arg1, addHeapObject(arg2));
2739
+ wasm.__wasm_bindgen_func_elem_4220(retptr, arg0, arg1, addHeapObject(arg2));
2696
2740
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2697
2741
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2698
2742
  if (r1) {
@@ -2703,8 +2747,8 @@ function __wasm_bindgen_func_elem_4215(arg0, arg1, arg2) {
2703
2747
  }
2704
2748
  }
2705
2749
 
2706
- function __wasm_bindgen_func_elem_4230(arg0, arg1, arg2, arg3) {
2707
- wasm.__wasm_bindgen_func_elem_4230(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2750
+ function __wasm_bindgen_func_elem_4235(arg0, arg1, arg2, arg3) {
2751
+ wasm.__wasm_bindgen_func_elem_4235(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2708
2752
  }
2709
2753
 
2710
2754
  const PingClientFinalization = (typeof FinalizationRegistry === 'undefined')
Binary file
@@ -46,6 +46,7 @@ export const pingclient_createConversation: (a: number, b: number, c: number, d:
46
46
  export const pingclient_deviceId: (a: number, b: number) => void;
47
47
  export const pingclient_dropConversationLocal: (a: number, b: number, c: number) => number;
48
48
  export const pingclient_exportConversationSecret: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
49
+ export const pingclient_exportConversationSecretWithEpoch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
49
50
  export const pingclient_exportConversationStateSnapshot: (a: number, b: number, c: number, d: number, e: number) => void;
50
51
  export const pingclient_exportIdentity: (a: number, b: number) => void;
51
52
  export const pingclient_freshKeyPackage: (a: number) => number;
@@ -102,8 +103,8 @@ export const signDeviceLinkApproval: (a: number, b: number, c: number, d: number
102
103
  export const signDeviceLinkPossession: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
103
104
  export const signDeviceReauth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
104
105
  export const _start: () => void;
105
- export const __wasm_bindgen_func_elem_4215: (a: number, b: number, c: number, d: number) => void;
106
- export const __wasm_bindgen_func_elem_4230: (a: number, b: number, c: number, d: number) => void;
106
+ export const __wasm_bindgen_func_elem_4220: (a: number, b: number, c: number, d: number) => void;
107
+ export const __wasm_bindgen_func_elem_4235: (a: number, b: number, c: number, d: number) => void;
107
108
  export const __wbindgen_export: (a: number, b: number) => number;
108
109
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
109
110
  export const __wbindgen_export3: (a: number) => void;