Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

First we can try defining the function, say we want to calculate $xy+x^2+y^3$ for all $x,y\in GF(2^3)$. This can be done as follows

def f(x,y):
   return x*y+x^2+y^3

Now, to check all possible values we can try the following

FFq.<a> = GF( 2^3, 'a' ) # Note: a is the name of the generator
for x in FFq:
    for y in FFq:
        print f(x,y)

As a final comment, now that a has been defined to be the generator we can use it to evaluate f at particular points, say

f(a^3+1,a^2+1)

Hope it helped.