From 3329b4de8554dd7be56d8633721b5fbc53c4f71e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 4 May 2022 23:11:59 +0000 Subject: [PATCH 1/3] Migrate to `ff 0.12`, `group 0.12` MSRV is now 1.56.0. --- .github/workflows/ci.yml | 18 +++++++++--------- CHANGELOG.md | 3 +++ Cargo.toml | 5 +++-- README.md | 2 +- rust-toolchain | 2 +- src/arithmetic/fields.rs | 2 +- src/lib.rs | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc5ba6c..6abdbf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 override: true - name: Run tests uses: actions-rs/cargo@v1 @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 override: true - name: Add target run: rustup target add ${{ matrix.target }} @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 override: true # Build benchmarks to prevent bitrot - name: Build benchmarks @@ -71,7 +71,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 override: true - name: cargo build uses: actions-rs/cargo@v1 @@ -85,7 +85,7 @@ jobs: run: mdbook test -L target/debug/deps book/ clippy: - name: Clippy (1.51.0) + name: Clippy (1.56.0) timeout-minutes: 30 runs-on: ubuntu-latest @@ -93,13 +93,13 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 components: clippy override: true - name: Run clippy uses: actions-rs/clippy-check@v1 with: - name: Clippy (1.51.0) + name: Clippy (1.56.0) token: ${{ secrets.GITHUB_TOKEN }} args: --all-features --all-targets -- -D warnings @@ -158,7 +158,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 override: true - name: cargo fetch uses: actions-rs/cargo@v1 @@ -181,7 +181,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.51.0 + toolchain: 1.56.0 override: true - run: rustup component add rustfmt - uses: actions-rs/cargo@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b4589..376b42a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to Rust's notion of [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- MSRV is now 1.56.0. +- Migrated to `ff 0.12`, `group 0.12`. ## [0.3.1] - 2022-04-20 ### Added diff --git a/Cargo.toml b/Cargo.toml index faa5b0a..3e660c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ authors = [ "Jack Grigg ", ] edition = "2018" +rust-version = "1.56" license = "MIT OR Apache-2.0" repository = "https://github.com/zcash/pasta_curves" documentation = "https://docs.rs/pasta_curves" @@ -41,8 +42,8 @@ harness = false required-features = ["alloc"] [dependencies] -ff = { version = "0.11", default-features = false } -group = { version = "0.11", default-features = false } +ff = { version = "0.12", default-features = false } +group = { version = "0.12", default-features = false } rand = { version = "0.8", default-features = false } static_assertions = "1.1.0" subtle = { version = "2.3", default-features = false } diff --git a/README.md b/README.md index d4a51e8..c81125c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Pallas and Vesta. More details about the Pasta curves can be found ## Minimum Supported Rust Version -Requires Rust **1.51** or higher. +Requires Rust **1.56** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. diff --git a/rust-toolchain b/rust-toolchain index ba0a719..3ebf789 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.51.0 +1.56.0 diff --git a/src/arithmetic/fields.rs b/src/arithmetic/fields.rs index 3f47a89..43e1b26 100644 --- a/src/arithmetic/fields.rs +++ b/src/arithmetic/fields.rs @@ -27,7 +27,7 @@ pub trait SqrtRatio: ff::PrimeField { /// /// Field implementations may override this to use an efficient addition chain. fn pow_by_t_minus1_over2(&self) -> Self { - ff::Field::pow_vartime(&self, &Self::T_MINUS1_OVER2) + ff::Field::pow_vartime(self, &Self::T_MINUS1_OVER2) } /// Gets the lower 32 bits of this field element when expressed diff --git a/src/lib.rs b/src/lib.rs index 04ebf0b..16d8a36 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(unknown_lints)] #![allow(clippy::op_ref, clippy::same_item_push, clippy::upper_case_acronyms)] -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![deny(unsafe_code)] From 0b8ed00c84404fcca3ba83b3a8cc1a41cec4778e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 4 May 2022 23:16:27 +0000 Subject: [PATCH 2/3] Migrate to Rust 2021 --- Cargo.toml | 2 +- src/arithmetic/fields.rs | 2 +- src/fields/fp.rs | 1 - src/fields/fq.rs | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3e660c4..be8da06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Daira Hopwood ", "Jack Grigg ", ] -edition = "2018" +edition = "2021" rust-version = "1.56" license = "MIT OR Apache-2.0" repository = "https://github.com/zcash/pasta_curves" diff --git a/src/arithmetic/fields.rs b/src/arithmetic/fields.rs index 43e1b26..3cf2e9e 100644 --- a/src/arithmetic/fields.rs +++ b/src/arithmetic/fields.rs @@ -13,7 +13,7 @@ use core::assert; #[cfg(feature = "sqrt-table")] use alloc::{boxed::Box, vec::Vec}; #[cfg(feature = "sqrt-table")] -use core::{convert::TryInto, marker::PhantomData}; +use core::marker::PhantomData; const_assert!(size_of::() >= 4); diff --git a/src/fields/fp.rs b/src/fields/fp.rs index 6e39fc1..6d8db0d 100644 --- a/src/fields/fp.rs +++ b/src/fields/fp.rs @@ -1,4 +1,3 @@ -use core::convert::TryInto; use core::fmt; use core::ops::{Add, Mul, Neg, Sub}; diff --git a/src/fields/fq.rs b/src/fields/fq.rs index 5604c15..0a08718 100644 --- a/src/fields/fq.rs +++ b/src/fields/fq.rs @@ -1,4 +1,3 @@ -use core::convert::TryInto; use core::fmt; use core::ops::{Add, Mul, Neg, Sub}; From 94a5039b137c5618cc2881043689487db48c5536 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 4 May 2022 23:18:10 +0000 Subject: [PATCH 3/3] `pasta_curves 0.4.0` --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 376b42a..937e25c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to Rust's notion of [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [0.4.0] - 2022-05-05 ### Changed - MSRV is now 1.56.0. - Migrated to `ff 0.12`, `group 0.12`. diff --git a/Cargo.toml b/Cargo.toml index be8da06..071faa0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pasta_curves" description = "Implementation of the Pallas and Vesta (Pasta) curve cycle" -version = "0.3.1" +version = "0.4.0" authors = [ "Sean Bowe ", "Ying Tong Lai ",