mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-09 23:41:30 +01:00
Implement WB hash2curve for BLS12-377 and BLS12-381 (#138)
* include the coefficients of bls12-377 G1 and G2 isogenies for wb hash2curve * replacing the ark-ec dependency to w3f/arkworks-algebra * added parameters for isogenous curve to bls12-377 g1 curve for swu map * fix dependency inconsistency problem * implement WBParams and its isogenous curve for BLS12-377 G1 * implement the SWUParameters for isogenous curve to BLS12-377 g2 curve. * implement WBParams for BLS12-377 G2 curve * replacing const generic arrays with const slice in g1 and g2 iso coefficients * - Implement WB hash to curve for BLS12-381 G1 - Improvement to WB hash to curve code for BLS12-377 - Update sage code for generating isogeny coefficients for arkworks. * Implement WB hash to curve for BLS12-381 G2 * - fix the bug with base order for field_new for Fq2 - fix the polynomial coeffcient order for bls12-381 g1 and g2 isogenies. - fix the polynomial coeffcient order for bls12-377 g1. 377-g2 needs to be fixed still. * fix bls12-377 wb hash to curve isogeny coeffcients * fixed sage code for generating the isogeny coefficients * use patch.crates-io hack to resolve dependancy issues on w3f fork * Rename `Parameters` to `Config` for all fields * Rename `field_new` to `MontFp` * Rename `field_new` to `QuadExt` and `CubicExt` * Refactor bls12_381 crate based on update-ff branch. Close #9 * adapt bls12 wb hashing to new changes in algebra * update bls12-381 dependancies and g1, g2 definition to pass tests * adapt bls12-377 hash to curve to algebar updates * depend on upstream for pull request * cargo fmt * - move the isogeny finder script from sage to script folder - delete auxiliary isogeny coeff file * add unit tests for wb hashing to bls12-377 g1 and g2 * - Use IsogenyMap struct to specify WB Isogeny for bls12-381 and bls12-377 - Do not use auxiliary constants to define generators of g2_swu_iso curve. - Update change log * Bump the Algebra dependencies of bls12_381 and bls12_377 to 0.4.0-alpha.4 so they could use the IsogenyMap struct. * Add h2c tests for BLS12-381 curve * Drop alpha sub-version in dependancies because it takes the lastest sub version * Parameters → Config for bls12-377/381 curves * do cargo fmt * do SwuIsoParameters → SwuIsoConfig for bls12-377/381 * Adapt to new macro * Fix macro invocation should be semicolon not comma * curves master should use algebra/r1cs default branch * Add h2c test invocation for bls12-377 curve no actual test vectors yet * add faster cofactor clearing and tests for g1 * add faster cofactor clearing and tests for g2 parameters of endomorphisms are wrong for now * add test vectors for bls12-377 * add h_eff to g2 tests for correctness test * improve cofactor tests g2 * add a test for psi(psi(P)) == psi2(P) * fix bls12-377 psi & psi2 computation parameters * rename const to DOUBLE_P_POWER_ENDOMORPHISM_COEFF_0 and make private * fix clippy warnings in changed code * use the same zeta as test suites * update code comments, make methods private * update changelog Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu> Co-authored-by: mmagician <marcin.gorny.94@protonmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ ark-serialize = { version = "0.4.0-alpha", default-features = false }
|
||||
ark-algebra-test-templates = { version = "0.4.0-alpha", default-features = false }
|
||||
ark-algebra-bench-templates = { version = "0.4.0-alpha", default-features = false }
|
||||
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
|
||||
sha2 = { version = "0.10", default-features = false }
|
||||
|
||||
[features]
|
||||
default = [ "curve" ]
|
||||
|
||||
327
bls12_377/scripts/bls12_isogeny_computer.sage
Normal file
327
bls12_377/scripts/bls12_isogeny_computer.sage
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,7 @@
|
||||
use ark_ec::{
|
||||
bls12,
|
||||
bls12::Bls12Config,
|
||||
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
|
||||
models::{
|
||||
short_weierstrass::{Affine as SWAffine, SWCurveConfig},
|
||||
twisted_edwards::{
|
||||
@@ -11,8 +13,12 @@ use ark_ec::{
|
||||
use ark_ff::{Field, MontFp, PrimeField, Zero};
|
||||
use ark_std::{ops::Neg, One};
|
||||
|
||||
use super::g1_swu_iso::{SwuIsoConfig, ISOGENY_MAP_TO_G1};
|
||||
use crate::{Fq, Fr};
|
||||
|
||||
pub type G1Affine = bls12::G1Affine<crate::Config>;
|
||||
pub type G1Projective = bls12::G1Projective<crate::Config>;
|
||||
|
||||
#[derive(Clone, Default, PartialEq, Eq)]
|
||||
pub struct Config;
|
||||
|
||||
@@ -175,6 +181,12 @@ pub const G1_GENERATOR_X: Fq = MontFp!("8193799937315096423993825557346594823998
|
||||
/// 241266749859715473739788878240585681733927191168601896383759122102112907357779751001206799952863815012735208165030
|
||||
pub const G1_GENERATOR_Y: Fq = MontFp!("241266749859715473739788878240585681733927191168601896383759122102112907357779751001206799952863815012735208165030");
|
||||
|
||||
impl WBConfig for Config {
|
||||
type IsogenousCurve = SwuIsoConfig;
|
||||
|
||||
const ISOGENY_MAP: IsogenyMap<'static, Self::IsogenousCurve, Self> = ISOGENY_MAP_TO_G1;
|
||||
}
|
||||
|
||||
// The generator for twisted Edward form is the same SW generator converted into
|
||||
// the normalized TE form (TE2).
|
||||
//``` sage
|
||||
|
||||
107
bls12_377/src/curves/g1_swu_iso.rs
Normal file
107
bls12_377/src/curves/g1_swu_iso.rs
Normal file
@@ -0,0 +1,107 @@
|
||||
use ark_ec::{
|
||||
hashing::curve_maps::{swu::SWUConfig, wb::IsogenyMap},
|
||||
models::{
|
||||
short_weierstrass::{Affine, SWCurveConfig},
|
||||
CurveConfig,
|
||||
},
|
||||
};
|
||||
|
||||
use ark_ff::MontFp;
|
||||
|
||||
use crate::{g1, Fq, Fr};
|
||||
|
||||
type G1Affine = Affine<SwuIsoConfig>;
|
||||
|
||||
#[derive(Clone, Default, PartialEq, Eq)]
|
||||
pub struct SwuIsoConfig;
|
||||
|
||||
impl CurveConfig for SwuIsoConfig {
|
||||
type BaseField = Fq;
|
||||
type ScalarField = Fr;
|
||||
|
||||
/// COFACTOR = (x - 1)^2 / 3 = iso_G1.domain().order() /
|
||||
/// 8444461749428370424248824938781546531375899335154063827935233455917409239041
|
||||
// 30631250834960419227450344600217059328
|
||||
const COFACTOR: &'static [u64] = &[0x0, 0x170b5d4430000000];
|
||||
|
||||
/// COFACTOR_INV = COFACTOR^{-1} mod r
|
||||
/// = 5285428838741532253824584287042945485047145357130994810877
|
||||
const COFACTOR_INV: Fr = MontFp!("5285428838741532253824584287042945485047145357130994810877");
|
||||
}
|
||||
|
||||
// sage: iso_G1
|
||||
// Isogeny of degree 2 from Elliptic Curve defined by y^2 = x^3 +
|
||||
// 258664426012969092796408009721202742408018065645352501567204841856062976176281513834280849065051431927238430294002*
|
||||
// x + 22 over Finite Field of size
|
||||
// 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177
|
||||
// to Elliptic Curve defined by y^2 = x^3 + 1 over Finite Field of size
|
||||
// 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177
|
||||
|
||||
impl SWCurveConfig for SwuIsoConfig {
|
||||
/// COEFF_A
|
||||
const COEFF_A: Fq = MontFp!("258664426012969092796408009721202742408018065645352501567204841856062976176281513834280849065051431927238430294002");
|
||||
|
||||
/// COEFF_B
|
||||
const COEFF_B: Fq = MontFp!("22");
|
||||
|
||||
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
|
||||
const GENERATOR: G1Affine = G1Affine::new_unchecked(G1_GENERATOR_X, G1_GENERATOR_Y);
|
||||
}
|
||||
|
||||
// sage: G1_gen = iso_G1.domain().random_point()
|
||||
// sage: G1_gen = 30631250834960419227450344600217059328* G1_gen
|
||||
// sage: G1_gen.order() ==
|
||||
// 8444461749428370424248824938781546531375899335154063827935233455917409239041
|
||||
// True
|
||||
// sage: G1_gen
|
||||
// (183898640136580512316530045470998831691790391453237259434516336279447756609241220664846162561503820562316877867830 : 69018534046895515891776145953191511526693172354818719412306559690461416836925400134233128432719372819569406562974 : 1)
|
||||
/// G1_GENERATOR_X =
|
||||
/// 183898640136580512316530045470998831691790391453237259434516336279447756609241220664846162561503820562316877867830
|
||||
pub const G1_GENERATOR_X: Fq = MontFp!("183898640136580512316530045470998831691790391453237259434516336279447756609241220664846162561503820562316877867830");
|
||||
|
||||
/// G1_GENERATOR_Y =
|
||||
/// 69018534046895515891776145953191511526693172354818719412306559690461416836925400134233128432719372819569406562974
|
||||
pub const G1_GENERATOR_Y: Fq = MontFp!("69018534046895515891776145953191511526693172354818719412306559690461416836925400134233128432719372819569406562974");
|
||||
|
||||
impl SWUConfig for SwuIsoConfig {
|
||||
const ZETA: Fq = MontFp!("-11"); // arbitatry primitive root of unity (element)
|
||||
}
|
||||
|
||||
pub const ISOGENY_MAP_TO_G1 : IsogenyMap<'_, SwuIsoConfig, g1::Config, > = IsogenyMap {
|
||||
x_map_numerator : &[
|
||||
MontFp!("193998319509726820447277314072485610595876362210707887456279225959507476652652651634192264150953923683470146535424"),
|
||||
MontFp!("40474824132456359704279181570318738632422647360355249739068643631356267969150730939906729705473"),
|
||||
MontFp!("193998319509726820507989550271170150152295134566185995404913197000040351261255617081226666104680020093330241093633"),
|
||||
],
|
||||
|
||||
x_map_denominator : &[
|
||||
MontFp!("161899296529825438817116726281274954529690589441420998956274574525425071876602923759626918821892"),
|
||||
MontFp!("1"),
|
||||
],
|
||||
|
||||
y_map_numerator : &[
|
||||
MontFp!("193998319509726820507989550271170150152295134566185995404913197000040351261255617081226666104680020093330241093631"),
|
||||
MontFp!("32333053251621136903112182208573040583096119983059602439070460434672245065050016464457115901761911040205276577794"),
|
||||
MontFp!("129332213006484547066038603046131306324615528732935438218576102373893108782773376834518846023512776472080255287298"),
|
||||
MontFp!("226331372761347957259321141983031841844344323660550327972398729833380409804798219928097777122126690108885281275905"),
|
||||
],
|
||||
|
||||
y_map_denominator : &[
|
||||
MontFp!("258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458169"),
|
||||
MontFp!("971395779178952632902700357687649727178143536648525993737647447152550431259617542557761512931340"),
|
||||
MontFp!("485697889589476316451350178843824863589071768324262996868823723576275215629808771278880756465676"),
|
||||
MontFp!("1"),
|
||||
],
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_gen() {
|
||||
let gen: G1Affine = SwuIsoConfig::GENERATOR;
|
||||
assert!(gen.is_on_curve());
|
||||
assert!(gen.is_in_correct_subgroup_assuming_on_curve());
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,22 @@
|
||||
use ark_ec::{
|
||||
bls12,
|
||||
bls12::Bls12Config,
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
short_weierstrass::{Affine, Projective},
|
||||
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{Affine, Projective, SWCurveConfig},
|
||||
AffineRepr, CurveGroup, Group,
|
||||
};
|
||||
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_std::ops::Neg;
|
||||
|
||||
use crate::*;
|
||||
|
||||
pub type G2Affine = Affine<Config>;
|
||||
use super::g2_swu_iso::{SwuIsoConfig, ISOGENY_MAP_TO_G2};
|
||||
|
||||
pub type G2Affine = bls12::G2Affine<crate::Config>;
|
||||
pub type G2Projective = bls12::G2Projective<crate::Config>;
|
||||
|
||||
#[derive(Clone, Default, PartialEq, Eq)]
|
||||
pub struct Config;
|
||||
|
||||
@@ -169,6 +176,12 @@ fn double_p_power_endomorphism(p: &Projective<Config>) -> Projective<Config> {
|
||||
res
|
||||
}
|
||||
|
||||
impl WBConfig for Config {
|
||||
type IsogenousCurve = SwuIsoConfig;
|
||||
|
||||
const ISOGENY_MAP: IsogenyMap<'static, Self::IsogenousCurve, Self> = ISOGENY_MAP_TO_G2;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
|
||||
|
||||
457
bls12_377/src/curves/g2_swu_iso.rs
Normal file
457
bls12_377/src/curves/g2_swu_iso.rs
Normal file
@@ -0,0 +1,457 @@
|
||||
use ark_ec::{
|
||||
hashing::curve_maps::{swu::SWUConfig, wb::IsogenyMap},
|
||||
models::{
|
||||
short_weierstrass::{Affine, SWCurveConfig},
|
||||
CurveConfig,
|
||||
},
|
||||
};
|
||||
use ark_ff::MontFp;
|
||||
|
||||
use crate::{g2, Fq2, Fr};
|
||||
|
||||
type G2Affine = Affine<SwuIsoConfig>;
|
||||
|
||||
#[derive(Clone, Default, PartialEq, Eq)]
|
||||
pub struct SwuIsoConfig;
|
||||
|
||||
impl CurveConfig for SwuIsoConfig {
|
||||
type BaseField = Fq2;
|
||||
type ScalarField = Fr;
|
||||
|
||||
/// COFACTOR =
|
||||
/// 7923214915284317143930293550643874566881017850177945424769256759165301436616933228209277966774092486467289478618404761412630691835764674559376407658497
|
||||
/// same as the original g2 curve
|
||||
/// sage: iso_G2.domain().order() == iso_G2.codomain().order()
|
||||
/// True
|
||||
#[rustfmt::skip]
|
||||
const COFACTOR: &'static [u64] = &[
|
||||
0x0000000000000001,
|
||||
0x452217cc90000000,
|
||||
0xa0f3622fba094800,
|
||||
0xd693e8c36676bd09,
|
||||
0x8c505634fae2e189,
|
||||
0xfbb36b00e1dcc40c,
|
||||
0xddd88d99a6f6a829,
|
||||
0x26ba558ae9562a,
|
||||
];
|
||||
|
||||
/// COFACTOR_INV = COFACTOR^{-1} mod r
|
||||
/// = 6764900296503390671038341982857278410319949526107311149686707033187604810669
|
||||
const COFACTOR_INV: Fr =
|
||||
MontFp!("6764900296503390671038341982857278410319949526107311149686707033187604810669");
|
||||
}
|
||||
|
||||
// sage: E2p = iso_G2.domain()
|
||||
// sage: r = 8444461749428370424248824938781546531375899335154063827935233455917409239041
|
||||
// sage: E2p.order()/r
|
||||
// 7923214915284317143930293550643874566881017850177945424769256759165301436616933228209277966774092486467289478618404761412630691835764674559376407658497
|
||||
// sage: E2p
|
||||
// Elliptic Curve defined by y^2 = x^3 +
|
||||
// (69357795553467368835766998649443114298653120475771922004522583893765862042427351483161253261358624703462995261783*
|
||||
// X2+203567575243095400658685394654545117908398249146024925306257919445062693445414588103741379252427065422417496933054)*
|
||||
// x + (806998283981877041862626354975415285020485827233942100233224759047656510577433749137260740227904569833498998565*
|
||||
// X2+249039961697346248294162904170316935273494032138504221215795383014884687447192317932476994472315647695087734549420)
|
||||
// over Finite Field in X2 of size
|
||||
// 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177^2
|
||||
impl SWCurveConfig for SwuIsoConfig {
|
||||
/// COEFF_A =
|
||||
#[rustfmt::skip]
|
||||
const COEFF_A: Fq2 = Fq2::new(
|
||||
MontFp!("203567575243095400658685394654545117908398249146024925306257919445062693445414588103741379252427065422417496933054"),
|
||||
MontFp!("69357795553467368835766998649443114298653120475771922004522583893765862042427351483161253261358624703462995261783"),
|
||||
);
|
||||
|
||||
/// COEFF_B =
|
||||
#[rustfmt::skip]
|
||||
const COEFF_B: Fq2 = Fq2::new(
|
||||
MontFp!("249039961697346248294162904170316935273494032138504221215795383014884687447192317932476994472315647695087734549420"),
|
||||
MontFp!("806998283981877041862626354975415285020485827233942100233224759047656510577433749137260740227904569833498998565"),
|
||||
);
|
||||
|
||||
const GENERATOR: G2Affine = G2Affine::new_unchecked(G2_GENERATOR_X, G2_GENERATOR_Y);
|
||||
}
|
||||
|
||||
const G2_GENERATOR_X: Fq2 = Fq2::new(
|
||||
MontFp!("44471777796618567688228760095584248343372454885978087674329841655595593880133139294404651664057692271364857231527"),
|
||||
MontFp!("152209914092745808277594956866181055187624831129109767937025242463317365117655129123148193049673425418513926319001"),
|
||||
);
|
||||
const G2_GENERATOR_Y: Fq2 = Fq2::new(
|
||||
MontFp!("115206687171448860889110309021279060303629519187879257051215751573842462972180856243991157572371972099444077110343"),
|
||||
MontFp!("191377956145194479040228903677940355038998863371661730030204479850936075480341608934735952709786495341106477933498"),
|
||||
);
|
||||
|
||||
impl SWUConfig for SwuIsoConfig {
|
||||
// sage: F2.primitive_element()
|
||||
// X2 + 12
|
||||
const ZETA: Fq2 = Fq2::new(MontFp!("12"), MontFp!("1")); // arbitatry primitive root of unity (element)
|
||||
}
|
||||
pub const ISOGENY_MAP_TO_G2 : IsogenyMap<'_, SwuIsoConfig, g2::Config> = IsogenyMap {
|
||||
x_map_numerator : &[
|
||||
Fq2::new(
|
||||
MontFp!("165752316658948679552567650341600213993620343632797226373648182250196112194084163699689918190990441453209217107673"),
|
||||
MontFp!("172182978063994664796636281648715261218877265445686511820228400278128135165425091257965367402286789184662480399420")),
|
||||
Fq2::new(
|
||||
MontFp!("49078863819486020728803126419770411403544927967564775122533948145670810135602221046611632159195633125363688522753"),
|
||||
MontFp!("133330677606878026253733532636681674371349711466687180056118155523679405609126901243884039337337134962627419965345")),
|
||||
Fq2::new(
|
||||
MontFp!("88440326308038176392218244342168484162310820452393341528824316035047758188693394849605113877264996124652991932266"),
|
||||
MontFp!("26460985441766134300772651139298255538590921173641559533448371120006177647448359485069994828122162245692248966113")),
|
||||
Fq2::new(
|
||||
MontFp!("240831597672798022181780196442988629902557797416422752447288392631352072879531084668083129009311685341499602842359"),
|
||||
MontFp!("124795068789978952575783920730487695370136831800946532752608526840944057283524691812795315973894625798220920082767")),
|
||||
Fq2::new(
|
||||
MontFp!("231856156439094824000656216233999389240375109059054378946071472571709648546048606758615235778059505184730503731408"),
|
||||
MontFp!("134026238756820071135251263743482298414233385640297868129438877114735051445009051866011097877494554014116371908672")),
|
||||
Fq2::new(
|
||||
MontFp!("161628978970526519329329822295337582413127505041035400390544637404697415598883543152357105789965717470570494458589"),
|
||||
MontFp!("116602947282570158568911982642223012726308726836613908383578383334370050655181609483409110122767402070015216413338")),
|
||||
Fq2::new(
|
||||
MontFp!("231615170079008089001496386178968115998492752668752266579314749799030868007672086089822600816657899022828734321418"),
|
||||
MontFp!("141639542381992520856560441410242716791591163086143661904501184306161835850893036003163803884002896297253767009574")),
|
||||
Fq2::new(
|
||||
MontFp!("96957224446676123824350918241672464825735454895610578698586352322390662445273628285471423071856275085141118045105"),
|
||||
MontFp!("97587419381711441517698658129839468394457401157021696651597713140291602428957555768352336399994179660880524139808")),
|
||||
Fq2::new(
|
||||
MontFp!("18662780664429933771192510151421557554668611953190652639195940454142648933454488952361465779870877163142807899993"),
|
||||
MontFp!("55517007457989983858891530398020104232682844055600438506715652841000901588962918721851719951820185832313468320365")),
|
||||
Fq2::new(
|
||||
MontFp!("188864327416940344326229259749844123042825201085435432627935318423081174922012610651352346391417830722940140585036"),
|
||||
MontFp!("233542978062801907184831603532041452683131033894029390005010898310417350737942550513935694209129350870817277172583")),
|
||||
Fq2::new(
|
||||
MontFp!("33702103741469458207888758659069786556456463428431771947788685622778743201883736580054112022350187936628758294279"),
|
||||
MontFp!("7531651998638745138624528632013700806848273210661661935097722938692087106885113623803921367479582718152259987647")),
|
||||
Fq2::new(
|
||||
MontFp!("129405180560592211762572081137246817341681076084973348177153469170177032429929182033872985192027066614650754524309"),
|
||||
MontFp!("71494892585734577638768956295356005795556178117525317604450863442514001295461407965931789120761632296953990284809")),
|
||||
Fq2::new(
|
||||
MontFp!("121805396188033590038927712795579559087103093135515082191363074395734682090746320669474388875423586929711608364404"),
|
||||
MontFp!("75932324143801627944771670190157701465835368459121478812142087933983158148741884038298732552979549182443318608554")),
|
||||
Fq2::new(
|
||||
MontFp!("205121513164720886728676669276499362266139599046368626660027529707299170205603076104821498121463983514654737906998"),
|
||||
MontFp!("168051662766288660516992486993594951443897767271245608184500932350745292043277998040372769419920145370014740823389")),
|
||||
Fq2::new(
|
||||
MontFp!("224387508661509885922784938707800296916307265709615639996851552571542396031861010679067114387017955365668256976459"),
|
||||
MontFp!("139097554917981907719834170888130444861465074977932740823078016609751284491153969166862091045221603146530147099779")),
|
||||
Fq2::new(
|
||||
MontFp!("142477190388553987083175296028785369398580520754966744245694134692905987471896623788336582063245356609279657681007"),
|
||||
MontFp!("140302880976816076816721836344737338071783799730513599397010923016385668972882234545823525686327074617973208860421")),
|
||||
Fq2::new(
|
||||
MontFp!("205538184807792915395400814312734290381492118179294333381188081024280220461983210331268164749465891791515156713363"),
|
||||
MontFp!("13030331252003455924520111292282390143014750833628314421882396445822808054003584720817672388894671968339344750750")),
|
||||
Fq2::new(
|
||||
MontFp!("139197805910452438551419010260519164074855817417063470117576949912038778696248952069759607969690314639425179841530"),
|
||||
MontFp!("134745690770497208213126494241047670387239583870118646766457825646403640347226342104549240830903829682059982326727")),
|
||||
Fq2::new(
|
||||
MontFp!("46999088780962505530452862218145506822520603893157196954987630663398814970386085186714696215299498862118704356116"),
|
||||
MontFp!("239220883081126775212690475926873251881459118214247205003758844846022330659109168499739536107988232402392010148915")),
|
||||
Fq2::new(
|
||||
MontFp!("137461512605659170682300574841422927080299499340556631216517745531687218204749421916211266297116812992348911035943"),
|
||||
MontFp!("126932856673577834557989832150639712812952235385146245135235966945536973066700604316981524138335070494135486842267")),
|
||||
Fq2::new(
|
||||
MontFp!("57815299880375466472857931022912171296473275308202666945592250229771936329503691945881925004852905385160277065937"),
|
||||
MontFp!("207900273391847649346738694548609379565855077833395139615718913929125517933139374225345876078131155102796477330196")),
|
||||
Fq2::new(
|
||||
MontFp!("182397511129719455005407008314265069548677727690813781407770284951663734172103638427690475141072553074575221965383"),
|
||||
MontFp!("225121846650282460844501132545123914298308844633699320249517374760159461135641190512758348530493533776082794775238")),
|
||||
Fq2::new(
|
||||
MontFp!("42757221749971324771094873984161893488770713619971906650868412147150411626107692517374735631529074208182971223761"),
|
||||
MontFp!("111424637101855455933266154646364284011426845669269128135151076357862608862363255550023430066507374024948118755170")),
|
||||
Fq2::new(
|
||||
MontFp!("257686488674545770403807165703608491821700153538449954828958424244540050698630649531963334687249831352703307010320"),
|
||||
MontFp!("0")),
|
||||
],
|
||||
|
||||
x_map_denominator : &[
|
||||
Fq2::new(
|
||||
MontFp!("196537929755540830130458921156910352741196129560556501635658595085779576490417628044619830744899117989899096675116"),
|
||||
MontFp!("106967816747202586221026040614608875779671819314280336591550617355334247302203894951925800601923998790402234025494")),
|
||||
Fq2::new(
|
||||
MontFp!("73314120416427646620569455169905724114883313094893949291513517502168861559767103394033744003864213510722887906274"),
|
||||
MontFp!("38999017135204040984255776995893429123212353273299706702441986090800506456890730978953545316903022073202240280957")),
|
||||
Fq2::new(
|
||||
MontFp!("133779461364688439286044255858523747234865723284672664672066362220940987786797573428234566651244275384657571315397"),
|
||||
MontFp!("154931903368935230733381648548242132592387960818255334523314635613616976204585469590179605887364646535250639335453")),
|
||||
Fq2::new(
|
||||
MontFp!("247957910140234524214324761874381439955705875777136703199106095643204254634304448830280410483013931961038942096519"),
|
||||
MontFp!("214943806307523271117409515396321303330984956986022871981067208079182219051826091487389512723678609613943324945884")),
|
||||
Fq2::new(
|
||||
MontFp!("11697862001088266121450094179739500241088837734277696824118211258364151630931186792937914301859707394679202145393"),
|
||||
MontFp!("95980723944521770226526824868742386994509079773043937452565624851192578861364669763702851513923262074687274763858")),
|
||||
Fq2::new(
|
||||
MontFp!("168096269708683796856556357930292925811554548435612382636199127159818409693729567946366892866365435246772528367031"),
|
||||
MontFp!("99720174640078175171062115168656883367851695095484071724968247253018133737453004325770034298778522431209097310502")),
|
||||
Fq2::new(
|
||||
MontFp!("33059404918884325948584592996172619413923041143099424466021368531149134447772287601175965141235934645074697267050"),
|
||||
MontFp!("10757428905957703588038877674336794621171834192483169256644941002565404396356505770991807551250572677872221995215")),
|
||||
Fq2::new(
|
||||
MontFp!("142027935684179419855710336591935481541662612521926997142809731189880364304749483394981554800161483370077741056896"),
|
||||
MontFp!("1943403947563275150997369785095274118967148389261968103605246462390957897712088493386683316483490223770940902453")),
|
||||
Fq2::new(
|
||||
MontFp!("200535851812830711305923885193456283997079838967145939474743725430895019937175928830731575175640901984178880783011"),
|
||||
MontFp!("73874168720549156282270730246833500558176745413797996774310087510749148634278604002052708223696920208907646881989")),
|
||||
Fq2::new(
|
||||
MontFp!("220384543328043309613139993483671702409123249316603413540407457441864555087013622511692877380446192851630287225413"),
|
||||
MontFp!("39000405073743042346296304484168728185850505353133307908773204457381817815206498660334035187329579833299098854925")),
|
||||
Fq2::new(
|
||||
MontFp!("219195224293908756855578672234544437367397890301565855376597788842679778002659222115121213889017072727428356719234"),
|
||||
MontFp!("247894577734607804564008327202067464850944943412136922154651844411293409127507835027401641672218158657943826643185")),
|
||||
Fq2::new(
|
||||
MontFp!("146699001487357489560227247646638441970227213145065178169054120124066032784405371946823057532199624317631250110158"),
|
||||
MontFp!("196336324454181158449524835117699225596467237400207491815838252818724619960701247377784788803043096102210425517795")),
|
||||
Fq2::new(
|
||||
MontFp!("155939253194251956164424003889230633804182501306742152137449150503013281009623802843490858570697615902305132709111"),
|
||||
MontFp!("172261303485740204844677209985093962119870302741179905216184157502752680126595180139007438892219460422745105017475")),
|
||||
Fq2::new(
|
||||
MontFp!("137972103666241533333852948884443545062916813938500094392929132716673981519930321922556812217620174550912349461419"),
|
||||
MontFp!("47600282095791674213992406796226738606147801920837771594412659335039656256887529097801732359033209329929517773020")),
|
||||
Fq2::new(
|
||||
MontFp!("135098057022357227608956235549944366234286127511416070373827898662879730495316177891045223676768538262860577751087"),
|
||||
MontFp!("218641591773893348322227471378547165043111820723080862748702228639502320411481947789769811366015509814793754417785")),
|
||||
Fq2::new(
|
||||
MontFp!("228687493726193558146661770435566220015197012398911029567178581932152080915557441338298274247922585720118620741642"),
|
||||
MontFp!("48223421552324743764826987807666420223567068651197810526658625431719723647078135623842652870214605734395702563953")),
|
||||
Fq2::new(
|
||||
MontFp!("82401683815523491481199527201592079745651015539510634295850130611233688561451492330603949648060220533354045095181"),
|
||||
MontFp!("159070381032762485827712709726121404273458384870681735035622289092845201234785949112608113110663482448286550123895")),
|
||||
Fq2::new(
|
||||
MontFp!("61539107135026562717413992304341045078777699607129438878970720148394005607774781361280841945254066290447512808860"),
|
||||
MontFp!("258564647705165711537697112631909171171984598885182416737094411313452565619624851452883996847677936536536427515609")),
|
||||
Fq2::new(
|
||||
MontFp!("219867891253233227579149075701158020315633373195728794672342716359369374905471205886891783929214978430681990036959"),
|
||||
MontFp!("40524381030862708561992431051313657250449208728762250622105264621614810013551839533882876237430311293361821844681")),
|
||||
Fq2::new(
|
||||
MontFp!("88800087516399959501800534486349824688877578947555023348699585957763763180753947498274724426567091309571649023166"),
|
||||
MontFp!("122245180850560437899129167839042992977076962956306963014567407897293197200681367630073717776421484831646532593850")),
|
||||
Fq2::new(
|
||||
MontFp!("69204740140688189359361744597982172008615446130082862488352885921056331761951244674105352971861180999345144984246"),
|
||||
MontFp!("38216467720351249271557670250657907497353617320059247139049052120842234439257669911851800147147313339669901995490")),
|
||||
Fq2::new(
|
||||
MontFp!("114765242606519624982400506165904237893471895287563151339459173837887003905317760268941880935997925302483810508170"),
|
||||
MontFp!("226808321937551848279625259185874129283473963677740840941191767963773773116795416044456897499248110949601850478751")),
|
||||
Fq2::new(
|
||||
MontFp!("1"),
|
||||
MontFp!("0")),
|
||||
],
|
||||
|
||||
y_map_numerator : &[
|
||||
Fq2::new(
|
||||
MontFp!("243169287995837894205750503657473181252400776697661357268613577074201794943537027717771587727860769419520957117060"),
|
||||
MontFp!("154445371651863854130996979206021232172872232688365227537444264835087932826365764405635125797374865965304745730822")),
|
||||
Fq2::new(
|
||||
MontFp!("109149004424675517113489432756837393820953128532207867425106578478986226345054217066591849467433110788215195319750"),
|
||||
MontFp!("30408441237651674477115309504276625429344634933425091999725383701660094027885762738289460271315609173544614563248")),
|
||||
Fq2::new(
|
||||
MontFp!("8414285408102090292522571401032945098403423241877066651551931468973120658567171350501434823318074450118610388181"),
|
||||
MontFp!("226047422399128874433860903177676209375847937545805175562415311468986239012130226120019081492247088609694678876810")),
|
||||
Fq2::new(
|
||||
MontFp!("228308803559737454633222698485074629499383737811342884536963429506633258142551503400414163815852158951494613610809"),
|
||||
MontFp!("220909287290837789818195731110558629271153823543746871132117978761339034747123501189473420274677281822601971748563")),
|
||||
Fq2::new(
|
||||
MontFp!("116623955280658732717402646061913268461869836841204913444259922610012147799771656282704605878638711580234302879520"),
|
||||
MontFp!("251345693404812657374633929641944735274020119374936409701199723189056283828393555325905238148261248120379910778583")),
|
||||
Fq2::new(
|
||||
MontFp!("142632909729670553826438094523500302011158161959746397893981306350515911350319381478896794266740222044724793183031"),
|
||||
MontFp!("135097007131619291616144192105571840182910366835929043414300810591005223344182310684819863256436016908585466099814")),
|
||||
Fq2::new(
|
||||
MontFp!("159262246805999098136860288248138175456624792734939305704793543040582454889431805248352849370505960249829264037333"),
|
||||
MontFp!("256411146327954053251262434650444473133439725697572806395735688747939610541453396276159230618136278790246160635595")),
|
||||
Fq2::new(
|
||||
MontFp!("106675525854808944323662773997719159035717496275254424840883415090817949089664218352587480756720528552217297479523"),
|
||||
MontFp!("142202207982399429498494980946602932891398916434890751210930378360132151108127041093945093575972538591541631204396")),
|
||||
Fq2::new(
|
||||
MontFp!("115853993705912938985758922127173369175321347209545356726288637524744651943071927137158115778405271676616612170666"),
|
||||
MontFp!("188439202506521797668192307957766105517906171778775206324453830870041256388075168650527562921934698697140423464142")),
|
||||
Fq2::new(
|
||||
MontFp!("199891426461397900698689228549412057991574595606781836622700872746783962617889812808189413859146835266670353365164"),
|
||||
MontFp!("123487321384490387195094801639396482206262484603737596281845841408384878196277195829349272799617445074531384638014")),
|
||||
Fq2::new(
|
||||
MontFp!("203453160391122297114764634999687500867096029894782931052056493086745424054313508850135956093450854351511962568248"),
|
||||
MontFp!("3933321808920817665892338621688661599151270488240879901971434149901647580182088988848276352998263499828820719486")),
|
||||
Fq2::new(
|
||||
MontFp!("216229669548325266866202681779047392389311278655704899819569794547799955366773265486059541504823551138048188296915"),
|
||||
MontFp!("41448968894064940344019909320065089603789758666259308674991068396259424208998703895462327945020441899649105710894")),
|
||||
Fq2::new(
|
||||
MontFp!("202678826482051686554967485240375873611017127444692775767942717540980994219310434688309713205309853725035377739266"),
|
||||
MontFp!("48778316120483961415587198479185523835826749642473845435889717611018677968038563827240090688089889339896065735651")),
|
||||
Fq2::new(
|
||||
MontFp!("43364741387169348753014627410136368149262698966106150910900756728904165177527487078077667350512959263803465594111"),
|
||||
MontFp!("61944739699039529393579599024212698483276675572994284564132452254474389809816373777333943401872462638231436446348")),
|
||||
Fq2::new(
|
||||
MontFp!("1902545032251691771730077590223241149624964994150687591044314892275508885163105731414463515832696686914784357054"),
|
||||
MontFp!("67221897212365550931740188657735915316732820967428518278153545138481072202717711417949297443415145931349647354864")),
|
||||
Fq2::new(
|
||||
MontFp!("232464396645736057215489125286424902556417590819993013568149210848680788030572385843387291711255018198764185991688"),
|
||||
MontFp!("41800154023275681622180037448850007404785328883356603798952195956734186941687720006035939799906615555216990599152")),
|
||||
Fq2::new(
|
||||
MontFp!("187038260664272653235271156369560372695631446985830424056061915935191103410794701043280599214000281588074544657045"),
|
||||
MontFp!("38290302770763423573829549940707041833171456153861823771988991461936307395626028842226881832323571911777783325552")),
|
||||
Fq2::new(
|
||||
MontFp!("8193038016485856982946817225511231096542148907426451941320763511467909442967073658628847889502238964737537651732"),
|
||||
MontFp!("9418692556935347898382092734571186686450013671235254851703843297990915553970523788207837029694342875454233715193")),
|
||||
Fq2::new(
|
||||
MontFp!("134073844001083825421215848942909782702386338984309026786345170296027964134133613977422644522116018820345983847098"),
|
||||
MontFp!("153830492090479629579603390014414329445124716355506854714467139884353350218676155251380590350715220577136073627555")),
|
||||
Fq2::new(
|
||||
MontFp!("24894203921911934571199160858232802417038583022586807490232139245280305064770051397858560092019807972764914216208"),
|
||||
MontFp!("120208242722200714489749801697072499732825359039071841003310452443348308205795253556381720202955786470886397257982")),
|
||||
Fq2::new(
|
||||
MontFp!("190392008574458975806418600277835706985376229847531539152452591238358119216217627352637258288556199770365835067627"),
|
||||
MontFp!("236947842470057836630333692287445445381482585314120394670322793497639860754696181540315462907276465780536189751938")),
|
||||
Fq2::new(
|
||||
MontFp!("128014602802339573117431114877417430852771121268703430430938496966993823548956133449208721198231566864014207876438"),
|
||||
MontFp!("76313913933214383311039506294052736258824720597935452573279680967713148986901401959316819572744945391130691484709")),
|
||||
Fq2::new(
|
||||
MontFp!("25945524144868616798377005434321968607597029473408456417628770501736226577600936996306306386148517051252174176056"),
|
||||
MontFp!("93302878136439028547402102681387844515310157832968167882878653011659204369510932686206718073261314562836132094987")),
|
||||
Fq2::new(
|
||||
MontFp!("89345438915485267000169594163110872264018138861479961667441187849751112704236404111089533981719810422892295971197"),
|
||||
MontFp!("225199447663521472758596124691205483139271667363437613911741821442536429098852529066869544898685674003162780468715")),
|
||||
Fq2::new(
|
||||
MontFp!("133226465537371725791207823007732608016851433266603356824246032571600774858733596680855277271698121233692296984412"),
|
||||
MontFp!("214026235442364760645768878901893433888530027239186932434340221483611429797860448445573321733516533800376783586849")),
|
||||
Fq2::new(
|
||||
MontFp!("209865017468509971341642462085093919192185569139223034709204939485243056860760867821924437786503336074163109167043"),
|
||||
MontFp!("219490420378012040044597900078465204875085141304274262719756064241884227366143829466191943246131284770521917871841")),
|
||||
Fq2::new(
|
||||
MontFp!("107794270350250727824303719264349327362253764840855494366195678657690526275364378542854833701549538802096418248084"),
|
||||
MontFp!("214497132288922282410470995366492104127705853917251639956391350188219443322307620708083843529019036699996096662829")),
|
||||
Fq2::new(
|
||||
MontFp!("216436913923048926393371382639334167145590308917722616640273699755872914758105310937706004925121569777096571773501"),
|
||||
MontFp!("14821532235517245029225575994881495294340097494060025842437989195232333244802578196149414170959605497405878582540")),
|
||||
Fq2::new(
|
||||
MontFp!("149340524242957423974772893433814190392014381473852786295383636551096665463613496468840974015807625484823068784839"),
|
||||
MontFp!("92602205576740019970555092291786069878442230185393269119060098961688837594116147683652993589116622567477525635445")),
|
||||
Fq2::new(
|
||||
MontFp!("187289608720372854303118076618428364941868395899689208696722069999084187290922488892094161492110977423619035272649"),
|
||||
MontFp!("138246251209835932037747211155451146889753321830881007441732932302281412878493276648902633332871835811473542877960")),
|
||||
Fq2::new(
|
||||
MontFp!("165653628641840315664303139225783620502451401675361521932235743336920154286645843675719999005591028855021909439672"),
|
||||
MontFp!("221484407095875062109245088271905042727631591858266177514520864715688286361376419124935364810076972840743950061836")),
|
||||
Fq2::new(
|
||||
MontFp!("133980604703672698089766182661998480874540278232523164821108522954758888202993741126021280431373622479768313949356"),
|
||||
MontFp!("38886256490758184304393553179653915986060051480245869194662478974097783410818598716423697164666847852998235320966")),
|
||||
Fq2::new(
|
||||
MontFp!("8411654157888762354868203383638678565276209861191964793314989111047210939710084789719415109438273538021505111510"),
|
||||
MontFp!("187207294428708203829145346569036650547801585764458185253951079008883539428999915118458145884040644479498579194069")),
|
||||
Fq2::new(
|
||||
MontFp!("191144230647045707590184821948778479495825928592047153194222027257046414968351470170933284561757547536684715232224"),
|
||||
MontFp!("0")),
|
||||
],
|
||||
|
||||
y_map_denominator : &[
|
||||
Fq2::new(
|
||||
MontFp!("177304823246185962354212404236288831041380791662214394697399928748373114098169675564032904690251242875327747673679"),
|
||||
MontFp!("234106598974619695004693596968258258794247055108931498762994964636371479098512727352039267846913406623802246782945")),
|
||||
Fq2::new(
|
||||
MontFp!("255874157960252694683645508260848371559149621054025374393554376526882940742514793344046680765937904153005134511200"),
|
||||
MontFp!("19068358873460915055376626440913257473060029137260026174266944920186136734103362122730468957229595374427187617425")),
|
||||
Fq2::new(
|
||||
MontFp!("83946178094995839681455048029661822915614318352963730526672352524233381944447759416757234629624830143848209247040"),
|
||||
MontFp!("36167189440196390196320129647971031300455228428629866775570898825049060037811108115927676106354625467897211624573")),
|
||||
Fq2::new(
|
||||
MontFp!("214137118009637944275213937166601531498145257806838837034827533674793291112410824873653425491233537265355337125438"),
|
||||
MontFp!("75310151275642225944994533227518963961512910025529659163648069668626195571780520556481029340507362571133885889206")),
|
||||
Fq2::new(
|
||||
MontFp!("107140053800026140817203074526089346919722280052456645787788712045148531978814339001150298053597504647766497707422"),
|
||||
MontFp!("114397460921328140828185121166450637136573513025702964340164304518654108540682577087979875141067314446917571826582")),
|
||||
Fq2::new(
|
||||
MontFp!("42398151340378868438123040588425908782227436520374323184618125390984068793920538080412999034838310511981244418952"),
|
||||
MontFp!("82194329196840936158921467961561828669469444994699107543787160001285217807552090667641931153824104285439311091477")),
|
||||
Fq2::new(
|
||||
MontFp!("32044478312863504453978511975839237915357713065285858656377527520925624222082496835678894223326750023304346513708"),
|
||||
MontFp!("224732340440722096332247540469311391766792864305974461767563394934556509366444399113606207665094042937608880394380")),
|
||||
Fq2::new(
|
||||
MontFp!("53290030879673160724264978063216325707183784347799183367929912851157629196486013218134779085284663628473135140615"),
|
||||
MontFp!("42967590874964323361920860309631969474991176192252393149421408476343364383848642144439727879920981862569415477634")),
|
||||
Fq2::new(
|
||||
MontFp!("250488593850017034090300371968459931740406675270099747930030660805939980644430804509506597720682995099971419762057"),
|
||||
MontFp!("131736273443849165304852712527070616520885505701320868662058330388440710419459541866884603770735894010610491333882")),
|
||||
Fq2::new(
|
||||
MontFp!("251064692215092635541196206457923985861467397867989080397969990645886126152674833092283559946890888232618697517884"),
|
||||
MontFp!("171430383391121065822039978510482289343958135960126315509375831831735263180943544895493884988847947752888720502133")),
|
||||
Fq2::new(
|
||||
MontFp!("255810123836950778051032251049468471118744836441263107437005316697409810175422976454215094737538073112171964000966"),
|
||||
MontFp!("78363344687446114757879143124020926645520829625790622079288990711202726499291972408305265373741655103522048633806")),
|
||||
Fq2::new(
|
||||
MontFp!("94953611600133917480746113251669332369937157892937924494319507354263981756523698288726321437604686331762128114942"),
|
||||
MontFp!("224037954053161681052577381077631881138732983068288196649494577229506443999757164090758954620762136536790092765707")),
|
||||
Fq2::new(
|
||||
MontFp!("18177910449767953614338723180992575758462819793657888834925741153507922227776503487306285172452430778418239589878"),
|
||||
MontFp!("55976309667093193926953058482403983650044130588205371047077237394269232758375928755579870418413040530924659710422")),
|
||||
Fq2::new(
|
||||
MontFp!("108398849957050915959578499238335172000970311919637037913625633347326921657585237193100994767528244599176367431882"),
|
||||
MontFp!("204809230842263072415312635210643987712012160534293694062738501600937603588267937911969298058204043106501986725326")),
|
||||
Fq2::new(
|
||||
MontFp!("40836628940164991036725499428168139451294386215534361893839871958837737306822281294361671587764896498700322394958"),
|
||||
MontFp!("119396884503349014053839666170414789560955868303656326650021743484252346209353246139311353657707899076368015332219")),
|
||||
Fq2::new(
|
||||
MontFp!("57449149099548285338146473529383255206310079371370663992648410210841833627207062160011080280732475904935527767063"),
|
||||
MontFp!("53213606042373287683153647684084583002441527525177758051678463570615020765660540938870067881706148841340293404257")),
|
||||
Fq2::new(
|
||||
MontFp!("136011650568921952309089811450436645471254909718073766303847394446918967077385999380499048535832357755732371368738"),
|
||||
MontFp!("167478505497067957490757520193067128323382872103395718848436244112857102765738573826312783708349214669979612036158")),
|
||||
Fq2::new(
|
||||
MontFp!("124201488690791095020042847186337439989685011854729481246272047846908500431421470344897520044190299684207452017073"),
|
||||
MontFp!("206045464105062318563700338460670926332476051084269665075012377410704353049241671458557389593362582538704238377616")),
|
||||
Fq2::new(
|
||||
MontFp!("141307886851791570111930048284226290849958071383456038631306928334570275405889250568493573543543795501685612269615"),
|
||||
MontFp!("33695298953151791677564491610276872092952551110021466172491397823758283921068636555353240048692541883780027233962")),
|
||||
Fq2::new(
|
||||
MontFp!("248265339860070148327157063205450906034372346050742532250909040050681913704941472496789561564874787781299103889328"),
|
||||
MontFp!("246735083688655178976599901436968434779493759990448799231310864308891009496294971885106650388027197609829556319894")),
|
||||
Fq2::new(
|
||||
MontFp!("242374981274128257174433646391488180576863913259197526647513270422870835725158808599624055920155693832356361192562"),
|
||||
MontFp!("228823832066259533984346839854456963456061412139464585495219844904598927917971403987214543635705786807302526573779")),
|
||||
Fq2::new(
|
||||
MontFp!("252218794556637183364789705825049189219556217519670190016584589877973440046635828866291293002549365274213665103495"),
|
||||
MontFp!("246226868929550107779875102413192686259972538740042993595504829761267272514998892312681511407413880843390092913913")),
|
||||
Fq2::new(
|
||||
MontFp!("194440756770673250653849096711805826346541581797630354589253365569405779009028682866443842541588052010949210024484"),
|
||||
MontFp!("75265817091612360444217709043194311507703596250641164601263089234422086318666070167810083868284770450890779266774")),
|
||||
Fq2::new(
|
||||
MontFp!("30126025128311053094362231518416999154688680759401769180563223025361877725315179695978985780460875616652938854146"),
|
||||
MontFp!("53390417057360854696711134553867053334956120915983753729596602193155006833056717338565729257476036879055975910097")),
|
||||
Fq2::new(
|
||||
MontFp!("101332532133743769759178027285109552486478973958553103055307446365529747250973790438239230671819476569086244438727"),
|
||||
MontFp!("148745905560783494991892238622790396213255789465409808038709750840775025617296316699696997331989504328034553213894")),
|
||||
Fq2::new(
|
||||
MontFp!("64805743514968884017432304617184871899075979363892814607985017391426869625002757534871594116135107848421987411961"),
|
||||
MontFp!("6046324386958113626500748531301314307229746408846776295678625368971798823548167403538529285882066298168231669149")),
|
||||
Fq2::new(
|
||||
MontFp!("42585898388361518080924198789209195881860509830112816215046001795045034138585747974649960102171072364466234418812"),
|
||||
MontFp!("132695208880203057798268960407754614753345990251279710979596670783892175104478291787481794529190706739877760089560")),
|
||||
Fq2::new(
|
||||
MontFp!("212862020601301354783026588297306531610140885387724836359356800753780855161155144746080869191538655229274242914307"),
|
||||
MontFp!("157598266513011182093451150345114371606842593014102635902061162138398777778450012845089379844999350325670077782200")),
|
||||
Fq2::new(
|
||||
MontFp!("4121090928751590306336774011079865996138664888804166805010515676212588791761189056383637824656513752764121888675"),
|
||||
MontFp!("183219245849642047090141657656072708461001592401873575143115550847958265143529306190408825011434780265059908079650")),
|
||||
Fq2::new(
|
||||
MontFp!("79081485025787885179619178550309706744599846607596447880706626420512740963985633088538634502003788677250834958908"),
|
||||
MontFp!("183808890703436998546164599111050972902808423546263572335175957576564587842514119276068990911067829699066843757937")),
|
||||
Fq2::new(
|
||||
MontFp!("212106075999882114389916784897163150756429321557076536924307653148222968665985018997130331497354557069316538670523"),
|
||||
MontFp!("6765896997590927451499527318422027932088882822980873934837948553969718709492787823596776070132570199077127482065")),
|
||||
Fq2::new(
|
||||
MontFp!("234716866510887739589745422464313597883163631119309437461957606368046054279070563732715561665778636277317684644515"),
|
||||
MontFp!("97451989647642778641795555357790293895920858058713680518946629728091416392679362160653023502048556793761866531581")),
|
||||
Fq2::new(
|
||||
MontFp!("172147863909779437473600759248856356840207842931344727009188760756830505857976640403412821403996887953725715762255"),
|
||||
MontFp!("210880269899843225414111521931364427157014189139153931141845520612300425501022712679200902179085486362182614989038")),
|
||||
Fq2::new(
|
||||
MontFp!("1"),
|
||||
MontFp!("0")),
|
||||
],
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_gen() {
|
||||
let gen: G2Affine = SwuIsoConfig::GENERATOR;
|
||||
assert!(gen.is_on_curve());
|
||||
assert!(gen.is_in_correct_subgroup_assuming_on_curve());
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,9 @@ use crate::*;
|
||||
pub mod g1;
|
||||
pub mod g2;
|
||||
|
||||
mod g1_swu_iso;
|
||||
mod g2_swu_iso;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
use crate::{Bls12_377, G1Projective, G2Projective};
|
||||
use ark_algebra_test_templates::*;
|
||||
|
||||
test_group!(g1; G1Projective; sw);
|
||||
test_group!(g2; G2Projective; sw);
|
||||
test_group!(pairing_output; ark_ec::pairing::PairingOutput<Bls12_377>; msm);
|
||||
test_pairing!(pairing; crate::Bls12_377);
|
||||
115
bls12_377/src/curves/tests/BLS12377G1_XMD-SHA-256_SSWU_RO_.json
Normal file
115
bls12_377/src/curves/tests/BLS12377G1_XMD-SHA-256_SSWU_RO_.json
Normal file
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"L": "0x40",
|
||||
"Z": "0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508bffffffffff6",
|
||||
"ciphersuite": "BLS12377G1_XMD:SHA-256_SSWU_RO_",
|
||||
"curve": "BLS12-377 G1",
|
||||
"dst": "QUUX-V01-CS02-with-BLS12377G1_XMD:SHA-256_SSWU_RO_",
|
||||
"expand": "XMD",
|
||||
"field": {
|
||||
"m": "0x1",
|
||||
"p": "0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001"
|
||||
},
|
||||
"hash": "sha256",
|
||||
"k": "0x80",
|
||||
"map": {
|
||||
"name": "SSWU"
|
||||
},
|
||||
"randomOracle": true,
|
||||
"vectors": [
|
||||
{
|
||||
"P": {
|
||||
"x": "0x0123184bf576b5d69c00311c57eb503e3df99ab60156a2bc34228e46cd1b0c8a15304f0de63602ae32bbb08a7f44c2c9",
|
||||
"y": "0x017c05a4f658399a64f5028b1c5d8a928f6a955bf28525d906592b9e6aabdad838102c6b1b4a9108898931fa42ef0cdf"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x00e10a1e6c2853d3416288652f6cda34fd2363c993f4c4fdebb38f185855fd17fdae6f8b35f6586abf39b746e14c0297",
|
||||
"y": "0x0132b86c328a4c52e82db1a43257ca0cb5a8f8e2546b92a854117ab26cf6607e9d8c207854d8597426c6987ebca42d97"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x005648e0f6aa7131780c1ae8d396bdac0dc8e76426b8a2adf6b0dee3a0f80b7152343332a9c2ad5c83113b8956fe2685",
|
||||
"y": "0x0196b1ffad506901d481b632f7dc9ebad6e3eed84c7d03edab2c7df0b1566c5b5d376aa2bbd4c7c169abc449f3129f9c"
|
||||
},
|
||||
"msg": "",
|
||||
"u": [
|
||||
"0x00e91c93755d4dce58b4277d109ca11cb178e160d0209f0b97c0ef0a9d03206bdb93498faaaba98969d4a50f91d8fed3",
|
||||
"0x01442032ceae5c549af8f3222a0b9fafe5ef19a001ab399c2ddbb9f7dd59671150a067bd104604bc7d7fb9b909a2b276"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x015756bc7b5a8140577878f75009f8a0009bf1820719354863a52057d0758b27ff7d843e177fc618146edec267d1510f",
|
||||
"y": "0x013b4be1db30d04593dc965b804044c2f92e366543f32377463a0deeddf7ddaa0e62e843d5590e948e5a0d9af2b917cd"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x01029fe43eca43ce7adca5d31a84b66b28fc00de3adcddd393c3ad1bd993e24cf70a9dd99b8233d2a657536943cc5000",
|
||||
"y": "0x0011e54e8956bfbfdd17dab8b91e571a49ef5c5c7a5b3c00f9ecb045c39c6f59e3c60c3cc0d290c0e5effde15672ce8f"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x009e6c4f23e3590fb40b0a622a3cda01addda2a4ebd860ba4d87615c299f87e02c190035e593e6b80b18282d37168f3a",
|
||||
"y": "0x0090c6fac6f33662a3b50631e367b087e144315a4400bbfbcea7c16366cba865893c85bfa79d82cad31954925363219b"
|
||||
},
|
||||
"msg": "abc",
|
||||
"u": [
|
||||
"0x00cf409921dcdce7de4b3541144bbb5c41592a95278af448bb6f6287e5a71b71c8148a03b8f98cf6e654b2a93bf89c5b",
|
||||
"0x00bccdefe8cbec53dad21b03a0d1f05e1e4c401a7f20ff349043ff1afe8074ea4edb457a2181d6388a41be08445f1099"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x01a6d66a21a28362895c867fa2a65e5e54fd85171a0a8327faec0f7272dd5fbfeaafb311d7e83c85dfabbc790fb8031f",
|
||||
"y": "0x01183a9c2d97c91c06cb090e69cfdf0e89e92baa780b8e3c5e1d92488d3a2422896c4ab808ab099f0b4d9203c7499147"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x017397c57e444777264e21318d6e0096779eccafd05f7a95a87acad1f8730fe7fe9e1d1dbf1ddf11539515596ad71861",
|
||||
"y": "0x01660b0335de45c1d4e7edc3b1230bbedaf598cc3943ce854fc2d86d84080486c4b0f325dbcbef0212b99ee3d0994f58"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x00cfcc6e7987859db4156bd643a7ac69357f0fa86c6fec36e039b2822001c90fd852c4afa98a5dcb00e65280299520ed",
|
||||
"y": "0x01823e2bce6d7769163f6646e6d80944572a6c473d7760b0b55911697437e7bedbc6674a4cf55850d03bc238128e9479"
|
||||
},
|
||||
"msg": "abcdef0123456789",
|
||||
"u": [
|
||||
"0x019061c2817582abc25c57a58f08f5239bd8d0eb1980d2b911e38131a779e0991c5a5662eb8a6aad8ce0bbc0cdfb67b8",
|
||||
"0x003d673f221f321f652ad6baac32fd04ad1c06a2c03e4974f752e9b87f5fe222b120e853c7a7c767255adda229c71a49"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x009574af6ebc91ea9e337178cbd5c83ecb9d42fed22b3272c3e50b1840c5089fe5bec9808eaaba8a06ced26a30b82747",
|
||||
"y": "0x00ccbad45957f1d493c1859e325c27dca3c63ac49177a1b2a9b5e22e14fd23845a638214e85506f46260db2827e2869a"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x00a4721db398949969915611e7a65cc43d167bc9c6b11fa69e871663aac40266a4a01ae64ac380dcce313f9975fe8f2b",
|
||||
"y": "0x002123e943b9a1943d7a57e69e30c84c9bcebc96905b920365f2fc5a4af2f9c42bc1c7c5660d3b10de8c8b1381b8163c"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x00860490ade9e09cbf22a1f32cfe14bd1e82721b73a244d1e3e03a38ea45b0332dca194a5f43bbc8e9bc6319399a0a13",
|
||||
"y": "0x00279ad50592f1a5b92430020566b2bca7837bef7fe0f8e08d456962b7ff6a25b4839863baa4a9659bee69af343d8ed9"
|
||||
},
|
||||
"msg": "q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",
|
||||
"u": [
|
||||
"0x000ec0c5ca9fd63019bd1f989f8b054b29a0a1833a0e3078031da7bb6446de321ddd6ba40a7cb9dfc70afca8bac538ff",
|
||||
"0x000e110ff18deec2d60a2dfc92642fdebd6d70712114a6310e1f3eadf56e608a05058d378413fdb819c8274437f0d440"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x00c54bd72909539ce2c7558b081a7ab7cf8643cb5c02e87d233f6458c69c1a9270ebb0a6c42083ba38835a2698a57cde",
|
||||
"y": "0x01a9529726f7d9994634d1d02c1ab474e2b9c20f2cb0cfec7e566ea033f40438548e737c43d4e7d1cb2fb75bf7686533"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x003ca77f5b09d595550a258c0480381569c8ed1caf4bf69e3c8a530d1d910d3ee941a53f6abc452219aa79f22734e61c",
|
||||
"y": "0x004d376f45eb23e03be43ea5c1e00f9290d800d01ff0141c8faa8d1b0bd88c2ee8f3bb8c7ce17ddfe21633ec2b223780"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x011f325cc402afd10b3b92a6ea9f52440d9fda541cd2fe6bf58040bf803f23a22c59c3dd494c1392f911ffec1a283b98",
|
||||
"y": "0x00346cb1d6116a329e755b913f5d2d9c7f5405b21e8e400853791ffaefc18a1b1aa8610bbbd4961fe112aa78d1859a40"
|
||||
},
|
||||
"msg": "a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
"u": [
|
||||
"0x00d5ca54c4622a2f8ec71843ce327959689ae7ff37e7509a88212b3b852e213cbef248471eac50bfdbca3c9ce733d8e8",
|
||||
"0x00b91b02d867e03924593529ae87f35a2adf317a87209bed9c91d5c886e801191676a272422454c7d9692b8368b02e21"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
115
bls12_377/src/curves/tests/BLS12377G2_XMD-SHA-256_SSWU_RO_.json
Normal file
115
bls12_377/src/curves/tests/BLS12377G2_XMD-SHA-256_SSWU_RO_.json
Normal file
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"L": "0x40",
|
||||
"Z": "0xc,0x1",
|
||||
"ciphersuite": "BLS12377G2_XMD:SHA-256_SSWU_RO_",
|
||||
"curve": "BLS12-377 G2",
|
||||
"dst": "QUUX-V01-CS02-with-BLS12377G2_XMD:SHA-256_SSWU_RO_",
|
||||
"expand": "XMD",
|
||||
"field": {
|
||||
"m": "0x2",
|
||||
"p": "0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001"
|
||||
},
|
||||
"hash": "sha256",
|
||||
"k": "0x80",
|
||||
"map": {
|
||||
"name": "SSWU"
|
||||
},
|
||||
"randomOracle": true,
|
||||
"vectors": [
|
||||
{
|
||||
"P": {
|
||||
"x": "0x012988d49df0158335f268551a0121a3fd5509580e675ed2e26f66ffb8ec1089b9db4a69bd19db25f7cae34619b8542a,0x0060eecba902692a7f95900c6501ea3f6e6f52b2e951586f60c9f31585c4fb63cb5486d155df4bc394a872f6e0bc3eea",
|
||||
"y": "0x00e07c09af8c992a920bdfcdba4db43b542c5799258f2a01897d5a0c621db77c29f02ca2afa99d78dad2abdd4e180d89,0x00020a02b4d45959b67af782b737915298c203dada50f9d4941ada19ea7e986e91a83cb33d01af449dc540244b418561"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x0040618d422085e035e06f0333349c4630b7e47d96c45b803db208243cfe176cc9b89710c0ac9b6c25387772b0253de9,0x016e1c02056c1c0d179c0225b37845f1ea7fdeede136d731b2365248003829bee421b65f64b43c579ad9b30469d6cdd1",
|
||||
"y": "0x0011e6e3019b9c453e3b930a091fb514b082e0353dbd58185d8e9211ec33d036c7c1d535ba020ad2b5cf584aab23fcf0,0x014063792b5a789670e1f75fd996a22fa9174888dd315fdb8b4597bdd7572edbb145817b933a0f79c467dabf473ed98c"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x00d0ec3127b58d178301f9f63be6932d2bf84a71fc79e50004efe7d13ab9ebd80cb7a958a369a1061e5aeb5365d657d2,0x00a69c72d1855528334e08529d9d304d39326e5670943f2fa3d57f32b4e1ce215a7df744bff01574e5ef35826e61cdef",
|
||||
"y": "0x0158d9d3ea783058becfbde70cf6215c53a9afd702308c551c5d8b02e00240e20ff93d2d4515d3033b92d44b76f063fa,0x0111257e46569bdb27e1c54c51b57a0aef5c5b287e28205b6b08bb585087774993895c2886dcc500c98fc3af92f114dd"
|
||||
},
|
||||
"msg": "",
|
||||
"u": [
|
||||
"0x00bad459056ed98adf92ddc87a4b9970b8ce50e5c1d811f72a5631f0ee41eeba11bdc1fcbf135ab259f7be9dbf44c3f4,0x018d496adfe469a57596f015eebd869b7bed74083c573bb4b9d40a471e082517e5b744dac07eb67dac975bb8411766c6",
|
||||
"0x0022395aab1038ade247f4b17deb81f4b00cabc04ad532fd3ac580ddbfcb44b3cb9d1d1976b09de603a0a228e713ae7d,0x01a366c20f9c2c1bc6b766e25856a85967a104d616680f4a79d97745c224fdadff08940f11ae0b26ea96f656f28b5e78"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x001346f07170e2ed45d08def787101795af173163239e7a1ee3297fd4e2b4fb6d76380058612e745a62a6fa6186744b7,0x00977c6b055e2b80e68afb986a05870294628464393619a2d92a698abcbc8927fe9729b4b72daac63e7f0c76ef711992",
|
||||
"y": "0x016896c5571627fb322a371c57528f98131c51b1dc4ceb2be384610dc3f1a224236febd2c501bcea4d387a3c0c7b4e1c,0x007a86495cf20600a5d066b91a726df0b7d67f8758d7ed3fedb797d8772805c52eba9a7bd4661d37932f855b05f19892"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x00af89668bbc75ea1818bde76c0d126f516356b5b4da3f06603a0c4af5c68e44e8984ce185b756287b9aead31fc54c4c,0x0013b1d55b0cf613f54d056541daea78edc693750cb992564a9a7861e66f26b3cd4da71a30295dea0e40f0809847a030",
|
||||
"y": "0x0127448b51269ac893ef00a585646b14371c0af69cafafaf3176e663f4e033b29a85e332116d8d9a3bfc8d1873730866,0x009a3aad06b68199b2e66fc1dafe20dcc5af8dd740be98fe7db529b424f098ae27759d7613f1942e9b1602664868c17b"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x009fc985f056445b2f6156a8021faff087f9b8d4690653346ca74b4420589fdbe511491fec0c535b52d521c1bb4be400,0x00f920679bd77a0d50d624513cf2296e4565f57dc3d7a578ddb19bfa60f05de1d5954ce247979fbc6501af72cd62e334",
|
||||
"y": "0x0164c6cd007aba3e295df8310a2da71ef40022cec7a2e51dcab9f3850795ac823c7bb65082a88199d7c378b0ac4e9257,0x0028633591401d7da706fcb4a4da6f8999a7aff7b167bb96fd92511dca61f62f4b4e0be3213f0d68841a110b39c5a685"
|
||||
},
|
||||
"msg": "abc",
|
||||
"u": [
|
||||
"0x014a48b15756981016043ea1be11e30a728877c090f3beb8bd56cdadeb98792c0f47246c99c92c6a6d9b4f2ccef6d09f,0x01445002d867fb15a2d50311d23ace363b27befbe88d5feecababd66082e6b056d306f7f9dec8d3f4dfb1b2314963cec",
|
||||
"0x001559a97f7639b2b5122e90b51a35c6714903b15cdab56bbe16eac4f8a0bd1514b412867f46f6948362c6f29d88c9fb,0x015556fa42d21cb9c6af6de63f6fbfcd6cae7c788e1b74c978f9c2ad1aae724912ff47bd4bab7d77c2af68b9c45b8c49"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x00dceaed928808d01aff4fc8c762d8cda12cc7ba1f6e721887606ee40ed0df1186f8cde71550636425de7b5ec0137fca,0x0166a7280c74d1bb3f0fd8c48aae30b855ba1a59a1dc309fb743f44b958ee721f1c273ee9ccc17e5ae931d566cf93671",
|
||||
"y": "0x003125c58959ccbbca6e456a531833720d87dd039068ec1c4dbeab97230db643c71fb47e6be54eda3a470f452f3d6b1c,0x00d070fa5ebd18f6af02f65102b74cc379af99ab9d2b797a316c736bda39fb209bdaee9b59877cd0925c9d0949d91b0a"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x013c8c7d3aa93cb082f1b83edfd76a44a17aba8253a4b0a183b679b9e4d85e1e9653145b4947320187e99825d1846149,0x014e9afc495733168d15ebddd8d5177563e2b33a584a9993cef5536a1bba557590f37fc79651825cdf7bb6516ab54a88",
|
||||
"y": "0x008a53b0d7d5a96b9fb7a15c60374028f1ab06c6545c69cfbb6ad7320e3933c64bb13b5139009ae7fb4dc0d29a1eacbd,0x0081a61008d4e7204c4a0268c1b4a369d142f4cfbfc8ee794d9653d89dc42d9b27e208ae0f11167d7eadfb56c7d4d1da"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x0062e543539c61cbfeb512fd1ec5f58bedec3ecc8bfec05de8043bfa92fec6fd7a671c9d3c9b0f86278ec6fbf4ae02a6,0x00f9402ce08a6d603d17d45dbaeda0babc9188a7837dba10c4aaad3e4dba9b5208b8df01d0635c30cb913ab16d9d23dc",
|
||||
"y": "0x001c23bb7a1789b4afb3d896e497e8c9d5d4018721ac1303836265bd3d54e7eaa5f63ba45fa8e3776642fa27f049d792,0x00cd3bf5161c9ac44a3a490beb0e12c91de09706c4c86b369da263ee63560e84c30ba0ebd72536fa7f874539f2d590b1"
|
||||
},
|
||||
"msg": "abcdef0123456789",
|
||||
"u": [
|
||||
"0x014058fb0e66728eb352ca096e0ff6534512d1b8da4391b192da08e1d45d86064c92f01568889b13318cc3ad8144190a,0x004f706e3d9a2a46f32f2953cb7a305d092ffb332f085d6ff4ec063d24686c8917a9036e0699c7dcf48f884f1e47ab2e",
|
||||
"0x00cf38b24a429230e04edbaf3b759aacfd37dc8dcc9b297b65b1b9705858f4d3bffee8b10324be05d7e4a18bcc4cd863,0x00c478b8e924194155ae97dd29ed2374cf8e207049e32bfb1519ead43702d49f22208ce12b058e7ff31ae7866f05959e"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x00cdb3038598c178025dbaf99dcd440d99c2b38d5b8041893d67002e7c6bab93beaff51439845d06c63f6ddd7c5c401e,0x011d2a48f51437628dd6508f6bbb306da621acadf14fbe9e8f47ddf1915beea1e4e3286319c172a32742d7faa45a5b7f",
|
||||
"y": "0x00cac5a0278869557095a63c6a7203468a71d58ad123aaa82f72381cd94250c01479ea8cbe643a8341678679305bc01d,0x01a91041b5c1406e643b44d4564babe6f2bdf5fa3c1620419fb6cdb4ba294f1494a33fc829784cc14cbc8066c5310a87"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x012f22361e00eb23ffe9082f1b4bf4822553cd42c8367588e5329fa166efdcf09c53e0e0b5f06e2a610f42c6b278050c,0x01aade240952b9e4db24fd88e0b0552904b3cb8bab3e4cfbaf2a5c35da48127ef75d1348d76225e8fb896c62766902b5",
|
||||
"y": "0x00f205ed12fd5bdeac9a95349e8383ab854dd59690992b6240357652246388e3224ddfa5ce06de195dfe4e9dc2c5a901,0x01203782b3fa65de7ab229eafae08b4ea9bae437e195491b03fab30ddce83881a0b940b33f0f3e7bd7feca2c76e139d6"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x0171cca78371628178ecc12072e263eda9725524b5de48e340ccc8514897834b81cf36466ef7e2473f88aca8830fd0c7,0x017273b33c0259339fac166bf927a66da0a6b40b751048a0093bb4e5d37c35f2a7318e393d4aaef61435ad4471603662",
|
||||
"y": "0x008fe7352facf00e07a74b1315db5b308827577c53a950607fe25974039598f017ed7cc054c1d279dd4957a19435d16d,0x0083382ba5e521808254bf1e058dd663336bf591c564d15a0df71791c4124c2ab38baee90d1d4435f4d6c3967df0f9ef"
|
||||
},
|
||||
"msg": "q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",
|
||||
"u": [
|
||||
"0x017afe7f987942b49e66831d61b785992f3172b2387f55e97863062e81734b0001bd64ed508d6721956741688dc9af0b,0x00631bcf5d854071890838210f50dfa1359da5ff4694255b7cd6ed630e4c6dfca746c69a9c5f3d76ee3cceae20bb355b",
|
||||
"0x00b1fc859bd156b84a8b95d503db388a604c7a05ead79f8cd08cb21b677f3bd77143d8334ff51ddbc77ebf670b7839fa,0x00df8ed5ad61dced6490d9b58585fa3803f04f0b7d4efee366296339e634201c6f8924c8c3794c45685f49c6f974cf7e"
|
||||
]
|
||||
},
|
||||
{
|
||||
"P": {
|
||||
"x": "0x00bc60ec05a3e54f000d07e4ef4d86c9f5bbc8d17aae021f547615a1c89a374bb47fdd25aa488ce8ad6e4b45483cf70f,0x00dac74d2a7d021f868b1ba53075fbb5d8b44fa709ba1b94d904d18cd79373bf23e277ca808bc70b64bd47fa877e81aa",
|
||||
"y": "0x010dc70c8b009d9013768bef31ebf18db9ae405fbbdebf7cb8ced20d10ef633e66e3c2301e233e375e75c972f9dc11f1,0x0040e8b8abcd97f7bb841fb35655830456be9b0e931db9dbd40307ce7380b53351d22557ca29204b55eb7298cc3b1e0a"
|
||||
},
|
||||
"Q0": {
|
||||
"x": "0x01891e447beb5b70294a6f5f7e0230faed4b3119353bf55ad2afa86cc266359350c07d1eb974389a67533c07f15d506b,0x0164482864c5fabe4716cc80bfd8776a8037d87dd141058737c5cf407aa39ec76b78564621637edb6c2ef6b8921d72c9",
|
||||
"y": "0x003b6cffeb0e47c6bd294263d38fb8908707502415d850d06b524a61e1de100d8a768996c6cb8c8d67b8e88cd3dcb4d7,0x008ac2f1ea197c81aab704952b808f0cb418d63df22b39d5b88c000c40890200934e8695aac7345e3da11493d76c4231"
|
||||
},
|
||||
"Q1": {
|
||||
"x": "0x00f507c2c5090a0e1d5c8e8db72e168c461cb99cbab2f9672934a3a2d92b81501553fce7bc3da3d53fc487dfe7512dd0,0x004d70e612013e7b66829a9d3e7d0f8a865fa3cddb794ce30e3b145d4287e4eca91977889f0a6a3837089c34c4ca035e",
|
||||
"y": "0x0055eb01ee257e72fc09d0cb36162af8d98bbb9cad244715cfd63dc30e66ff452d6f4519c418654b4110eabcdf701f76,0x00a20ce3bdb4d1da6b8047caf4b7c2285265021dff3b1c1a760badef8d5b108aff67a13d964218711613330b3f0c3344"
|
||||
},
|
||||
"msg": "a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
"u": [
|
||||
"0x011c761e1ea0285445d16b6982d2c58b8ac14ac32dcecd59a76d652c86adacb8643fabc49f6340a9bbb85220ae3272db,0x00a340146d9af76164b2aac1026bb445b0f4a9d8d65725c2b26051c905b40146548056e0828590573efb151312ed97de",
|
||||
"0x000edd1a63bc707aef87eed2bd7bf933247a697404d4ed1abebf8db4670cf14c9ebf6b138c642be96bc7fa9616284e7a,0x00521fae4b02b3a025c08bbeb2c4783786f82816b7f4c8d496f4715906a3b1085cd48d9d2b58588c138ae4757e220a91"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
57
bls12_377/src/curves/tests/mod.rs
Executable file
57
bls12_377/src/curves/tests/mod.rs
Executable file
@@ -0,0 +1,57 @@
|
||||
use crate::{Bls12_377, G1Projective, G2Projective};
|
||||
use ark_algebra_test_templates::*;
|
||||
|
||||
test_group!(g1; G1Projective; sw);
|
||||
test_group!(g2; G2Projective; sw);
|
||||
test_group!(pairing_output; ark_ec::pairing::PairingOutput<Bls12_377>; msm);
|
||||
test_pairing!(pairing; crate::Bls12_377);
|
||||
test_h2c!(g1_h2c; "./src/curves/tests"; "BLS12377G1"; crate::g1::Config; crate::Fq; crate::Fq; 1);
|
||||
test_h2c!(g2_hc2; "./src/curves/tests"; "BLS12377G2"; crate::g2::Config; crate::Fq2; crate::Fq; 2);
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use ark_ec::{
|
||||
hashing::{
|
||||
curve_maps::wb::{WBConfig, WBMap},
|
||||
map_to_curve_hasher::MapToCurveBasedHasher,
|
||||
HashToCurve,
|
||||
},
|
||||
short_weierstrass::Projective,
|
||||
};
|
||||
use ark_ff::field_hashers::DefaultFieldHasher;
|
||||
use ark_std::Zero;
|
||||
|
||||
/// make a simple hash
|
||||
fn wb_hash_arbitrary_string_to_curve<WBCurve: WBConfig>() {
|
||||
use sha2::Sha256;
|
||||
let test_wb_to_curve_hasher = MapToCurveBasedHasher::<
|
||||
Projective<WBCurve>,
|
||||
DefaultFieldHasher<Sha256, 128>,
|
||||
WBMap<WBCurve>,
|
||||
>::new(&[1])
|
||||
.unwrap();
|
||||
|
||||
let hash_result = test_wb_to_curve_hasher.hash(b"if you stick a Babel fish in your ear you can instantly understand anything said to you in any form of language.").expect("fail to hash the string to curve");
|
||||
|
||||
assert!(
|
||||
hash_result.x != WBCurve::BaseField::zero()
|
||||
&& hash_result.y != WBCurve::BaseField::zero(),
|
||||
"we assume that not both a and b coefficienst are zero for the test curve"
|
||||
);
|
||||
|
||||
assert!(
|
||||
hash_result.is_on_curve(),
|
||||
"hash results into a point off the curve"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wb_hash_arbitrary_string_to_g1() {
|
||||
wb_hash_arbitrary_string_to_curve::<crate::g1::Config>();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wb_hash_arbitrary_string_to_g2() {
|
||||
wb_hash_arbitrary_string_to_curve::<crate::g2::Config>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user