Skip to content

Commit

Permalink
Pre-Release v0.6.0 + proteus support (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Augusto César Dias authored Oct 21, 2022
1 parent 1981230 commit c82161a
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 21 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ Platform support legends:
* Note: the papercuts will majorly be with the build process. Things might be very rough to integrate as no polish at all has been given yet.
* ❌ = tier 3 support. It doesn't work just yet, but we plan to make it work.

## [0.6.0-pre.2] - 2022-10.21

<details>
<summary>git-conventional changelog</summary>

</details>

* Enable proteus support

## [0.6.0-pre.1] - 2022-10.21

<details>
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ Platform support legends:
* Note: the papercuts will majorly be with the build process. Things might be very rough to integrate as no polish at all has been given yet.
* ❌ = tier 3 support. It doesn't work just yet, but we plan to make it work.

## [0.6.0-pre.2] - 2022-10.21

<details>
<summary>git-conventional changelog</summary>
{{git-cliff tag="v0.6.0-pre.2" unreleased=true}}
</details>

* Enable proteus support

## [0.6.0-pre.1] - 2022-10.21

<details>
<summary>git-conventional changelog</summary>
{{git-cliff tag="v0.6.0-pre.1" unreleased=true}}
{{git-cliff tag="v0.6.0-pre.1"}}
</details>

## [0.5.2] - 2022-27-09
Expand Down
2 changes: 1 addition & 1 deletion crypto-attributes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "core-crypto-attributes"
description = "Macros for core-crypto"
repository = "https://github.com/wireapp/core-crypto"
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
edition = "2021"
license = "GPL-3.0-only"

Expand Down
6 changes: 3 additions & 3 deletions crypto-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "core-crypto-ffi"
description = "Platform-specific bindings (Android, iOS, WASM) for CoreCrypto"
repository = "https://github.com/wireapp/core-crypto"
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
edition = "2021"
license = "GPL-3.0-only"
publish = false
Expand All @@ -12,13 +12,13 @@ name = "core_crypto_ffi"
crate-type = ["cdylib", "staticlib"]

[features]
default = []
default = ["proteus"]
proteus = ["core-crypto/proteus", "core-crypto/cryptobox-migrate"]
mobile = ["uniffi", "uniffi_macros", "uniffi_build", "uniffi_bindgen"]
# c-api = ["libc"] # FIXME: Disabled until it becomes compatible with the internal APIs again

[dependencies]
core-crypto = { version = "0.6.0-pre.1", path = "../crypto" }
core-crypto = { version = "0.6.0-pre.2", path = "../crypto" }
thiserror = "1.0"
cfg-if = "1.0"
futures-util = "0.3"
Expand Down
8 changes: 4 additions & 4 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "core-crypto"
description = "Abstraction over OpenMLS with persistent keystore"
repository = "https://github.com/wireapp/core-crypto"
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
edition = "2021"
license = "GPL-3.0-only"
publish = false
Expand All @@ -12,7 +12,7 @@ name = "core_crypto"
crate-type = ["lib", "cdylib"]

[features]
default = []
default = ["proteus", "cryptobox-migrate"]
proteus = [
"dep:proteus-wasm",
"core-crypto-keystore/proteus-keystore"
Expand Down Expand Up @@ -57,7 +57,7 @@ serde-wasm-bindgen = "0.4"
rexie = { version = "0.4", optional = true }

[dependencies.core-crypto-keystore]
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
path = "../keystore"

[dependencies.mls-crypto-provider]
Expand Down Expand Up @@ -90,7 +90,7 @@ version = "0.3"
features = ["async_futures", "html_reports"]

[dev-dependencies.core-crypto-attributes]
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
path = "../crypto-attributes"

[package.metadata.wasm-pack.profile.release]
Expand Down
2 changes: 1 addition & 1 deletion crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,6 @@ impl CoreCrypto {
///The client can then be initialized with [CoreCrypto::proteus_init]
pub async fn proteus_cryptobox_migrate(&self, path: &str) -> CryptoResult<()> {
let keystore = self.mls.mls_backend.borrow_keystore();
Ok(crate::proteus::ProteusCentral::cryptobox_migrate(keystore, path).await?)
crate::proteus::ProteusCentral::cryptobox_migrate(keystore, path).await
}
}
3 changes: 1 addition & 2 deletions crypto/src/proteus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ impl ProteusCentral {
let sk = identity.sk_raw();
let pk = identity.pk_raw();
// SAFETY: Byte lengths are ensured at the keystore level so this function is safe to call, despite being cursed
let kp = unsafe { IdentityKeyPair::from_raw_key_pair(*sk, *pk) };

kp
unsafe { IdentityKeyPair::from_raw_key_pair(*sk, *pk) }
} else {
Self::create_identity(keystore).await?
};
Expand Down
2 changes: 1 addition & 1 deletion interop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "interop"
version = "0.2.0-pre.1"
version = "0.2.0-pre.2"
edition = "2021"
license = "GPL-3.0-only"

Expand Down
2 changes: 1 addition & 1 deletion keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "core-crypto-keystore"
description = "Encrypted keystore with support for OpenMLS and Proteus"
repository = "https://github.com/wireapp/core-crypto"
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
edition = "2021"
license = "GPL-3.0-only"
publish = false
Expand Down
4 changes: 2 additions & 2 deletions keystore/benches/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ fn benchmark_reads_proteus(c: &mut Criterion) {
#[cfg(feature = "memory-cache")]
store_uncached.cache(false);

let prekey_id = proteus::keys::PreKeyId::new(28273);
let prekey = proteus::keys::PreKey::new(prekey_id);
let prekey_id = proteus_wasm::keys::PreKeyId::new(28273);
let prekey = proteus_wasm::keys::PreKey::new(prekey_id);

use core_crypto_keystore::CryptoKeystoreProteus as _;
let prekey_id_value = prekey_id.value();
Expand Down
7 changes: 5 additions & 2 deletions keystore/benches/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use mls_crypto_provider::MlsCryptoProvider;
#[cfg(feature = "proteus-keystore")]
fn benchmark_writes_proteus(c: &mut Criterion) {
use core_crypto_keystore::CryptoKeystoreProteus as _;
use proteus::keys::{PreKey, PreKeyId};
use proteus_wasm::keys::{PreKey, PreKeyId};
use rand::Rng as _;

let store = block_on(async { CryptoKeystore::open_with_key("bench_write", "key").await.unwrap() });
Expand All @@ -47,7 +47,10 @@ fn benchmark_writes_proteus(c: &mut Criterion) {
let pk = PreKey::new(PreKeyId::new(u16::from_le_bytes(prng.gen())));
(pk.key_id.value(), pk.serialise().unwrap())
},
|(pk_id, pk_ser)| async move { black_box(store.proteus_store_prekey(pk_id, &pk_ser).await.unwrap()) },
|(pk_id, pk_ser)| async move {
store.proteus_store_prekey(pk_id, &pk_ser).await.unwrap();
black_box(())
},
BatchSize::SmallInput,
)
});
Expand Down
4 changes: 2 additions & 2 deletions mls-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "mls-crypto-provider"
description = "MLS Crypto Provider wrapping core-crypto-keystore"
repository = "https://github.com/wireapp/core-crypto"
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
edition = "2018"
license = "GPL-3.0-only"
publish = false
Expand Down Expand Up @@ -38,7 +38,7 @@ zeroize = "1.5"
thiserror = "1.0"

[dependencies.core-crypto-keystore]
version = "0.6.0-pre.1"
version = "0.6.0-pre.2"
path = "../keystore"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wireapp/core-crypto",
"version": "0.6.0-pre.1",
"version": "0.6.0-pre.2",
"description": "CoreCrypto bindings for the Web",
"type": "module",
"module": "platforms/web/corecrypto.js",
Expand Down

0 comments on commit c82161a

Please sign in to comment.