mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-27 22:23:48 +01:00
Compare commits
6 Commits
releases
...
use-algebr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d3366971c | ||
|
|
5a41d7f27a | ||
|
|
4ab8ba6eb7 | ||
|
|
ab9be6d8f4 | ||
|
|
d5447dec42 | ||
|
|
3668338023 |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -168,7 +168,7 @@ jobs:
|
|||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
target: aarch64-unknown-none
|
target: thumbv6m-none-eabi
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
@@ -183,10 +183,10 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
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
|
- name: build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: build
|
command: build
|
||||||
args: --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none
|
args: --workspace --exclude ark-curve-constraint-tests --target thumbv6m-none-eabi
|
||||||
|
|||||||
10
Cargo.toml
10
Cargo.toml
@@ -34,7 +34,7 @@ members = [
|
|||||||
"secp256r1",
|
"secp256r1",
|
||||||
"secp384r1",
|
"secp384r1",
|
||||||
"secq256k1",
|
"secq256k1",
|
||||||
|
|
||||||
"curve25519",
|
"curve25519",
|
||||||
"ed25519",
|
"ed25519",
|
||||||
]
|
]
|
||||||
@@ -64,3 +64,11 @@ lto = "thin"
|
|||||||
incremental = true
|
incremental = true
|
||||||
debug-assertions = true
|
debug-assertions = true
|
||||||
debug = 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/" }
|
||||||
|
|||||||
@@ -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-relations = { version = "0.4.0", default-features = false }
|
||||||
ark-serialize = { 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-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 }
|
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
|
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
|
||||||
r1cs = [ "ark-r1cs-std" ]
|
r1cs = [ "ark-r1cs-std" ]
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "curve25519"
|
||||||
|
path = "benches/curve25519.rs"
|
||||||
|
harness = false
|
||||||
|
|||||||
9
curve25519/benches/curve25519.rs
Normal file
9
curve25519/benches/curve25519.rs
Normal 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,
|
||||||
|
);
|
||||||
@@ -61,11 +61,11 @@ impl MontCurveConfig for Curve25519Config {
|
|||||||
|
|
||||||
/// GENERATOR_X =
|
/// GENERATOR_X =
|
||||||
/// 38213832894368730265794714087330135568483813637251082400757400312561599933396
|
/// 38213832894368730265794714087330135568483813637251082400757400312561599933396
|
||||||
const GENERATOR_X: Fq =
|
pub const GENERATOR_X: Fq =
|
||||||
MontFp!("38213832894368730265794714087330135568483813637251082400757400312561599933396");
|
MontFp!("38213832894368730265794714087330135568483813637251082400757400312561599933396");
|
||||||
|
|
||||||
/// GENERATOR_Y =
|
/// GENERATOR_Y =
|
||||||
/// (4/5)
|
/// (4/5)
|
||||||
/// 46316835694926478169428394003475163141307993866256225615783033603165251855960
|
/// 46316835694926478169428394003475163141307993866256225615783033603165251855960
|
||||||
const GENERATOR_Y: Fq =
|
pub const GENERATOR_Y: Fq =
|
||||||
MontFp!("46316835694926478169428394003475163141307993866256225615783033603165251855960");
|
MontFp!("46316835694926478169428394003475163141307993866256225615783033603165251855960");
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ impl MontCurveConfig for EdwardsConfig {
|
|||||||
|
|
||||||
/// GENERATOR_X =
|
/// GENERATOR_X =
|
||||||
/// 15112221349535400772501151409588531511454012693041857206046113283949847762202
|
/// 15112221349535400772501151409588531511454012693041857206046113283949847762202
|
||||||
const GENERATOR_X: Fq =
|
pub const GENERATOR_X: Fq =
|
||||||
MontFp!("15112221349535400772501151409588531511454012693041857206046113283949847762202");
|
MontFp!("15112221349535400772501151409588531511454012693041857206046113283949847762202");
|
||||||
|
|
||||||
/// GENERATOR_Y =
|
/// GENERATOR_Y =
|
||||||
/// (4/5)
|
/// (4/5)
|
||||||
/// 46316835694926478169428394003475163141307993866256225615783033603165251855960
|
/// 46316835694926478169428394003475163141307993866256225615783033603165251855960
|
||||||
const GENERATOR_Y: Fq =
|
pub const GENERATOR_Y: Fq =
|
||||||
MontFp!("46316835694926478169428394003475163141307993866256225615783033603165251855960");
|
MontFp!("46316835694926478169428394003475163141307993866256225615783033603165251855960");
|
||||||
|
|||||||
@@ -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-relations = { version = "0.4.0", default-features = false }
|
||||||
ark-serialize = { 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-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 }
|
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
|
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
|
||||||
r1cs = [ "ark-r1cs-std" ]
|
r1cs = [ "ark-r1cs-std" ]
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "ed_on_bls12_377"
|
||||||
|
path = "benches/ed_on_bls12_377.rs"
|
||||||
|
harness = false
|
||||||
|
|||||||
9
ed_on_bls12_377/benches/ed_on_bls12_377.rs
Normal file
9
ed_on_bls12_377/benches/ed_on_bls12_377.rs
Normal 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,
|
||||||
|
);
|
||||||
@@ -64,10 +64,10 @@ impl MontCurveConfig for EdwardsConfig {
|
|||||||
|
|
||||||
/// GENERATOR_X =
|
/// GENERATOR_X =
|
||||||
/// 4497879464030519973909970603271755437257548612157028181994697785683032656389,
|
/// 4497879464030519973909970603271755437257548612157028181994697785683032656389,
|
||||||
const GENERATOR_X: Fq =
|
pub const GENERATOR_X: Fq =
|
||||||
MontFp!("4497879464030519973909970603271755437257548612157028181994697785683032656389");
|
MontFp!("4497879464030519973909970603271755437257548612157028181994697785683032656389");
|
||||||
|
|
||||||
/// GENERATOR_Y =
|
/// GENERATOR_Y =
|
||||||
/// 4357141146396347889246900916607623952598927460421559113092863576544024487809
|
/// 4357141146396347889246900916607623952598927460421559113092863576544024487809
|
||||||
const GENERATOR_Y: Fq =
|
pub const GENERATOR_Y: Fq =
|
||||||
MontFp!("4357141146396347889246900916607623952598927460421559113092863576544024487809");
|
MontFp!("4357141146396347889246900916607623952598927460421559113092863576544024487809");
|
||||||
|
|||||||
@@ -30,3 +30,8 @@ ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-featu
|
|||||||
default = []
|
default = []
|
||||||
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-381/std" ]
|
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-381/std" ]
|
||||||
r1cs = ["ark-r1cs-std"]
|
r1cs = ["ark-r1cs-std"]
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "ed_on_bls12_381"
|
||||||
|
path = "benches/ed_on_bls12_381.rs"
|
||||||
|
harness = false
|
||||||
|
|||||||
@@ -96,10 +96,14 @@ impl MontCurveConfig for JubjubConfig {
|
|||||||
type TECurveConfig = JubjubConfig;
|
type TECurveConfig = JubjubConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GENERATOR_X: Fq =
|
/// GENERATOR_X =
|
||||||
|
/// 8076246640662884909881801758704306714034609987455869804520522091855516602923
|
||||||
|
pub const GENERATOR_X: Fq =
|
||||||
MontFp!("8076246640662884909881801758704306714034609987455869804520522091855516602923");
|
MontFp!("8076246640662884909881801758704306714034609987455869804520522091855516602923");
|
||||||
|
|
||||||
const GENERATOR_Y: Fq =
|
/// GENERATOR_Y =
|
||||||
|
/// 13262374693698910701929044844600465831413122818447359594527400194675274060458
|
||||||
|
pub const GENERATOR_Y: Fq =
|
||||||
MontFp!("13262374693698910701929044844600465831413122818447359594527400194675274060458");
|
MontFp!("13262374693698910701929044844600465831413122818447359594527400194675274060458");
|
||||||
|
|
||||||
impl SWCurveConfig for JubjubConfig {
|
impl SWCurveConfig for JubjubConfig {
|
||||||
@@ -116,9 +120,13 @@ impl SWCurveConfig for JubjubConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// x coordinate for SW curve generator
|
/// x coordinate for SW curve generator
|
||||||
const SW_GENERATOR_X: Fq =
|
/// SW_GENERATOR_X =
|
||||||
|
/// 33835869156188682335217394949746694649676633840125476177319971163079011318731
|
||||||
|
pub const SW_GENERATOR_X: Fq =
|
||||||
MontFp!("33835869156188682335217394949746694649676633840125476177319971163079011318731");
|
MontFp!("33835869156188682335217394949746694649676633840125476177319971163079011318731");
|
||||||
|
|
||||||
/// y coordinate for SW curve generator
|
/// y coordinate for SW curve generator
|
||||||
const SW_GENERATOR_Y: Fq =
|
/// SW_GENERATOR_Y =
|
||||||
|
/// 43777270878440091394432848052353307184915192688165709016756678962558652055320
|
||||||
|
pub const SW_GENERATOR_Y: Fq =
|
||||||
MontFp!("43777270878440091394432848052353307184915192688165709016756678962558652055320");
|
MontFp!("43777270878440091394432848052353307184915192688165709016756678962558652055320");
|
||||||
|
|||||||
@@ -64,8 +64,12 @@ impl MontCurveConfig for EdwardsConfig {
|
|||||||
type TECurveConfig = EdwardsConfig;
|
type TECurveConfig = EdwardsConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GENERATOR_X: Fq =
|
/// GENERATOR_X =
|
||||||
|
/// 19698561148652590122159747500897617769866003486955115824547446575314762165298
|
||||||
|
pub const GENERATOR_X: Fq =
|
||||||
MontFp!("19698561148652590122159747500897617769866003486955115824547446575314762165298");
|
MontFp!("19698561148652590122159747500897617769866003486955115824547446575314762165298");
|
||||||
|
|
||||||
const GENERATOR_Y: Fq =
|
/// GENERATOR_Y =
|
||||||
|
/// 19298250018296453272277890825869354524455968081175474282777126169995084727839
|
||||||
|
pub const GENERATOR_Y: Fq =
|
||||||
MontFp!("19298250018296453272277890825869354524455968081175474282777126169995084727839");
|
MontFp!("19298250018296453272277890825869354524455968081175474282777126169995084727839");
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ impl MontCurveConfig for EdwardsConfig {
|
|||||||
|
|
||||||
/// GENERATOR_X =
|
/// GENERATOR_X =
|
||||||
/// 174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127
|
/// 174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127
|
||||||
const GENERATOR_X: Fq = MontFp!("174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127");
|
pub const GENERATOR_X: Fq = MontFp!("174701772324485506941690903512423551998294352968833659960042362742684869862495746426366187462669992073196420267127");
|
||||||
|
|
||||||
/// GENERATOR_Y =
|
/// GENERATOR_Y =
|
||||||
/// 208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833
|
/// 208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833
|
||||||
const GENERATOR_Y: Fq = MontFp!("208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833");
|
pub const GENERATOR_Y: Fq = MontFp!("208487200052258845495340374451540775445408439654930191324011635560142523886549663106522691296420655144190624954833");
|
||||||
|
|||||||
@@ -71,12 +71,12 @@ impl MontCurveConfig for EdwardsConfig {
|
|||||||
|
|
||||||
/// GENERATOR_X =
|
/// GENERATOR_X =
|
||||||
/// 282406820114868156776872298252698015906762052916420164316497572033519876761239463633892227
|
/// 282406820114868156776872298252698015906762052916420164316497572033519876761239463633892227
|
||||||
const GENERATOR_X: Fq = MontFp!(
|
pub const GENERATOR_X: Fq = MontFp!(
|
||||||
"282406820114868156776872298252698015906762052916420164316497572033519876761239463633892227"
|
"282406820114868156776872298252698015906762052916420164316497572033519876761239463633892227"
|
||||||
);
|
);
|
||||||
|
|
||||||
/// GENERATOR_Y =
|
/// GENERATOR_Y =
|
||||||
/// 452667754940241021433619311795265643711152068500301853535337412655162600774122192283142703
|
/// 452667754940241021433619311795265643711152068500301853535337412655162600774122192283142703
|
||||||
const GENERATOR_Y: Fq = MontFp!(
|
pub const GENERATOR_Y: Fq = MontFp!(
|
||||||
"452667754940241021433619311795265643711152068500301853535337412655162600774122192283142703"
|
"452667754940241021433619311795265643711152068500301853535337412655162600774122192283142703"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,8 +58,10 @@ impl MontCurveConfig for EdwardsConfig {
|
|||||||
|
|
||||||
/// GENERATOR_X =
|
/// GENERATOR_X =
|
||||||
/// 41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826
|
/// 41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826
|
||||||
const GENERATOR_X: Fq = MontFp!("41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826");
|
pub const GENERATOR_X: Fq =
|
||||||
|
MontFp!("41126137307536311801428235632419266329480236393691483739251051053325519918069469184425962602019877935619960143044210127218431046103600632347238890180171944971817510488009355627861577881883236134824745174469522277738875418206826");
|
||||||
|
|
||||||
/// GENERATOR_Y =
|
/// GENERATOR_Y =
|
||||||
/// 18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681
|
/// 18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681
|
||||||
const GENERATOR_Y: Fq = MontFp!("18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681");
|
pub const GENERATOR_Y: Fq =
|
||||||
|
MontFp!("18249602579663240810999977712212098844157230095713722119136881953011435881503578209163288529034825612841855863913294174196656077002578342108932925693640046298989762289691399012056048139253937882385653600831389370198228562812681");
|
||||||
|
|||||||
@@ -22,9 +22,15 @@ ark-std = { version = "0.4.0", default-features = false }
|
|||||||
ark-relations = { 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-serialize = { version = "0.4.0", default-features = false }
|
||||||
ark-algebra-test-templates = { 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 }
|
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
|
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
|
||||||
r1cs = [ "ark-r1cs-std" ]
|
r1cs = [ "ark-r1cs-std" ]
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "secp256k1"
|
||||||
|
path = "benches/secp256k1.rs"
|
||||||
|
harness = false
|
||||||
9
secp256k1/benches/secp256k1.rs
Normal file
9
secp256k1/benches/secp256k1.rs
Normal 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,
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user