From dd8dcf1a7a045984b4716ed4edae2d64db699ebc Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:09:08 -0400 Subject: [PATCH 01/11] update rust version to 1.70 #313 --- .github/workflows/main.yml | 2 +- README.md | 2 +- rust-toolchain.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5635ba4..708b89b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: with: profile: minimal # Set Rust version here! - toolchain: 1.69.0 + toolchain: 1.70 override: true components: rustfmt, clippy diff --git a/README.md b/README.md index f02018f1..42069ece 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This project relies on the `libpaillier` Rust crate using the GMP backend. GMP s ### Rust Dependencies and Versions -The minimum supported stable Rust version is cargo 1.68. +The minimum supported stable Rust version is 1.68 (the library has been tested up to version 1.70). This library has been tested with GMP version 6.2.1. diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 438f8c82..32d89d2a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "stable-2023-04-20" \ No newline at end of file +channel = "stable-2023-06-01" From a494de8476481c1b289d08e899b2e0e3f792a3a6 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:35:37 -0400 Subject: [PATCH 02/11] update rust installers #344 --- .github/workflows/main.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 708b89b4..24ac36b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,34 +17,19 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - id: install-rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - # Set Rust version here! - toolchain: 1.70 - override: true - components: rustfmt, clippy + run: rustup toolchain install 1.70 --profile minimal - - name: Install nightly toolchain - id: install-rust-nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - components: rustfmt + - name: Install nightly toolchain for fmt + run: rustup toolchain install nightly --component rustfmt --profile minimal + + - name: Install cargo-make + run: cargo install cargo-make # Caching for Rust files. Must be called after installing Rust toolchain. # See https://github.com/Swatinem/rust-cache for more information. - name: Set Up Cache uses: Swatinem/rust-cache@v2 - - name: Install cargo-make - uses: actions-rs/cargo@v1 - with: - command: install - args: --debug cargo-make - - name: Run full CI (fmt, clippy, build, test, doctest, docs) run: cargo make ci From 1d1e8aa6bd861a5023f7654bd6b1d6888d227e65 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:41:18 -0400 Subject: [PATCH 03/11] fix fmt bugs from rust update #313 --- src/protocol.rs | 2 +- src/zkp/piaffg.rs | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/protocol.rs b/src/protocol.rs index 87b4380a..6f327cc2 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -56,7 +56,7 @@ pub enum ProtocolType { /// all messages generated by participants of a sub-protocol session. /// for its [`Participant`]. This includes: /// 1. Initializing a session by calling [`Participant::initialize_message()`]. -/// The message returned from that function must be passed back to the +/// The message returned from that function must be passed back to the /// [`Participant`] in order to begin the protocol execution. /// 2. Receiving messages sent by other participants, and passing /// them to the participant by calling diff --git a/src/zkp/piaffg.rs b/src/zkp/piaffg.rs index b964bbf2..f6f0524b 100644 --- a/src/zkp/piaffg.rs +++ b/src/zkp/piaffg.rs @@ -231,9 +231,8 @@ impl Proof2 for PiAffgProof { // `p`rover's or the `v`erifier's encryption key. The prover wants to // prove the following three claims: // - // 1. `C_v[z] ^ x · C_v[y] = D`, where `C_v[z]` is a public value - // provided by the verifier and `D` is a public value computed by the - // prover. + // 1. `C_v[z] ^ x · C_v[y] = D`, where `C_v[z]` is a public value provided by + // the verifier and `D` is a public value computed by the prover. // // 2. `C_p[y] = Y`, where `Y` is a public value provided by the prover. // @@ -246,14 +245,14 @@ impl Proof2 for PiAffgProof { // following three conditions, using a challenge value `e` produced by // using Fiat-Shamir: // - // 1. C_v[z] ^ (ɑ + e x) · C_v[β + e y] = A * D ^ e (note that if `D` - // "encodes" `z x + y` this check will pass) + // 1. C_v[z] ^ (ɑ + e x) · C_v[β + e y] = A * D ^ e (note that if `D` "encodes" + // `z x + y` this check will pass) // - // 2. g ^ (ɑ + e x) = B_x · X ^ e (note that if `X = g ^ x` this check - // will pass) + // 2. g ^ (ɑ + e x) = B_x · X ^ e (note that if `X = g ^ x` this check will + // pass) // - // 3. C_p[β + e y] = B_y · Y ^ e (note that if `Y = C_p[y]` this check - // will pass) + // 3. C_p[β + e y] = B_y · Y ^ e (note that if `Y = C_p[y]` this check will + // pass) // // This checks the main properties we are going for, however it doesn't // enforce yet that `ɑ + e x`, `β + e y`, etc. were computed correctly. From e6499e46ebc45eb75c35b782e93800edce838e00 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:51:56 -0400 Subject: [PATCH 04/11] install all stable components, try fast make #344 --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24ac36b1..289d0ffa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,17 +17,17 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: rustup toolchain install 1.70 --profile minimal + run: rustup toolchain install 1.70 - - name: Install nightly toolchain for fmt - run: rustup toolchain install nightly --component rustfmt --profile minimal + - name: Install nightly toolchain (for rustfmt) + run: rustup toolchain install nightly --profile minimal --component rustfmt - - name: Install cargo-make - run: cargo install cargo-make + - name: Install cargo-make (fast!) + uses: davidB/rust-cargo-make@v1 # Caching for Rust files. Must be called after installing Rust toolchain. # See https://github.com/Swatinem/rust-cache for more information. - - name: Set Up Cache + - name: Cache Rust files uses: Swatinem/rust-cache@v2 - name: Run full CI (fmt, clippy, build, test, doctest, docs) From c0ee6b1d2c3f4a184f4377088ba8f4509562731f Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:55:34 -0400 Subject: [PATCH 05/11] try different rustup command #344 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 289d0ffa..d5ee6c3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,9 +17,9 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: rustup toolchain install 1.70 + run: rustup update 1.70 - - name: Install nightly toolchain (for rustfmt) + - name: Install nightly toolchain (for rustfmt only) run: rustup toolchain install nightly --profile minimal --component rustfmt - name: Install cargo-make (fast!) From d1f43af52e695ed85152e88ea13042ac5cbecafd Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:57:32 -0400 Subject: [PATCH 06/11] explicitly include clippy #344 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5ee6c3a..5057f9c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: rustup update 1.70 + run: rustup update 1.70 --component clippy - name: Install nightly toolchain (for rustfmt only) run: rustup toolchain install nightly --profile minimal --component rustfmt From 49ef5a941433fc168f6d78b95e2685cacc775235 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 15:59:04 -0400 Subject: [PATCH 07/11] explicitly install clippy #344 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5057f9c2..e6d28486 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: rustup update 1.70 --component clippy + run: rustup toolchain install 1.70 --component clippy - name: Install nightly toolchain (for rustfmt only) run: rustup toolchain install nightly --profile minimal --component rustfmt From c1237ca09baba25d99e3923f1e8a65c110afc9df Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 16:02:21 -0400 Subject: [PATCH 08/11] manually install clippy #344 --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6d28486..d98c577c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,9 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: rustup toolchain install 1.70 --component clippy + run: rustup toolchain install 1.70 + - name: Install clippy like the error says to install it + run: rustup component add clippy --toolchain 1.70 - name: Install nightly toolchain (for rustfmt only) run: rustup toolchain install nightly --profile minimal --component rustfmt From 0238423b253a7350eaae5b86ff5e5271629c3b2c Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 16:07:04 -0400 Subject: [PATCH 09/11] try another arrangement to get clippy #344 --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d98c577c..7f73aed6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,9 +17,9 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: rustup toolchain install 1.70 - - name: Install clippy like the error says to install it - run: rustup component add clippy --toolchain 1.70 + run: | + rustup toolchain install 1.70 --profile default --no-self-update + rustup component add clippy --toolchain 1.70 - name: Install nightly toolchain (for rustfmt only) run: rustup toolchain install nightly --profile minimal --component rustfmt From c773cdb29f8490e7ef01a5fd46fa48bb03a8a9f0 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 16:11:09 -0400 Subject: [PATCH 10/11] try iron core action #344 --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f73aed6..3c9d77b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,9 +17,10 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - run: | - rustup toolchain install 1.70 --profile default --no-self-update - rustup component add clippy --toolchain 1.70 + # This uses the version specified in rust-toolchain.toml by default + uses: IronCoreLabs/rust-toolchain@v1 + with: + components: clippy, rust-docs - name: Install nightly toolchain (for rustfmt only) run: rustup toolchain install nightly --profile minimal --component rustfmt From 5fbde33160c64a145f32504613596b32c95dae46 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Wed, 21 Jun 2023 16:50:16 -0400 Subject: [PATCH 11/11] change toolchain specification format #313 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 32d89d2a..f400973c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "stable-2023-06-01" +channel = "1.70"