Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Releases: syakoo/galois-field

Adding Features of getting a primitive element in GF(q).

03 Dec 03:40
27bec63
Compare
Choose a tag to compare

Motivation

This library was created to apply Finite Field to cryptography and coding theory, Especially in cryptography, there are many situations where we want to get a primitive element in GF(q). So we implemented a function to get a primitive element for all GF(q).

Usage

It can be retrieved by executing random_primitive_elm() function of the GFp or GFpn class.

gf_11 = GFp(11)
# Getting a random primitive element in GF(11)
gf_11.random_primitive_elm() # 8 (mod 11)

gf_5_4 = GFpn(5, [1, 0, 0, 0, 2])
# Getting a random primitive element in GF(5^4)
gf_5_4.random_primitive_elm() # 1x^3 + 2x^2 + 4x + 3

Be careful when using a finite field with large orders because the computational complexity is very large.

v2.0.0

14 Nov 11:32
38f5377
Compare
Choose a tag to compare

The structure of the class has been changed.

In previous version, GF was defined and elements of their instances was changed depending on whether or not they included a mod_poly as an argument.

>>> gf1 = GF(11)
>>> el1 = gf1(13) # This is an element in GF(11).
>>> gf2 = GF(11, [1, 0, 1])
>>> el2 = gf2([1,2]) # This is an element in GF(11^2)

However, the type hints didn't work well because the properties and methods used by the extension fields and the prime fields are different.

For this reason, we divided the GF class into GFp and GFpn classes:

>>> gf1 = GFp(11) # GF(p)
>>> el1 = gf1(13)
>>> gf2 = GFpn(11, [1, 0, 1]) # GF(p^n)
>>> el2 = gf2([1,2])

v1.0.2

13 Nov 11:21
792a7e1
Compare
Choose a tag to compare
  • Fix: a bug about a dim of an element in GFpn.
  • Add: __pow__ operation.

v1.0.1

13 Nov 06:37
3a31de8
Compare
Choose a tag to compare
  • Add __repr__ to ElementInFp and ElementInFpn.
  • Change some docs.

v1.0.0

13 Nov 03:28
f67855a
Compare
Choose a tag to compare
Merge pull request #6 from syakoo/develop

Update: version to 1.0.0🐍