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

add clippy rules for test-curves crate #934

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 15 additions & 9 deletions test-curves/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ark-test-curves"
description = "A library for testing ark-ec & ark-poly"
keywords = ["cryptography", "serialization" ]
keywords = ["cryptography", "serialization"]
documentation = "https://docs.rs/ark-test-curves/"
version.workspace = true
authors.workspace = true
Expand All @@ -15,36 +15,42 @@ rust-version.workspace = true
metadata.docs.rs.workspace = true
package.metadata.release.workspace = true

[lints]
workspace = true

[dependencies]
ark-std = { workspace = true, default-features = false }
ark-ff = { workspace = true, default-features = false }
ark-ec = { workspace = true, default-features = false }

[dev-dependencies]
ark-serialize = { workspace = true, default-features = false }
ark-serialize = { workspace = true, default-features = false }
ark-algebra-test-templates = { workspace = true, default-features = false }
ark-algebra-bench-templates = { workspace = true, default-features = false }

[features]
default = []

asm = [ "ark-ff/asm" ]
asm = ["ark-ff/asm"]

parallel = [ "ark-ff/parallel", "ark-ec/parallel", "ark-std/parallel" ]
parallel = ["ark-ff/parallel", "ark-ec/parallel", "ark-std/parallel"]

bls12_381_scalar_field = []
bls12_381_curve = [ "bls12_381_scalar_field" ]
ed_on_bls12_381 = [ "bls12_381_scalar_field" ]
bls12_381_curve = ["bls12_381_scalar_field"]
ed_on_bls12_381 = ["bls12_381_scalar_field"]

mnt4_753_scalar_field = []
mnt4_753_base_field = []
mnt4_753_curve = [ "mnt4_753_scalar_field", "mnt4_753_base_field" ]
mnt4_753_curve = ["mnt4_753_scalar_field", "mnt4_753_base_field"]

mnt6_753 = [ "mnt4_753_scalar_field", "mnt4_753_base_field" ]
mnt6_753 = ["mnt4_753_scalar_field", "mnt4_753_base_field"]

bn384_small_two_adicity_scalar_field = []
bn384_small_two_adicity_base_field = []
bn384_small_two_adicity_curve = [ "bn384_small_two_adicity_scalar_field", "bn384_small_two_adicity_base_field" ]
bn384_small_two_adicity_curve = [
"bn384_small_two_adicity_scalar_field",
"bn384_small_two_adicity_base_field",
]

secp256k1 = []

Expand Down
2 changes: 1 addition & 1 deletion test-curves/src/bls12_381/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl short_weierstrass::SWCurveConfig for Config {
// It is enough to multiply by (x - 1), instead of (x - 1)^2 / 3
// sqrt(76329603384216526031706109802092473003*3) = 15132376222941642753
let h_eff: &[u64] = &[0xd201000000010001];
Config::mul_affine(p, h_eff).into()
Self::mul_affine(p, h_eff).into()
}
}

Expand Down
2 changes: 1 addition & 1 deletion test-curves/src/bls12_381/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl short_weierstrass::SWCurveConfig for Config {
let p_projective = p.into_group();

// [x]P
let x_p = Config::mul_affine(p, x).neg();
let x_p = Self::mul_affine(p, x).neg();
// ψ(P)
let psi_p = p_power_endomorphism(p);
// (ψ^2)(2P)
Expand Down
4 changes: 2 additions & 2 deletions test-curves/src/ed_on_bls12_381/g.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl TECurveConfig for EdwardsConfig {
const GENERATOR: twisted_edwards::Affine<Self> =
twisted_edwards::Affine::new_unchecked(GENERATOR_X, GENERATOR_Y);

type MontCurveConfig = EdwardsConfig;
type MontCurveConfig = Self;

/// Multiplication by `a` is simply negation here.
#[inline(always)]
Expand All @@ -68,7 +68,7 @@ impl MontCurveConfig for EdwardsConfig {
const COEFF_A: Fq = MontFp!("40962");
const COEFF_B: Fq = MontFp!("-40964");

type TECurveConfig = EdwardsConfig;
type TECurveConfig = Self;
}

const GENERATOR_X: Fq =
Expand Down
Loading