Use BigInt macro for defining curve config parameters (#170)

This commit is contained in:
mmagician
2023-09-01 10:43:12 -06:00
committed by GitHub
parent 7e58260618
commit 379f23070c
7 changed files with 20 additions and 131 deletions

View File

@@ -26,7 +26,7 @@ impl MNT6Config for Config {
const TWIST_COEFF_A: Fp3<Self::Fp3Config> =
Fp3::<Self::Fp3Config>::new(Fq::ZERO, Fq::ZERO, g1::Config::COEFF_A);
// https://github.com/o1-labs/snarky/blob/9c21ab2bb23874604640740d646a932e813432c3/snarkette/mnt4_80.ml#L88
// https://github.com/o1-labs/snarky/blob/9c21ab2bb23874604640740d646a932e813432c3/snarkette/mnt6_80.ml#L118
const ATE_LOOP_COUNT: &'static [i8] = &[
1, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, -1,
0, 1, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0,
@@ -36,10 +36,11 @@ impl MNT6Config for Config {
0, 0, 0, 0, 0, 0,
];
const ATE_IS_LOOP_COUNT_NEG: bool = true;
const FINAL_EXPONENT_LAST_CHUNK_1: BigInteger320 = BigInt::new([0x1, 0x0, 0x0, 0x0, 0x0]);
const FINAL_EXPONENT_LAST_CHUNK_1: BigInteger320 = BigInt!("0x1");
const FINAL_EXPONENT_LAST_CHUNK_W0_IS_NEG: bool = true;
// https://github.com/o1-labs/snarky/blob/9c21ab2bb23874604640740d646a932e813432c3/snarkette/mnt6_80.ml#L126
const FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0: BigInteger320 =
BigInt::new([0xdc9a1b671660000, 0x46609756bec2a33f, 0x1eef55, 0x0, 0x0]);
BigInt!("689871209842287392837045615510547309923794944");
type Fp = Fq;
type Fr = Fr;
type Fp3Config = Fq3Config;