Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::algebra::𝔽64 Struct Referencefinalexport

The Galois field of order 64, \(\mathrm{GF}(2^6) = \mathbb{F}_2[x] / (x^6 + x + 1)\). More...

Public Member Functions

constexpr 𝔽64 (std::uint8_t v) noexcept
constexpr 𝔽64 inverse () const

Public Attributes

std::uint8_t value

Friends

constexpr friend 𝔽64 operator+ (𝔽64 a, 𝔽64 b) noexcept
constexpr friend 𝔽64 operator- (𝔽64 a, 𝔽64 b) noexcept
constexpr friend 𝔽64 operator- (𝔽64 a) noexcept
constexpr friend 𝔽64 operator* (𝔽64 a, 𝔽64 b) noexcept
constexpr friend 𝔽64 operator/ (𝔽64 a, 𝔽64 b)
constexpr friend bool operator== (𝔽64 a, 𝔽64 b) noexcept

Detailed Description

The Galois field of order 64, \(\mathrm{GF}(2^6) = \mathbb{F}_2[x] / (x^6 + x + 1)\).

The smallest non-prime finite field: 64 elements of characteristic 2, cyclic multiplicative group \(\mathbb{F}_{64}^{\times}\) of order

  1. Each element is a polynomial of degree \(< 6\) in \(\mathbb{F}_2[x]\), packed bit-wise into a single std::uint8_t (bit i holds the coefficient of \(x^i\); the top two bits are always zero).
  • Addition is XOR (characteristic two; subtraction coincides, so \(-x = x\)).
  • Multiplication is polynomial multiplication modulo the irreducible polynomial \(f(x) = x^6 + x + 1\) (bit pattern 0b1000011 = 0x43). This \(f\) is both irreducible and primitive over \(\mathbb{F}_2\).
  • The multiplicative inverse is computed by Fermat's little theorem: \(a^{-1} = a^{62}\) on \(\mathbb{F}_{64}^{\times}\), via square-and-multiply.

The struct wrapper exists to canonicalise the value range to \({0, \ldots, 63}\) (C++ concepts cannot restrict types to a subset of uint8_t values); addition and multiplication both preserve this invariant.

As a carrier, 𝔽64 witnesses IsGaloisField (here) and IsVectorSpace<𝔽64, bool> (in algebra:vectorspace). The vector-space claim uses the natural embedding \(\mathbb{F}_2 \hookrightarrow \mathbb{F}_{64}\) as the scalar action on coordinates.

Reference polynomial: Lidl & Niederreiter, Finite Fields, 2nd ed. (Cambridge University Press, 1997), Table C.1.


The documentation for this struct was generated from the following file: