algebra: Refactor implementation to be generic over curve choice #151
clippy
40 errors
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 40 |
Warning | 0 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.70.0-nightly (22f247c6f 2023-03-13)
- cargo 1.70.0-nightly (7d3033d2e 2023-03-08)
- clippy 0.1.70 (22f247c 2023-03-13)
Annotations
Check failure on line 1 in src/lib.rs
github-actions / clippy
cycle detected when computing the variances for items in this crate
error[E0391]: cycle detected when computing the variances for items in this crate
|
note: ...which requires computing function signature of `algebra::scalar::<impl at src/algebra/scalar.rs:45:1: 45:30>::inner`...
--> src/algebra/scalar.rs:60:5
|
60 | pub fn inner(&self) -> Self::Field {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires computing the variances of `algebra::scalar::Scalar`...
--> src/algebra/scalar.rs:43:1
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires computing the variances for items in this crate, completing the cycle
note: cycle used when computing the variances of `algebra::curve::CurvePoint`
--> src/algebra/curve.rs:56:1
|
56 | pub struct CurvePoint<C: CurveGroup>(pub(crate) C);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check failure on line 44 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:44:41
|
44 | ) -> (Vec<Scalar>, Vec<Scalar>, Vec<Scalar>) {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
44 | ) -> (Vec<Scalar>, Vec<Scalar>, Vec<Scalar<C>>) {
| +++
Check failure on line 44 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:44:28
|
44 | ) -> (Vec<Scalar>, Vec<Scalar>, Vec<Scalar>) {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
44 | ) -> (Vec<Scalar>, Vec<Scalar<C>>, Vec<Scalar>) {
| +++
Check failure on line 44 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:44:15
|
44 | ) -> (Vec<Scalar>, Vec<Scalar>, Vec<Scalar>) {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
44 | ) -> (Vec<Scalar<C>>, Vec<Scalar>, Vec<Scalar>) {
| +++
Check failure on line 39 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:39:52
|
39 | fn next_triplet(&mut self) -> (Scalar, Scalar, Scalar);
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
39 | fn next_triplet(&mut self) -> (Scalar, Scalar, Scalar<C>);
| +++
Check failure on line 39 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:39:44
|
39 | fn next_triplet(&mut self) -> (Scalar, Scalar, Scalar);
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
39 | fn next_triplet(&mut self) -> (Scalar, Scalar<C>, Scalar);
| +++
Check failure on line 39 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:39:36
|
39 | fn next_triplet(&mut self) -> (Scalar, Scalar, Scalar);
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
39 | fn next_triplet(&mut self) -> (Scalar<C>, Scalar, Scalar);
| +++
Check failure on line 33 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:33:89
|
33 | fn next_shared_inverse_pair_batch(&mut self, num_pairs: usize) -> (Vec<Scalar>, Vec<Scalar>) {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
33 | fn next_shared_inverse_pair_batch(&mut self, num_pairs: usize) -> (Vec<Scalar>, Vec<Scalar<C>>) {
| +++
Check failure on line 33 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:33:76
|
33 | fn next_shared_inverse_pair_batch(&mut self, num_pairs: usize) -> (Vec<Scalar>, Vec<Scalar>) {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
33 | fn next_shared_inverse_pair_batch(&mut self, num_pairs: usize) -> (Vec<Scalar<C>>, Vec<Scalar>) {
| +++
Check failure on line 31 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:31:56
|
31 | fn next_shared_inverse_pair(&mut self) -> (Scalar, Scalar);
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
31 | fn next_shared_inverse_pair(&mut self) -> (Scalar, Scalar<C>);
| +++
Check failure on line 31 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:31:48
|
31 | fn next_shared_inverse_pair(&mut self) -> (Scalar, Scalar);
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
31 | fn next_shared_inverse_pair(&mut self) -> (Scalar<C>, Scalar);
| +++
Check failure on line 25 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:25:69
|
25 | fn next_shared_value_batch(&mut self, num_values: usize) -> Vec<Scalar> {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
25 | fn next_shared_value_batch(&mut self, num_values: usize) -> Vec<Scalar<C>> {
| +++
Check failure on line 23 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:23:40
|
23 | fn next_shared_value(&mut self) -> Scalar;
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
23 | fn next_shared_value(&mut self) -> Scalar<C>;
| +++
Check failure on line 17 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:17:67
|
17 | fn next_shared_bit_batch(&mut self, num_values: usize) -> Vec<Scalar> {
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
17 | fn next_shared_bit_batch(&mut self, num_values: usize) -> Vec<Scalar<C>> {
| +++
Check failure on line 15 in src/beaver.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/beaver.rs:15:38
|
15 | fn next_shared_bit(&mut self) -> Scalar;
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
15 | fn next_shared_bit(&mut self) -> Scalar<C>;
| +++
Check failure on line 152 in src/algebra/scalar.rs
github-actions / clippy
struct takes 1 generic argument but 2 generic arguments were supplied
error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
--> src/algebra/scalar.rs:152:33
|
152 | pub type BatchScalarResult<C> = ResultHandle<C, Vec<Scalar<C>>>;
| ^^^^^^^^^^^^ -------------- help: remove this generic argument
| |
| expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `T`
--> src/fabric/result.rs:171:12
|
171 | pub struct ResultHandle<T: From<ResultValue>> {
| ^^^^^^^^^^^^ -
Check failure on line 211 in src/algebra/curve.rs
github-actions / clippy
struct takes 1 generic argument but 2 generic arguments were supplied
error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
--> src/algebra/curve.rs:211:37
|
211 | pub type BatchCurvePointResult<C> = ResultHandle<C, Vec<CurvePoint<C>>>;
| ^^^^^^^^^^^^ ------------------ help: remove this generic argument
| |
| expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `T`
--> src/fabric/result.rs:171:12
|
171 | pub struct ResultHandle<T: From<ResultValue>> {
| ^^^^^^^^^^^^ -
Check failure on line 48 in src/network.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/network.rs:48:21
|
48 | ScalarBatch(Vec<Scalar>),
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
48 | ScalarBatch(Vec<Scalar<C>>),
| +++
Check failure on line 46 in src/network.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/network.rs:46:12
|
46 | Scalar(Scalar),
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
46 | Scalar(Scalar<C>),
| +++
Check failure on line 166 in src/fabric.rs
github-actions / clippy
missing generics for struct `algebra::mpc_scalar::MpcScalarResult`
error[E0107]: missing generics for struct `algebra::mpc_scalar::MpcScalarResult`
--> src/fabric.rs:166:29
|
166 | pub mac_key: Option<Arc<MpcScalarResult>>,
| ^^^^^^^^^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/mpc_scalar.rs:25:12
|
25 | pub struct MpcScalarResult<C: CurveGroup> {
| ^^^^^^^^^^^^^^^ -
help: add missing generic argument
|
166 | pub mac_key: Option<Arc<MpcScalarResult<C>>>,
| +++
Check failure on line 50 in src/fabric/result.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/fabric/result.rs:50:21
|
50 | ScalarBatch(Vec<Scalar>),
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
50 | ScalarBatch(Vec<Scalar<C>>),
| +++
Check failure on line 48 in src/fabric/result.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/fabric/result.rs:48:12
|
48 | Scalar(Scalar),
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
48 | Scalar(Scalar<C>),
| +++
Check failure on line 106 in src/commitment.rs
github-actions / clippy
missing generics for type alias `algebra::scalar::ScalarResult`
error[E0107]: missing generics for type alias `algebra::scalar::ScalarResult`
--> src/commitment.rs:106:28
|
106 | pub(crate) commitment: ScalarResult,
| ^^^^^^^^^^^^ expected 1 generic argument
|
note: type alias defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:150:10
|
150 | pub type ScalarResult<C> = ResultHandle<C, Scalar<C>>;
| ^^^^^^^^^^^^ -
help: add missing generic argument
|
106 | pub(crate) commitment: ScalarResult<C>,
| +++
Check failure on line 104 in src/commitment.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/commitment.rs:104:25
|
104 | pub(crate) blinder: Scalar,
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
104 | pub(crate) blinder: Scalar<C>,
| +++
Check failure on line 78 in src/commitment.rs
github-actions / clippy
missing generics for struct `algebra::scalar::Scalar`
error[E0107]: missing generics for struct `algebra::scalar::Scalar`
--> src/commitment.rs:78:28
|
78 | pub(crate) commitment: Scalar,
| ^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `C`
--> src/algebra/scalar.rs:43:12
|
43 | pub struct Scalar<C: CurveGroup>(pub(crate) C::ScalarField);
| ^^^^^^ -
help: add missing generic argument
|
78 | pub(crate) commitment: Scalar<C>,
| +++