@wireapp/core-crypto 0.6.0-pre.4 → 0.6.0-pre.5
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/README.md
CHANGED
@@ -101,7 +101,7 @@ cargo make wasm
|
|
101
101
|
|
102
102
|
### Versioning
|
103
103
|
|
104
|
-
* Run `cargo xtask bump [major|minor|patch|rc|pre]`
|
104
|
+
* Run `cargo xtask release bump [major|minor|patch|rc|pre]`
|
105
105
|
* Update the internal dependencies of the updated crates to use the new version
|
106
106
|
* Update the version in the `package.json`
|
107
107
|
* Update the version in the `build.gradle.kts` inside `./kotlin/android` and `./kotlin/jvm`
|
package/package.json
CHANGED
Binary file
|
@@ -423,6 +423,19 @@ export declare class CoreCrypto {
|
|
423
423
|
* ````
|
424
424
|
*/
|
425
425
|
static init({ databaseName, key, clientId, wasmFilePath, entropySeed }: CoreCryptoParams): Promise<CoreCrypto>;
|
426
|
+
/**
|
427
|
+
* Almost identical to {@link CoreCrypto.init} but allows a 2 phase initialization of MLS.
|
428
|
+
* First, calling this will set up the keystore and will allow generating proteus prekeys.
|
429
|
+
* Then, those keys can be traded for a clientId.
|
430
|
+
* Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
|
431
|
+
*/
|
432
|
+
static deferredInit(databaseName: string, key: string, entropySeed?: Uint8Array, wasmFilePath?: string): Promise<CoreCrypto>;
|
433
|
+
/**
|
434
|
+
* Use this after {@link CoreCrypto.deferredInit} when you have a clientId. It initializes MLS.
|
435
|
+
*
|
436
|
+
* @param clientId - {@link CoreCryptoParams#clientId} but required
|
437
|
+
*/
|
438
|
+
mlsInit(clientId: string): Promise<void>;
|
426
439
|
/** @hidden */
|
427
440
|
private constructor();
|
428
441
|
/**
|
@@ -767,6 +780,18 @@ export declare class CoreCrypto {
|
|
767
780
|
* @returns Hex-encoded public key string
|
768
781
|
*/
|
769
782
|
proteusFingerprint(): Promise<string>;
|
783
|
+
/**
|
784
|
+
* Proteus session local fingerprint
|
785
|
+
*
|
786
|
+
* @returns Hex-encoded public key string
|
787
|
+
*/
|
788
|
+
proteusFingerprintLocal(sessionId: string): Promise<string>;
|
789
|
+
/**
|
790
|
+
* Proteus session remote fingerprint
|
791
|
+
*
|
792
|
+
* @returns Hex-encoded public key string
|
793
|
+
*/
|
794
|
+
proteusFingerprintRemote(sessionId: string): Promise<string>;
|
770
795
|
/**
|
771
796
|
* Imports all the data stored by Cryptobox into the CoreCrypto keystore
|
772
797
|
*
|
@@ -36,15 +36,6 @@ function getObject(idx) { return heap[idx]; }
|
|
36
36
|
|
37
37
|
let heap_next = heap.length;
|
38
38
|
|
39
|
-
function addHeapObject(obj) {
|
40
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
41
|
-
const idx = heap_next;
|
42
|
-
heap_next = heap[idx];
|
43
|
-
|
44
|
-
heap[idx] = obj;
|
45
|
-
return idx;
|
46
|
-
}
|
47
|
-
|
48
39
|
function dropObject(idx) {
|
49
40
|
if (idx < 36) return;
|
50
41
|
heap[idx] = heap_next;
|
@@ -57,6 +48,15 @@ function takeObject(idx) {
|
|
57
48
|
return ret;
|
58
49
|
}
|
59
50
|
|
51
|
+
function addHeapObject(obj) {
|
52
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
53
|
+
const idx = heap_next;
|
54
|
+
heap_next = heap[idx];
|
55
|
+
|
56
|
+
heap[idx] = obj;
|
57
|
+
return idx;
|
58
|
+
}
|
59
|
+
|
60
60
|
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
61
61
|
|
62
62
|
cachedTextDecoder.decode();
|
@@ -328,7 +328,7 @@ function handleError(f, args) {
|
|
328
328
|
function getArrayU8FromWasm0(ptr, len) {
|
329
329
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
330
330
|
}
|
331
|
-
function
|
331
|
+
function __wbg_adapter_217(arg0, arg1, arg2, arg3) {
|
332
332
|
wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h880776ea65aca59d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
333
333
|
}
|
334
334
|
|
@@ -519,6 +519,34 @@ class CoreCrypto$1 {
|
|
519
519
|
return takeObject(ret);
|
520
520
|
}
|
521
521
|
/**
|
522
|
+
* see [core_crypto::MlsCentral::try_new]
|
523
|
+
* @param {string} path
|
524
|
+
* @param {string} key
|
525
|
+
* @param {Uint8Array | undefined} entropy_seed
|
526
|
+
* @returns {Promise<CoreCrypto>}
|
527
|
+
*/
|
528
|
+
static deferred_init(path, key, entropy_seed) {
|
529
|
+
const ptr0 = passStringToWasm0(path, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
530
|
+
const len0 = WASM_VECTOR_LEN;
|
531
|
+
const ptr1 = passStringToWasm0(key, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
532
|
+
const len1 = WASM_VECTOR_LEN;
|
533
|
+
var ptr2 = isLikeNone(entropy_seed) ? 0 : passArray8ToWasm0(entropy_seed, wasm$1.__wbindgen_malloc);
|
534
|
+
var len2 = WASM_VECTOR_LEN;
|
535
|
+
const ret = wasm$1.corecrypto_deferred_init(ptr0, len0, ptr1, len1, ptr2, len2);
|
536
|
+
return takeObject(ret);
|
537
|
+
}
|
538
|
+
/**
|
539
|
+
* see [core_crypto::MlsCentral::mls_init]
|
540
|
+
* @param {string} client_id
|
541
|
+
* @returns {Promise<Promise<any>>}
|
542
|
+
*/
|
543
|
+
mls_init(client_id) {
|
544
|
+
const ptr0 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
545
|
+
const len0 = WASM_VECTOR_LEN;
|
546
|
+
const ret = wasm$1.corecrypto_mls_init(this.ptr, ptr0, len0);
|
547
|
+
return takeObject(ret);
|
548
|
+
}
|
549
|
+
/**
|
522
550
|
* Returns: [`WasmCryptoResult<()>`]
|
523
551
|
*
|
524
552
|
* see [core_crypto::MlsCentral::close]
|
@@ -1085,6 +1113,32 @@ class CoreCrypto$1 {
|
|
1085
1113
|
return takeObject(ret);
|
1086
1114
|
}
|
1087
1115
|
/**
|
1116
|
+
* Returns: [`WasmCryptoResult<String>`]
|
1117
|
+
*
|
1118
|
+
* see [core_crypto::proteus::ProteusCentral::fingerprint_local]
|
1119
|
+
* @param {string} session_id
|
1120
|
+
* @returns {Promise<string>}
|
1121
|
+
*/
|
1122
|
+
proteus_fingerprint_local(session_id) {
|
1123
|
+
const ptr0 = passStringToWasm0(session_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1124
|
+
const len0 = WASM_VECTOR_LEN;
|
1125
|
+
const ret = wasm$1.corecrypto_proteus_fingerprint_local(this.ptr, ptr0, len0);
|
1126
|
+
return takeObject(ret);
|
1127
|
+
}
|
1128
|
+
/**
|
1129
|
+
* Returns: [`WasmCryptoResult<String>`]
|
1130
|
+
*
|
1131
|
+
* see [core_crypto::proteus::ProteusCentral::fingerprint_remote]
|
1132
|
+
* @param {string} session_id
|
1133
|
+
* @returns {Promise<string>}
|
1134
|
+
*/
|
1135
|
+
proteus_fingerprint_remote(session_id) {
|
1136
|
+
const ptr0 = passStringToWasm0(session_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
1137
|
+
const len0 = WASM_VECTOR_LEN;
|
1138
|
+
const ret = wasm$1.corecrypto_proteus_fingerprint_remote(this.ptr, ptr0, len0);
|
1139
|
+
return takeObject(ret);
|
1140
|
+
}
|
1141
|
+
/**
|
1088
1142
|
* Returns: [`WasmCryptoResult<()>`]
|
1089
1143
|
*
|
1090
1144
|
* see [core_crypto::proteus::ProteusCentral::cryptobox_migrate]
|
@@ -1443,6 +1497,9 @@ async function load(module, imports) {
|
|
1443
1497
|
function getImports() {
|
1444
1498
|
const imports = {};
|
1445
1499
|
imports.wbg = {};
|
1500
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
1501
|
+
takeObject(arg0);
|
1502
|
+
};
|
1446
1503
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
1447
1504
|
const ret = getObject(arg0);
|
1448
1505
|
return addHeapObject(ret);
|
@@ -1452,9 +1509,6 @@ function getImports() {
|
|
1452
1509
|
const ret = typeof(val) === 'object' && val !== null;
|
1453
1510
|
return ret;
|
1454
1511
|
};
|
1455
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
1456
|
-
takeObject(arg0);
|
1457
|
-
};
|
1458
1512
|
imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
|
1459
1513
|
const ret = getObject(arg0)[getObject(arg1)];
|
1460
1514
|
return addHeapObject(ret);
|
@@ -1586,30 +1640,22 @@ function getImports() {
|
|
1586
1640
|
const ret = getObject(arg0)[arg1 >>> 0];
|
1587
1641
|
return addHeapObject(ret);
|
1588
1642
|
};
|
1589
|
-
imports.wbg.
|
1590
|
-
const ret =
|
1643
|
+
imports.wbg.__wbg_corecrypto_new = function(arg0) {
|
1644
|
+
const ret = CoreCrypto$1.__wrap(arg0);
|
1591
1645
|
return addHeapObject(ret);
|
1592
1646
|
};
|
1593
1647
|
imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
|
1594
1648
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
1595
1649
|
return addHeapObject(ret);
|
1596
1650
|
}, arguments) };
|
1597
|
-
imports.wbg.
|
1598
|
-
const ret =
|
1651
|
+
imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
|
1652
|
+
const ret = new Uint8Array(getObject(arg0));
|
1599
1653
|
return addHeapObject(ret);
|
1600
1654
|
};
|
1601
1655
|
imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
|
1602
1656
|
const ret = getObject(arg0).push(getObject(arg1));
|
1603
1657
|
return ret;
|
1604
1658
|
};
|
1605
|
-
imports.wbg.__wbg_call_3999bee59e9f7719 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
1606
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
1607
|
-
return addHeapObject(ret);
|
1608
|
-
}, arguments) };
|
1609
|
-
imports.wbg.__wbg_call_e1f72c051cdab859 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
1610
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
1611
|
-
return addHeapObject(ret);
|
1612
|
-
}, arguments) };
|
1613
1659
|
imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
|
1614
1660
|
try {
|
1615
1661
|
var state0 = {a: arg0, b: arg1};
|
@@ -1617,7 +1663,7 @@ function getImports() {
|
|
1617
1663
|
const a = state0.a;
|
1618
1664
|
state0.a = 0;
|
1619
1665
|
try {
|
1620
|
-
return
|
1666
|
+
return __wbg_adapter_217(a, state0.b, arg0, arg1);
|
1621
1667
|
} finally {
|
1622
1668
|
state0.a = a;
|
1623
1669
|
}
|
@@ -1628,6 +1674,14 @@ function getImports() {
|
|
1628
1674
|
state0.a = state0.b = 0;
|
1629
1675
|
}
|
1630
1676
|
};
|
1677
|
+
imports.wbg.__wbg_call_3999bee59e9f7719 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
1678
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
1679
|
+
return addHeapObject(ret);
|
1680
|
+
}, arguments) };
|
1681
|
+
imports.wbg.__wbg_call_e1f72c051cdab859 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
1682
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
1683
|
+
return addHeapObject(ret);
|
1684
|
+
}, arguments) };
|
1631
1685
|
imports.wbg.__wbg_reject_72477563edad55b7 = function(arg0) {
|
1632
1686
|
const ret = Promise.reject(getObject(arg0));
|
1633
1687
|
return addHeapObject(ret);
|
@@ -1687,32 +1741,9 @@ function getImports() {
|
|
1687
1741
|
const ret = false;
|
1688
1742
|
return ret;
|
1689
1743
|
};
|
1690
|
-
imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
|
1691
|
-
const ret = getObject(arg0).get(getObject(arg1));
|
1692
|
-
return addHeapObject(ret);
|
1693
|
-
}, arguments) };
|
1694
|
-
imports.wbg.__wbg_openCursor_e036069f0e326708 = function() { return handleError(function (arg0, arg1) {
|
1695
|
-
const ret = getObject(arg0).openCursor(getObject(arg1));
|
1696
|
-
return addHeapObject(ret);
|
1697
|
-
}, arguments) };
|
1698
|
-
imports.wbg.__wbg_openCursor_f055654a98eeab7f = function() { return handleError(function (arg0) {
|
1699
|
-
const ret = getObject(arg0).openCursor();
|
1700
|
-
return addHeapObject(ret);
|
1701
|
-
}, arguments) };
|
1702
1744
|
imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
|
1703
1745
|
getObject(arg0).onsuccess = getObject(arg1);
|
1704
1746
|
};
|
1705
|
-
imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
|
1706
|
-
const ret = getObject(arg0).delete(getObject(arg1));
|
1707
|
-
return addHeapObject(ret);
|
1708
|
-
}, arguments) };
|
1709
|
-
imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
|
1710
|
-
const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
|
1711
|
-
return addHeapObject(ret);
|
1712
|
-
}, arguments) };
|
1713
|
-
imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
|
1714
|
-
getObject(arg0).close();
|
1715
|
-
};
|
1716
1747
|
imports.wbg.__wbg_setonerror_d5771cc5bf9ea74c = function(arg0, arg1) {
|
1717
1748
|
getObject(arg0).onerror = getObject(arg1);
|
1718
1749
|
};
|
@@ -1724,17 +1755,30 @@ function getImports() {
|
|
1724
1755
|
const ret = getObject(arg0).put(getObject(arg1));
|
1725
1756
|
return addHeapObject(ret);
|
1726
1757
|
}, arguments) };
|
1727
|
-
imports.wbg.
|
1728
|
-
const ret = getObject(arg0).
|
1758
|
+
imports.wbg.__wbg_openCursor_e036069f0e326708 = function() { return handleError(function (arg0, arg1) {
|
1759
|
+
const ret = getObject(arg0).openCursor(getObject(arg1));
|
1729
1760
|
return addHeapObject(ret);
|
1730
1761
|
}, arguments) };
|
1731
|
-
imports.wbg.
|
1732
|
-
const ret = getObject(arg0).
|
1762
|
+
imports.wbg.__wbg_openCursor_f055654a98eeab7f = function() { return handleError(function (arg0) {
|
1763
|
+
const ret = getObject(arg0).openCursor();
|
1764
|
+
return addHeapObject(ret);
|
1765
|
+
}, arguments) };
|
1766
|
+
imports.wbg.__wbg_count_b0e88953a0ea909c = function() { return handleError(function (arg0) {
|
1767
|
+
const ret = getObject(arg0).count();
|
1768
|
+
return addHeapObject(ret);
|
1769
|
+
}, arguments) };
|
1770
|
+
imports.wbg.__wbg_count_46eda68a16dbe30e = function() { return handleError(function (arg0, arg1) {
|
1771
|
+
const ret = getObject(arg0).count(getObject(arg1));
|
1772
|
+
return addHeapObject(ret);
|
1773
|
+
}, arguments) };
|
1774
|
+
imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
|
1775
|
+
const ret = getObject(arg0).delete(getObject(arg1));
|
1776
|
+
return addHeapObject(ret);
|
1777
|
+
}, arguments) };
|
1778
|
+
imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
|
1779
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
1733
1780
|
return addHeapObject(ret);
|
1734
1781
|
}, arguments) };
|
1735
|
-
imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
|
1736
|
-
getObject(arg0).onupgradeneeded = getObject(arg1);
|
1737
|
-
};
|
1738
1782
|
imports.wbg.__wbg_index_86861edf1478f49c = function() { return handleError(function (arg0, arg1, arg2) {
|
1739
1783
|
const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
|
1740
1784
|
return addHeapObject(ret);
|
@@ -1755,14 +1799,24 @@ function getImports() {
|
|
1755
1799
|
const ret = getObject(arg0).openCursor(getObject(arg1));
|
1756
1800
|
return addHeapObject(ret);
|
1757
1801
|
}, arguments) };
|
1758
|
-
imports.wbg.
|
1759
|
-
const ret = getObject(arg0).
|
1802
|
+
imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
|
1803
|
+
const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
|
1760
1804
|
return addHeapObject(ret);
|
1761
1805
|
}, arguments) };
|
1762
|
-
imports.wbg.
|
1763
|
-
|
1806
|
+
imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
|
1807
|
+
getObject(arg0).close();
|
1808
|
+
};
|
1809
|
+
imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
|
1810
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
|
1764
1811
|
return addHeapObject(ret);
|
1765
1812
|
}, arguments) };
|
1813
|
+
imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
1814
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
1815
|
+
return addHeapObject(ret);
|
1816
|
+
}, arguments) };
|
1817
|
+
imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
|
1818
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
1819
|
+
};
|
1766
1820
|
imports.wbg.__wbg_randomFillSync_6894564c2c334c42 = function() { return handleError(function (arg0, arg1, arg2) {
|
1767
1821
|
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
1768
1822
|
}, arguments) };
|
@@ -2010,11 +2064,11 @@ function getImports() {
|
|
2010
2064
|
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
2011
2065
|
return addHeapObject(ret);
|
2012
2066
|
}, arguments) };
|
2013
|
-
imports.wbg.
|
2067
|
+
imports.wbg.__wbindgen_closure_wrapper2358 = function(arg0, arg1, arg2) {
|
2014
2068
|
const ret = makeMutClosure(arg0, arg1, 123, __wbg_adapter_52);
|
2015
2069
|
return addHeapObject(ret);
|
2016
2070
|
};
|
2017
|
-
imports.wbg.
|
2071
|
+
imports.wbg.__wbindgen_closure_wrapper3780 = function(arg0, arg1, arg2) {
|
2018
2072
|
const ret = makeMutClosure(arg0, arg1, 123, __wbg_adapter_55);
|
2019
2073
|
return addHeapObject(ret);
|
2020
2074
|
};
|
@@ -2083,7 +2137,7 @@ var exports = /*#__PURE__*/Object.freeze({
|
|
2083
2137
|
var wasm = async (opt = {}) => {
|
2084
2138
|
let {importHook, serverPath} = opt;
|
2085
2139
|
|
2086
|
-
let path = "assets/core_crypto_ffi-
|
2140
|
+
let path = "assets/core_crypto_ffi-bf5877ee.wasm";
|
2087
2141
|
|
2088
2142
|
if (serverPath != null) {
|
2089
2143
|
path = serverPath + /[^\/\\]*$/.exec(path)[0];
|
@@ -2252,6 +2306,29 @@ class CoreCrypto {
|
|
2252
2306
|
const cc = await __classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto._internal_new(databaseName, key, clientId, entropySeed);
|
2253
2307
|
return new this(cc);
|
2254
2308
|
}
|
2309
|
+
/**
|
2310
|
+
* Almost identical to {@link CoreCrypto.init} but allows a 2 phase initialization of MLS.
|
2311
|
+
* First, calling this will set up the keystore and will allow generating proteus prekeys.
|
2312
|
+
* Then, those keys can be traded for a clientId.
|
2313
|
+
* Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
|
2314
|
+
*/
|
2315
|
+
static async deferredInit(databaseName, key, entropySeed, wasmFilePath) {
|
2316
|
+
if (!__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module)) {
|
2317
|
+
const wasmImportArgs = wasmFilePath ? { importHook: () => wasmFilePath } : undefined;
|
2318
|
+
const exports = (await wasm(wasmImportArgs));
|
2319
|
+
__classPrivateFieldSet(this, _a, exports, "f", _CoreCrypto_module);
|
2320
|
+
}
|
2321
|
+
const cc = await __classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.deferred_init(databaseName, key, entropySeed);
|
2322
|
+
return new this(cc);
|
2323
|
+
}
|
2324
|
+
/**
|
2325
|
+
* Use this after {@link CoreCrypto.deferredInit} when you have a clientId. It initializes MLS.
|
2326
|
+
*
|
2327
|
+
* @param clientId - {@link CoreCryptoParams#clientId} but required
|
2328
|
+
*/
|
2329
|
+
async mlsInit(clientId) {
|
2330
|
+
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").mls_init(clientId);
|
2331
|
+
}
|
2255
2332
|
/**
|
2256
2333
|
* Wipes the {@link CoreCrypto} backing storage (i.e. {@link https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API | IndexedDB} database)
|
2257
2334
|
*
|
@@ -2786,6 +2863,22 @@ class CoreCrypto {
|
|
2786
2863
|
async proteusFingerprint() {
|
2787
2864
|
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint();
|
2788
2865
|
}
|
2866
|
+
/**
|
2867
|
+
* Proteus session local fingerprint
|
2868
|
+
*
|
2869
|
+
* @returns Hex-encoded public key string
|
2870
|
+
*/
|
2871
|
+
async proteusFingerprintLocal(sessionId) {
|
2872
|
+
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint_local(sessionId);
|
2873
|
+
}
|
2874
|
+
/**
|
2875
|
+
* Proteus session remote fingerprint
|
2876
|
+
*
|
2877
|
+
* @returns Hex-encoded public key string
|
2878
|
+
*/
|
2879
|
+
async proteusFingerprintRemote(sessionId) {
|
2880
|
+
return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_fingerprint_remote(sessionId);
|
2881
|
+
}
|
2789
2882
|
/**
|
2790
2883
|
* Imports all the data stored by Cryptobox into the CoreCrypto keystore
|
2791
2884
|
*
|
Binary file
|