//! Blurb sourced from https://github.com/arkworks-rs //! This library implements the scalar field of the BLS12_381 curve generated by [Sean Bowe](https://electriccoin.co/blog/new-snark-curve/). //! The name denotes that it is a Barreto--Lynn--Scott curve of embedding degree //! 12, defined over a 381-bit (prime) field. //! This curve was intended to replace the BN254 curve to provide a higher //! security level without incurring a large performance overhead. //! //! //! Curve information: //! * Base field: q = 4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787 //! * Scalar field: r = //! 52435875175126190479447740508185965837690552500527637822603658699938581184513 //! * valuation(q - 1, 2) = 1 //! * valuation(r - 1, 2) = 32 //! * G1 curve equation: y^2 = x^3 + 4 //! * G2 curve equation: y^2 = x^3 + Fq2(4, 4) use crate::BigNumParamsTrait; use crate::runtime_bignum::BigNumInstance; use crate::runtime_bignum::BigNumParamsTrait as RuntimeBigNumParamsTrait; use crate::utils::u60_representation::U60Repr; pub struct BLS12_381_Fr_Params {} impl RuntimeBigNumParamsTrait<3> for BLS12_381_Fr_Params { fn modulus_bits() -> u32 { 255 } } impl BigNumParamsTrait<3> for BLS12_381_Fr_Params { fn get_instance() -> BigNumInstance<3, Self> { BLS12_381_Fr_Instance } fn modulus_bits() -> u32 { 255 } } pub global BLS12_381_Fr_Instance: BigNumInstance<3, BLS12_381_Fr_Params> = BigNumInstance { modulus: [ 0xbda402fffe5bfeffffffff00000001, 0xa753299d7d483339d80809a1d80553, 0x73ed ], double_modulus: [ 0x017b4805fffcb7fdfffffffe00000002, 0x014ea6533afa906673b0101343b00aa6, 0xe7da ], modulus_u60: U60Repr { limbs: [ 0x0fffffff00000001, 0x0bda402fffe5bfef, 0x09d80809a1d80553, 0x0a753299d7d48333, 0x73ed, 0x00]}, modulus_u60_x4: U60Repr { limbs: [ 0x0fffffff00000001, 0x0bda402fffe5bfef, 0x09d80809a1d80553, 0x0a753299d7d48333, 0x73ed, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] }, redc_param: [ 0x10fad2f92eb5c509cde80830358e4c, 0x53b7fb78ddf0e2d772dc1f823b4d94, 0x08d542 ] };