Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 2-adic generator to 0x64fdd1a46201e246 #1579

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions field/src/goldilocks_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GoldilocksField> {
Expand All @@ -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<GoldilocksField> {
Expand All @@ -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] = [
Expand Down
4 changes: 2 additions & 2 deletions field/src/goldilocks_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down