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

@@ -1,8 +1,5 @@
use ark_ec::models::mnt4::{MNT4Config, MNT4};
use ark_ff::{
biginteger::{BigInt, BigInteger768},
AdditiveGroup, Field, Fp2, MontFp,
};
use ark_ff::{biginteger::BigInteger768, AdditiveGroup, BigInt, Field, Fp2, MontFp};
use crate::{Fq, Fq2Config, Fq4Config, Fr};
@@ -48,23 +45,10 @@ impl MNT4Config for Config {
0, 0, 0,
];
const ATE_IS_LOOP_COUNT_NEG: bool = true;
const FINAL_EXPONENT_LAST_CHUNK_1: BigInteger768 =
BigInt::new([0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
const FINAL_EXPONENT_LAST_CHUNK_1: BigInteger768 = BigInt!("0x1");
const FINAL_EXPONENT_LAST_CHUNK_W0_IS_NEG: bool = true;
const FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0: BigInteger768 = BigInt::new([
8824542903220142079,
7711082599397206192,
8303354903384568230,
5874150271971943936,
9717849827920685054,
95829799234282493,
0,
0,
0,
0,
0,
0,
]);
// https://github.com/o1-labs/snarky/blob/9c21ab2bb23874604640740d646a932e813432c3/snarkette/mnt4753.ml#L100
const FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0: BigInteger768 = BigInt!("204691208819330962009469868104636132783269696790011977400223898462431810102935615891307667367766898917669754470399");
type Fp = Fq;
type Fr = Fr;
type Fp2Config = Fq2Config;