Skip to content

Commit 2463065

Browse files
committed
weird compatibility and cleanup 3
1 parent d0bd9f5 commit 2463065

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
lines changed

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT", "d
2929
license = "MIT OR Apache-2.0"
3030
edition = "2021"
3131
rust-version = "1.75"
32+
keywords = ["cryptography", "zero-knowledge", "elliptic-curves", "arkworks"]
3233

3334
[workspace.metadata.docs.rs]
3435
rustdoc-args = [ "--html-in-header katex-header.html" ]
@@ -50,6 +51,9 @@ ark-algebra-bench-templates = { version = "0.5.0", path = "./bench-templates",
5051
ark-algebra-test-templates = { version = "0.5.0", path = "./test-templates", default-features = false }
5152
ark-test-curves = { version = "0.5.0", path = "./test-curves", default-features = false }
5253

54+
ark-r1cs-std = { version = "0.5.0", default-features = false }
55+
ark-relations = { version = "0.5.0", default-features = false }
56+
5357
num-traits = { version = "0.2", default-features = false }
5458
num-bigint = { version = "0.4", default-features = false }
5559
num-integer = { version = "0.1", default-features = false }
@@ -100,3 +104,7 @@ lto = "thin"
100104
incremental = true
101105
debug-assertions = true
102106
debug = true
107+
108+
[patch.crates-io]
109+
ark-bn254 = { path = "./curves/bn254", features = ["curve", "scalar_field"] }
110+

curves/bn254/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-r1cs-std?/std" ]
3131
r1cs = [ "ark-r1cs-std" ]
3232
curve = [ "scalar_field" ]
3333
scalar_field = []
34+
asm = [ "ark-ff/asm" ]
3435

3536
[[bench]]
3637
name = "bn254"

jolt-optimizations/Cargo.toml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
[package]
22
name = "jolt-optimizations"
3-
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["arkworks contributors"]
6-
description = "Optimized BN254 G2 scalar multiplication using 4D GLV decomposition"
7-
license = "MIT/Apache-2.0"
3+
version.workspace = true
4+
authors.workspace = true
5+
homepage.workspace = true
6+
repository.workspace = true
7+
categories.workspace = true
8+
include.workspace = true
9+
license.workspace = true
10+
edition.workspace = true
11+
rust-version.workspace = true
12+
metadata.docs.rs.workspace = true
13+
description = "Optimized BN254 G1/G2 scalar multiplication primitives using 2D/4D GLV decomposition"
814

915
[dependencies]
10-
# Use published arkworks versions for stability
11-
1216
ark-bn254 = "0.5.0"
13-
ark-ec = { version = "0.5.0", default-features = false, features = [
14-
"parallel",
15-
] }
16-
ark-ff = { version = "0.5.0", default-features = false, features = [
17-
"parallel",
18-
] }
19-
ark-serialize = { version = "0.5.0", default-features = false, features = [
20-
"derive",
21-
"parallel",
22-
] }
23-
ark-std = "0.4"
24-
num-bigint = "0.4"
17+
ark-ec.workspace = true
18+
ark-ff.workspace = true
19+
ark-serialize.workspace = true
20+
ark-std.workspace = true
21+
num-bigint.workspace = true
2522
num-rational = "0.4.2"
26-
num-integer = "0.1.46"
27-
num-traits = "0.2"
28-
rayon = "1.8"
29-
30-
# Patches should be in workspace root Cargo.toml
23+
num-integer.workspace = true
24+
num-traits.workspace = true
25+
rayon.workspace = true
3126

3227
[dev-dependencies]
33-
criterion = "0.5"
28+
criterion.workspace = true
29+
30+
[features]
31+
default = []
32+
std = ["ark-std/std", "ark-ff/std", "ark-ec/std", "ark-serialize/std"]
33+
parallel = ["std", "ark-std/parallel", "ark-ff/parallel", "ark-ec/parallel", "ark-serialize/parallel"]
3434

3535
[[bench]]
3636
name = "scalar_multiplication"

jolt-optimizations/src/constants.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
use ark_bn254::Fq2;
77
use ark_ff::MontFp;
8+
use ark_bn254::Fr;
89

910
// Include the generated power of 2 decompositions table
1011
include!(concat!(env!("OUT_DIR"), "/power_of_2_decompositions.rs"));
@@ -64,9 +65,9 @@ pub fn get_frobenius_coefficients() -> FrobeniusCoefficients {
6465
}
6566

6667
/// Get the Frobenius eigenvalue λ_ψ for BN254
67-
pub fn get_bn254_frobenius_eigenvalue() -> ark_bn254::Fr {
68+
pub fn get_bn254_frobenius_eigenvalue() -> Fr {
6869
use ark_ff::PrimeField;
69-
ark_bn254::Fr::from_be_bytes_mod_order(&[
70+
Fr::from_be_bytes_mod_order(&[
7071
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7172
0x00, 0x6f, 0x4d, 0x82, 0x48, 0xee, 0xb8, 0x59, 0xfb, 0xf8, 0x3e, 0x96, 0x82, 0xe8, 0x7c,
7273
0xfd, 0x46,

0 commit comments

Comments
 (0)