|
|
@ -2,10 +2,7 @@ use ark_ec::{ |
|
|
|
models::{ModelParameters, SWModelParameters},
|
|
|
|
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};
|
|
|
|
|
|
|
@ -26,21 +23,7 @@ impl SWModelParameters for Parameters { |
|
|
|
const COEFF_A: Fq3 = field_new!(Fq3,
|
|
|
|
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) =
|
|
|
@ -48,21 +31,7 @@ impl SWModelParameters for Parameters { |
|
|
|
/// 0, 0)
|
|
|
|
#[rustfmt::skip]
|
|
|
|
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,
|
|
|
|
);
|
|
|
@ -107,14 +76,7 @@ impl SWModelParameters for Parameters { |
|
|
|
/// COFACTOR^(-1) mod r =
|
|
|
|
/// 45586359457219724873147353901735745013467692594291916855200979604570630929674383405372210802279573887880950375598
|
|
|
|
#[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)
|
|
|
|
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
|
|
@ -129,113 +91,29 @@ const G2_GENERATOR_Y: Fq3 = |
|
|
|
/// G2_GENERATOR_X_C0 =
|
|
|
|
/// 13426761183630949215425595811885033211332897733228446437546263564078445562454176776915160094418980045665397361295624472103734543457352048745726512354895954850428989867542989474136256025045975283415690491751906307188562464175510373683338
|
|
|
|
#[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 =
|
|
|
|
/// 20471601555918880743198170952645906008198510944268658573129351735028343217532386920456705632337352161031960990613816401042894531220068552819818037605513359562118363589199569321421558696125646867661360498323171027455638052943806292028610
|
|
|
|
#[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 =
|
|
|
|
/// 3905053196875761830053608605277158152930144841844497593936739534395003062685449846381431331169369910535935138116320442345524758217411779027270883193856999691582831339845600938304719916501940381093815781408183227875600753651697934495980
|
|
|
|
#[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 =
|
|
|
|
/// 8567517639523571619872938228644013584947463594196306323477160496987712111576624702939472765993995586889532559039169098780892505598589581147768095093536988446010255611523736706017580686335404469207486594272103717837888228343074699140243
|
|
|
|
#[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 =
|
|
|
|
/// 3890537069205870914984502594450293167889863914413852788876350245583932846980126025043974070704295857226211547108005650399870458089721518559480870503159804530091559886149680718531004778697982910253701559194337987238111062202037698927752
|
|
|
|
#[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 =
|
|
|
|
/// 10936269922612615564271188303104593362724754284143779051599749016735041389483971486958818324356025479751246744831831158558101688599198721653921723013062333636402617118847009085485166284126970598561393411916461254016145116183331671450721
|
|
|
|
#[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");
|