From 01e1db4ad6e36406fe899eef6e12a1be52e16301 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:38:39 +0000 Subject: [PATCH 01/10] Chore(deps): bump webpki from 0.22.0 to 0.22.2 Bumps [webpki](https://github.com/briansmith/webpki) from 0.22.0 to 0.22.2. - [Commits](https://github.com/briansmith/webpki/commits) --- updated-dependencies: - dependency-name: webpki dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d947e7f..48d6c47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4119,9 +4119,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "07ecc0cd7cac091bf682ec5efa18b1cff79d617b84181f38b3951dbe135f607f" dependencies = [ "ring", "untrusted", From 106c6db114790c002f77189c1d8f62ff87e234ba Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 13 Oct 2023 16:58:39 +0200 Subject: [PATCH 02/10] Upgrade minimum rust to 1.65 --- .circleci/config.yml | 10 +++++----- README.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53eb486..04019a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: name: Install rustup command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - run: - name: Install Rust 1.64 - command: rustup install 1.64.0 && rustup default 1.64.0 + name: Install Rust 1.65 + command: rustup install 1.65.0 && rustup default 1.65.0 - run: name: Install iOS targets command: rustup target add aarch64-apple-ios x86_64-apple-ios @@ -37,7 +37,7 @@ jobs: test: docker: - - image: cimg/rust:1.64.0 + - image: cimg/rust:1.65.0 resource_class: large steps: - checkout @@ -66,7 +66,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.64.0 + - image: cimg/rust:1.65.0 steps: - checkout - run: @@ -78,7 +78,7 @@ jobs: cross-android: docker: - - image: cimg/rust:1.64.0 + - image: cimg/rust:1.65.0 working_directory: ~/work steps: - checkout diff --git a/README.md b/README.md index 5e5e86d..84eb113 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Build with `cargo build (--release)`. Test with `cargo test`. All crates require Rust 2021 edition and are tested on the following channels: -- `1.64.0` +- `1.65.0` If you do not have Rust installed, run: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` ## Android and iOS -The library compiles to Android and iOS. This has been tested with Rust v1.64.0. +The library compiles to Android and iOS. This has been tested with Rust v1.65.0. To compile to Android: From feca8fd2e03bd64f009c4756b25ac77add8969a3 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 13 Oct 2023 16:58:57 +0200 Subject: [PATCH 03/10] Use resolver v2 in workspace --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index ae21197..b210e80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "crates/dkg-cli", From 4a1ae85dbcca6fc4a894431979ef3ccec02a4ae2 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 13 Oct 2023 17:06:03 +0200 Subject: [PATCH 04/10] test --- .circleci/config.yml | 10 +++++----- README.md | 4 ++-- crates/dkg-cli/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 04019a5..4301c78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: name: Install rustup command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - run: - name: Install Rust 1.65 - command: rustup install 1.65.0 && rustup default 1.65.0 + name: Install Rust 1.67 + command: rustup install 1.67.0 && rustup default 1.67.0 - run: name: Install iOS targets command: rustup target add aarch64-apple-ios x86_64-apple-ios @@ -37,7 +37,7 @@ jobs: test: docker: - - image: cimg/rust:1.65.0 + - image: cimg/rust:1.67.0 resource_class: large steps: - checkout @@ -66,7 +66,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.65.0 + - image: cimg/rust:1.67.0 steps: - checkout - run: @@ -78,7 +78,7 @@ jobs: cross-android: docker: - - image: cimg/rust:1.65.0 + - image: cimg/rust:1.67.0 working_directory: ~/work steps: - checkout diff --git a/README.md b/README.md index 84eb113..120b773 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Build with `cargo build (--release)`. Test with `cargo test`. All crates require Rust 2021 edition and are tested on the following channels: -- `1.65.0` +- `1.67.0` If you do not have Rust installed, run: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` ## Android and iOS -The library compiles to Android and iOS. This has been tested with Rust v1.65.0. +The library compiles to Android and iOS. This has been tested with Rust v1.67.0. To compile to Android: diff --git a/crates/dkg-cli/Dockerfile b/crates/dkg-cli/Dockerfile index a693c3e..913dc46 100644 --- a/crates/dkg-cli/Dockerfile +++ b/crates/dkg-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM cimg/rust:1.65.0 +FROM cimg/rust:1.67.0 ENV HOME=/home/circleci ENV PATH=$HOME/bin:$PATH From 5850b54c39c8d835eacd8f70b436d68762297a51 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 13 Oct 2023 17:08:54 +0200 Subject: [PATCH 05/10] 1.68 --- .circleci/config.yml | 10 +++++----- README.md | 4 ++-- crates/dkg-cli/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4301c78..b877236 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: name: Install rustup command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - run: - name: Install Rust 1.67 - command: rustup install 1.67.0 && rustup default 1.67.0 + name: Install Rust 1.68 + command: rustup install 1.68.0 && rustup default 1.68.0 - run: name: Install iOS targets command: rustup target add aarch64-apple-ios x86_64-apple-ios @@ -37,7 +37,7 @@ jobs: test: docker: - - image: cimg/rust:1.67.0 + - image: cimg/rust:1.68.0 resource_class: large steps: - checkout @@ -66,7 +66,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.67.0 + - image: cimg/rust:1.68.0 steps: - checkout - run: @@ -78,7 +78,7 @@ jobs: cross-android: docker: - - image: cimg/rust:1.67.0 + - image: cimg/rust:1.68.0 working_directory: ~/work steps: - checkout diff --git a/README.md b/README.md index 120b773..b3712c5 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Build with `cargo build (--release)`. Test with `cargo test`. All crates require Rust 2021 edition and are tested on the following channels: -- `1.67.0` +- `1.68.0` If you do not have Rust installed, run: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` ## Android and iOS -The library compiles to Android and iOS. This has been tested with Rust v1.67.0. +The library compiles to Android and iOS. This has been tested with Rust v1.68.0. To compile to Android: diff --git a/crates/dkg-cli/Dockerfile b/crates/dkg-cli/Dockerfile index 913dc46..60149ea 100644 --- a/crates/dkg-cli/Dockerfile +++ b/crates/dkg-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM cimg/rust:1.67.0 +FROM cimg/rust:1.68.0 ENV HOME=/home/circleci ENV PATH=$HOME/bin:$PATH From 67efdb78aac98b0a7f739ef3a3a33295c78d786c Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 13 Oct 2023 17:10:16 +0200 Subject: [PATCH 06/10] 1.70 --- .circleci/config.yml | 10 +++++----- README.md | 4 ++-- crates/dkg-cli/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b877236..1249db7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: name: Install rustup command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - run: - name: Install Rust 1.68 - command: rustup install 1.68.0 && rustup default 1.68.0 + name: Install Rust 1.70 + command: rustup install 1.70.0 && rustup default 1.70.0 - run: name: Install iOS targets command: rustup target add aarch64-apple-ios x86_64-apple-ios @@ -37,7 +37,7 @@ jobs: test: docker: - - image: cimg/rust:1.68.0 + - image: cimg/rust:1.70.0 resource_class: large steps: - checkout @@ -66,7 +66,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.68.0 + - image: cimg/rust:1.70.0 steps: - checkout - run: @@ -78,7 +78,7 @@ jobs: cross-android: docker: - - image: cimg/rust:1.68.0 + - image: cimg/rust:1.70.0 working_directory: ~/work steps: - checkout diff --git a/README.md b/README.md index b3712c5..fb38692 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Build with `cargo build (--release)`. Test with `cargo test`. All crates require Rust 2021 edition and are tested on the following channels: -- `1.68.0` +- `1.70.0` If you do not have Rust installed, run: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` ## Android and iOS -The library compiles to Android and iOS. This has been tested with Rust v1.68.0. +The library compiles to Android and iOS. This has been tested with Rust v1.70.0. To compile to Android: diff --git a/crates/dkg-cli/Dockerfile b/crates/dkg-cli/Dockerfile index 60149ea..38ac5a2 100644 --- a/crates/dkg-cli/Dockerfile +++ b/crates/dkg-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM cimg/rust:1.68.0 +FROM cimg/rust:1.70.0 ENV HOME=/home/circleci ENV PATH=$HOME/bin:$PATH From a0d218170682a67a58e1fa8c42fbf88a2af7c4f4 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Tue, 24 Oct 2023 10:35:02 +0200 Subject: [PATCH 07/10] clippy --- crates/dkg-cli/src/actions.rs | 8 ++++---- crates/threshold-bls-ffi/src/ffi.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/dkg-cli/src/actions.rs b/crates/dkg-cli/src/actions.rs index dfa8730..fdc712a 100644 --- a/crates/dkg-cli/src/actions.rs +++ b/crates/dkg-cli/src/actions.rs @@ -37,7 +37,7 @@ where { let wallet = Wallet::new(rng); let output = CeloKeypairJson { - private_key: hex::encode(&wallet.signer().to_bytes()), + private_key: hex::encode(wallet.signer().to_bytes()), address: wallet.address(), }; @@ -355,9 +355,9 @@ fn parse_bundle( fn write_output(writer: W, out: &DKGOutput) -> Result<()> { let output = OutputJson { - public_key: hex::encode(&bincode::serialize(&out.public.public_key())?), - public_polynomial: hex::encode(&bincode::serialize(&out.public)?), - share: hex::encode(&bincode::serialize(&out.share)?), + public_key: hex::encode(bincode::serialize(&out.public.public_key())?), + public_polynomial: hex::encode(bincode::serialize(&out.public)?), + share: hex::encode(bincode::serialize(&out.share)?), }; serde_json::to_writer(writer, &output)?; Ok(()) diff --git a/crates/threshold-bls-ffi/src/ffi.rs b/crates/threshold-bls-ffi/src/ffi.rs index 847cff9..ae03d10 100644 --- a/crates/threshold-bls-ffi/src/ffi.rs +++ b/crates/threshold-bls-ffi/src/ffi.rs @@ -536,7 +536,7 @@ pub unsafe extern "C" fn destroy_privkey(private_key: *mut PrivateKey) { /// /// The pointer must point to a valid instance of the data type pub unsafe extern "C" fn free_vector(bytes: *mut u8, len: usize) { - drop(unsafe { Vec::from_raw_parts(bytes, len as usize, len as usize) }); + drop(unsafe { Vec::from_raw_parts(bytes, len, len) }); } #[no_mangle] From ec0ce81b31f4366883d55594bea4c1be413a26bd Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Tue, 24 Oct 2023 11:00:34 +0200 Subject: [PATCH 08/10] 1.73 --- .circleci/config.yml | 10 +++++----- README.md | 4 ++-- crates/dkg-cli/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1249db7..aaf6b72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: name: Install rustup command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - run: - name: Install Rust 1.70 - command: rustup install 1.70.0 && rustup default 1.70.0 + name: Install Rust 1.73 + command: rustup install 1.73.0 && rustup default 1.73.0 - run: name: Install iOS targets command: rustup target add aarch64-apple-ios x86_64-apple-ios @@ -37,7 +37,7 @@ jobs: test: docker: - - image: cimg/rust:1.70.0 + - image: cimg/rust:1.73.0 resource_class: large steps: - checkout @@ -66,7 +66,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.70.0 + - image: cimg/rust:1.73.0 steps: - checkout - run: @@ -78,7 +78,7 @@ jobs: cross-android: docker: - - image: cimg/rust:1.70.0 + - image: cimg/rust:1.73.0 working_directory: ~/work steps: - checkout diff --git a/README.md b/README.md index fb38692..3108d4d 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Build with `cargo build (--release)`. Test with `cargo test`. All crates require Rust 2021 edition and are tested on the following channels: -- `1.70.0` +- `1.73.0` If you do not have Rust installed, run: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` ## Android and iOS -The library compiles to Android and iOS. This has been tested with Rust v1.70.0. +The library compiles to Android and iOS. This has been tested with Rust v1.73.0. To compile to Android: diff --git a/crates/dkg-cli/Dockerfile b/crates/dkg-cli/Dockerfile index 38ac5a2..3acd413 100644 --- a/crates/dkg-cli/Dockerfile +++ b/crates/dkg-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM cimg/rust:1.70.0 +FROM cimg/rust:1.73.0 ENV HOME=/home/circleci ENV PATH=$HOME/bin:$PATH From 27f14c41c295f6bc6d9966baac3a53ce655c86d4 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Tue, 24 Oct 2023 11:00:42 +0200 Subject: [PATCH 09/10] clippy --- crates/dkg-core/src/primitives/resharing.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/dkg-core/src/primitives/resharing.rs b/crates/dkg-core/src/primitives/resharing.rs index bc76eaa..474f0e6 100644 --- a/crates/dkg-core/src/primitives/resharing.rs +++ b/crates/dkg-core/src/primitives/resharing.rs @@ -666,7 +666,7 @@ mod tests { return b; } let msg = vec![1, 9, 6, 9]; - b.shares[((b.dealer_idx + 1) as usize % group.len()) as usize].secret = + b.shares[(b.dealer_idx + 1) as usize % group.len()].secret = ecies::encrypt::( &G1::rand(&mut thread_rng()), &msg, From 565930241ba0fc82845ad59e17a177b3eadde636 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Tue, 24 Oct 2023 11:09:08 +0200 Subject: [PATCH 10/10] clippy --- crates/threshold-bls/src/poly.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/threshold-bls/src/poly.rs b/crates/threshold-bls/src/poly.rs index 8bba751..1a6c452 100644 --- a/crates/threshold-bls/src/poly.rs +++ b/crates/threshold-bls/src/poly.rs @@ -516,7 +516,7 @@ pub mod tests { .map(|i| poly.eval(i as Idx)) .collect::>>(); let now = SystemTime::now(); - Poly::::recover(threshold as usize, shares).unwrap(); + Poly::::recover(threshold, shares).unwrap(); match now.elapsed() { Ok(e) => println!("single recover: time elapsed {:?}", e), Err(e) => panic!("{}", e), @@ -526,7 +526,7 @@ pub mod tests { .collect::>>(); let now = SystemTime::now(); - Poly::::full_recover(threshold as usize, shares).unwrap(); + Poly::::full_recover(threshold, shares).unwrap(); match now.elapsed() { Ok(e) => println!("full_recover: time elapsed {:?}", e), Err(e) => panic!("{}", e),