diff --git a/.circleci/config.yml b/.circleci/config.yml index 53eb486f..aaf6b72b 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.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.64.0 + - image: cimg/rust:1.73.0 resource_class: large steps: - checkout @@ -66,7 +66,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.64.0 + - image: cimg/rust:1.73.0 steps: - checkout - run: @@ -78,7 +78,7 @@ jobs: cross-android: docker: - - image: cimg/rust:1.64.0 + - image: cimg/rust:1.73.0 working_directory: ~/work steps: - checkout diff --git a/Cargo.lock b/Cargo.lock index d947e7f8..48d6c479 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", diff --git a/Cargo.toml b/Cargo.toml index ae21197d..b210e801 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "crates/dkg-cli", diff --git a/README.md b/README.md index 5e5e86dc..3108d4de 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.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.64.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 a693c3ec..3acd4135 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.73.0 ENV HOME=/home/circleci ENV PATH=$HOME/bin:$PATH diff --git a/crates/dkg-cli/src/actions.rs b/crates/dkg-cli/src/actions.rs index dfa8730f..fdc712a5 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/dkg-core/src/primitives/resharing.rs b/crates/dkg-core/src/primitives/resharing.rs index bc76eaa9..474f0e68 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, diff --git a/crates/threshold-bls-ffi/src/ffi.rs b/crates/threshold-bls-ffi/src/ffi.rs index 847cff99..ae03d10f 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] diff --git a/crates/threshold-bls/src/poly.rs b/crates/threshold-bls/src/poly.rs index 8bba7514..1a6c4526 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),