Questions tagged [finite-field]

In algebra, a finite field or Galois field (so named in honor of Évariste Galois) is a field that contains a finite number of elements.

In algebra, a finite field or Galois field (so named in honor of Évariste Galois) is a field that contains a finite number of elements, called its order (the size of the underlying set). As with any field, a finite field is a set on which the operations of commutative multiplication, addition, subtraction and division (by anything except zero) have been defined.

Read more: http://en.wikipedia.org/wiki/Finite_field

78 questions
3
votes
0 answers

Algorithms better than meet-in-the-middle

I am given n = 256 64-bit binary vectors ∈ GF(2)^64. I am also given a k and a target vector T, and I am required to choose exactly k out of the n vectors without repetition such that their sum (mod 2) is T. Such a solution is guaranteed to…
Gareth Ma
  • 199
  • 10
2
votes
0 answers

Julia ERROR: 'Can't Promote to Common Type' for multivariate polynomials in Nemo Library

I am new to Julia and have been trying to compute some polynomials using the Nemo library's multivariate polynomials. I have the following code: R = GF(2); # create finite field S, (z, x) = PolynomialRing(R, ["z", "x"]); # Multivariate…
Sputn1k
  • 51
  • 7
2
votes
2 answers

How to perform addition and multiplication in F_{2^8}

I want to perform addition and multiplication in F_{2^8} I currently have this code which seems to work for add but doesn't work for multiply; the issue seems to be that when I modulo by 100011011 (which represents x^8 + x^4 + x^3 + x + 1), it…
harlee53
  • 23
  • 3
2
votes
1 answer

Is there a better way to do modulo in a finite field when directly working on polynomials rather than binary numbers?

So currently I am trying to implement finite fields using only polynomials. So like, I don't want to be operating on binary numbers using operations such as AND. Instead I want to make the whole thing with polynomials. I have got very far with this,…
Evelyn
  • 85
  • 8
2
votes
2 answers

pyfinite gives wrong result for multiplication in field GF(2^8)

I am using pyfinte to calculate multiplication for AES over the field it uses which is F(2^8) but when I do as following: from pyfinite import ffield a = 0xbf b = 0x03 F = ffield.FField(8) c = F.Multiply(a, b) print(hex(c)) the actual result is…
mark
  • 351
  • 1
  • 3
  • 16
2
votes
0 answers

Python - Algorithm for finding order of cyclic group generator

I wanted to find the order of a generator g chosen from a cyclic group G = Z*q where q is a very large (hundreds of bits long) number. I have tried the following code from Rosetta Code but it is taking too long: def gcd(a, b): while b != 0: …
user7091463
  • 137
  • 3
  • 5
  • 12
2
votes
2 answers

Finite fields: Compute the inverse of a matrix

I am working with finite fields in Python. I have a matrix containing polynomials, each polynomial is represented as an integer. For example, the polynomial x^3 + x + 1 is represented as 11, because: x^3 + x + 1 ==> (1,0,1,1) ==> (8,0,2,1) ==> 8 + 0…
dimitris93
  • 4,155
  • 11
  • 50
  • 86
2
votes
1 answer

Create and invert large Galois field matrix

I have a matrix of size 128x128. Each entry is a binary field element (in my use case, only 0 and 1). I try to invert this matrix in matlab. I find some functions in matlab that does finite field matrix inversion here…
drdot
  • 3,215
  • 9
  • 46
  • 81
2
votes
3 answers

square root of a finite field element in C++

Is there any implementation of a method to obtain the square root of an element from a finite field. Programmed in C++ I was using NTL but the do not provide a method to do that. Thanks in advance
DaWNFoRCe
  • 151
  • 2
  • 11
2
votes
1 answer

Sympy symbol and the cls parameter

I have seen f = sympy.symbols('f', cls=Function) but not any documentation. Python does not like x = sympy.symbols('x', cls=FF(8)), it complains about raise CoercionFailed("expected an integer, got %s" % a) CoercionFailed: expected an integer, got…
Johan
  • 575
  • 5
  • 21
2
votes
1 answer

GF(256) finite field multiplication function in C#

I'm implementing AES in C# and at some point (MixColumns function) I have to multiply two Bytes over the GF(2^8) finite field. So, I have three options: Use a default function that dotNet has (does it have something like that?) Write a custom…
Cezar D.
  • 356
  • 1
  • 6
  • 12
1
vote
0 answers

Solving a large system of linear equations over the finite field F2

I have 10163 equations and 9000 unknowns, all over finite fields, like this style: Of course my equation will be much larger than this, I have 10163 rows and 9000 different x. Presented in the form of a matrix is AX=B. A is a 10163x9000 coefficient…
1
vote
0 answers

Julia: Adding a multivariate polynomial to a univariate polynomial

I am new Julia and I am trying to add a multivariate polynomial to a univariate polynomial. In essence my problem is summed up in the following code: R = GF(2); S, z = PolynomialRing(R, z); a = Array{gfp_poly}(undef, 1, 5); a = [z*0 z*0 z^1 z^2…
Mors
  • 11
  • 1
1
vote
1 answer

fast and efficient matrix multiplication in GF(2) field - python

I want to perform matrix multiplication over the GF(2) field. (in other words, '+' maps to XOR, and '×' maps to AND) I usually do matrix multiplication in the Real field followed by a mod(2) operation. A simple python example: import numpy as…
1
vote
1 answer

Is there an efficient algorithm to compute the Jacobsthal matrix or quadratic character in GF(q)?

Is there an efficient algorithm to compute the Jacobsthal matrix [WP] or equivalently the quadratic character χ in GF(q), J [ i, j ] = χ ( i - j ) = 0 if i = j else 1 if i - j is a square in GF(q) else -1, where i, j run over the elements of…
Max
  • 415
  • 5
  • 12