@wireapp/core-crypto 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # Wire CoreCrypto
2
+
3
+ [![Wire logo](https://github.com/wireapp/wire/blob/master/assets/header-small.png?raw=true)](https://wire.com/jobs/)
4
+
5
+ This repository is part of the source code of Wire. You can find more information at [wire.com](https://wire.com) or by contacting opensource@wire.com.
6
+
7
+ You can find the published source code at [github.com/wireapp/wire](https://github.com/wireapp/wire).
8
+
9
+ For licensing information, see the attached LICENSE file and the list of third-party licenses at [wire.com/legal/licenses/](https://wire.com/legal/licenses/).
10
+
11
+ No license is granted to the Wire trademark and its associated logos, all of which will continue to be owned exclusively by Wire Swiss GmbH. Any use of the Wire trademark and/or its associated logos is expressly prohibited without the express prior written consent of Wire Swiss GmbH.
12
+
13
+ ## Parts
14
+
15
+ * CoreCrypto: Abstracts MLS & Proteus in a unified API
16
+ * CoreCryptoFFI: FFI bindings for iOS, Android and WASM
17
+ * Keystore: Encrypted Keystore powered by SQLCipher on all platforms except WASM. WASM uses an IndexedDB-backed, encrypted store with AES256-GCM
18
+ * MlsProvider: RustCrypto + Keystore MLS provider
19
+
20
+ See [ARCHITECTURE.md](docs/ARCHITECTURE.md)
21
+
22
+ ## Usage
23
+
24
+ ### [API Docs](https://wireapp.github.io/core-crypto/core_crypto/)
25
+
26
+ ## Building
27
+
28
+ ### General Requirements
29
+
30
+ - rust: [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install)
31
+ - cargo-make: [https://sagiegurari.github.io/cargo-make/](https://sagiegurari.github.io/cargo-make/)
32
+
33
+ ### Android
34
+
35
+ Install Android SDK and Build-Tools for API level 30+
36
+
37
+ NOTE: If you are building on macOS you'll need to setup $ANDROID_SDK_ROOT path variable manually:
38
+ ```ignore
39
+ export ANDROID_SDK_ROOT=~/Android/Sdk
40
+ ```
41
+ Install android rust targets
42
+ ```ignore
43
+ rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android
44
+ ```
45
+
46
+ ### iOS
47
+
48
+ Install Xcode & it's commandline tools: [https://developer.apple.com/xcode/](https://developer.apple.com/xcode/)
49
+
50
+ Install iOS rust targets
51
+
52
+ ```ignore
53
+ rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
54
+ ```
55
+
56
+ ### MacOS
57
+
58
+ Install macOS rust targets (M1 macs are currently not supported)
59
+ ```ignore
60
+ rustup target add x86_64-apple-darwin
61
+ ```
62
+
63
+ ### Linux
64
+
65
+ If cross-compiling from macOS you'll need install: [https://github.com/messense/homebrew-macos-cross-toolchains](https://github.com/messense/homebrew-macos-cross-toolchains)
66
+
67
+ Install linux targets
68
+
69
+ ```ignore
70
+ rustup target add x86_64-unknown-linux-gnu
71
+ ```
72
+
73
+ ### WASM
74
+
75
+ * Install [wasm-pack](https://rustwasm.github.io/wasm-pack/)
76
+ * Install the wasm32-unknown-unknown toolchain `rustup target add wasm32-unknown-unknown`
77
+ * Install node.js (recommended way is via [Volta](https://volta.sh/))
78
+
79
+ ### Bindings
80
+
81
+ Build bindings for Android, JVM, iOS and WASM
82
+
83
+ ```ignore
84
+ cd crypto-ffi
85
+
86
+ # builds bindings and targets for the JVM (macOS / Linux)
87
+ cargo make "copy-jvm-resources"
88
+
89
+ # builds bindings and targets for Android
90
+ cargo make "copy-android-resources"
91
+
92
+ # builds iOS framework
93
+ cargo make "create-swift-package"
94
+
95
+ # builds wasm binary
96
+ cargo make wasm
97
+ ```
98
+
99
+ ## Publishing
100
+
101
+ ### Changelog
102
+
103
+ * Update <CHANGELOG.tpl> accordingly
104
+ * run `cargo xtask documentation changelog` to update <CHANGELOG.md> with the git-conventional history
105
+
106
+ ### Android / JVM
107
+
108
+ You can publish the JVM and Android bindings to maven using gradle after you'be build the corresponding target.
109
+
110
+ ```ignore
111
+ cd kotlin
112
+ ./gradlew :jvm:publishToMavenLocal
113
+ ./gradlew :android:publishToMavenLocal
114
+ ```
115
+
116
+ ### JS / WASM
117
+
118
+ Given that you are logged in NPM and can publish to `@wireapp/core-crypto`, you can just `npm publish` to push a new version
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@wireapp/core-crypto",
3
+ "version": "0.4.0",
4
+ "description": "CoreCrypto bindings for the Web - Dev version",
5
+ "type": "module",
6
+ "module": "platforms/web/corecrypto.js",
7
+ "types": "platforms/web/corecrypto.d.js",
8
+ "scripts": {
9
+ "prepare": "npm run build",
10
+ "build": "npm run clean && rollup -c crypto-ffi/bindings/js/rollup.config.js",
11
+ "build:test": "npm run clean && rollup -c crypto-ffi/bindings/js/rollup.config.test.js",
12
+ "clean": "rm -f ./platforms/web/*.{js,ts,wasm,html} && rm -rf ./platforms/web/assets",
13
+ "package": "npm run build && npm pack",
14
+ "test:raw": "jest -c crypto-ffi/bindings/js/jest.config.js --no-cache --runInBand --verbose",
15
+ "test": "npm run build:test && npm run test:raw",
16
+ "test:cov": "npm run build:test && jest -c crypto-ffi/bindings/js/jest.config.js --coverage --no-cache --runInBand --verbose"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "platforms/web"
23
+ ],
24
+ "keywords": [
25
+ "wire",
26
+ "e2ee",
27
+ "corecrypto",
28
+ "mls",
29
+ "proteus"
30
+ ],
31
+ "author": "Mathieu Amiot <amiot.mathieu@gmail.com>",
32
+ "license": "GPL-3.0",
33
+ "homepage": "https://github.com/wireapp/core-crypto",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git@github.com:wireapp/core-crypto.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/wireapp/core-crypto/issues"
40
+ },
41
+ "devDependencies": {
42
+ "@rollup/plugin-html": "^0.2.4",
43
+ "@types/jest": "^28.1.6",
44
+ "@types/jest-dev-server": "^5.0.0",
45
+ "@typescript-eslint/eslint-plugin": "^5.33.0",
46
+ "@typescript-eslint/parser": "^5.33.0",
47
+ "@wasm-tool/rollup-plugin-rust": "^2.2.2",
48
+ "dts-bundle-generator": "^6.12.0",
49
+ "eslint": "^8.21.0",
50
+ "eslint-config-prettier": "^8.5.0",
51
+ "eslint-plugin-prettier": "^4.2.1",
52
+ "jest": "^28.1.3",
53
+ "jest-dev-server": "^6.1.1",
54
+ "prettier": "^2.7.1",
55
+ "puppeteer": "^16.1.0",
56
+ "rollup": "^2.77.2",
57
+ "rollup-jest": "^3.0.0",
58
+ "rollup-plugin-ts": "^3.0.2",
59
+ "ts-jest": "^28.0.7",
60
+ "ts-loader": "^9.3.1",
61
+ "typescript": "^4.7.4"
62
+ }
63
+ }
File without changes