Skip to content

Commit

Permalink
update 2-adic generator to 0x64fdd1a46201e246 (#1579)
Browse files Browse the repository at this point in the history
* 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 <bdiamond@ulvetanna.io>
  • Loading branch information
benediamond and Benjamin Diamond authored Apr 26, 2024
1 parent 246c4a6 commit c4fbd3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
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

0 comments on commit c4fbd3a

Please sign in to comment.