Skip to content

Latest commit

 

History

History
129 lines (84 loc) · 4.06 KB

README.md

File metadata and controls

129 lines (84 loc) · 4.06 KB

Wire CoreCrypto

Wire logo

This repository is part of the source code of Wire. You can find more information at wire.com or by contacting [email protected].

You can find the published source code at github.com/wireapp/wire.

For licensing information, see the attached LICENSE file and the list of third-party licenses at wire.com/legal/licenses/.

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.

Parts

  • CoreCrypto: Abstracts MLS & Proteus in a unified API
  • CoreCryptoFFI: FFI bindings for iOS, Android and WASM
  • Keystore: Encrypted Keystore powered by SQLCipher on all platforms except WASM. WASM uses an IndexedDB-backed, encrypted store with AES256-GCM
  • MlsProvider: RustCrypto + Keystore MLS provider

See ARCHITECTURE.md

Usage

Building

General Requirements

Android

Install Android SDK and Build-Tools for API level 30+

NOTE: If you are building on macOS you'll need to setup $ANDROID_SDK_ROOT path variable manually:

export ANDROID_SDK_ROOT=~/Android/Sdk

Install android rust targets

rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android

iOS

Install Xcode & it's commandline tools: https://developer.apple.com/xcode/

Install iOS rust targets

rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim

MacOS

Install macOS rust targets

rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin

Linux

If cross-compiling from macOS you'll need install: https://github.com/messense/homebrew-macos-cross-toolchains

Install linux targets

rustup target add x86_64-unknown-linux-gnu

WASM

  • Install wasm-pack
  • Install the wasm32-unknown-unknown toolchain rustup target add wasm32-unknown-unknown
  • Install node.js (recommended way is via Volta)
  • Install Bun (follow the instructions on Bun's website)

Bindings

Build bindings for Android, JVM, iOS and WASM

cd crypto-ffi 

# builds bindings and targets for the JVM (macOS / Linux)
cargo make "copy-jvm-resources"

# builds bindings and targets for Android
cargo make "copy-android-resources"

# builds iOS framework
cargo make "ios-create-xcframework"

# builds wasm binary & TS bindings
cargo make wasm

Publishing

Versioning

  • Run cargo xtask release bump [major|minor|patch|rc|pre]
  • Update the internal dependencies of the updated crates to use the new version
  • Update the version in the package.json
  • Update the version in the build.gradle.kts inside ./kotlin/android and ./kotlin/jvm

Changelog

  • Update <CHANGELOG.tpl> accordingly
  • Fetch the latest tags from the remote
  • run cargo xtask documentation changelog to update <CHANGELOG.md> with the git-conventional history

Android / JVM

You can publish the JVM and Android bindings to maven using gradle after you've built the corresponding target.

cd kotlin
./gradlew :jvm:publishToMavenLocal
./gradlew :android:publishToMavenLocal

JS / WASM

Given that you are logged in NPM and can publish to @wireapp/core-crypto, you can just npm publish to push a new version But this is not needed as releases are auto-published to the @wireapp organization