I am fairly new to python and I have this challenge to complete but have no clue on how to approach this below are the questions:
Code a simple four-function calculator in GF(2^4). You may use table lookups for the multiplicative inverses.
And
Code a simple four-function calculator in GF(28). You should compute the multiplicative inverses on the fly.
I need tips and if possible solutions for this challenge thanks.
I am the author of the galois Python 3 package. It extends NumPy arrays to operate over Galois fields. Both lookup tables and explicit calculation may be used.
If you are simply trying to accomplish the task, the below examples will do the trick. However, if you'd like to understand how to implement the arithmetic yourself, the code is open-source on GitHub, so you can view the exact implementations. For instance, here is the code for Galois field arithmetic in
GF(2^m)
.Additionally, I have two tutorials on how Galois fields work -- one on prime fields and one on extension fields. You may find them helpful.