Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to access serial number corresponding to each element in GF(23)?

I would like to access serial number corresponding to each element in GF(23)? Corresponding to each serial number, I can access the element in G(23) as follows:

F.<x> = GF(2^3, name='x', modulus=x^3 + x^2 + 1)
for i in range(2^3):
    print i,'=>',F.fetch_int(i)

This provides :

0 => 0
1 => 1
2 => x
3 => x + 1
4 => x^2
5 => x^2 + 1
6 => x^2 + x
7 => x^2 + x + 1

I would like to get the reverse process which will provide seral number corresponding to each element in (23), that is,

0 => 0
1 => 1
x => 2
x + 1 => 3
x^2 => 4
x^2 + 1 => 5
x^2 + x => 6
x^2 + x + 1 => 7

Is there any such way?