Browse Source

Update CP6-782

fq2_neg_nonresidue
Pratyush Mishra 4 years ago
parent
commit
abdaafdd54
6 changed files with 38 additions and 427 deletions
  1. +6
    -72
      cp6_782/src/curves/g1.rs
  2. +10
    -132
      cp6_782/src/curves/g2.rs
  3. +2
    -8
      cp6_782/src/curves/mod.rs
  4. +3
    -0
      cp6_782/src/fields/fq.rs
  5. +11
    -124
      cp6_782/src/fields/fq3.rs
  6. +6
    -91
      cp6_782/src/fields/fq6.rs

+ 6
- 72
cp6_782/src/curves/g1.rs

@ -2,10 +2,7 @@ use ark_ec::{
models::{ModelParameters, SWModelParameters}, models::{ModelParameters, SWModelParameters},
short_weierstrass_jacobian::{GroupAffine, GroupProjective}, short_weierstrass_jacobian::{GroupAffine, GroupProjective},
}; };
use ark_ff::{
biginteger::{BigInteger384, BigInteger832},
field_new,
};
use ark_ff::field_new;
use crate::{Fq, Fr}; use crate::{Fq, Fr};
@ -23,39 +20,11 @@ impl ModelParameters for Parameters {
impl SWModelParameters for Parameters { impl SWModelParameters for Parameters {
/// COEFF_A = 5 /// COEFF_A = 5
#[rustfmt::skip] #[rustfmt::skip]
const COEFF_A: Fq = field_new!(Fq, BigInteger832([
0x781c76643018bd7a,
0x64f3a5a4f1d1ad48,
0xd2f8a1eb4f72692d,
0xc35eb123c6ed72ca,
0xb58d6bcfd32de058,
0x841eab13b02a492c,
0x4b70dc5a54c487e7,
0x2f231a8808a74c59,
0x5e2915154d70b050,
0x8a40fa16f37a6b37,
0xd01980093a72c54b,
0xef6845c25398004c,
0x48,
]));
const COEFF_A: Fq = field_new!(Fq, "5");
/// COEFF_B = 17764315118651679038286329069295091506801468118146712649886336045535808055361274148466772191243305528312843236347777260247138934336850548243151534538734724191505953341403463040067571652261229308333392040104884438208594329793895206056414 /// COEFF_B = 17764315118651679038286329069295091506801468118146712649886336045535808055361274148466772191243305528312843236347777260247138934336850548243151534538734724191505953341403463040067571652261229308333392040104884438208594329793895206056414
#[rustfmt::skip] #[rustfmt::skip]
const COEFF_B: Fq = field_new!(Fq, BigInteger832([
0xec5bd271ad37429,
0x9db8ac843ecca28a,
0x94f29bcb7e01bc74,
0x1b0bebb77bb5af0,
0x75b8cef4aa27ee17,
0xb5767ae80812cf6b,
0x592fa41e377a0d8c,
0xb6c6deedbb52df3e,
0xcb1343e488737fd4,
0x878020734d05b5a9,
0x2f51354eddfa069a,
0x498e2ecdc545243e,
0x2c2,
]));
const COEFF_B: Fq = field_new!(Fq, "17764315118651679038286329069295091506801468118146712649886336045535808055361274148466772191243305528312843236347777260247138934336850548243151534538734724191505953341403463040067571652261229308333392040104884438208594329793895206056414");
/// COFACTOR = /// COFACTOR =
/// 86482221941698704497288378992285180119495364068003923046442785886272123124361700722982503222189455144364945735564951561028 /// 86482221941698704497288378992285180119495364068003923046442785886272123124361700722982503222189455144364945735564951561028
@ -73,14 +42,7 @@ impl SWModelParameters for Parameters {
/// COFACTOR^(-1) mod r = /// COFACTOR^(-1) mod r =
/// 163276846538158998893990986356139314746223949404500031940624325017036397274793417940375498603127780919653358641788 /// 163276846538158998893990986356139314746223949404500031940624325017036397274793417940375498603127780919653358641788
#[rustfmt::skip] #[rustfmt::skip]
const COFACTOR_INV: Fr = field_new!(Fr, BigInteger384([
4179837108212676264,
15545810469293120493,
13202863094424182470,
9506285060796071546,
9248558385029790142,
87030208545296111,
]));
const COFACTOR_INV: Fr = field_new!(Fr, "163276846538158998893990986356139314746223949404500031940624325017036397274793417940375498603127780919653358641788");
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y) /// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) = const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
@ -90,37 +52,9 @@ impl SWModelParameters for Parameters {
/// G1_GENERATOR_X = /// G1_GENERATOR_X =
/// 5511163824921585887915590525772884263960974614921003940645351443740084257508990841338974915037175497689287870585840954231884082785026301437744745393958283053278991955159266640440849940136976927372133743626748847559939620888818486853646 /// 5511163824921585887915590525772884263960974614921003940645351443740084257508990841338974915037175497689287870585840954231884082785026301437744745393958283053278991955159266640440849940136976927372133743626748847559939620888818486853646
#[rustfmt::skip] #[rustfmt::skip]
pub const G1_GENERATOR_X: Fq = field_new!(Fq, BigInteger832([
0x5901480e5bc22290,
0x20024afcdb9bd3a9,
0x12dc18ff416e8138,
0x28c69aa0ea223e18,
0xafb1524a1eb7efe6,
0x3d5c34edc3764ca2,
0x736c2230c8466ce9,
0xacfaa04e051014f1,
0x5d5ff82f00ff2964,
0x64c13ba270a26eaf,
0x50e9864b56ab172e,
0xd8370826a322499e,
0x00000000000006f1,
]));
pub const G1_GENERATOR_X: Fq = field_new!(Fq, "5511163824921585887915590525772884263960974614921003940645351443740084257508990841338974915037175497689287870585840954231884082785026301437744745393958283053278991955159266640440849940136976927372133743626748847559939620888818486853646");
/// G1_GENERATOR_Y = /// G1_GENERATOR_Y =
/// 7913123550914612057135582061699117755797758113868200992327595317370485234417808273674357776714522052694559358668442301647906991623400754234679697332299689255516547752391831738454121261248793568285885897998257357202903170202349380518443 /// 7913123550914612057135582061699117755797758113868200992327595317370485234417808273674357776714522052694559358668442301647906991623400754234679697332299689255516547752391831738454121261248793568285885897998257357202903170202349380518443
#[rustfmt::skip] #[rustfmt::skip]
pub const G1_GENERATOR_Y: Fq = field_new!(Fq, BigInteger832([
0x8af8b64b402e1953,
0xd1bbceb3a258ea51,
0xdca9efa3140aaa0d,
0x807a610058ddedb2,
0xeb898562fe88076c,
0x0e4342ca56dd8ce2,
0x4f5528d29f1bde9a,
0xf18b0c6c19feb372,
0x94503ac2fac9199c,
0xffc86a8aff08ea34,
0xf7b1295214735d8c,
0x44eda9e0f55edd10,
0x0000000000000ef3,
]));
pub const G1_GENERATOR_Y: Fq = field_new!(Fq, "7913123550914612057135582061699117755797758113868200992327595317370485234417808273674357776714522052694559358668442301647906991623400754234679697332299689255516547752391831738454121261248793568285885897998257357202903170202349380518443");

+ 10
- 132
cp6_782/src/curves/g2.rs

@ -2,10 +2,7 @@ use ark_ec::{
models::{ModelParameters, SWModelParameters}, models::{ModelParameters, SWModelParameters},
short_weierstrass_jacobian::{GroupAffine, GroupProjective}, short_weierstrass_jacobian::{GroupAffine, GroupProjective},
}; };
use ark_ff::{
biginteger::{BigInteger384, BigInteger832},
field_new,
};
use ark_ff::field_new;
use crate::{Fq, Fq3, Fr, FQ_ZERO}; use crate::{Fq, Fq3, Fr, FQ_ZERO};
@ -26,21 +23,7 @@ impl SWModelParameters for Parameters {
const COEFF_A: Fq3 = field_new!(Fq3, const COEFF_A: Fq3 = field_new!(Fq3,
FQ_ZERO, FQ_ZERO,
FQ_ZERO, FQ_ZERO,
field_new!(Fq, BigInteger832([
0x781c76643018bd7a,
0x64f3a5a4f1d1ad48,
0xd2f8a1eb4f72692d,
0xc35eb123c6ed72ca,
0xb58d6bcfd32de058,
0x841eab13b02a492c,
0x4b70dc5a54c487e7,
0x2f231a8808a74c59,
0x5e2915154d70b050,
0x8a40fa16f37a6b37,
0xd01980093a72c54b,
0xef6845c25398004c,
0x48,
])),
field_new!(Fq, "5"),
); );
/// COEFF_B = (G1::COEFF_B * TWIST^3, 0, 0) = /// COEFF_B = (G1::COEFF_B * TWIST^3, 0, 0) =
@ -48,21 +31,7 @@ impl SWModelParameters for Parameters {
/// 0, 0) /// 0, 0)
#[rustfmt::skip] #[rustfmt::skip]
const COEFF_B: Fq3 = field_new!(Fq3, const COEFF_B: Fq3 = field_new!(Fq3,
field_new!(Fq, BigInteger832([
0xc00a9afc5cbce615,
0x0260c2b730644102,
0x9051e955661691ec,
0x15f9af8514839e37,
0xfa62826ca407172b,
0x37043dc868f48874,
0x876b5588d132b025,
0x481952128335562a,
0x4ffa729aeddd7dcd,
0xe181a5dae94a399f,
0x671fb50145b255d8,
0xbc3860730482d728,
0x00000000000023dd,
])),
field_new!(Fq, "7237353553714858194254855835825640240663090882935418626687402315497764195116318527743248304684159666286416318482685337633828994152723793439622384740540789612754127688659139509552568164770448654259255628317166934203899992395064470477612"),
FQ_ZERO, FQ_ZERO,
FQ_ZERO, FQ_ZERO,
); );
@ -107,14 +76,7 @@ impl SWModelParameters for Parameters {
/// COFACTOR^(-1) mod r = /// COFACTOR^(-1) mod r =
/// 45586359457219724873147353901735745013467692594291916855200979604570630929674383405372210802279573887880950375598 /// 45586359457219724873147353901735745013467692594291916855200979604570630929674383405372210802279573887880950375598
#[rustfmt::skip] #[rustfmt::skip]
const COFACTOR_INV: Fr = field_new!(Fr, BigInteger384([
7373687189387546408,
11284009518041539892,
301575489693670883,
13203058298476577559,
18441611830097862156,
4115759498196698,
]));
const COFACTOR_INV: Fr = field_new!(Fr, "45586359457219724873147353901735745013467692594291916855200979604570630929674383405372210802279573887880950375598");
/// AFFINE_GENERATOR_COEFFS = (G2_GENERATOR_X, G2_GENERATOR_Y) /// AFFINE_GENERATOR_COEFFS = (G2_GENERATOR_X, G2_GENERATOR_Y)
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) = const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
@ -129,113 +91,29 @@ const G2_GENERATOR_Y: Fq3 =
/// G2_GENERATOR_X_C0 = /// G2_GENERATOR_X_C0 =
/// 13426761183630949215425595811885033211332897733228446437546263564078445562454176776915160094418980045665397361295624472103734543457352048745726512354895954850428989867542989474136256025045975283415690491751906307188562464175510373683338 /// 13426761183630949215425595811885033211332897733228446437546263564078445562454176776915160094418980045665397361295624472103734543457352048745726512354895954850428989867542989474136256025045975283415690491751906307188562464175510373683338
#[rustfmt::skip] #[rustfmt::skip]
pub const G2_GENERATOR_X_C0: Fq = field_new!(Fq, BigInteger832([
0x03b3fe4c8d4ecac7,
0x9568212677524d1e,
0xf5de3f2228d187c1,
0x7bac772e31a420ef,
0x0255cf59968a612b,
0x991d4676f6b5d605,
0x02dd2ae4831d29ea,
0xbeca7c9a62e392c2,
0xfc1d0633d48d2fc5,
0x7867813be5f7d2a1,
0x6f567b6617030028,
0xf08c9fa6ca6809df,
0x0000000000000de9,
]));
pub const G2_GENERATOR_X_C0: Fq = field_new!(Fq, "13426761183630949215425595811885033211332897733228446437546263564078445562454176776915160094418980045665397361295624472103734543457352048745726512354895954850428989867542989474136256025045975283415690491751906307188562464175510373683338");
/// G2_GENERATOR_X_C1 = /// G2_GENERATOR_X_C1 =
/// 20471601555918880743198170952645906008198510944268658573129351735028343217532386920456705632337352161031960990613816401042894531220068552819818037605513359562118363589199569321421558696125646867661360498323171027455638052943806292028610 /// 20471601555918880743198170952645906008198510944268658573129351735028343217532386920456705632337352161031960990613816401042894531220068552819818037605513359562118363589199569321421558696125646867661360498323171027455638052943806292028610
#[rustfmt::skip] #[rustfmt::skip]
pub const G2_GENERATOR_X_C1: Fq = field_new!(Fq, BigInteger832([
0xefd1b506e5fbe05f,
0xad27d47a4975140c,
0xfa11540132dbc27a,
0x8dca42b6da7c4717,
0x66d30fd7fd76207a,
0xb8e4f65c68932b1d,
0x3b7f971e93ad14be,
0xf860a89f4e582f9f,
0x7d438aaa3986f73b,
0xa37ec0c18c6e106a,
0x9f2dfb98b5185b54,
0x19995e421ca939bc,
0x0000000000002f4f,
]));
pub const G2_GENERATOR_X_C1: Fq = field_new!(Fq, "20471601555918880743198170952645906008198510944268658573129351735028343217532386920456705632337352161031960990613816401042894531220068552819818037605513359562118363589199569321421558696125646867661360498323171027455638052943806292028610");
/// G2_GENERATOR_X_C2 = /// G2_GENERATOR_X_C2 =
/// 3905053196875761830053608605277158152930144841844497593936739534395003062685449846381431331169369910535935138116320442345524758217411779027270883193856999691582831339845600938304719916501940381093815781408183227875600753651697934495980 /// 3905053196875761830053608605277158152930144841844497593936739534395003062685449846381431331169369910535935138116320442345524758217411779027270883193856999691582831339845600938304719916501940381093815781408183227875600753651697934495980
#[rustfmt::skip] #[rustfmt::skip]
pub const G2_GENERATOR_X_C2: Fq = field_new!(Fq, BigInteger832([
0xc081ed832bdf911e,
0xb85ff7aeebdfe7b3,
0x96dce6bb307b14eb,
0x578f7ded84bd824c,
0xb799305a9971d184,
0x0116ad33c2874b90,
0x862dce68efdca245,
0x4190947c70534c1d,
0x1b1aa80334248d03,
0xb13b07aff63fcf27,
0x5727687b73ab4fff,
0xf559a7f4eb8d180a,
0x0000000000002d37,
]));
pub const G2_GENERATOR_X_C2: Fq = field_new!(Fq, "3905053196875761830053608605277158152930144841844497593936739534395003062685449846381431331169369910535935138116320442345524758217411779027270883193856999691582831339845600938304719916501940381093815781408183227875600753651697934495980");
/// G2_GENERATOR_Y_C0 = /// G2_GENERATOR_Y_C0 =
/// 8567517639523571619872938228644013584947463594196306323477160496987712111576624702939472765993995586889532559039169098780892505598589581147768095093536988446010255611523736706017580686335404469207486594272103717837888228343074699140243 /// 8567517639523571619872938228644013584947463594196306323477160496987712111576624702939472765993995586889532559039169098780892505598589581147768095093536988446010255611523736706017580686335404469207486594272103717837888228343074699140243
#[rustfmt::skip] #[rustfmt::skip]
pub const G2_GENERATOR_Y_C0: Fq = field_new!(Fq, BigInteger832([
0x3f680b59e26b33d1,
0x720fdf65b9e15b17,
0x0f0b56def11247b1,
0x5ea05417c8a4a52c,
0x4ad59dc4f7c47a09,
0xf393e0db62107115,
0xde3b16404a53d2bb,
0xeaa74961636280e0,
0x2d16ccd14cf5a88c,
0x5667565a06187d0e,
0xb446fdc7565d0261,
0xd3ad395d6fd0faab,
0x0000000000000655,
]));
pub const G2_GENERATOR_Y_C0: Fq = field_new!(Fq, "8567517639523571619872938228644013584947463594196306323477160496987712111576624702939472765993995586889532559039169098780892505598589581147768095093536988446010255611523736706017580686335404469207486594272103717837888228343074699140243");
/// G2_GENERATOR_Y_C1 = /// G2_GENERATOR_Y_C1 =
/// 3890537069205870914984502594450293167889863914413852788876350245583932846980126025043974070704295857226211547108005650399870458089721518559480870503159804530091559886149680718531004778697982910253701559194337987238111062202037698927752 /// 3890537069205870914984502594450293167889863914413852788876350245583932846980126025043974070704295857226211547108005650399870458089721518559480870503159804530091559886149680718531004778697982910253701559194337987238111062202037698927752
#[rustfmt::skip] #[rustfmt::skip]
pub const G2_GENERATOR_Y_C1: Fq = field_new!(Fq, BigInteger832([
0x9e86cc63207679dd,
0x4e16d9a9d87c3e47,
0xdbee3524db80627d,
0x137322b87d93befc,
0x24a7ca2f9aae90a0,
0x44abea538df3e854,
0xc01d176c6e042eee,
0xf5fcc4caabc75699,
0x1f99972699a38960,
0x30d4cc8256bf963d,
0xa3634826edcfefff,
0x34f3bd0c8e5a4b38,
0x0000000000001d28,
]));
pub const G2_GENERATOR_Y_C1: Fq = field_new!(Fq, "3890537069205870914984502594450293167889863914413852788876350245583932846980126025043974070704295857226211547108005650399870458089721518559480870503159804530091559886149680718531004778697982910253701559194337987238111062202037698927752");
/// G2_GENERATOR_Y_C2 = /// G2_GENERATOR_Y_C2 =
/// 10936269922612615564271188303104593362724754284143779051599749016735041389483971486958818324356025479751246744831831158558101688599198721653921723013062333636402617118847009085485166284126970598561393411916461254016145116183331671450721 /// 10936269922612615564271188303104593362724754284143779051599749016735041389483971486958818324356025479751246744831831158558101688599198721653921723013062333636402617118847009085485166284126970598561393411916461254016145116183331671450721
#[rustfmt::skip] #[rustfmt::skip]
pub const G2_GENERATOR_Y_C2: Fq = field_new!(Fq, BigInteger832([
0xfc478105dedf3654,
0xa6fcfcfdd2710d6a,
0x05a68c283d5d4c65,
0x9fab8d94c667a679,
0x009b0a616ea54ff9,
0xf0df517bc7bc6382,
0xdb44338e7491f5b7,
0xcd192a7e53453f45,
0xa041a7a60982d92c,
0x4dd01c62bae4c7ff,
0x79a69a54e6b66178,
0xd47b0bfe832b05f8,
0x00000000000000ef,
]));
pub const G2_GENERATOR_Y_C2: Fq = field_new!(Fq, "10936269922612615564271188303104593362724754284143779051599749016735041389483971486958818324356025479751246744831831158558101688599198721653921723013062333636402617118847009085485166284126970598561393411916461254016145116183331671450721");

+ 2
- 8
cp6_782/src/curves/mod.rs

@ -2,11 +2,11 @@ use ark_ec::{models::SWModelParameters, PairingEngine};
use ark_ff::{ use ark_ff::{
biginteger::BigInteger832, biginteger::BigInteger832,
field_new, field_new,
fields::{BitIteratorBE, Field, FpParameters},
fields::{BitIteratorBE, Field},
One, One,
}; };
use crate::{Fq, Fq3, Fq6, FqParameters, Fr};
use crate::{Fq, Fq3, Fq6, Fr, FQ_ONE, FQ_ZERO};
pub mod g1; pub mod g1;
pub use self::g1::{G1Affine, G1Projective}; pub use self::g1::{G1Affine, G1Projective};
@ -153,12 +153,6 @@ impl CP6_782 {
} }
} }
/// FQ_ZERO = 0
pub const FQ_ZERO: Fq = field_new!(Fq, BigInteger832([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]));
/// FQ_ONE = 1
pub const FQ_ONE: Fq = field_new!(Fq, FqParameters::R);
/// TWIST = (0, 1, 0) /// TWIST = (0, 1, 0)
pub const TWIST: Fq3 = field_new!(Fq3, FQ_ZERO, FQ_ONE, FQ_ZERO); pub const TWIST: Fq3 = field_new!(Fq3, FQ_ZERO, FQ_ONE, FQ_ZERO);

+ 3
- 0
cp6_782/src/fields/fq.rs

@ -7,6 +7,9 @@ pub type Fq = Fp832;
pub struct FqParameters; pub struct FqParameters;
pub const FQ_ONE: Fq = ark_ff::field_new!(Fq, "1");
pub const FQ_ZERO: Fq = ark_ff::field_new!(Fq, "0");
impl Fp832Parameters for FqParameters {} impl Fp832Parameters for FqParameters {}
impl FftParameters for FqParameters { impl FftParameters for FqParameters {
type BigInt = BigInteger; type BigInt = BigInteger;

+ 11
- 124
cp6_782/src/fields/fq3.rs

@ -1,6 +1,5 @@
use crate::Fq;
use crate::{fields::FQ_ZERO, Fq};
use ark_ff::{ use ark_ff::{
biginteger::BigInteger832 as BigInteger,
field_new, field_new,
fields::fp3::{Fp3, Fp3Parameters}, fields::fp3::{Fp3, Fp3Parameters},
Field, Field,
@ -15,21 +14,7 @@ impl Fp3Parameters for Fq3Parameters {
/// NONRESIDUE = 13 /// NONRESIDUE = 13
#[rustfmt::skip] #[rustfmt::skip]
const NONRESIDUE: Fq = field_new!(Fq, BigInteger([
0xe755952f4650755e,
0x16c44ce1331ef791,
0x162f8835b467306f,
0xac1c2b31e1062c4c,
0x20b3dab9a2a935e1,
0xccd2ec5fd01e00c1,
0x4d1d1bf190c8da9b,
0x49cba09fb0e13fbe,
0xe392ed2957c061a3,
0x3159d02b3c93d6e1,
0x71566d160a9f8614,
0xa5840728fc854414,
0x2dc4,
]));
const NONRESIDUE: Fq = field_new!(Fq, "13");
const TWO_ADICITY: u32 = 3; const TWO_ADICITY: u32 = 3;
@ -76,121 +61,23 @@ impl Fp3Parameters for Fq3Parameters {
#[rustfmt::skip] #[rustfmt::skip]
const QUADRATIC_NONRESIDUE_TO_T: (Fq, Fq, Fq) = ( const QUADRATIC_NONRESIDUE_TO_T: (Fq, Fq, Fq) = (
field_new!(Fq, BigInteger([
0x59987c0ef8e31739,
0x59578d750d6f57dd,
0x9672547570dddab8,
0x1a1f630e1d6dbdd5,
0xde15f46e52d7613e,
0x6a1b6e4f80179926,
0x461ad119d93123b,
0x12054e3654907ed9,
0x85ea06b12bf811a0,
0xc01d53d07347f9ec,
0x70c424eb666c3922,
0x1796ce4ed605d49e,
0x68b,
])),
field_new!(Fq, BigInteger([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
field_new!(Fq, BigInteger([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
field_new!(Fq, "5759691735434357221228070840130186543101559976323700017469395641639510585333061695996665166662748527158637897523704071820491869715512532675375604262649010727161924084052120196921150869218319839231115277876207074651754402338718419191428"),
FQ_ZERO,
FQ_ZERO,
); );
#[rustfmt::skip] #[rustfmt::skip]
const FROBENIUS_COEFF_FP3_C1: &'static [Fq] = &[ const FROBENIUS_COEFF_FP3_C1: &'static [Fq] = &[
field_new!(Fq, BigInteger([
0x9b4e60b420910c71,
0xe068d7c83f284a6e,
0x1f708acc7c452c43,
0xeb2f6a66cca51856,
0x9acf675f886e9fcd,
0xb26885e567cc8082,
0x75d05357183eb61f,
0x24db4a09b5842a32,
0x85e64cf9ba4b14ae,
0xf311a6784358a588,
0xe8d431c061aecb4a,
0xd92c8b4aab19f288,
0x21d3,
])),
field_new!(Fq, BigInteger([
0xe793e750fc0c0fdc,
0x28cd75f5634a867e,
0xde5e9b1261eb3c33,
0x68a0fb1c17595903,
0x19626d2c9f392e46,
0xc4d95794cb378b83,
0x54870f1f582d67c9,
0xf3f1a0ac4aceb56d,
0x811361215ea4fd47,
0x32cd6ee17d95bd00,
0x725f9881049a9c52,
0x5acb70be0613a307,
0x11bb,
])),
field_new!(Fq, BigInteger([
0x57ec31b05ef70e9c,
0x4b273803cb8a715d,
0xf0443627811cbe40,
0x485f10c72ec590f1,
0x66a35e7875569c25,
0xdb621dfd9498071a,
0xe0de3451f11039a8,
0x6a3f87d780a6f7eb,
0x637875d359122b11,
0x967e0211b37c8d9d,
0x8e255dfc2908fec6,
0x90da2a32facafe8f,
0x4b9,
])),
field_new!(Fq, "1"),
field_new!(Fq, "2416169158604010336818399199316106389588878314690767988978701685873498866746813334102117883272276610365242925950967572554030909749205624998805208910209389668659757274773858916683688639755413288353778854399286396639505385648830027756861"),
field_new!(Fq, "19953705140271686593528343007184948545186721150606416593204794941773275185711211206130361134875604609812811649452874332003866805473427708373329547516091672819022569300184729084448897691707139947053705234905346679611277243843727293068715"),
]; ];
#[rustfmt::skip] #[rustfmt::skip]
const FROBENIUS_COEFF_FP3_C2: &'static [Fq] = &[ const FROBENIUS_COEFF_FP3_C2: &'static [Fq] = &[
field_new!(Fq, BigInteger([
0x9b4e60b420910c71,
0xe068d7c83f284a6e,
0x1f708acc7c452c43,
0xeb2f6a66cca51856,
0x9acf675f886e9fcd,
0xb26885e567cc8082,
0x75d05357183eb61f,
0x24db4a09b5842a32,
0x85e64cf9ba4b14ae,
0xf311a6784358a588,
0xe8d431c061aecb4a,
0xd92c8b4aab19f288,
0x21d3,
])),
field_new!(Fq, BigInteger([
0x57ec31b05ef70e9c,
0x4b273803cb8a715d,
0xf0443627811cbe40,
0x485f10c72ec590f1,
0x66a35e7875569c25,
0xdb621dfd9498071a,
0xe0de3451f11039a8,
0x6a3f87d780a6f7eb,
0x637875d359122b11,
0x967e0211b37c8d9d,
0x8e255dfc2908fec6,
0x90da2a32facafe8f,
0x4b9,
])),
field_new!(Fq, BigInteger([
0xe793e750fc0c0fdc,
0x28cd75f5634a867e,
0xde5e9b1261eb3c33,
0x68a0fb1c17595903,
0x19626d2c9f392e46,
0xc4d95794cb378b83,
0x54870f1f582d67c9,
0xf3f1a0ac4aceb56d,
0x811361215ea4fd47,
0x32cd6ee17d95bd00,
0x725f9881049a9c52,
0x5acb70be0613a307,
0x11bb,
])),
field_new!(Fq, "1"),
field_new!(Fq, "19953705140271686593528343007184948545186721150606416593204794941773275185711211206130361134875604609812811649452874332003866805473427708373329547516091672819022569300184729084448897691707139947053705234905346679611277243843727293068715"),
field_new!(Fq, "2416169158604010336818399199316106389588878314690767988978701685873498866746813334102117883272276610365242925950967572554030909749205624998805208910209389668659757274773858916683688639755413288353778854399286396639505385648830027756861"),
]; ];
#[inline(always)] #[inline(always)]

+ 6
- 91
cp6_782/src/fields/fq6.rs

@ -1,6 +1,5 @@
use crate::{Fq, Fq3, Fq3Parameters, FQ_ONE, FQ_ZERO}; use crate::{Fq, Fq3, Fq3Parameters, FQ_ONE, FQ_ZERO};
use ark_ff::{ use ark_ff::{
biginteger::BigInteger832 as BigInteger,
field_new, field_new,
fields::fp6_2over3::{Fp6, Fp6Parameters}, fields::fp6_2over3::{Fp6, Fp6Parameters},
}; };
@ -18,95 +17,11 @@ impl Fp6Parameters for Fq6Parameters {
#[rustfmt::skip] #[rustfmt::skip]
const FROBENIUS_COEFF_FP6_C1: &'static [Fq] = &[ const FROBENIUS_COEFF_FP6_C1: &'static [Fq] = &[
field_new!(Fq, BigInteger([
0x9b4e60b420910c71,
0xe068d7c83f284a6e,
0x1f708acc7c452c43,
0xeb2f6a66cca51856,
0x9acf675f886e9fcd,
0xb26885e567cc8082,
0x75d05357183eb61f,
0x24db4a09b5842a32,
0x85e64cf9ba4b14ae,
0xf311a6784358a588,
0xe8d431c061aecb4a,
0xd92c8b4aab19f288,
0x21d3,
])),
field_new!(Fq, BigInteger([
0x82e248051c9d1c4d,
0x9364dbda272d0ed,
0xfdcf25dede306877,
0x53d06582e3fe7159,
0xb431d48c27a7ce14,
0x7741dd7a33040c05,
0xca576276706c1de9,
0x18cceab60052df9f,
0x6f9ae1b18f011f6,
0x25df1559c0ee6289,
0x5b33ca416649679d,
0x33f7fc08b12d9590,
0x338f,
])),
field_new!(Fq, BigInteger([
0xe793e750fc0c0fdc,
0x28cd75f5634a867e,
0xde5e9b1261eb3c33,
0x68a0fb1c17595903,
0x19626d2c9f392e46,
0xc4d95794cb378b83,
0x54870f1f582d67c9,
0xf3f1a0ac4aceb56d,
0x811361215ea4fd47,
0x32cd6ee17d95bd00,
0x725f9881049a9c52,
0x5acb70be0613a307,
0x11bb,
])),
field_new!(Fq, BigInteger([
0x3f8019015b031e78,
0x73f4adf92ed4f7dc,
0xcea2d139e307fa73,
0xb1000be3461ee9f5,
0x8005cba5148fca6b,
0xa03b75925fcf929d,
0x35654371493da172,
0x5e312883cb75ad59,
0xe48bd6f4b7b72859,
0xc94b70f331124a9d,
0x84f67d2da39b18,
0xeba59af100dea197,
0x1674,
])),
field_new!(Fq, BigInteger([
0x57ec31b05ef70e9c,
0x4b273803cb8a715d,
0xf0443627811cbe40,
0x485f10c72ec590f1,
0x66a35e7875569c25,
0xdb621dfd9498071a,
0xe0de3451f11039a8,
0x6a3f87d780a6f7eb,
0x637875d359122b11,
0x967e0211b37c8d9d,
0x8e255dfc2908fec6,
0x90da2a32facafe8f,
0x4b9,
])),
field_new!(Fq, BigInteger([
0xf33a92647f881b0d,
0x2b900fcc0ab2bbcb,
0xfb4c0f3fd61ea84,
0x338e7b2dfb6aa948,
0x172c5d7fdc53bf3,
0x8dcaa3e2fc64879d,
0x56ae87a9094eefc8,
0x8f1ad1e1362b221e,
0xe95ec2cd135d3fbf,
0x898fa889f6d53325,
0x76f98fbc8ab7ca11,
0x6a06b57da5e4f118,
0x268d,
])),
field_new!(Fq, "1"),
field_new!(Fq, "2416169158604010336818399199316106389588878314690767988978701685873498866746813334102117883272276610365242925950967572554030909749205624998805208910209389668659757274773858916683688639755413288353778854399286396639505385648830027756862"),
field_new!(Fq, "2416169158604010336818399199316106389588878314690767988978701685873498866746813334102117883272276610365242925950967572554030909749205624998805208910209389668659757274773858916683688639755413288353778854399286396639505385648830027756861"),
field_new!(Fq, "22369874298875696930346742206501054934775599465297184582183496627646774052458024540232479018147881220178054575403841904557897715222633333372134756426301062487682326574958588001132586331462553235407484089304633076250782629492557320825576"),
field_new!(Fq, "19953705140271686593528343007184948545186721150606416593204794941773275185711211206130361134875604609812811649452874332003866805473427708373329547516091672819022569300184729084448897691707139947053705234905346679611277243843727293068715"),
field_new!(Fq, "19953705140271686593528343007184948545186721150606416593204794941773275185711211206130361134875604609812811649452874332003866805473427708373329547516091672819022569300184729084448897691707139947053705234905346679611277243843727293068716"),
]; ];
} }

Loading…
Cancel
Save