Skip to content

Commit

Permalink
Merge branch 'master' into DensePolynomial-generics
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush authored Mar 5, 2025
2 parents 49d7a86 + 9c3cc53 commit 6266583
Show file tree
Hide file tree
Showing 101 changed files with 545 additions and 401 deletions.
98 changes: 96 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resolver = "2"

[workspace.package]
version = "0.5.0"
authors = [ "arkworks contributors" ]
authors = ["arkworks contributors"]
homepage = "https://arkworks.rs"
repository = "https://github.com/arkworks-rs/algebra"
categories = ["cryptography"]
Expand All @@ -41,6 +41,100 @@ rustdoc-args = ["--html-in-header katex-header.html"]
[workspace.metadata.release]
dependent-version = "fix"

[workspace.lints]
rust.rust_2018_idioms = { level = "deny", priority = -1 }
rust.unreachable_pub = "warn"
rust.unused_must_use = "deny"
rustdoc.all = "warn"
# rust.unnameable-types = "warn"

[workspace.lints.clippy]
# These are some of clippy's nursery (i.e., experimental) lints that we like.
# By default, nursery lints are allowed. Some of the lints below have made good
# suggestions which we fixed. The others didn't have any findings, so we can
# assume they don't have that many false positives. Let's enable them to
# prevent future problems.
borrow_as_ptr = "warn"
branches_sharing_code = "warn"
clear_with_drain = "warn"
cloned_instead_of_copied = "warn"
collection_is_never_read = "warn"
dbg_macro = "warn"
derive_partial_eq_without_eq = "warn"
empty_line_after_doc_comments = "warn"
empty_line_after_outer_attr = "warn"
enum_glob_use = "warn"
equatable_if_let = "warn"
explicit_into_iter_loop = "warn"
explicit_iter_loop = "warn"
flat_map_option = "warn"
from_iter_instead_of_collect = "warn"
if_not_else = "warn"
if_then_some_else_none = "warn"
implicit_clone = "warn"
imprecise_flops = "warn"
iter_on_empty_collections = "warn"
iter_on_single_items = "warn"
iter_with_drain = "warn"
iter_without_into_iter = "warn"
large_stack_frames = "warn"
manual_assert = "warn"
manual_clamp = "warn"
manual_is_variant_and = "warn"
manual_string_new = "warn"
match_same_arms = "warn"
missing_const_for_fn = "warn"
mutex_integer = "warn"
naive_bytecount = "warn"
needless_bitwise_bool = "warn"
needless_continue = "warn"
needless_for_each = "warn"
needless_pass_by_ref_mut = "warn"
nonstandard_macro_braces = "warn"
option_as_ref_cloned = "warn"
or_fun_call = "warn"
path_buf_push_overwrite = "warn"
read_zero_byte_vec = "warn"
redundant_clone = "warn"
redundant_else = "warn"
single_char_pattern = "warn"
string_lit_as_bytes = "warn"
string_lit_chars_any = "warn"
suboptimal_flops = "warn"
suspicious_operation_groupings = "warn"
trailing_empty_array = "warn"
trait_duplication_in_bounds = "warn"
transmute_undefined_repr = "warn"
trivial_regex = "warn"
tuple_array_conversions = "warn"
type_repetition_in_bounds = "warn"
uninhabited_references = "warn"
unnecessary_self_imports = "warn"
unnecessary_struct_initialization = "warn"
unnested_or_patterns = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
use_self = "warn"
useless_let_if_seq = "warn"
while_float = "warn"
zero_sized_map_values = "warn"

# These are nursery lints which have findings. Allow them for now. Some are not
# quite mature enough for use in our codebase and some we don't really want.
# Explicitly listing should make it easier to fix in the future.
as_ptr_cast_mut = "allow"
cognitive_complexity = "allow"
debug_assert_with_mut_call = "allow"
doc_markdown = "allow"
fallible_impl_from = "allow"
future_not_send = "allow"
needless_collect = "allow"
non_send_fields_in_send_ty = "allow"
redundant_pub_crate = "allow"
significant_drop_in_scrutinee = "allow"
significant_drop_tightening = "allow"
too_long_first_doc_paragraph = "allow"

[workspace.dependencies]
ark-ec = { version = "0.5.0", path = "./ec", default-features = false }
ark-ff = { version = "0.5.0", path = "./ff", default-features = false }
Expand All @@ -51,7 +145,7 @@ ark-serialize = { version = "0.5.0", path = "./serialize", default-features = fa
ark-serialize-derive = { version = "0.5.0", path = "./serialize-derive" }
ark-std = { version = "0.5.0", default-features = false }

ark-algebra-bench-templates = { version = "0.5.0", path = "./bench-templates", default-features = false }
ark-algebra-bench-templates = { version = "0.5.0", path = "./bench-templates", default-features = false }
ark-algebra-test-templates = { version = "0.5.0", path = "./test-templates", default-features = false }
ark-test-curves = { version = "0.5.0", path = "./test-curves", default-features = false }

Expand Down
15 changes: 10 additions & 5 deletions bench-templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ rust-version.workspace = true
metadata.docs.rs.workspace = true
package.metadata.release.workspace = true


################################# Dependencies ################################
[lints]
workspace = true

[dependencies]
criterion = { workspace = true, features = [ "html_reports" ] }
criterion = { workspace = true, features = ["html_reports"] }
ark-std.workspace = true
ark-ec.workspace = true
ark-ff.workspace = true
ark-serialize.workspace = true
paste.workspace = true

[features]
asm = [ "ark-ff/asm" ]
parallel = [ "ark-std/parallel", "ark-ff/parallel", "ark-ec/parallel", "ark-serialize/parallel" ]
asm = ["ark-ff/asm"]
parallel = [
"ark-std/parallel",
"ark-ff/parallel",
"ark-ec/parallel",
"ark-serialize/parallel",
]
2 changes: 1 addition & 1 deletion bench-templates/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(unused_macros, unused_imports)]
#[macro_use]
pub mod macros;
pub use macros::*;
use macros::*;

#[macro_use]
pub extern crate criterion;
Expand Down
1 change: 1 addition & 0 deletions curves/bls12_377/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "bls12_377"
Expand Down
1 change: 1 addition & 0 deletions curves/bls12_381/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]

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

[[bench]]
name = "bls12_381"
Expand Down
1 change: 1 addition & 0 deletions curves/bn254/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-r1cs-std?/std" ]
r1cs = [ "ark-r1cs-std" ]
curve = [ "scalar_field" ]
scalar_field = []
asm = [ "ark-ff/asm" ]

[[bench]]
name = "bn254"
Expand Down
1 change: 1 addition & 0 deletions curves/bw6_761/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ark-algebra-bench-templates = { workspace = true }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "bw6_761"
Expand Down
1 change: 1 addition & 0 deletions curves/bw6_767/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ark-algebra-bench-templates = { workspace = true }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-381/std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "bw6_767"
Expand Down
1 change: 1 addition & 0 deletions curves/cp6_782/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ark-algebra-bench-templates = { workspace = true }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "cp6_782"
Expand Down
1 change: 1 addition & 0 deletions curves/curve25519/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "curve25519"
Expand Down
1 change: 1 addition & 0 deletions curves/ed25519/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/ed_on_bls12_377/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "ed_on_bls12_377"
Expand Down
1 change: 1 addition & 0 deletions curves/ed_on_bls12_381/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-381/std" ]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "ed_on_bls12_381"
Expand Down
1 change: 1 addition & 0 deletions curves/ed_on_bls12_381_bandersnatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ std = [
"ark-bls12-381/std"
]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/ed_on_bn254/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bn254/std" ]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/ed_on_bw6_761/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ ark-std = { workspace = true }
default = []
std = [ "ark-ed-on-cp6-782/std" ]
r1cs = [ "ark-ed-on-cp6-782/r1cs" ]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/ed_on_cp6_782/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/ed_on_mnt4_298/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-mnt4-298/std" ]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/ed_on_mnt4_753/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-mnt4-753/std" ]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/grumpkin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "grumpkin"
Expand Down
1 change: 1 addition & 0 deletions curves/mnt4_298/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "mnt4_298"
Expand Down
1 change: 1 addition & 0 deletions curves/mnt4_753/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "mnt4_753"
Expand Down
1 change: 1 addition & 0 deletions curves/mnt6_298/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "mnt6_298"
Expand Down
1 change: 1 addition & 0 deletions curves/mnt6_753/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = ["ark-r1cs-std"]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "mnt6_753"
Expand Down
1 change: 1 addition & 0 deletions curves/pallas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "pallas"
Expand Down
1 change: 1 addition & 0 deletions curves/secp256k1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "secp256k1"
Expand Down
1 change: 1 addition & 0 deletions curves/secp256r1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/secp384r1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/secq256k1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]
1 change: 1 addition & 0 deletions curves/vesta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests" }
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
asm = [ "ark-ff/asm" ]

[[bench]]
name = "vesta"
Expand Down
9 changes: 6 additions & 3 deletions ec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ metadata.docs.rs.workspace = true
package.metadata.release.workspace = true
keywords = ["cryptography", "elliptic-curves", "pairing"]

[lints]
workspace = true

[dependencies]
ark-std.workspace = true
ark-serialize.workspace = true
Expand All @@ -30,7 +33,7 @@ hashbrown.workspace = true
itertools.workspace = true

[target.'cfg(all(target_has_atomic = "8", target_has_atomic = "16", target_has_atomic = "32", target_has_atomic = "64", target_has_atomic = "ptr"))'.dependencies]
ahash = { version = "0.8", default-features = false}
ahash = { version = "0.8", default-features = false }

[target.'cfg(not(all(target_has_atomic = "8", target_has_atomic = "16", target_has_atomic = "32", target_has_atomic = "64", target_has_atomic = "ptr")))'.dependencies]
fnv = { version = "1.0", default-features = false }
Expand All @@ -46,5 +49,5 @@ hex.workspace = true

[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-serialize/std" ]
parallel = [ "std", "rayon", "ark-std/parallel", "ark-serialize/parallel" ]
std = ["ark-std/std", "ark-ff/std", "ark-serialize/std"]
parallel = ["std", "rayon", "ark-std/parallel", "ark-serialize/parallel"]
Loading

0 comments on commit 6266583

Please sign in to comment.