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

@@ -17,36 +17,10 @@ pub struct Config;
impl BW6Config for Config {
// X is the same as in bls12_381
const X: BigInteger = BigInt::new([
0xd201000000010000,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
]);
const X: BigInteger = BigInt!("0xd201000000010000");
const X_IS_NEGATIVE: bool = true;
// [(-X)+1]/3, since X < 0
const X_MINUS_1_DIV_3: BigInteger = BigInt::new([
0x460055555555aaab,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
]);
const X_MINUS_1_DIV_3: BigInteger = BigInt!("0x460055555555aaab");
// -[(-X)+1]
const ATE_LOOP_COUNT_1: &'static [u64] = &[0xd20100000000ffff];
const ATE_LOOP_COUNT_1_IS_NEGATIVE: bool = true;