From c4fbd3ac1a1a82e89c2feb5484233145278649a3 Mon Sep 17 00:00:00 2001 From: Benjamin Diamond <30356252+benediamond@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:46:04 -0400 Subject: [PATCH] update 2-adic generator to `0x64fdd1a46201e246` (#1579) * update 2-adic generator to `0x64fdd1a46201e246` this necesstitates that we also change the various lifts of the two-adic generator; i.e. the lifts to mult. generators of the _entire_ field, as well as the lifts to 2-adic generators of the various extension fields. * cargo fmt --------- Co-authored-by: Benjamin Diamond --- field/src/goldilocks_extensions.rs | 25 ++++++++++--------------- field/src/goldilocks_field.rs | 4 ++-- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/field/src/goldilocks_extensions.rs b/field/src/goldilocks_extensions.rs index 6dd15ce0..8f2d8525 100644 --- a/field/src/goldilocks_extensions.rs +++ b/field/src/goldilocks_extensions.rs @@ -21,10 +21,9 @@ impl Extendable<2> for GoldilocksField { // DTH_ROOT = W^((ORDER - 1)/2) const DTH_ROOT: Self = Self(18446744069414584320); - const EXT_MULTIPLICATIVE_GROUP_GENERATOR: [Self; 2] = - [Self(18081566051660590251), Self(16121475356294670766)]; + const EXT_MULTIPLICATIVE_GROUP_GENERATOR: [Self; 2] = [Self(0), Self(11713931119993638672)]; - const EXT_POWER_OF_TWO_GENERATOR: [Self; 2] = [Self(0), Self(15659105665374529263)]; + const EXT_POWER_OF_TWO_GENERATOR: [Self; 2] = [Self(0), Self(7226896044987257365)]; } impl Mul for QuadraticExtension { @@ -45,15 +44,11 @@ impl Extendable<4> for GoldilocksField { // DTH_ROOT = W^((ORDER - 1)/4) const DTH_ROOT: Self = Self(281474976710656); - const EXT_MULTIPLICATIVE_GROUP_GENERATOR: [Self; 4] = [ - Self(5024755240244648895), - Self(13227474371289740625), - Self(3912887029498544536), - Self(3900057112666848848), - ]; + const EXT_MULTIPLICATIVE_GROUP_GENERATOR: [Self; 4] = + [Self(0), Self(8295451483910296135), Self(0), Self(0)]; const EXT_POWER_OF_TWO_GENERATOR: [Self; 4] = - [Self(0), Self(0), Self(0), Self(12587610116473453104)]; + [Self(0), Self(0), Self(0), Self(17216955519093520442)]; } impl Mul for QuarticExtension { @@ -75,11 +70,11 @@ impl Extendable<5> for GoldilocksField { const DTH_ROOT: Self = Self(1041288259238279555); const EXT_MULTIPLICATIVE_GROUP_GENERATOR: [Self; 5] = [ - Self(2899034827742553394), - Self(13012057356839176729), - Self(14593811582388663055), - Self(7722900811313895436), - Self(4557222484695340057), + Self(4624713872807171977), + Self(381988216716071028), + Self(14499722700050429911), + Self(4870631734967222356), + Self(4518902370426242880), ]; const EXT_POWER_OF_TWO_GENERATOR: [Self; 5] = [ diff --git a/field/src/goldilocks_field.rs b/field/src/goldilocks_field.rs index 4e459c90..b0191ca5 100644 --- a/field/src/goldilocks_field.rs +++ b/field/src/goldilocks_field.rs @@ -77,14 +77,14 @@ impl Field for GoldilocksField { const CHARACTERISTIC_TWO_ADICITY: usize = Self::TWO_ADICITY; // Sage: `g = GF(p).multiplicative_generator()` - const MULTIPLICATIVE_GROUP_GENERATOR: Self = Self(7); + const MULTIPLICATIVE_GROUP_GENERATOR: Self = Self(14293326489335486720); // Sage: // ``` // g_2 = g^((p - 1) / 2^32) // g_2.multiplicative_order().factor() // ``` - const POWER_OF_TWO_GENERATOR: Self = Self(1753635133440165772); + const POWER_OF_TWO_GENERATOR: Self = Self(7277203076849721926); const BITS: usize = 64;