diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f34375c3a..2a96737f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,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 @@ -46,7 +46,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 }} @@ -65,7 +65,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 @@ -105,7 +105,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/.github/workflows/lints-stable.yml b/.github/workflows/lints-stable.yml index e76d7f25f..2976ecfef 100644 --- a/.github/workflows/lints-stable.yml +++ b/.github/workflows/lints-stable.yml @@ -5,7 +5,7 @@ on: pull_request jobs: clippy: - name: Clippy (1.51.0) + name: Clippy (1.56.0) timeout-minutes: 30 runs-on: ubuntu-latest @@ -13,12 +13,12 @@ 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 924c0be75..754718c2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to Rust's notion of ## [Unreleased] +## [0.12.0] - 2022-05-04 +### Changed +- MSRV bumped to `1.56.0` +- Bumped dependencies to `ff 0.12`, `group 0.12`, `pairing 0.22`, `bitvec 1.0`, `blake2s_simd 1.0`. + ## [0.11.2] - 2022-05-04 ### Fixed - Groth16 prover now correctly computes query densitites with respect to linear diff --git a/Cargo.toml b/Cargo.toml index f769f82bb..915a9d212 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,15 +9,15 @@ homepage = "https://github.com/zkcrypto/bellman" license = "MIT/Apache-2.0" name = "bellman" repository = "https://github.com/zkcrypto/bellman" -version = "0.11.2" -edition = "2018" +version = "0.12.0" +edition = "2021" [dependencies] -bitvec = "0.22" -blake2s_simd = "0.5" -ff = "0.11" -group = "0.11" -pairing = { version = "0.21", optional = true } +bitvec = "1" +blake2s_simd = "1" +ff = "0.12" +group = "0.12" +pairing = { version = "0.22", optional = true } rand_core = "0.6" byteorder = "1" subtle = "2.2.1" @@ -30,12 +30,12 @@ num_cpus = { version = "1", optional = true } rayon = { version = "1.5.1", optional = true } [dev-dependencies] -bls12_381 = "0.6" +bls12_381 = "0.7" criterion = "0.3" hex-literal = "0.3" rand = "0.8" rand_xorshift = "0.3" -sha2 = "0.9" +sha2 = "0.10" [features] groth16 = ["pairing"] diff --git a/rust-toolchain b/rust-toolchain index ba0a71911..3ebf789f5 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.51.0 +1.56.0 diff --git a/src/gadgets/boolean.rs b/src/gadgets/boolean.rs index 7ea53c72b..7dbb67ad6 100644 --- a/src/gadgets/boolean.rs +++ b/src/gadgets/boolean.rs @@ -322,12 +322,12 @@ pub fn field_into_allocated_bits_le< let values = match value { Some(ref value) => { let field_char = F::char_le_bits(); - let mut field_char = field_char.iter().by_ref().rev(); + let mut field_char = field_char.iter().by_refs().rev(); let mut tmp = Vec::with_capacity(F::NUM_BITS as usize); let mut found_one = false; - for b in value.to_le_bits().iter().by_val().rev() { + for b in value.to_le_bits().iter().by_vals().rev() { // Skip leading bits found_one |= field_char.next().unwrap(); if !found_one { @@ -1533,15 +1533,15 @@ mod test { assert_eq!(bits.len(), 64); - assert_eq!(bits[63].get_value().unwrap(), true); - assert_eq!(bits[63 - 1].get_value().unwrap(), true); - assert_eq!(bits[63 - 2].get_value().unwrap(), true); - assert_eq!(bits[63 - 3].get_value().unwrap(), false); - assert_eq!(bits[63 - 4].get_value().unwrap(), true); - assert_eq!(bits[63 - 5].get_value().unwrap(), true); - assert_eq!(bits[63 - 20].get_value().unwrap(), true); - assert_eq!(bits[63 - 21].get_value().unwrap(), false); - assert_eq!(bits[63 - 22].get_value().unwrap(), false); + assert!(bits[63].get_value().unwrap()); + assert!(bits[63 - 1].get_value().unwrap()); + assert!(bits[63 - 2].get_value().unwrap()); + assert!(!bits[63 - 3].get_value().unwrap()); + assert!(bits[63 - 4].get_value().unwrap()); + assert!(bits[63 - 5].get_value().unwrap()); + assert!(bits[63 - 20].get_value().unwrap()); + assert!(!bits[63 - 21].get_value().unwrap()); + assert!(!bits[63 - 22].get_value().unwrap()); } #[test] @@ -1559,14 +1559,14 @@ mod test { assert_eq!(bits.len(), 255); - assert_eq!(bits[254].value.unwrap(), false); - assert_eq!(bits[254 - 1].value.unwrap(), false); - assert_eq!(bits[254 - 2].value.unwrap(), true); - assert_eq!(bits[254 - 3].value.unwrap(), false); - assert_eq!(bits[254 - 4].value.unwrap(), true); - assert_eq!(bits[254 - 5].value.unwrap(), false); - assert_eq!(bits[254 - 20].value.unwrap(), true); - assert_eq!(bits[254 - 23].value.unwrap(), true); + assert!(!bits[254].value.unwrap()); + assert!(!bits[254 - 1].value.unwrap()); + assert!(bits[254 - 2].value.unwrap()); + assert!(!bits[254 - 3].value.unwrap()); + assert!(bits[254 - 4].value.unwrap()); + assert!(!bits[254 - 5].value.unwrap()); + assert!(bits[254 - 20].value.unwrap()); + assert!(bits[254 - 23].value.unwrap()); } #[test] diff --git a/src/gadgets/num.rs b/src/gadgets/num.rs index 091a2d71a..e922e4172 100644 --- a/src/gadgets/num.rs +++ b/src/gadgets/num.rs @@ -107,7 +107,7 @@ impl AllocatedNum { let b = (-Scalar::one()).to_le_bits(); // Get the bits of a in big-endian order - let mut a = a.as_ref().map(|e| e.iter().by_val().rev()); + let mut a = a.as_ref().map(|e| e.iter().by_vals().rev()); let mut result = vec![]; @@ -117,7 +117,7 @@ impl AllocatedNum { let mut found_one = false; let mut i = 0; - for b in b.iter().by_val().rev() { + for b in b.iter().by_vals().rev() { let a_bit = a.as_mut().map(|e| e.next().unwrap()); // Skip over unset bits at the beginning @@ -568,7 +568,7 @@ mod test { for (b, a) in r .to_le_bits() .iter() - .by_val() + .by_vals() .rev() .skip(1) .zip(bits.iter().rev()) diff --git a/src/lib.rs b/src/lib.rs index 86d8cfe2c..cce91dd5a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,7 +135,7 @@ //! be separate crates that pull in the dependencies they require. // Catch documentation errors caused by code changes. -#![deny(broken_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] pub mod domain; pub mod gadgets; diff --git a/src/multiexp.rs b/src/multiexp.rs index 301ba8b20..169a29f21 100644 --- a/src/multiexp.rs +++ b/src/multiexp.rs @@ -122,7 +122,7 @@ impl<'a> QueryDensity for &'a DensityTracker { type Iter = Box>; fn iter(self) -> Self::Iter { - Box::new(self.bv.iter().by_val()) + Box::new(self.bv.iter().by_vals()) } fn get_query_size(self) -> Option { @@ -207,7 +207,7 @@ where } else { let exp = exp .into_iter() - .by_val() + .by_vals() .skip(skip as usize) .take(c as usize) .enumerate()