6 Commits

Author SHA1 Message Date
Weikeng Chen
9d3366971c Update ci.yml 2023-08-19 11:22:12 -07:00
swasilyev
5a41d7f27a Ed on bls12 377 bench (#152)
Co-authored-by: mmagician <marcin.gorny.94@protonmail.com>
2023-03-01 10:42:20 -08:00
Davide Galassi
4ab8ba6eb7 Publish some generators xy values (#150)
* Publish some generators xy values

* Publish all generators xy values
2023-03-01 19:12:08 +01:00
Michele Orrù
ab9be6d8f4 Add benchmarks for curve25519. 2023-01-29 14:47:03 -08:00
Michele Orrù
d5447dec42 Add benchmarks for secp256k1 2023-01-29 14:47:03 -08:00
mmagician
3668338023 Merge releases into master, keeping the patch.crates-io section 2023-01-19 16:36:44 -08:00
17 changed files with 94 additions and 22 deletions

View File

@@ -168,7 +168,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-unknown-none
target: thumbv6m-none-eabi
override: true
- uses: actions/cache@v2
@@ -183,10 +183,10 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none
args: --examples --workspace --exclude ark-curve-constraint-tests --target thumbv6m-none-eabi
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none
args: --workspace --exclude ark-curve-constraint-tests --target thumbv6m-none-eabi

View File

@@ -34,7 +34,7 @@ members = [
"secp256r1",
"secp384r1",
"secq256k1",
"curve25519",
"ed25519",
]
@@ -64,3 +64,11 @@ lto = "thin"
incremental = true
debug-assertions = true
debug = true
[patch.crates-io]
ark-ff = { git = "https://github.com/arkworks-rs/algebra/" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra/" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra/" }
ark-algebra-test-templates = { git = "https://github.com/arkworks-rs/algebra/" }
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }

View File

@@ -22,9 +22,15 @@ ark-r1cs-std = { version = "0.4.0", default-features = false, optional = true }
ark-relations = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.0", default-features = false }
ark-algebra-test-templates = { version = "0.4.0", default-features = false }
ark-algebra-bench-templates = { version = "0.4.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
[[bench]]
name = "curve25519"
path = "benches/curve25519.rs"
harness = false

View File

@@ -0,0 +1,9 @@
use ark_algebra_bench_templates::*;
use ark_curve25519::{EdwardsProjective as G, Fq, Fr};
bench!(
Name = "Curve25519",
Group = G,
ScalarField = Fr,
PrimeBaseField = Fq,
);

View File

@@ -61,11 +61,11 @@ impl MontCurveConfig for Curve25519Config {
/// GENERATOR_X =
/// 38213832894368730265794714087330135568483813637251082400757400312561599933396
const GENERATOR_X: Fq =
pub const GENERATOR_X: Fq =
MontFp!("38213832894368730265794714087330135568483813637251082400757400312561599933396");
/// GENERATOR_Y =
/// (4/5)
/// 46316835694926478169428394003475163141307993866256225615783033603165251855960
const GENERATOR_Y: Fq =
pub const GENERATOR_Y: Fq =
MontFp!("46316835694926478169428394003475163141307993866256225615783033603165251855960");

View File

@@ -62,11 +62,11 @@ impl MontCurveConfig for EdwardsConfig {
/// GENERATOR_X =
/// 15112221349535400772501151409588531511454012693041857206046113283949847762202
const GENERATOR_X: Fq =
pub const GENERATOR_X: Fq =
MontFp!("15112221349535400772501151409588531511454012693041857206046113283949847762202");
/// GENERATOR_Y =
/// (4/5)
/// 46316835694926478169428394003475163141307993866256225615783033603165251855960
const GENERATOR_Y: Fq =
pub const GENERATOR_Y: Fq =
MontFp!("46316835694926478169428394003475163141307993866256225615783033603165251855960");

View File

@@ -23,9 +23,15 @@ ark-bls12-377 = { version = "0.4.0", path = "../bls12_377", default-features = f
ark-relations = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.0", default-features = false }
ark-algebra-test-templates = { version = "0.4.0", default-features = false }
ark-algebra-bench-templates = { version = "0.4.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
r1cs = [ "ark-r1cs-std" ]
[[bench]]
name = "ed_on_bls12_377"
path = "benches/ed_on_bls12_377.rs"
harness = false

View File

@@ -0,0 +1,9 @@
use ark_algebra_bench_templates::*;
use ark_ed_on_bls12_377::{fq::Fq, fr::Fr, EdwardsProjective as G};
bench!(
Name = "EdOnBls12_377",
Group = G,
ScalarField = Fr,
PrimeBaseField = Fq,
);

View File

@@ -64,10 +64,10 @@ impl MontCurveConfig for EdwardsConfig {
/// GENERATOR_X =
/// 4497879464030519973909970603271755437257548612157028181994697785683032656389,
const GENERATOR_X: Fq =
pub const GENERATOR_X: Fq =
MontFp!("4497879464030519973909970603271755437257548612157028181994697785683032656389");
/// GENERATOR_Y =
/// 4357141146396347889246900916607623952598927460421559113092863576544024487809
const GENERATOR_Y: Fq =
pub const GENERATOR_Y: Fq =
MontFp!("4357141146396347889246900916607623952598927460421559113092863576544024487809");

View File

@@ -30,3 +30,8 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-featu
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-381/std" ]
r1cs = ["ark-r1cs-std"]
[[bench]]
name = "ed_on_bls12_381"
path = "benches/ed_on_bls12_381.rs"
harness = false

View File

@@ -96,10 +96,14 @@ impl MontCurveConfig for JubjubConfig {
type TECurveConfig = JubjubConfig;
}
const GENERATOR_X: Fq =
/// GENERATOR_X =
/// 8076246640662884909881801758704306714034609987455869804520522091855516602923
pub const GENERATOR_X: Fq =
MontFp!("8076246640662884909881801758704306714034609987455869804520522091855516602923");
const GENERATOR_Y: Fq =
/// GENERATOR_Y =
/// 13262374693698910701929044844600465831413122818447359594527400194675274060458
pub const GENERATOR_Y: Fq =
MontFp!("13262374693698910701929044844600465831413122818447359594527400194675274060458");
impl SWCurveConfig for JubjubConfig {
@@ -116,9 +120,13 @@ impl SWCurveConfig for JubjubConfig {
}
/// x coordinate for SW curve generator
const SW_GENERATOR_X: Fq =
/// SW_GENERATOR_X =
/// 33835869156188682335217394949746694649676633840125476177319971163079011318731
pub const SW_GENERATOR_X: Fq =
MontFp!("33835869156188682335217394949746694649676633840125476177319971163079011318731");
/// y coordinate for SW curve generator
const SW_GENERATOR_Y: Fq =
/// SW_GENERATOR_Y =
/// 43777270878440091394432848052353307184915192688165709016756678962558652055320
pub const SW_GENERATOR_Y: Fq =
MontFp!("43777270878440091394432848052353307184915192688165709016756678962558652055320");

View File

@@ -64,8 +64,12 @@ impl MontCurveConfig for EdwardsConfig {
type TECurveConfig = EdwardsConfig;
}
const GENERATOR_X: Fq =
/// GENERATOR_X =
/// 19698561148652590122159747500897617769866003486955115824547446575314762165298
pub const GENERATOR_X: Fq =
MontFp!("19698561148652590122159747500897617769866003486955115824547446575314762165298");
const GENERATOR_Y: Fq =
/// GENERATOR_Y =
/// 19298250018296453272277890825869354524455968081175474282777126169995084727839
pub const GENERATOR_Y: Fq =
MontFp!("19298250018296453272277890825869354524455968081175474282777126169995084727839");

View File

@@ -58,8 +58,8 @@ impl MontCurveConfig for EdwardsConfig {
/// GENERATOR_X =
/// 174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127
const GENERATOR_X: Fq = MontFp!("174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127");
pub const GENERATOR_X: Fq = MontFp!("174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127");
/// GENERATOR_Y =
/// 208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833
const GENERATOR_Y: Fq = MontFp!("208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833");
pub const GENERATOR_Y: Fq = MontFp!("208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833");

View File

@@ -71,12 +71,12 @@ impl MontCurveConfig for EdwardsConfig {
/// GENERATOR_X =
/// 282406820114868156776872298252698015906762052916420164316497572033519876761239463633892227
const GENERATOR_X: Fq = MontFp!(
pub const GENERATOR_X: Fq = MontFp!(
"282406820114868156776872298252698015906762052916420164316497572033519876761239463633892227"
);
/// GENERATOR_Y =
/// 452667754940241021433619311795265643711152068500301853535337412655162600774122192283142703
const GENERATOR_Y: Fq = MontFp!(
pub const GENERATOR_Y: Fq = MontFp!(
"452667754940241021433619311795265643711152068500301853535337412655162600774122192283142703"
);

View File

@@ -58,8 +58,10 @@ impl MontCurveConfig for EdwardsConfig {
/// GENERATOR_X =
/// 41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826
const GENERATOR_X: Fq = MontFp!("41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826");
pub const GENERATOR_X: Fq =
MontFp!("41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826");
/// GENERATOR_Y =
/// 18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681
const GENERATOR_Y: Fq = MontFp!("18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681");
pub const GENERATOR_Y: Fq =
MontFp!("18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681");

View File

@@ -22,9 +22,15 @@ ark-std = { version = "0.4.0", default-features = false }
ark-relations = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.0", default-features = false }
ark-algebra-test-templates = { version = "0.4.0", default-features = false }
ark-algebra-bench-templates = { version = "0.4.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
[[bench]]
name = "secp256k1"
path = "benches/secp256k1.rs"
harness = false

View File

@@ -0,0 +1,9 @@
use ark_algebra_bench_templates::*;
use ark_secp256k1::{fq::Fq, fr::Fr, Projective as G};
bench!(
Name = "Secp256k1",
Group = G,
ScalarField = Fr,
PrimeBaseField = Fq,
);