News for hackers. Stuff that matters.
Re:Galois field instructions on 2021 CPUs by jacoblambda on Sunday November 06, 2022 @01:18PM (#33495477)
`251 == 0` is maths friendly because 251 is a prime number. Like the article outlines, this means that for any given number x in the field, there exists some other y where `x * y == 1`. This isn't necessarily the case for non-primes.

When that breaks down, you can no longer invert numbers in a reversible way. aka `1/(1/x) == x` no longer holds true. This means you can no longer easily manipulate values or equations using the common set of properties established for most mathematics, hence "not maths friendly".

Re:Galois field instructions on 2021 CPUs by creata on Sunday November 06, 2022 @04:27PM (#33497405)
> Like the article outlines, this means that for any given number x in the field, there exists some other y where `x * y == 1`. This isn't necessarily the case for non-primes.

Your use of the word "field" here hurts my head. The integers mod k form a field (under the usual addition and multiplication) precisely when k is prime. The elements of a field always have inverses.

Re:Galois field instructions on 2021 CPUs by sbf501 on Sunday November 06, 2022 @04:31PM (#33497449)
So P=256 cannot define a field because it isn't prime?
Re:Galois field instructions on 2021 CPUs by creata on Sunday November 06, 2022 @04:32PM (#33497458)
There is a field with 256 elements, because 256 is the power of a prime. But that field is not the integers mod 256: it has different rules for addition and multiplication.
Re:Galois field instructions on 2021 CPUs by sbf501 on Sunday November 06, 2022 @04:36PM (#33497514)
Ah, thanks! Fields are a lot less intimidating than I thought they would be! Well, I mean: the basic idea (after reading these replies + wikipedia).
Re:Galois field instructions on 2021 CPUs by vmilner on Sunday November 06, 2022 @05:23PM (#33498097)
There is a finite field (or Galois field GF(p)) of size p for any prime p. This can be exhibited by integers mod p.

There are also finite (Galois) fields GF(p^n) of size p^n (positive integer powers of p)

These can be exhibited by polynomials with coefficients in the GF(p) field with up to n terms.

Eg for p = 2 and n = 3

0

1

x

1 + x

1 + x + x^2

1 + x^2

x + x^2

x^2