//! Blurb sourced from https://github.com/arkworks-rs //! This library implements the base 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_Fq_Params {} impl RuntimeBigNumParamsTrait<4> for BLS12_381_Fq_Params { fn modulus_bits() -> u32 { 381 } } impl BigNumParamsTrait<4> for BLS12_381_Fq_Params { fn get_instance() -> BigNumInstance<4, Self> { BLS12_381_Fq_Instance } fn modulus_bits() -> u32 { 381 } } pub global BLS12_381_Fq_Instance: BigNumInstance<4, BLS12_381_Fq_Params> = BigNumInstance { modulus: [ 0xabfffeb153ffffb9feffffffffaaab, 0x4b84f38512bf6730d2a0f6b0f6241e, 0xea397fe69a4b1ba7b6434bacd76477, 0x1a0111 ], double_modulus: [ 0x0157fffd62a7ffff73fdffffffff5556, 0x019709e70a257ece61a541ed61ec483c, 0x01d472ffcd3496374f6c869759aec8ed, 0x340222 ], modulus_u60: U60Repr { limbs: [ 0x09feffffffffaaab, 0x0abfffeb153ffffb, 0xd2a0f6b0f6241e, 0x04b84f38512bf673, 0x07b6434bacd76477, 0x0ea397fe69a4b1ba, 0x1a0111, 0x00]}, modulus_u60_x4: U60Repr { limbs: [ 0x09feffffffffaaab, 0x0abfffeb153ffffb, 0xd2a0f6b0f6241e, 0x04b84f38512bf673, 0x07b6434bacd76477, 0x0ea397fe69a4b1ba, 0x1a0111, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] }, redc_param: [ 0x5c59e8163c701ec4f881fd59646e8b, 0x9d07fda82a52f7d1dc780a19de74e6, 0xbcf32791738a0406c331e9ae8a46e0, 0x02760d74 ] };