From 9a97d75149c41dc43df2c95b19367995cf1cdbb8 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Tue, 8 Dec 2020 21:42:36 -0800 Subject: [PATCH] Update edwards curves constants --- ed_on_bls12_377/src/fields/fr.rs | 9 +++++++-- ed_on_cp6_782/src/fields/fr.rs | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ed_on_bls12_377/src/fields/fr.rs b/ed_on_bls12_377/src/fields/fr.rs index 0a08752..2812425 100644 --- a/ed_on_bls12_377/src/fields/fr.rs +++ b/ed_on_bls12_377/src/fields/fr.rs @@ -72,7 +72,12 @@ impl FpParameters for FrParameters { 168160046336021674u64, ]); - const T: BigInteger = BigInteger([0x0, 0x0, 0x0, 0x0]); + const T: BigInteger = Self::MODULUS_MINUS_ONE_DIV_TWO; - const T_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([0x0, 0x0, 0x0, 0x0]); + const T_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([ + 0xae56bba6b0cff67f, + 0x14a4e8ebf10f22bf, + 0x660b44d1e5c37b00, + 0x12ab655e9a2ca55, + ]); } diff --git a/ed_on_cp6_782/src/fields/fr.rs b/ed_on_cp6_782/src/fields/fr.rs index 33bb997..b10bbec 100644 --- a/ed_on_cp6_782/src/fields/fr.rs +++ b/ed_on_cp6_782/src/fields/fr.rs @@ -84,7 +84,23 @@ impl FpParameters for FrParameters { 7568644544155918u64, ]); - const T: BigInteger = BigInteger([0x0, 0x0, 0x0, 0x0, 0x0, 0x0]); + /// 8083263312905284187832897927965422923012297273591083141858954470483627824280993199911680825703270958985656030373 + const T: BigInteger = BigInteger([ + 5782852926996632741, + 10160572951715783904, + 8680081325396045328, + 15623293663189641372, + 6210983053257673289, + 3784322272077959, + ]); - const T_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([0x0, 0x0, 0x0, 0x0, 0x0, 0x0]); + /// 4041631656452642093916448963982711461506148636795541570929477235241813912140496599955840412851635479492828015186 + const T_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([ + 2891426463498316370, + 5080286475857891952, + 4340040662698022664, + 17035018868449596494, + 12328863563483612452, + 1892161136038979, + ]); }