Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrchardZSA backward compatability using traits #31

Merged
merged 123 commits into from
Aug 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
80dfd60
add initial doc
Apr 23, 2024
d3a6f42
clean up code
Apr 24, 2024
86bd33f
remove cfg[test]
Apr 24, 2024
989f29b
remove generator table trait, fix hash_to_point
Apr 25, 2024
507a53c
update code for hash
Apr 29, 2024
2e31e97
fmt
Apr 29, 2024
b02478a
fix run tests error
Apr 29, 2024
e6d1dbe
minor update
Apr 29, 2024
23a2951
test error
Apr 29, 2024
301e7d8
Revert "test error"
Apr 29, 2024
c324006
re-naming structs and functions
Apr 30, 2024
af29df4
fix complex type
Apr 30, 2024
1ea04bb
add round trip test to verify that the pinned verification key (repre…
May 6, 2024
684c13e
update serialized_proof_test_case
May 6, 2024
a25a6ad
update
May 6, 2024
42f1b0a
update short lookup test
May 6, 2024
2b89fae
cargo fmt
May 6, 2024
8552c97
fix Clippy error
May 6, 2024
f35cbe9
clean up code
May 7, 2024
f65d5a3
add initial files
May 10, 2024
7e50d0b
minor update
May 10, 2024
58f8b3f
remove pub(crate) in ecc
May 13, 2024
738eabe
add a line after cargo.toml
May 13, 2024
0fb6dd4
add a line after cargo.toml
May 13, 2024
e2c9c30
slide lines in base_field_elem
May 13, 2024
5322c81
slide lines in base_field_elem
May 13, 2024
46773e3
adjuct function orders for configure in sinsemilla/chip
May 13, 2024
3621e0e
adjuct function orders for hash_message
May 13, 2024
a30596b
adjuct function orders for hash_message
May 13, 2024
b3cb453
cleanup code
May 13, 2024
cf2bd37
cleanup code
May 13, 2024
da85c71
cleanup code
May 13, 2024
a5bf5ee
resolve review
May 14, 2024
8d27dd7
Introduce conditionally_save_circuit_to_disk function to reuse the pr…
dmidem May 14, 2024
48f941e
Rename conditionally_save_circuit_to_disk function to conditionally_s…
dmidem May 14, 2024
58b7eff
Introduce test_serialized_proof_with_vk and test_serialized_proof fun…
dmidem May 14, 2024
756bb78
Fix cargo clippy error
dmidem May 14, 2024
6814fc2
rename
May 14, 2024
64a8ac2
fix git error
May 14, 2024
704d3f6
Move all test .bin files and test_circuit.rs module to new tests fold…
dmidem May 14, 2024
d0d3a6f
Add missed files
dmidem May 14, 2024
35f161d
Move all .bin and vk_ test data files into src/tests folder
dmidem May 14, 2024
497c290
add tests for short range check
May 14, 2024
d3a9d4e
Add fixed_verification_key_test_with_circuit function to generalize V…
dmidem May 15, 2024
cf8aca0
Avoid duplicating test data folder name src/tests in every file name,…
dmidem May 15, 2024
b7c7261
Remove 'else' in fixed_verification_key_test_with_circuit function, t…
dmidem May 15, 2024
d3c7eb0
Use fs::read, fs::write instad of read_test_case and write_test_case
dmidem May 15, 2024
af5fd9c
Merge branch 'improve-backward-compatability-without-zsa' of github.c…
May 15, 2024
5248a0a
revert .github/workflows/ci.yml
May 15, 2024
8a68152
rename circuit.rs
May 15, 2024
8dbb582
add a line
May 15, 2024
32842df
fix ci.yml
May 15, 2024
3324348
Rename PallasLookupRC LookupRangeCheck trait alias to PallasLookup. A…
dmidem May 15, 2024
92922be
Move circuit test data to tests/circuit_reference_data folder, fix na…
dmidem May 15, 2024
6c7713f
Rename circuit_reference_data to circuit_data
dmidem May 15, 2024
8922ed6
Fix cargo fmt issues
dmidem May 15, 2024
f75b054
Try to increase cargo-tarpaulin timeout in ci.yml from 600 to 1800 to…
dmidem May 16, 2024
5414d95
Add default generic arguments for PallasLookup to improve backward co…
dmidem May 17, 2024
396bbde
Try to increase cargo-tarpaulin timeout in ci.yml from to 3600
dmidem May 22, 2024
1ae0a31
update
May 28, 2024
adf4d0d
cargo fmt
May 28, 2024
807304d
Merge branch 'improve-backward-compatability-without-zsa-default-gene…
dmidem May 28, 2024
1bb0b84
add index to proofs
May 28, 2024
923293b
rename PallasLookupRC10b to PallasLookupRCConfig
May 30, 2024
9ecbd65
resolve some comments
May 30, 2024
9337142
add zsa feature
Jun 3, 2024
8a8aca2
fix cargo clippy
Jun 3, 2024
4de57c1
fix shrot test
Jun 3, 2024
1c694c6
add some docs
Jun 3, 2024
aedcc54
Fix error in ci.yml
Jun 4, 2024
b252579
remove space in ci.yml
Jun 4, 2024
ce24e86
order functions in hash_to_point
Jun 4, 2024
5474c7c
order functions in hash_to_point
Jun 4, 2024
1cac5b7
crate -> super
Jun 4, 2024
ddee3ed
re-order cond_swap and lookup
Jun 4, 2024
637abbc
re-order cond_swap
Jun 4, 2024
9cef0b0
remove crate for configure_with_tag
Jun 4, 2024
f69907b
lookup tests update
Jun 4, 2024
9b4c51f
change sinsemillachip to sinsemillachipOptimized
Jun 4, 2024
2069bd1
Cleanup code and some renamings
ConstanceBeguier Jun 11, 2024
1a21413
rust fmt
ConstanceBeguier Jun 11, 2024
de56201
Remove EccInstructionsOptimized
ConstanceBeguier Jun 14, 2024
52e6fbb
Remove dead_code flag on EccPointQ
ConstanceBeguier Jun 14, 2024
8d13e7a
Remove CondSwapInstructionsOptimized
ConstanceBeguier Jun 14, 2024
36a9319
Clean imports
ConstanceBeguier Jun 17, 2024
6cab338
Remove redundancy in lookup_range_check tests
ConstanceBeguier Jun 18, 2024
474cfac
Save test files for optimized lookup range check
ConstanceBeguier Jun 21, 2024
ce807ea
Fix test_against_stored_ecc_chip_4_5_b
ConstanceBeguier Jun 21, 2024
8c55c6f
Put together test_against_stored_vk/proof into test_against_stored_ci…
ConstanceBeguier Jun 21, 2024
c9d8006
Add test on mul_sign for non optimized lookup
ConstanceBeguier Jun 22, 2024
06746f7
Remove redundancy in ecc tests
ConstanceBeguier Jun 22, 2024
36e03e3
Add expected_proof_size in test_against_stored_circuit
ConstanceBeguier Jun 23, 2024
5623a78
Fix Merkle tests with optimized lookup
ConstanceBeguier Jun 23, 2024
2c1f636
Rename layout images for circuits with optimized lookup
ConstanceBeguier Jun 23, 2024
ac71097
Remove redundancy in mul_fixed short tests
ConstanceBeguier Jun 24, 2024
61d223e
Move load_with_tag
ConstanceBeguier Jun 24, 2024
b4a70ab
Light modifications on hash_to_point
ConstanceBeguier Jun 24, 2024
a208dca
Add test on mux with non optimized lookup
ConstanceBeguier Jun 24, 2024
fda20b9
Rename some lookup traits and structures
ConstanceBeguier Jun 24, 2024
cd4d43a
Rename Sinsemilla/MerkleChipOptimized
ConstanceBeguier Jun 24, 2024
18e3e0d
Put together some imports
ConstanceBeguier Jun 25, 2024
d6bcf3b
Fix LookupangeCheck loading in Sinsemilla
ConstanceBeguier Jun 25, 2024
b5d8916
Fix Sinsemilla45BChip and Merkle45BChip
ConstanceBeguier Jun 25, 2024
1fbc7de
Rename Sinsemilla/Merkle45BChip
ConstanceBeguier Jun 25, 2024
37e9380
Clean lookup range check tests
ConstanceBeguier Jun 25, 2024
eda965f
Rename some layouter images
ConstanceBeguier Jun 27, 2024
6af9ebf
Update some comments
ConstanceBeguier Jun 27, 2024
2021f5e
Simplify Sinsemilla/Merkle chips thanks to enable_hash_from_private_p…
ConstanceBeguier Jul 1, 2024
0d2512a
Refactoring
ConstanceBeguier Jul 1, 2024
e2c9e93
Refactor
ConstanceBeguier Jul 2, 2024
7f5c0ba
Remove MerkleSinsemillaInstructions
ConstanceBeguier Jul 2, 2024
41c7d2e
Restore code coverage
ConstanceBeguier Jul 5, 2024
9c29f27
Refactor
ConstanceBeguier Jul 5, 2024
714fff0
Remove redundancy in Merkle tests
ConstanceBeguier Jul 7, 2024
70af809
Rename MyCircuit into MyMagnitudeSignCircuit on fixed_mul/short tests
ConstanceBeguier Jul 7, 2024
68d65e0
Refactor
ConstanceBeguier Jul 7, 2024
a8832c9
Make cond_swap_config public in merkle_config
ConstanceBeguier Jul 16, 2024
8a2cbee
Take into account Pablo's review
ConstanceBeguier Jul 17, 2024
03dbe70
Take into account Pablo's review
ConstanceBeguier Aug 2, 2024
a34d146
Some renamings
ConstanceBeguier Aug 2, 2024
9df4fb6
Replace enable_hash_from_private_point by init_from_private_point
ConstanceBeguier Aug 8, 2024
493bf53
Remove unnecessary changes in CI
ConstanceBeguier Aug 8, 2024
46db5d4
Rename Error::HashFromPrivatePoint to Error::IllegalHashFromPrivatePoint
ConstanceBeguier Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions halo2_gadgets/src/ecc.rs
Original file line number Diff line number Diff line change
@@ -595,9 +595,7 @@ pub(crate) mod tests {
},
FixedPoints,
};
use crate::{
utilities::lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig},
};
use crate::utilities::lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig};

#[derive(Debug, Eq, PartialEq, Clone)]
pub(crate) struct TestFixedBases;
24 changes: 8 additions & 16 deletions halo2_gadgets/src/ecc/chip.rs
Original file line number Diff line number Diff line change
@@ -227,17 +227,13 @@ pub trait FixedPoint<C: CurveAffine>: std::fmt::Debug + Eq + Clone {

/// An [`EccInstructions`] chip that uses 10 advice columns.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct EccChip<
FixedPoints: super::FixedPoints<pallas::Affine>,
Lookup: DefaultLookupRangeCheck,
> {
pub struct EccChip<FixedPoints: super::FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck>
{
config: EccConfig<FixedPoints, Lookup>,
}

impl<
FixedPoints: super::FixedPoints<pallas::Affine>,
Lookup: DefaultLookupRangeCheck,
> Chip<pallas::Base> for EccChip<FixedPoints, Lookup>
impl<FixedPoints: super::FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck>
Chip<pallas::Base> for EccChip<FixedPoints, Lookup>
{
type Config = EccConfig<FixedPoints, Lookup>;
type Loaded = ();
@@ -251,18 +247,14 @@ impl<
}
}

impl<
Fixed: super::FixedPoints<pallas::Affine>,
Lookup: DefaultLookupRangeCheck,
> UtilitiesInstructions<pallas::Base> for EccChip<Fixed, Lookup>
impl<Fixed: super::FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck>
UtilitiesInstructions<pallas::Base> for EccChip<Fixed, Lookup>
{
type Var = AssignedCell<pallas::Base, pallas::Base>;
}

impl<
FixedPoints: super::FixedPoints<pallas::Affine>,
Lookup: DefaultLookupRangeCheck,
> EccChip<FixedPoints, Lookup>
impl<FixedPoints: super::FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck>
EccChip<FixedPoints, Lookup>
{
/// Reconstructs this chip from the given config.
pub fn construct(config: <Self as Chip<pallas::Base>>::Config) -> Self {
2 changes: 1 addition & 1 deletion halo2_gadgets/src/ecc/chip/mul.rs
Original file line number Diff line number Diff line change
@@ -467,7 +467,7 @@ pub mod tests {
use pasta_curves::pallas;
use rand::rngs::OsRng;

use crate::utilities::lookup_range_check::{DefaultLookupRangeCheck};
use crate::utilities::lookup_range_check::DefaultLookupRangeCheck;
use crate::{
ecc::{
chip::{EccChip, EccPoint},
9 changes: 2 additions & 7 deletions halo2_gadgets/src/ecc/chip/mul_fixed/base_field_elem.rs
Original file line number Diff line number Diff line change
@@ -16,19 +16,14 @@ use pasta_curves::pallas;
use std::convert::TryInto;

#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Config<
Fixed: FixedPoints<pallas::Affine>,
Lookup: DefaultLookupRangeCheck,
> {
pub struct Config<Fixed: FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck> {
q_mul_fixed_base_field: Selector,
canon_advices: [Column<Advice>; 3],
lookup_config: Lookup,
super_config: super::Config<Fixed>,
}

impl<Fixed: FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck>
Config<Fixed, Lookup>
{
impl<Fixed: FixedPoints<pallas::Affine>, Lookup: DefaultLookupRangeCheck> Config<Fixed, Lookup> {
pub(crate) fn configure(
meta: &mut ConstraintSystem<pallas::Base>,
canon_advices: [Column<Advice>; 3],
4 changes: 1 addition & 3 deletions halo2_gadgets/src/ecc_opt/chip/mul_fixed/short.rs
Original file line number Diff line number Diff line change
@@ -91,9 +91,7 @@ pub mod tests {
use crate::utilities_opt::lookup_range_check::LookupRangeCheckConfigOptimized;
use crate::{
ecc::{chip::EccChip, tests::TestFixedBases, Point},
utilities::{
UtilitiesInstructions,
},
utilities::UtilitiesInstructions,
};

pub(crate) fn test_mul_sign<Lookup: DefaultLookupRangeCheck>(
9 changes: 3 additions & 6 deletions halo2_gadgets/src/sinsemilla/chip.rs
Original file line number Diff line number Diff line change
@@ -63,8 +63,7 @@ where
pub(crate) _marker: PhantomData<(Hash, Commit, F)>,
}

impl<Hash, Commit, F, Lookup>
SinsemillaConfig<Hash, Commit, F, Lookup>
impl<Hash, Commit, F, Lookup> SinsemillaConfig<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
@@ -109,8 +108,7 @@ where
config: SinsemillaConfig<Hash, Commit, Fixed, Lookup>,
}

impl<Hash, Commit, Fixed, Lookup> Chip<pallas::Base>
for SinsemillaChip<Hash, Commit, Fixed, Lookup>
impl<Hash, Commit, Fixed, Lookup> Chip<pallas::Base> for SinsemillaChip<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
@@ -129,8 +127,7 @@ where
}
}

impl<Hash, Commit, F, Lookup>
SinsemillaChip<Hash, Commit, F, Lookup>
impl<Hash, Commit, F, Lookup> SinsemillaChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
3 changes: 1 addition & 2 deletions halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs
Original file line number Diff line number Diff line change
@@ -20,12 +20,11 @@
/// Define an enum that can hold either type
#[derive(Debug, Clone)]
pub enum EccPointQ<'a> {
PublicPoint(pallas::Affine),

Check warning on line 23 in halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs

GitHub Actions / Clippy (beta)

field `0` is never read

warning: field `0` is never read --> halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs:23:17 | 23 | PublicPoint(pallas::Affine), | ----------- ^^^^^^^^^^^^^^ | | | field in this variant | = note: `#[warn(dead_code)]` on by default help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 23 | PublicPoint(()), | ~~
PrivatePoint(&'a NonIdentityEccPoint),

Check warning on line 24 in halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs

GitHub Actions / Clippy (beta)

field `0` is never read

warning: field `0` is never read --> halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs:24:18 | 24 | PrivatePoint(&'a NonIdentityEccPoint), | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ | | | field in this variant | help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 24 | PrivatePoint(()), | ~~
}

impl<Hash, Commit, Fixed, Lookup>
SinsemillaChip<Hash, Commit, Fixed, Lookup>
impl<Hash, Commit, Fixed, Lookup> SinsemillaChip<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
@@ -72,13 +71,13 @@
x_a: X<pallas::Base>,
y_a: AssignedCell<Assigned<pallas::Base>, pallas::Base>,
zs_sum: Vec<Vec<AssignedCell<pallas::Base, pallas::Base>>>,
) -> Result<
(
NonIdentityEccPoint,
Vec<Vec<AssignedCell<pallas::Base, pallas::Base>>>,
),
Error,
> {

Check warning on line 80 in halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs

GitHub Actions / Clippy (beta)

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions --> halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs:74:10 | 74 | ) -> Result< | __________^ 75 | | ( 76 | | NonIdentityEccPoint, 77 | | Vec<Vec<AssignedCell<pallas::Base, pallas::Base>>>, 78 | | ), 79 | | Error, 80 | | > { | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity = note: `-W clippy::type-complexity` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]`

Check warning on line 80 in halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs

GitHub Actions / Clippy (beta)

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions --> halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs:74:10 | 74 | ) -> Result< | __________^ 75 | | ( 76 | | NonIdentityEccPoint, 77 | | Vec<Vec<AssignedCell<pallas::Base, pallas::Base>>>, 78 | | ), 79 | | Error, 80 | | > { | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity = note: `-W clippy::type-complexity` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::type_complexity)]`
#[cfg(test)]
{
use crate::sinsemilla::primitives::{K, S_PERSONALIZATION};
121 changes: 56 additions & 65 deletions halo2_gadgets/src/sinsemilla/merkle/chip.rs
Original file line number Diff line number Diff line change
@@ -29,11 +29,11 @@ use group::ff::PrimeField;
/// Configuration for the `MerkleChip` implementation.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MerkleConfig<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
Lookup: DefaultLookupRangeCheck,
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
Lookup: DefaultLookupRangeCheck,
{
pub(crate) advices: [Column<Advice>; 5],
pub(crate) q_decompose: Selector,
@@ -53,22 +53,21 @@ pub struct MerkleConfig<Hash, Commit, Fixed, Lookup>
/// `left` and `right`.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MerkleChip<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
Lookup: DefaultLookupRangeCheck,
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
Lookup: DefaultLookupRangeCheck,
{
pub(crate) config: MerkleConfig<Hash, Commit, Fixed, Lookup>,
}

impl<Hash, Commit, Fixed, Lookup> Chip<pallas::Base>
for MerkleChip<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
Lookup: DefaultLookupRangeCheck,
impl<Hash, Commit, Fixed, Lookup> Chip<pallas::Base> for MerkleChip<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
Lookup: DefaultLookupRangeCheck,
{
type Config = MerkleConfig<Hash, Commit, Fixed, Lookup>;
type Loaded = ();
@@ -83,11 +82,11 @@ for MerkleChip<Hash, Commit, Fixed, Lookup>
}

impl<Hash, Commit, F, Lookup> MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
{
/// Configures the [`MerkleChip`].
pub fn configure(
@@ -202,13 +201,13 @@ impl<Hash, Commit, F, Lookup> MerkleChip<Hash, Commit, F, Lookup>
}

impl<Hash, Commit, F, Lookup, const MERKLE_DEPTH: usize>
MerkleInstructions<pallas::Affine, MERKLE_DEPTH, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine> + Eq,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash> + Eq,
Lookup: DefaultLookupRangeCheck,
MerkleInstructions<pallas::Affine, MERKLE_DEPTH, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine> + Eq,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash> + Eq,
Lookup: DefaultLookupRangeCheck,
{
#[allow(non_snake_case)]
fn hash_layer(
@@ -422,23 +421,23 @@ for MerkleChip<Hash, Commit, F, Lookup>
}

impl<Hash, Commit, F, Lookup> UtilitiesInstructions<pallas::Base>
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
{
type Var = AssignedCell<pallas::Base, pallas::Base>;
}

impl<Hash, Commit, F, Lookup> CondSwapInstructions<pallas::Base>
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
{
#[allow(clippy::type_complexity)]
fn swap(
@@ -454,35 +453,31 @@ for MerkleChip<Hash, Commit, F, Lookup>
}

impl<Hash, Commit, F, Lookup>
SinsemillaInstructions<pallas::Affine, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
SinsemillaInstructions<pallas::Affine, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChip<Hash, Commit, F, Lookup>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
Lookup: DefaultLookupRangeCheck,
{
type CellValue =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type CellValue = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
>>::CellValue;

type Message =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type Message = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
>>::Message;
type MessagePiece =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type MessagePiece = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
>>::MessagePiece;
type RunningSum =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type RunningSum = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
@@ -493,27 +488,23 @@ for MerkleChip<Hash, Commit, F, Lookup>
{ sinsemilla::K },
{ sinsemilla::C },
>>::X;
type NonIdentityPoint =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type NonIdentityPoint = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
>>::NonIdentityPoint;
type FixedPoints =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type FixedPoints = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
>>::FixedPoints;

type HashDomains =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type HashDomains = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
>>::HashDomains;
type CommitDomains =
<SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
type CommitDomains = <SinsemillaChip<Hash, Commit, F, Lookup> as SinsemillaInstructions<
pallas::Affine,
{ sinsemilla::K },
{ sinsemilla::C },
@@ -546,4 +537,4 @@ for MerkleChip<Hash, Commit, F, Lookup>
fn extract(point: &Self::NonIdentityPoint) -> Self::X {
SinsemillaChip::<Hash, Commit, F, Lookup>::extract(point)
}
}
}
15 changes: 6 additions & 9 deletions halo2_gadgets/src/sinsemilla_opt.rs
Original file line number Diff line number Diff line change
@@ -23,9 +23,8 @@
/// designed to enhance performance in specific cryptographic scenarios.ld

pub trait SinsemillaInstructionsOptimized<C: CurveAffine, const K: usize, const MAX_WORDS: usize>:
SinsemillaInstructions<C, K, MAX_WORDS>
SinsemillaInstructions<C, K, MAX_WORDS>
{

/// Hashes a message to an ECC curve point.
/// This returns both the resulting point, as well as the message
/// decomposition in the form of intermediate values in a cumulative
@@ -156,14 +155,12 @@

use crate::{
ecc::ScalarFixed,
sinsemilla::primitives::{self as sinsemilla, K},
{
ecc::{
chip::{find_zs_and_us, EccChip, EccConfig, H, NUM_WINDOWS},
tests::{FullWidth, TestFixedBases},
NonIdentityPoint,
},
ecc::{
chip::{find_zs_and_us, EccChip, EccConfig, H, NUM_WINDOWS},
tests::{FullWidth, TestFixedBases},
NonIdentityPoint,
},
sinsemilla::primitives::{self as sinsemilla, K},
};

use group::{ff::Field, Curve};
@@ -366,8 +363,8 @@
let point = merkle_crh
.hash_to_point(
l.into_iter()
.chain(left.into_iter())

Check warning on line 366 in halo2_gadgets/src/sinsemilla_opt.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_gadgets/src/sinsemilla_opt.rs:366:48 | 366 | ... .chain(left.into_iter()) | ^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `left` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
.chain(right.into_iter()),

Check warning on line 367 in halo2_gadgets/src/sinsemilla_opt.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_gadgets/src/sinsemilla_opt.rs:367:48 | 367 | ... .chain(right.into_iter()), | ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `right` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
)
.unwrap();
point.to_affine()
59 changes: 31 additions & 28 deletions halo2_gadgets/src/sinsemilla_opt/chip.rs
Original file line number Diff line number Diff line change
@@ -28,19 +28,19 @@ mod hash_to_point;
/// [Chip description](https://zcash.github.io/halo2/design/gadgets/sinsemilla.html#plonk--halo-2-constraints).
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct SinsemillaChipOptimized<Hash, Commit, Fixed>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
{
inner: SinsemillaChip<Hash, Commit, Fixed, DefaultLookupRangeCheckConfigOptimized>,
}

impl<Hash, Commit, Fixed> Chip<pallas::Base> for SinsemillaChipOptimized<Hash, Commit, Fixed>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
{
type Config = SinsemillaConfig<Hash, Commit, Fixed, DefaultLookupRangeCheckConfigOptimized>;
type Loaded = ();
@@ -55,18 +55,18 @@ impl<Hash, Commit, Fixed> Chip<pallas::Base> for SinsemillaChipOptimized<Hash, C
}

impl<Hash, Commit, F> SinsemillaChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
/// Reconstructs this chip from the given config.
pub fn construct(config: <Self as Chip<pallas::Base>>::Config) -> Self {
Self {
inner:
SinsemillaChip::<Hash, Commit, F, DefaultLookupRangeCheckConfigOptimized>::construct(
config,
),
SinsemillaChip::<Hash, Commit, F, DefaultLookupRangeCheckConfigOptimized>::construct(
config,
),
}
}

@@ -145,11 +145,11 @@ impl<Hash, Commit, F> SinsemillaChipOptimized<Hash, Commit, F>

// Implement `SinsemillaInstructions` for `SinsemillaChip`
impl<Hash, Commit, F> SinsemillaInstructions<pallas::Affine, { sinsemilla::K }, { sinsemilla::C }>
for SinsemillaChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
for SinsemillaChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
type CellValue = AssignedCell<pallas::Base, pallas::Base>;

@@ -196,12 +196,12 @@ for SinsemillaChipOptimized<Hash, Commit, F>

// Implement `SinsemillaInstructions` for `SinsemillaChip`
impl<Hash, Commit, F>
SinsemillaInstructionsOptimized<pallas::Affine, { sinsemilla::K }, { sinsemilla::C }>
for SinsemillaChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
SinsemillaInstructionsOptimized<pallas::Affine, { sinsemilla::K }, { sinsemilla::C }>
for SinsemillaChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
#[allow(non_snake_case)]
#[allow(clippy::type_complexity)]
@@ -213,7 +213,10 @@ for SinsemillaChipOptimized<Hash, Commit, F>
) -> Result<(Self::NonIdentityPoint, Vec<Self::RunningSum>), Error> {
layouter.assign_region(
|| "hash_to_point",
|mut region| self.inner.hash_message_with_private_init(&mut region, Q, &message),
|mut region| {
self.inner
.hash_message_with_private_init(&mut region, Q, &message)
},
)
}
}
}
3 changes: 1 addition & 2 deletions halo2_gadgets/src/sinsemilla_opt/chip/hash_to_point.rs
Original file line number Diff line number Diff line change
@@ -17,8 +17,7 @@ use crate::{
},
};

impl<Hash, Commit, Fixed, Lookup>
SinsemillaChip<Hash, Commit, Fixed, Lookup>
impl<Hash, Commit, Fixed, Lookup> SinsemillaChip<Hash, Commit, Fixed, Lookup>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
4 changes: 2 additions & 2 deletions halo2_gadgets/src/sinsemilla_opt/merkle.rs
Original file line number Diff line number Diff line change
@@ -22,13 +22,13 @@ pub mod tests {
plonk::{Circuit, ConstraintSystem, Error},
};

use crate::sinsemilla::merkle::chip::{MerkleConfig};
use crate::sinsemilla::merkle::chip::MerkleConfig;
use crate::sinsemilla::merkle::MerklePath;
use crate::sinsemilla_opt::chip::SinsemillaChipOptimized;
use crate::sinsemilla_opt::merkle::chip::MerkleChipOptimized;
use crate::utilities_opt::lookup_range_check::LookupRangeCheckConfigOptimized;
use rand::{rngs::OsRng, RngCore};
use std::{convert::TryInto, iter};
use crate::sinsemilla_opt::merkle::chip::MerkleChipOptimized;

const MERKLE_DEPTH: usize = 32;

70 changes: 34 additions & 36 deletions halo2_gadgets/src/sinsemilla_opt/merkle/chip.rs
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ use halo2_proofs::{
};
use pasta_curves::pallas;

use crate::sinsemilla::MessagePiece;
use crate::utilities::RangeConstrained;
use crate::{
sinsemilla::{
merkle::{
@@ -23,8 +25,6 @@ use crate::{
utilities::{cond_swap::CondSwapInstructions, UtilitiesInstructions},
},
};
use crate::sinsemilla::MessagePiece;
use crate::utilities::RangeConstrained;

/// Chip implementing `MerkleInstructions`.
///
@@ -38,19 +38,19 @@ use crate::utilities::RangeConstrained;
/// `left` and `right`.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MerkleChipOptimized<Hash, Commit, Fixed>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
{
base: MerkleChip<Hash, Commit, Fixed, DefaultLookupRangeCheckConfigOptimized>,
}

impl<Hash, Commit, Fixed> Chip<pallas::Base> for MerkleChipOptimized<Hash, Commit, Fixed>
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
where
Hash: HashDomains<pallas::Affine>,
Fixed: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, Fixed, Hash>,
{
type Config = MerkleConfig<Hash, Commit, Fixed, DefaultLookupRangeCheckConfigOptimized>;
type Loaded = ();
@@ -65,10 +65,10 @@ impl<Hash, Commit, Fixed> Chip<pallas::Base> for MerkleChipOptimized<Hash, Commi
}

impl<Hash, Commit, F> MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
/// Configures the [`MerkleChip`].
pub fn configure(
@@ -94,12 +94,12 @@ impl<Hash, Commit, F> MerkleChipOptimized<Hash, Commit, F>
}

impl<Hash, Commit, F, const MERKLE_DEPTH: usize>
MerkleInstructions<pallas::Affine, MERKLE_DEPTH, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine> + Eq,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash> + Eq,
MerkleInstructions<pallas::Affine, MERKLE_DEPTH, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine> + Eq,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash> + Eq,
{
// Todo: simplify the body?
#[allow(non_snake_case)]
@@ -311,25 +311,23 @@ for MerkleChipOptimized<Hash, Commit, F>
}

Ok(hash)


}
}

impl<Hash, Commit, F> UtilitiesInstructions<pallas::Base> for MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
type Var = AssignedCell<pallas::Base, pallas::Base>;
}

impl<Hash, Commit, F> CondSwapInstructions<pallas::Base> for MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
#[allow(clippy::type_complexity)]
fn swap(
@@ -343,11 +341,11 @@ impl<Hash, Commit, F> CondSwapInstructions<pallas::Base> for MerkleChipOptimized
}

impl<Hash, Commit, F> SinsemillaInstructions<pallas::Affine, { sinsemilla::K }, { sinsemilla::C }>
for MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
for MerkleChipOptimized<Hash, Commit, F>
where
Hash: HashDomains<pallas::Affine>,
F: FixedPoints<pallas::Affine>,
Commit: CommitDomains<pallas::Affine, F, Hash>,
{
type CellValue = <SinsemillaChipOptimized<Hash, Commit, F> as SinsemillaInstructions<
pallas::Affine,
@@ -425,4 +423,4 @@ for MerkleChipOptimized<Hash, Commit, F>
fn extract(point: &Self::NonIdentityPoint) -> Self::X {
SinsemillaChipOptimized::<Hash, Commit, F>::extract(point)
}
}
}
3 changes: 0 additions & 3 deletions halo2_gadgets/src/utilities/lookup_range_check.rs
Original file line number Diff line number Diff line change
@@ -287,7 +287,6 @@ pub trait LookupRangeCheck<F: PrimeFieldBits, const K: usize> {
}

impl<F: PrimeFieldBits, const K: usize> LookupRangeCheck<F, K> for LookupRangeCheckConfig<F, K> {

fn config(&self) -> &LookupRangeCheckConfig<F, K> {
self
}
@@ -440,5 +439,3 @@ pub trait DefaultLookupRangeCheck:
}

impl DefaultLookupRangeCheck for LookupRangeCheckConfig<pallas::Base, { sinsemilla::K }> {}


2 changes: 1 addition & 1 deletion halo2_gadgets/src/utilities_opt/cond_swap.rs
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ mod tests {
tests::TestFixedBases,
NonIdentityPoint, Point,
},
utilities::lookup_range_check::{LookupRangeCheck},
utilities::lookup_range_check::LookupRangeCheck,
};

use group::{cofactor::CofactorCurveAffine, Curve, Group};

Unchanged files with check annotations Beta

}
#[cfg(test)]
mod tests {

Check warning on line 260 in halo2_gadgets/src/utilities_opt/lookup_range_check.rs

GitHub Actions / Clippy (beta)

items after a test module

warning: items after a test module --> halo2_gadgets/src/utilities_opt/lookup_range_check.rs:260:1 | 260 | mod tests { | ^^^^^^^^^ ... 567 | pub(crate) type DefaultLookupRangeCheckConfigOptimized = | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 570 | impl DefaultLookupRangeCheck for DefaultLookupRangeCheckConfigOptimized {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module = note: `-W clippy::items-after-test-module` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::items_after_test_module)]` = help: move the items to before the test module was defined
use super::{LookupRangeCheck, LookupRangeCheckConfigOptimized};
use crate::sinsemilla::primitives::K;
Self {
inner: value.map(|value| bitrange_subset(value, bitrange)),
num_bits,
_phantom: PhantomData::default(),

Check warning on line 103 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:103:34 | 103 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 103 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:103:34 | 103 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
Self {
inner: cell,
num_bits,
_phantom: PhantomData::default(),

Check warning on line 118 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:118:34 | 118 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 118 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:118:34 | 118 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
RangeConstrained {
inner: self.inner.value().copied(),
num_bits: self.num_bits,
_phantom: PhantomData::default(),

Check warning on line 127 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:127:34 | 127 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 127 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/utilities.rs:127:34 | 127 | _phantom: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
assert_eq!(field_elem, sum);
};
decompose(pallas::Base::random(rng), &[0..255]);

Check warning on line 407 in halo2_gadgets/src/utilities.rs

GitHub Actions / Clippy (beta)

an array of `Range` that is only one element

warning: an array of `Range` that is only one element --> halo2_gadgets/src/utilities.rs:407:47 | 407 | decompose(pallas::Base::random(rng), &[0..255]); | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init = note: `-W clippy::single-range-in-vec-init` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::single_range_in_vec_init)]` help: if you wanted a `Vec` that contains the entire range, try | 407 | decompose(pallas::Base::random(rng), &(0..255).collect::<std::vec::Vec<usize>>()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help: if you wanted an array of len 255, try | 407 | decompose(pallas::Base::random(rng), &[0; 255]); | ~~~~~~
decompose(pallas::Base::random(rng), &[0..1, 1..255]);
decompose(pallas::Base::random(rng), &[0..254, 254..255]);
decompose(pallas::Base::random(rng), &[0..127, 127..255]);
let domain = CommitDomain::new("z.cash:ZSA-NoteCommit");
let mut os_rng = OsRng::default();

Check warning on line 57 in halo2_gadgets/src/sinsemilla_opt/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/sinsemilla_opt/primitives.rs:57:31 | 57 | let mut os_rng = OsRng::default(); | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
let msg: Vec<bool> = (0..36).map(|_| os_rng.gen::<bool>()).collect();
let rcm = pallas::Scalar::random(&mut os_rng);
let point = merkle_crh
.hash_to_point(
l.into_iter()
.chain(left.into_iter())

Check warning on line 681 in halo2_gadgets/src/sinsemilla.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_gadgets/src/sinsemilla.rs:681:48 | 681 | ... .chain(left.into_iter()) | ^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `left` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `-W clippy::useless-conversion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::useless_conversion)]`
.chain(right.into_iter()),

Check warning on line 682 in halo2_gadgets/src/sinsemilla.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_gadgets/src/sinsemilla.rs:682:48 | 682 | ... .chain(right.into_iter()), | ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `right` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
)
.unwrap();
point.to_affine()
}
fn sbox(val: Fp) -> Fp {
val.pow_vartime(&[5])

Check warning on line 127 in halo2_gadgets/benches/poseidon.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/benches/poseidon.rs:127:25 | 127 | val.pow_vartime(&[5]) | ^^^^ help: change this to: `[5]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`
}
fn secure_mds() -> usize {
.unwrap(),
),
state,
_marker: PhantomData::default(),

Check warning on line 159 in halo2_gadgets/src/poseidon.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon.rs:159:33 | 159 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 159 in halo2_gadgets/src/poseidon.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon.rs:159:33 | 159 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
})
}
chip: self.chip,
mode,
state: self.state,
_marker: PhantomData::default(),

Check warning on line 206 in halo2_gadgets/src/poseidon.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon.rs:206:33 | 206 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 206 in halo2_gadgets/src/poseidon.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon.rs:206:33 | 206 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
})
}
}
state,
mds_matrix,
round_constants,
_marker: PhantomData::default(),

Check warning on line 220 in halo2_gadgets/src/poseidon/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives.rs:220:33 | 220 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 220 in halo2_gadgets/src/poseidon/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives.rs:220:33 | 220 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
state: self.state,
mds_matrix: self.mds_matrix,
round_constants: self.round_constants,
_marker: PhantomData::default(),

Check warning on line 257 in halo2_gadgets/src/poseidon/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives.rs:257:33 | 257 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 257 in halo2_gadgets/src/poseidon/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives.rs:257:33 | 257 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
pub fn init() -> Self {
Hash {
sponge: Sponge::new(D::initial_capacity_element()),
_domain: PhantomData::default(),

Check warning on line 363 in halo2_gadgets/src/poseidon/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives.rs:363:33 | 363 | _domain: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 363 in halo2_gadgets/src/poseidon/primitives.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives.rs:363:33 | 363 | _domain: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
impl<F: Field, const SECURE_MDS: usize> P128Pow5T3Gen<F, SECURE_MDS> {
#![allow(dead_code)]
pub fn new() -> Self {
P128Pow5T3Gen(PhantomData::default())

Check warning on line 88 in halo2_gadgets/src/poseidon/primitives/p128pow5t3.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives/p128pow5t3.rs:88:38 | 88 | P128Pow5T3Gen(PhantomData::default()) | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
let mut grain = Grain {
state,
next_bit: STATE,
_field: PhantomData::default(),

Check warning on line 72 in halo2_gadgets/src/poseidon/primitives/grain.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives/grain.rs:72:32 | 72 | _field: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `-W clippy::default-constructed-unit-structs` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::default_constructed_unit_structs)]`

Check warning on line 72 in halo2_gadgets/src/poseidon/primitives/grain.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_gadgets/src/poseidon/primitives/grain.rs:72:32 | 72 | _field: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `-W clippy::default-constructed-unit-structs` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::default_constructed_unit_structs)]`
};
// Discard the first 160 bits.
// Load the initial state into this region.
let state = Pow5State::load(&mut region, config, initial_state)?;
let state = (0..config.half_full_rounds).fold(Ok(state), |res, r| {
res.and_then(|state| state.full_round(&mut region, config, r, r))
})?;

Check warning on line 243 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_gadgets/src/poseidon/pow5.rs:241:58 | 241 | let state = (0..config.half_full_rounds).fold(Ok(state), |res, r| { | __________________________________________________________^ 242 | | res.and_then(|state| state.full_round(&mut region, config, r, r)) 243 | | })?; | |__________________^ help: use `try_fold` instead: `try_fold(state, |res, r| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold = note: `-W clippy::manual-try-fold` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::manual_try_fold)]`

Check warning on line 243 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_gadgets/src/poseidon/pow5.rs:241:58 | 241 | let state = (0..config.half_full_rounds).fold(Ok(state), |res, r| { | __________________________________________________________^ 242 | | res.and_then(|state| state.full_round(&mut region, config, r, r)) 243 | | })?; | |__________________^ help: use `try_fold` instead: `try_fold(state, |res, r| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold = note: `-W clippy::manual-try-fold` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::manual_try_fold)]`
let state = (0..config.half_partial_rounds).fold(Ok(state), |res, r| {
res.and_then(|state| {
state.partial_round(
&mut region,
config,
config.half_full_rounds + 2 * r,
config.half_full_rounds + r,
)
})
})?;

Check warning on line 254 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_gadgets/src/poseidon/pow5.rs:245:61 | 245 | let state = (0..config.half_partial_rounds).fold(Ok(state), |res, r| { | _____________________________________________________________^ 246 | | res.and_then(|state| { 247 | | state.partial_round( 248 | | &mut region, ... | 253 | | }) 254 | | })?; | |__________________^ help: use `try_fold` instead: `try_fold(state, |res, r| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold

Check warning on line 254 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_gadgets/src/poseidon/pow5.rs:245:61 | 245 | let state = (0..config.half_partial_rounds).fold(Ok(state), |res, r| { | _____________________________________________________________^ 246 | | res.and_then(|state| { 247 | | state.partial_round( 248 | | &mut region, ... | 253 | | }) 254 | | })?; | |__________________^ help: use `try_fold` instead: `try_fold(state, |res, r| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold
let state = (0..config.half_full_rounds).fold(Ok(state), |res, r| {
res.and_then(|state| {
state.full_round(
&mut region,
config,
config.half_full_rounds + 2 * config.half_partial_rounds + r,
config.half_full_rounds + config.half_partial_rounds + r,
)
})
})?;

Check warning on line 265 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_gadgets/src/poseidon/pow5.rs:256:58 | 256 | let state = (0..config.half_full_rounds).fold(Ok(state), |res, r| { | __________________________________________________________^ 257 | | res.and_then(|state| { 258 | | state.full_round( 259 | | &mut region, ... | 264 | | }) 265 | | })?; | |__________________^ help: use `try_fold` instead: `try_fold(state, |res, r| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold

Check warning on line 265 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_gadgets/src/poseidon/pow5.rs:256:58 | 256 | let state = (0..config.half_full_rounds).fold(Ok(state), |res, r| { | __________________________________________________________^ 257 | | res.and_then(|state| { 258 | | state.full_round( 259 | | &mut region, ... | 264 | | }) 265 | | })?; | |__________________^ help: use `try_fold` instead: `try_fold(state, |res, r| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold
Ok(state.0)
},
.value()
.map(|v| *v + config.round_constants[round][idx])
});
let r: Value<Vec<F>> = q.map(|q| q.map(|q| q.pow(&config.alpha))).collect();

Check warning on line 451 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/poseidon/pow5.rs:451:62 | 451 | let r: Value<Vec<F>> = q.map(|q| q.map(|q| q.pow(&config.alpha))).collect(); | ^^^^^^^^^^^^^ help: change this to: `config.alpha` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 451 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/poseidon/pow5.rs:451:62 | 451 | let r: Value<Vec<F>> = q.map(|q| q.map(|q| q.pow(&config.alpha))).collect(); | ^^^^^^^^^^^^^ help: change this to: `config.alpha` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
let m = &config.m_reg;
let state = m.iter().map(|m_i| {
r.as_ref().map(|r| {
let p: Value<Vec<_>> = self.0.iter().map(|word| word.0.value().cloned()).collect();
let r: Value<Vec<_>> = p.map(|p| {
let r_0 = (p[0] + config.round_constants[round][0]).pow(&config.alpha);

Check warning on line 477 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/poseidon/pow5.rs:477:73 | 477 | let r_0 = (p[0] + config.round_constants[round][0]).pow(&config.alpha); | ^^^^^^^^^^^^^ help: change this to: `config.alpha` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 477 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/poseidon/pow5.rs:477:73 | 477 | let r_0 = (p[0] + config.round_constants[round][0]).pow(&config.alpha); | ^^^^^^^^^^^^^ help: change this to: `config.alpha` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
let r_i = p[1..]
.iter()
.enumerate()
}
let r_mid: Value<Vec<_>> = p_mid.map(|p| {
let r_0 = (p[0] + config.round_constants[round + 1][0]).pow(&config.alpha);

Check warning on line 517 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/poseidon/pow5.rs:517:77 | 517 | let r_0 = (p[0] + config.round_constants[round + 1][0]).pow(&config.alpha); | ^^^^^^^^^^^^^ help: change this to: `config.alpha` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 517 in halo2_gadgets/src/poseidon/pow5.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/poseidon/pow5.rs:517:77 | 517 | let r_0 = (p[0] + config.round_constants[round + 1][0]).pow(&config.alpha); | ^^^^^^^^^^^^^ help: change this to: `config.alpha` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
let r_i = p[1..]
.iter()
.enumerate()
base: &F,
) -> Result<NonIdentityEccPoint, Error> {
// `scalar = [(k_w + 2) ⋅ 8^w]
let scalar = k.map(|k| (k + *TWO_SCALAR) * (*H_SCALAR).pow(&[w as u64, 0, 0, 0]));

Check warning on line 373 in halo2_gadgets/src/ecc/chip/mul_fixed.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/mul_fixed.rs:373:68 | 373 | let scalar = k.map(|k| (k + *TWO_SCALAR) * (*H_SCALAR).pow(&[w as u64, 0, 0, 0])); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[w as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 373 in halo2_gadgets/src/ecc/chip/mul_fixed.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/mul_fixed.rs:373:68 | 373 | let scalar = k.map(|k| (k + *TWO_SCALAR) * (*H_SCALAR).pow(&[w as u64, 0, 0, 0])); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[w as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
self.process_window::<_, NUM_WINDOWS>(region, offset, w, k_usize, scalar, base)
}
// offset_acc = \sum_{j = 0}^{NUM_WINDOWS - 2} 2^{FIXED_BASE_WINDOW_SIZE*j + 1}
let offset_acc = (0..(NUM_WINDOWS - 1)).fold(pallas::Scalar::zero(), |acc, w| {
acc + (*TWO_SCALAR).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0])

Check warning on line 390 in halo2_gadgets/src/ecc/chip/mul_fixed.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/mul_fixed.rs:390:37 | 390 | acc + (*TWO_SCALAR).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 390 in halo2_gadgets/src/ecc/chip/mul_fixed.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/mul_fixed.rs:390:37 | 390 | acc + (*TWO_SCALAR).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
});
// `scalar = [k * 8^(NUM_WINDOWS - 1) - offset_acc]`.
let scalar = scalar.windows_field()[scalar.windows_field().len() - 1]
.map(|k| k * (*H_SCALAR).pow(&[(NUM_WINDOWS - 1) as u64, 0, 0, 0]) - offset_acc);

Check warning on line 395 in halo2_gadgets/src/ecc/chip/mul_fixed.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/mul_fixed.rs:395:42 | 395 | .map(|k| k * (*H_SCALAR).pow(&[(NUM_WINDOWS - 1) as u64, 0, 0, 0]) - offset_acc); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[(NUM_WINDOWS - 1) as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 395 in halo2_gadgets/src/ecc/chip/mul_fixed.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/mul_fixed.rs:395:42 | 395 | .map(|k| k * (*H_SCALAR).pow(&[(NUM_WINDOWS - 1) as u64, 0, 0, 0]) - offset_acc); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[(NUM_WINDOWS - 1) as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
self.process_window::<_, NUM_WINDOWS>(
region,
.map(|k| {
// scalar = (k+2)*(8^w)
let scalar = C::Scalar::from(k as u64 + 2)
* C::Scalar::from(H as u64).pow(&[w as u64, 0, 0, 0]);

Check warning on line 52 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:52:57 | 52 | * C::Scalar::from(H as u64).pow(&[w as u64, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[w as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`

Check warning on line 52 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:52:57 | 52 | * C::Scalar::from(H as u64).pow(&[w as u64, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[w as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`
(base * scalar).to_affine()
})
.collect::<ArrayVec<C, H>>()
// For the last window, we compute [k * (2^3)^w - sum]B, where sum is defined
// as sum = \sum_{j = 0}^{`num_windows - 2`} 2^{3j+1}
let sum = (0..(num_windows - 1)).fold(C::Scalar::ZERO, |acc, j| {
acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1, 0, 0, 0])

Check warning on line 65 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:65:38 | 65 | acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 65 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:65:38 | 65 | acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
});
window_table.push(
(0..H)
.map(|k| {
// scalar = k * (2^3)^w - sum, where w = `num_windows - 1`
let scalar = C::Scalar::from(k as u64)
* C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0])

Check warning on line 72 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:72:53 | 72 | * C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[(num_windows - 1) as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 72 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:72:53 | 72 | * C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[(num_windows - 1) as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
- sum;
(base * scalar).to_affine()
})
// Compute the actual x-coordinate of the multiple [(k+2)*(8^w)]B.
let point = base
* C::Scalar::from(bits as u64 + 2)
* C::Scalar::from(H as u64).pow(&[idx as u64, 0, 0, 0]);

Check warning on line 200 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:200:53 | 200 | * C::Scalar::from(H as u64).pow(&[idx as u64, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[idx as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 200 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:200:53 | 200 | * C::Scalar::from(H as u64).pow(&[idx as u64, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[idx as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
let x = *point.to_affine().coordinates().unwrap().x();
// Check that the interpolated x-coordinate matches the actual one.
// Compute the actual x-coordinate of the multiple [k * (8^84) - offset]B,
// where offset = \sum_{j = 0}^{83} 2^{3j+1}
let offset = (0..(num_windows - 1)).fold(C::Scalar::ZERO, |acc, w| {
acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0])

Check warning on line 217 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:217:42 | 217 | acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 217 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:217:42 | 217 | acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
});
let scalar = C::Scalar::from(bits as u64)
* C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0])

Check warning on line 220 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:220:45 | 220 | * C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[(num_windows - 1) as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 220 in halo2_gadgets/src/ecc/chip/constants.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_gadgets/src/ecc/chip/constants.rs:220:45 | 220 | * C::Scalar::from(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `[(num_windows - 1) as u64, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
- offset;
let point = base * scalar;
let x = *point.to_affine().coordinates().unwrap().x();
fn lookup_table() {
/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
pub struct Variable(Column<Advice>, usize);

Check warning on line 308 in halo2_gadgets/src/sha256/table16/spread_table.rs

GitHub Actions / Clippy (beta)

struct `Variable` is never constructed

warning: struct `Variable` is never constructed --> halo2_gadgets/src/sha256/table16/spread_table.rs:308:20 | 308 | pub struct Variable(Column<Advice>, usize); | ^^^^^^^^ | = note: `Variable` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default
struct MyCircuit {}
|| Value::known(Fp::from(2 * i as u64)),
)
})
.fold(Ok(()), |acc, res| acc.and(res))

Check warning on line 1066 in halo2_proofs/src/dev.rs

GitHub Actions / Clippy (beta)

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try` --> halo2_proofs/src/dev.rs:1066:30 | 1066 | ... .fold(Ok(()), |acc, res| acc.and(res)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold((), |acc, res| ...)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold = note: `-W clippy::manual-try-fold` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::manual_try_fold)]`
},
)?;
total_rows: 0,
total_advice_rows: 0,
total_fixed_rows: 0,
/// Any cells assigned outside of a region.

Check warning on line 105 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

unused doc comment

warning: unused doc comment --> halo2_proofs/src/dev/cost.rs:105:13 | 105 | /// Any cells assigned outside of a region. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 106 | loose_cells: vec![], | ------------------- rustdoc does not generate documentation for expression fields | = help: use `//` for a plain comment = note: `#[warn(unused_doc_comments)]` on by default

Check warning on line 105 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

unused doc comment

warning: unused doc comment --> halo2_proofs/src/dev/cost.rs:105:13 | 105 | /// Any cells assigned outside of a region. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 106 | loose_cells: vec![], | ------------------- rustdoc does not generate documentation for expression fields | = help: use `//` for a plain comment = note: `#[warn(unused_doc_comments)]` on by default

Check warning on line 105 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Bitrot check

unused doc comment
loose_cells: vec![],
/// Pairs of cells between which we have equality constraints.

Check warning on line 107 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

unused doc comment

warning: unused doc comment --> halo2_proofs/src/dev/cost.rs:107:13 | 107 | /// Pairs of cells between which we have equality constraints. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 108 | equality: vec![], | ---------------- rustdoc does not generate documentation for expression fields | = help: use `//` for a plain comment

Check warning on line 107 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

unused doc comment

warning: unused doc comment --> halo2_proofs/src/dev/cost.rs:107:13 | 107 | /// Pairs of cells between which we have equality constraints. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 108 | equality: vec![], | ---------------- rustdoc does not generate documentation for expression fields | = help: use `//` for a plain comment

Check warning on line 107 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Bitrot check

unused doc comment
equality: vec![],
/// Selector assignments used for optimization pass

Check warning on line 109 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

unused doc comment

warning: unused doc comment --> halo2_proofs/src/dev/cost.rs:109:13 | 109 | /// Selector assignments used for optimization pass | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 110 | selectors: vec![vec![false; n]; num_selectors], | ---------------------------------------------- rustdoc does not generate documentation for expression fields | = help: use `//` for a plain comment

Check warning on line 109 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

unused doc comment

warning: unused doc comment --> halo2_proofs/src/dev/cost.rs:109:13 | 109 | /// Selector assignments used for optimization pass | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 110 | selectors: vec![vec![false; n]; num_selectors], | ---------------------------------------------- rustdoc does not generate documentation for expression fields | = help: use `//` for a plain comment

Check warning on line 109 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Bitrot check

unused doc comment
selectors: vec![vec![false; n]; num_selectors],
}
}
lookups: cs.lookups.len(),
permutation_cols,
point_sets: point_sets.len(),
_marker: PhantomData::default(),

Check warning on line 328 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/dev/cost.rs:328:33 | 328 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 328 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/dev/cost.rs:328:33 | 328 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
max_rows: layout.total_rows,
max_advice_rows: layout.total_advice_rows,
max_fixed_rows: layout.total_fixed_rows,
if chunks == 0 { chunks } else { 3 * chunks - 1 },
),
_marker: PhantomData::default(),

Check warning on line 371 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/dev/cost.rs:371:33 | 371 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
// - xi
polycomm: ProofContribution::new((1 + 2 * self.k).try_into().unwrap(), 2),
_marker: PhantomData::default(),

Check warning on line 414 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/dev/cost.rs:414:33 | 414 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 414 in halo2_proofs/src/dev/cost.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/dev/cost.rs:414:33 | 414 | _marker: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
}
assigned
.iter()
.zip(assigned_denominators.into_iter())

Check warning on line 159 in halo2_proofs/src/poly.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/poly.rs:159:14 | 159 | .zip(assigned_denominators.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `assigned_denominators` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 159 in halo2_proofs/src/poly.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/poly.rs:159:14 | 159 | .zip(assigned_denominators.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `assigned_denominators` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
.map(|(poly, inv_denoms)| poly.invert(inv_denoms.into_iter().map(|d| d.unwrap_or(F::ONE))))
.collect()
}
impl<F: Field> Polynomial<Assigned<F>, LagrangeCoeff> {
pub(crate) fn invert(
&self,
inv_denoms: impl Iterator<Item = F> + ExactSizeIterator,

Check warning on line 167 in halo2_proofs/src/poly.rs

GitHub Actions / Clippy (beta)

this bound is already specified as the supertrait of `ExactSizeIterator`

warning: this bound is already specified as the supertrait of `ExactSizeIterator` --> halo2_proofs/src/poly.rs:167:26 | 167 | inv_denoms: impl Iterator<Item = F> + ExactSizeIterator, | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls = note: `-W clippy::implied-bounds-in-impls` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::implied_bounds_in_impls)]` help: try removing this bound | 167 - inv_denoms: impl Iterator<Item = F> + ExactSizeIterator, 167 + inv_denoms: impl ExactSizeIterator<Item = F>, |

Check warning on line 167 in halo2_proofs/src/poly.rs

GitHub Actions / Clippy (beta)

this bound is already specified as the supertrait of `ExactSizeIterator`

warning: this bound is already specified as the supertrait of `ExactSizeIterator` --> halo2_proofs/src/poly.rs:167:26 | 167 | inv_denoms: impl Iterator<Item = F> + ExactSizeIterator, | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls = note: `-W clippy::implied-bounds-in-impls` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::implied_bounds_in_impls)]` help: try removing this bound | 167 - inv_denoms: impl Iterator<Item = F> + ExactSizeIterator, 167 + inv_denoms: impl ExactSizeIterator<Item = F>, |
) -> Polynomial<F, LagrangeCoeff> {
assert_eq!(inv_denoms.len(), self.values.len());
Polynomial {
values: self
.values
.iter()
.zip(inv_denoms.into_iter())

Check warning on line 174 in halo2_proofs/src/poly.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/poly.rs:174:22 | 174 | .zip(inv_denoms.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `inv_denoms` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 174 in halo2_proofs/src/poly.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/poly.rs:174:22 | 174 | .zip(inv_denoms.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `inv_denoms` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
.map(|(a, inv_den)| a.numerator() * inv_den)
.collect(),
_marker: self._marker,
let mut point_index_set = BTreeSet::new();
for (commitment, point_idx_set) in commitment_set_map.iter() {
if query.get_commitment() == *commitment {
point_index_set = point_idx_set.clone();

Check warning on line 208 in halo2_proofs/src/poly/multiopen.rs

GitHub Actions / Clippy (beta)

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient --> halo2_proofs/src/poly/multiopen.rs:208:17 | 208 | point_index_set = point_idx_set.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `point_index_set.clone_from(point_idx_set)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `-W clippy::assigning-clones` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::assigning_clones)]`

Check warning on line 208 in halo2_proofs/src/poly/multiopen.rs

GitHub Actions / Clippy (beta)

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient --> halo2_proofs/src/poly/multiopen.rs:208:17 | 208 | point_index_set = point_idx_set.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `point_index_set.clone_from(point_idx_set)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `-W clippy::assigning-clones` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::assigning_clones)]`
}
}
assert!(!point_index_set.is_empty());
let x_4: ChallengeX4<_> = transcript.squeeze_challenge_scalar();
let (p_poly, p_poly_blind) = q_polys.into_iter().zip(q_blinds.into_iter()).fold(

Check warning on line 105 in halo2_proofs/src/poly/multiopen/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/poly/multiopen/prover.rs:105:58 | 105 | let (p_poly, p_poly_blind) = q_polys.into_iter().zip(q_blinds.into_iter()).fold( | ^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `q_blinds` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 105 in halo2_proofs/src/poly/multiopen/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/poly/multiopen/prover.rs:105:58 | 105 | let (p_poly, p_poly_blind) = q_polys.into_iter().zip(q_blinds.into_iter()).fold( | ^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `q_blinds` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
(q_prime_poly, q_prime_blind),
|(q_prime_poly, q_prime_blind), (poly, blind)| {
(
AstLeaf {
index: self.index,
rotation,
_evaluator: PhantomData::default(),

Check warning on line 78 in halo2_proofs/src/poly/evaluator.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/poly/evaluator.rs:78:36 | 78 | _evaluator: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `-W clippy::default-constructed-unit-structs` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::default_constructed_unit_structs)]`

Check warning on line 78 in halo2_proofs/src/poly/evaluator.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/poly/evaluator.rs:78:36 | 78 | _evaluator: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `-W clippy::default-constructed-unit-structs` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::default_constructed_unit_structs)]`
}
}
}
AstLeaf {
index,
rotation: Rotation::cur(),
_evaluator: PhantomData::default(),

Check warning on line 124 in halo2_proofs/src/poly/evaluator.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/poly/evaluator.rs:124:36 | 124 | _evaluator: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 124 in halo2_proofs/src/poly/evaluator.rs

GitHub Actions / Clippy (beta)

use of `default` to create a unit struct

warning: use of `default` to create a unit struct --> halo2_proofs/src/poly/evaluator.rs:124:36 | 124 | _evaluator: PhantomData::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
}
}
let mut l = vec![];
let mut points = vec![];
for i in 0..8 {
points.push(domain.omega.pow(&[i, 0, 0, 0]));

Check warning on line 549 in halo2_proofs/src/poly/domain.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_proofs/src/poly/domain.rs:549:38 | 549 | points.push(domain.omega.pow(&[i, 0, 0, 0])); | ^^^^^^^^^^^^^ help: change this to: `[i, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
}
for i in 0..8 {
let mut l_i = vec![Scalar::zero(); 8];
}
let x = Scalar::random(OsRng);
let xn = x.pow(&[8, 0, 0, 0]);

Check warning on line 559 in halo2_proofs/src/poly/domain.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_proofs/src/poly/domain.rs:559:20 | 559 | let xn = x.pow(&[8, 0, 0, 0]); | ^^^^^^^^^^^^^ help: change this to: `[8, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
let evaluations = domain.l_i_range(x, xn, -7..=7);
for i in 0..8 {
// commitments open to the correct values.
let vanishing = {
// x^n
let xn = x.pow(&[params.n, 0, 0, 0]);

Check warning on line 206 in halo2_proofs/src/plonk/verifier.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_proofs/src/plonk/verifier.rs:206:24 | 206 | let xn = x.pow(&[params.n, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[params.n, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 206 in halo2_proofs/src/plonk/verifier.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_proofs/src/plonk/verifier.rs:206:24 | 206 | let xn = x.pow(&[params.n, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[params.n, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
let blinding_factors = vk.cs.blinding_factors();
let l_evals = vk
x,
))
.chain(
lookups
.iter()
.zip(vk.cs.lookups.iter())
.flat_map(move |(p, argument)| {
p.expressions(
l_0,
l_last,
l_blind,
argument,
theta,
beta,
gamma,
advice_evals,
fixed_evals,
instance_evals,
)
})
.into_iter(),

Check warning on line 276 in halo2_proofs/src/plonk/verifier.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/verifier.rs:259:25 | 259 | / lookups 260 | | .iter() 261 | | .zip(vk.cs.lookups.iter()) 262 | | .flat_map(move |(p, argument)| { ... | 275 | | }) 276 | | .into_iter(), | |________________________________________^ | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing the `.into_iter()` | 259 ~ lookups 260 + .iter() 261 + .zip(vk.cs.lookups.iter()) 262 + .flat_map(move |(p, argument)| { 263 + p.expressions( 264 + l_0, 265 + l_last, 266 + l_blind, 267 + argument, 268 + theta, 269 + beta, 270 + gamma, 271 + advice_evals, 272 + fixed_evals, 273 + instance_evals, 274 + ) 275 ~ }), |

Check warning on line 276 in halo2_proofs/src/plonk/verifier.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/verifier.rs:259:25 | 259 | / lookups 260 | | .iter() 261 | | .zip(vk.cs.lookups.iter()) 262 | | .flat_map(move |(p, argument)| { ... | 275 | | }) 276 | | .into_iter(), | |________________________________________^ | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing the `.into_iter()` | 259 ~ lookups 260 + .iter() 261 + .zip(vk.cs.lookups.iter()) 262 + .flat_map(move |(p, argument)| { 263 + p.expressions( 264 + l_0, 265 + l_last, 266 + l_blind, 267 + argument, 268 + theta, 269 + beta, 270 + gamma, 271 + advice_evals, 272 + fixed_evals, 273 + instance_evals, 274 + ) 275 ~ }), |
)
});
))
.chain(permutation.queries(vk, x))
.chain(
lookups
.iter()
.flat_map(move |p| p.queries(vk, x))
.into_iter(),

Check warning on line 322 in halo2_proofs/src/plonk/verifier.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/verifier.rs:319:25 | 319 | / lookups 320 | | .iter() 321 | | .flat_map(move |p| p.queries(vk, x)) 322 | | .into_iter(), | |________________________________________^ | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing the `.into_iter()` | 319 ~ lookups 320 + .iter() 321 ~ .flat_map(move |p| p.queries(vk, x)), |

Check warning on line 322 in halo2_proofs/src/plonk/verifier.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/verifier.rs:319:25 | 319 | / lookups 320 | | .iter() 321 | | .flat_map(move |p| p.queries(vk, x)) 322 | | .into_iter(), | |________________________________________^ | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing the `.into_iter()` | 319 ~ lookups 320 + .iter() 321 ~ .flat_map(move |p| p.queries(vk, x)), |
)
},
)
let expressions = advice_cosets
.iter()
.zip(instance_cosets.iter())
.zip(permutation_expressions.into_iter())

Check warning on line 546 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:546:14 | 546 | .zip(permutation_expressions.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `permutation_expressions` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 546 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:546:14 | 546 | .zip(permutation_expressions.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `permutation_expressions` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
.zip(lookup_expressions.into_iter())

Check warning on line 547 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:547:14 | 547 | .zip(lookup_expressions.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `lookup_expressions` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 547 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:547:14 | 547 | .zip(lookup_expressions.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `lookup_expressions` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
.flat_map(
|(((advice_cosets, instance_cosets), permutation_expressions), lookup_expressions)| {
let fixed_cosets = &fixed_cosets;
})
}))
// Permutation constraints, if any.
.chain(permutation_expressions.into_iter())

Check warning on line 581 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:581:28 | 581 | .chain(permutation_expressions.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `permutation_expressions` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 581 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:581:28 | 581 | .chain(permutation_expressions.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `permutation_expressions` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
// Lookup constraints, if any.
.chain(lookup_expressions.into_iter().flatten())
},
)?;
let x: ChallengeX<_> = transcript.squeeze_challenge_scalar();
let xn = x.pow(&[params.n, 0, 0, 0]);

Check warning on line 599 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_proofs/src/plonk/prover.rs:599:20 | 599 | let xn = x.pow(&[params.n, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[params.n, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`

Check warning on line 599 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> halo2_proofs/src/plonk/prover.rs:599:20 | 599 | let xn = x.pow(&[params.n, 0, 0, 0]); | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `[params.n, 0, 0, 0]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `-W clippy::needless-borrows-for-generic-args` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrows_for_generic_args)]`
// Compute and hash instance evals for each circuit instance
for instance in instance.iter() {
}),
)
.chain(permutation.open(pk, x))
.chain(lookups.iter().flat_map(move |p| p.open(pk, x)).into_iter())

Check warning on line 707 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:707:24 | 707 | .chain(lookups.iter().flat_map(move |p| p.open(pk, x)).into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `lookups.iter().flat_map(move |p| p.open(pk, x))` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 707 in halo2_proofs/src/plonk/prover.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/prover.rs:707:24 | 707 | .chain(lookups.iter().flat_map(move |p| p.open(pk, x)).into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `lookups.iter().flat_map(move |p| p.open(pk, x))` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:484:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
})
.chain(
pk.vk
/// Represents an index into a vector where each entry corresponds to a distinct
/// point that polynomials are queried at.
#[derive(Copy, Clone, Debug)]
pub(crate) struct PointIndex(pub usize);

Check warning on line 769 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Clippy (beta)

struct `PointIndex` is never constructed

warning: struct `PointIndex` is never constructed --> halo2_proofs/src/plonk/circuit.rs:769:19 | 769 | pub(crate) struct PointIndex(pub usize); | ^^^^^^^^^^

Check warning on line 769 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Clippy (beta)

struct `PointIndex` is never constructed

warning: struct `PointIndex` is never constructed --> halo2_proofs/src/plonk/circuit.rs:769:19 | 769 | pub(crate) struct PointIndex(pub usize); | ^^^^^^^^^^

Check warning on line 769 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Bitrot check

field `0` is never read
/// A "virtual cell" is a PLONK cell that has been queried at a particular relative offset
/// within a custom gate.
fn into_iter(self) -> Self::IntoIter {
std::iter::repeat(self.selector)
.zip(self.constraints.into_iter())

Check warning on line 893 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/circuit.rs:893:18 | 893 | .zip(self.constraints.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `self.constraints` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `-W clippy::useless-conversion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::useless_conversion)]`

Check warning on line 893 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/circuit.rs:893:18 | 893 | .zip(self.constraints.into_iter()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `self.constraints` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `-W clippy::useless-conversion` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::useless_conversion)]`
.map(apply_selector_to_constraint)
}
}
let (polys, selector_assignment) = compress_selectors::process(
selectors
.into_iter()
.zip(degrees.into_iter())

Check warning on line 1261 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/circuit.rs:1261:22 | 1261 | .zip(degrees.into_iter()) | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `degrees` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 1261 in halo2_proofs/src/plonk/circuit.rs

GitHub Actions / Clippy (beta)

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> halo2_proofs/src/plonk/circuit.rs:1261:22 | 1261 | .zip(degrees.into_iter()) | ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `degrees` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/6b544f5ff8d45221d61962651a5f5ab9fe535e16/library/core/src/iter/traits/iterator.rs:603:12 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
.enumerate()
.map(
|(i, (activations, max_degree))| compress_selectors::SelectorDescription {
);
pub use maybe_rayon::{
iter::{IntoParallelIterator, ParallelIterator},

Check warning on line 15 in halo2_proofs/src/multicore.rs

GitHub Actions / Clippy (beta)

unused imports: `ParallelIterator`, `Scope`

warning: unused imports: `ParallelIterator`, `Scope` --> halo2_proofs/src/multicore.rs:15:34 | 15 | iter::{IntoParallelIterator, ParallelIterator}, | ^^^^^^^^^^^^^^^^ 16 | join, scope, Scope, | ^^^^^ | = note: `#[warn(unused_imports)]` on by default

Check warning on line 15 in halo2_proofs/src/multicore.rs

GitHub Actions / Clippy (beta)

unused imports: `ParallelIterator`, `Scope`

warning: unused imports: `ParallelIterator`, `Scope` --> halo2_proofs/src/multicore.rs:15:34 | 15 | iter::{IntoParallelIterator, ParallelIterator}, | ^^^^^^^^^^^^^^^^ 16 | join, scope, Scope, | ^^^^^ | = note: `#[warn(unused_imports)]` on by default
join, scope, Scope,

Check warning on line 16 in halo2_proofs/src/multicore.rs

GitHub Actions / Bitrot check

unused import: `Scope`
};
#[cfg(feature = "multicore")]
}
#[cfg(not(feature = "multicore"))]
pub trait IndexedParallelIterator: std::iter::Iterator {}

Check warning on line 28 in halo2_proofs/src/multicore.rs

GitHub Actions / Clippy (beta)

trait `IndexedParallelIterator` is never used

warning: trait `IndexedParallelIterator` is never used --> halo2_proofs/src/multicore.rs:28:11 | 28 | pub trait IndexedParallelIterator: std::iter::Iterator {} | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default

Check warning on line 28 in halo2_proofs/src/multicore.rs

GitHub Actions / Clippy (beta)

trait `IndexedParallelIterator` is never used

warning: trait `IndexedParallelIterator` is never used --> halo2_proofs/src/multicore.rs:28:11 | 28 | pub trait IndexedParallelIterator: std::iter::Iterator {} | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
pub trait TryFoldAndReduce<T, E> {
/// Implements `iter.try_fold().try_reduce()` for `rayon::iter::ParallelIterator`,
fn criterion_benchmark(c: &mut Criterion) {
/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
pub struct Variable(Column<Advice>, usize);

Check warning on line 19 in halo2_proofs/benches/plonk.rs

GitHub Actions / Clippy (beta)

struct `Variable` is never constructed

warning: struct `Variable` is never constructed --> halo2_proofs/benches/plonk.rs:19:16 | 19 | pub struct Variable(Column<Advice>, usize); | ^^^^^^^^ | = note: `Variable` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default
#[derive(Clone)]
struct PlonkConfig {
/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
pub struct Variable(Column<Advice>, usize);

Check warning on line 26 in halo2_proofs/tests/plonk_api.rs

GitHub Actions / Clippy (beta)

struct `Variable` is never constructed

warning: struct `Variable` is never constructed --> halo2_proofs/tests/plonk_api.rs:26:16 | 26 | pub struct Variable(Column<Advice>, usize); | ^^^^^^^^ | = note: `Variable` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default
// Initialize the polynomial commitment parameters
let params: Params<EqAffine> = Params::new(K);
/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
pub struct Variable(Column<Advice>, usize);

Check warning on line 13 in halo2_proofs/examples/circuit-layout.rs

GitHub Actions / Bitrot check

fields `0` and `1` are never read
#[derive(Clone)]
struct PlonkConfig {