@wireapp/core-crypto 7.0.2 → 8.0.0

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": "7.0.2",
3
+ "version": "8.0.0",
4
4
  "author": "Wire CoreCrypto team <team.corecrypto@wire.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,23 +9,23 @@
9
9
  "main": "src/CoreCrypto.ts",
10
10
  "module": "src/corecrypto.js",
11
11
  "devDependencies": {
12
- "@types/bun": "^1.2.9",
12
+ "@types/bun": "^1.2.18",
13
13
  "@types/mocha": "^10.0.10",
14
- "@wdio/browser-runner": "^9.12.1",
15
- "@wdio/cli": "^9.12.1",
16
- "@wdio/logger": "^9.4.4",
17
- "@wdio/mocha-framework": "^9.12.1",
18
- "@wdio/spec-reporter": "^9.11.0",
19
- "@wdio/static-server-service": "^9.10.1",
14
+ "@wdio/browser-runner": "^9.17.0",
15
+ "@wdio/cli": "^9.17.1",
16
+ "@wdio/logger": "^9.16.2",
17
+ "@wdio/mocha-framework": "^9.17.0",
18
+ "@wdio/spec-reporter": "^9.17.0",
19
+ "@wdio/static-server-service": "^9.16.2",
20
20
  "dts-bundle-generator": "^9.5.1",
21
- "eslint": "^9.23.0",
22
- "eslint-config-prettier": "^10.1.1",
23
- "eslint-plugin-prettier": "^5.2.5",
24
- "eslint-plugin-wdio": "^9.9.1",
25
- "prettier": "^3.5.3",
21
+ "eslint": "^9.30.1",
22
+ "eslint-config-prettier": "^10.1.5",
23
+ "eslint-plugin-prettier": "^5.5.1",
24
+ "eslint-plugin-wdio": "^9.16.2",
25
+ "prettier": "^3.6.2",
26
26
  "ts-loader": "^9.5.2",
27
- "typescript": "^5.8.2",
28
- "typescript-eslint": "^8.28.0"
27
+ "typescript": "^5.8.3",
28
+ "typescript-eslint": "^8.36.0"
29
29
  },
30
30
  "bugs": {
31
31
  "url": "https://github.com/wireapp/core-crypto/issues"
@@ -34,8 +34,8 @@
34
34
  "files": [
35
35
  "src/corecrypto.js",
36
36
  "src/corecrypto.d.ts",
37
- "src/core-crypto-ffi_bg.wasm",
38
- "src/core-crypto-ffi_bg.wasm.d.ts"
37
+ "src/autogenerated/core-crypto-ffi_bg.wasm",
38
+ "src/autogenerated/core-crypto-ffi_bg.wasm.d.ts"
39
39
  ],
40
40
  "homepage": "https://github.com/wireapp/core-crypto",
41
41
  "keywords": [
@@ -0,0 +1,116 @@
1
+ // Wire
2
+ // Copyright (C) 2022 Wire Swiss GmbH
3
+
4
+ // This program is free software: you can redistribute it and/or modify
5
+ // it under the terms of the GNU General Public License as published by
6
+ // the Free Software Foundation, either version 3 of the License, or
7
+ // (at your option) any later version.
8
+
9
+ // This program is distributed in the hope that it will be useful,
10
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ // GNU General Public License for more details.
13
+
14
+ // You should have received a copy of the GNU General Public License
15
+ // along with this program. If not, see http://www.gnu.org/licenses/.
16
+
17
+ export type { ConversationConfiguration } from "./ConversationConfiguration";
18
+ export { CoreCryptoError, type CoreCryptoRichError } from "./CoreCryptoError";
19
+
20
+ export { CoreCryptoContext } from "./CoreCryptoContext";
21
+
22
+ export {
23
+ BuildMetadata,
24
+ WireIdentity,
25
+ X509Identity,
26
+ setLogger,
27
+ CoreCryptoLogLevel,
28
+ setMaxLogLevel,
29
+ buildMetadata,
30
+ version,
31
+ CoreCrypto,
32
+ } from "./CoreCryptoInstance";
33
+ export type {
34
+ CoreCryptoDeferredParams,
35
+ CoreCryptoParams,
36
+ CoreCryptoLogger,
37
+ EpochObserver,
38
+ HistoryObserver,
39
+ } from "./CoreCryptoInstance";
40
+
41
+ export {
42
+ CredentialType,
43
+ WirePolicy,
44
+ GroupInfoEncryptionType,
45
+ RatchetTreeType,
46
+ DeviceStatus,
47
+ WelcomeBundle,
48
+ } from "./CoreCryptoMLS";
49
+ export type {
50
+ ProposalRef,
51
+ MlsTransportResponse,
52
+ MlsTransport,
53
+ GroupInfoBundle,
54
+ BufferedDecryptedMessage,
55
+ CommitBundle,
56
+ DecryptedMessage,
57
+ HistorySecret,
58
+ } from "./CoreCryptoMLS";
59
+
60
+ export { E2eiEnrollment, E2eiConversationState } from "./CoreCryptoE2EI";
61
+ export type {
62
+ CRLRegistration,
63
+ AcmeDirectory,
64
+ NewCrlDistributionPoints,
65
+ JsonRawData,
66
+ } from "./CoreCryptoE2EI";
67
+
68
+ export type { ProteusAutoPrekeyBundle } from "./CoreCryptoProteus";
69
+
70
+ export {
71
+ AcmeChallenge,
72
+ Ciphersuite,
73
+ ciphersuiteFromU16,
74
+ ciphersuiteDefault,
75
+ ClientId,
76
+ CustomConfiguration,
77
+ DatabaseKey,
78
+ MlsTransportData,
79
+ migrateDatabaseKeyTypeToBytes,
80
+ updateDatabaseKey,
81
+ NewAcmeAuthz,
82
+ NewAcmeOrder,
83
+ ExternalSenderKey,
84
+ GroupInfo,
85
+ ConversationId,
86
+ Welcome,
87
+ SecretKey,
88
+ } from "./autogenerated/core-crypto-ffi";
89
+ import initWasm from "./autogenerated/core-crypto-ffi";
90
+
91
+ /**
92
+ * Initialises the wasm module necessary for running core crypto.
93
+ *
94
+ * @param location path where the wasm module is located. If omitted the module is assumed be located at the root of the core crypto module.
95
+ */
96
+ export async function initWasmModule(location: string | undefined = undefined) {
97
+ if (typeof window !== "undefined") {
98
+ if (typeof location === "string") {
99
+ const path = `${location}core-crypto-ffi_bg.wasm`;
100
+ await initWasm({ module_or_path: path });
101
+ } else {
102
+ await initWasm({});
103
+ }
104
+ } else {
105
+ // non-browser context, load WASM module from file
106
+ const fs = await import("fs/promises");
107
+ const path = new URL(
108
+ `${location}core-crypto-ffi_bg.wasm`,
109
+ import.meta.url
110
+ );
111
+ const file = await fs.open(path);
112
+ const buffer = await file.readFile();
113
+ const module = new WebAssembly.Module(buffer);
114
+ await initWasm({ module_or_path: module });
115
+ }
116
+ }