diff --git a/src/bn256/curve.rs b/src/bn256/curve.rs index 981eedd8..bfc05c4b 100644 --- a/src/bn256/curve.rs +++ b/src/bn256/curve.rs @@ -115,13 +115,19 @@ const G2_GENERATOR_Y: Fq2 = Fq2 { ]), }; +// Generated using https://github.com/ConsenSys/gnark-crypto/blob/master/ecc/utils.go +// with `bn256::Fr::ZETA` +// See https://github.com/demining/Endomorphism-Secp256k1/blob/main/README.md +// to have more details about the endomorphism. const ENDO_PARAMS: EndoParameters = EndoParameters { + // round(b2/n) gamma1: [ 0x7a7bd9d4391eb18du64, 0x4ccef014a773d2cfu64, 0x0000000000000002u64, 0u64, ], + // round(-b1/n) gamma2: [0xd91d232ec7e0b3d7u64, 0x0000000000000002u64, 0u64, 0u64], b1: [0x8211bbeb7d4f1128u64, 0x6f4d8248eeb859fcu64, 0u64, 0u64], b2: [0x89d3256894d213e3u64, 0u64, 0u64, 0u64], diff --git a/src/pasta/mod.rs b/src/pasta/mod.rs index 0252b199..9cd4592e 100644 --- a/src/pasta/mod.rs +++ b/src/pasta/mod.rs @@ -35,15 +35,27 @@ impl crate::CurveAffineExt for EqAffine { } } +// Generated using https://github.com/ConsenSys/gnark-crypto/blob/master/ecc/utils.go +// with `pasta_curves::Fp::ZETA` +// See https://github.com/demining/Endomorphism-Secp256k1/blob/main/README.md +// to have more details about the endomorphism. const ENDO_PARAMS_EQ: EndoParameters = EndoParameters { + // round(b2/n) gamma1: [0x32c49e4c00000003, 0x279a745902a2654e, 0x1, 0x0], + // round(-b1/n) gamma2: [0x31f0256800000002, 0x4f34e8b2066389a4, 0x2, 0x0], b1: [0x8cb1279300000001, 0x49e69d1640a89953, 0x0, 0x0], b2: [0x0c7c095a00000001, 0x93cd3a2c8198e269, 0x0, 0x0], }; +// Generated using https://github.com/ConsenSys/gnark-crypto/blob/master/ecc/utils.go +// with `pasta_curves::Fq::ZETA` +// See https://github.com/demining/Endomorphism-Secp256k1/blob/main/README.md +// to have more details about the endomorphism. const ENDO_PARAMS_EP: EndoParameters = EndoParameters { + // round(b2/n) gamma1: [0x32c49e4bffffffff, 0x279a745902a2654e, 0x1, 0x0], + // round(-b1/n) gamma2: [0x31f0256800000002, 0x4f34e8b2066389a4, 0x2, 0x0], b1: [0x8cb1279300000000, 0x49e69d1640a89953, 0x0, 0x0], b2: [0x0c7c095a00000001, 0x93cd3a2c8198e269, 0x0, 0x0],