From 421a7a5ec78b595c19234892babd97a2671a6022 Mon Sep 17 00:00:00 2001 From: Marcella Hastings Date: Thu, 22 Jun 2023 08:58:32 -0400 Subject: [PATCH] update rust to 1.70 and fix gh actions #313 #344 --- .github/workflows/main.yml | 30 +++++++++--------------------- README.md | 2 +- rust-toolchain.toml | 2 +- src/protocol.rs | 2 +- src/zkp/piaffg.rs | 17 ++++++++--------- 5 files changed, 20 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5635ba4..3c9d77b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,34 +17,22 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - id: install-rust - uses: actions-rs/toolchain@v1 + # This uses the version specified in rust-toolchain.toml by default + uses: IronCoreLabs/rust-toolchain@v1 with: - profile: minimal - # Set Rust version here! - toolchain: 1.69.0 - override: true - components: rustfmt, clippy + components: clippy, rust-docs - - 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 rustfmt only) + run: rustup toolchain install nightly --profile minimal --component rustfmt + + - 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: 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 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..f400973c 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 = "1.70" 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.