4

I'm learning about Galois Fields by implementing the code to create the addition/multiplication/log/ilog tables. I've got working code but I cannot find many of the actual Galois Field tables online to verify I'm calculating the tables correctly.

I've got GF(8) from Wolfram Alpha. However, when I try GF(16), GF(32), etc. I get grayscale images instead of actual tables, presumably because the tables themselves become too unwieldy.

Is there a site online where these tables are listed? Or, source code that has these tables? Or alternatively, open source software that I can run to generate these tables?

me2
  • 71
  • 1
    Do them yourself? GF(16) has 256 elements for each of add/mul, GF(32) has 1024 elements, GF(256) has 64K elements. It's a bit much for me, and what I am trying to do is to verify that each number is correct. – me2 Dec 14 '14 at 18:58
  • 2
    Do you really need a table? A exponent list (log table) should be good enough for multiplication, and addition is in some sense trivial. – Lubin Dec 14 '14 at 20:13

2 Answers2

3

For posterity, the GF(256) table from thonky.com using the generator 100011101:

[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,1]

With an actual number list, I was able to have my code automatically check for correct calculation instead of doing it "by hand".

me2
  • 71
2

For further posterity, I have made some printable log/antilog tables for all 16 primitive polynomials in GF(256):

https://codyplanteen.com/assets/rs/gf256_log_antilog.pdf

EDIT: adding the table for one of the sixteen primitive polynomials of GF(256) here, in case of link rot. Unfortunately, StackExchange doesn't support tables or attachments so answering this in a pretty way on StackExchange is difficult!

Discrete anti-logarithm table for GF(256) with field generator 0x11D

j    α^j        j    α^j        j     α^j        j     α^j        j     α^j        j     α^j        j     α^j    
---- ------ --- ---- ------ --- ----- ------ --- ----- ------ --- ----- ------ --- ----- ------ --- ----- ------ ---
0    1          37   74         74    137        111   206        148   82         185   55         222   138    
1    2          38   148        75    15         112   129        149   164        186   110        223   9      
2    4          39   53         76    30         113   31         150   85         187   220        224   18     
3    8          40   106        77    60         114   62         151   170        188   165        225   36     
4    16         41   212        78    120        115   124        152   73         189   87         226   72     
5    32         42   181        79    240        116   248        153   146        190   174        227   144    
6    64         43   119        80    253        117   237        154   57         191   65         228   61     
7    128        44   238        81    231        118   199        155   114        192   130        229   122    
8    29         45   193        82    211        119   147        156   228        193   25         230   244    
9    58         46   159        83    187        120   59         157   213        194   50         231   245    
10   116        47   35         84    107        121   118        158   183        195   100        232   247    
11   232        48   70         85    214        122   236        159   115        196   200        233   243    
12   205        49   140        86    177        123   197        160   230        197   141        234   251    
13   135        50   5          87    127        124   151        161   209        198   7          235   235    
14   19         51   10         88    254        125   51         162   191        199   14         236   203    
15   38         52   20         89    225        126   102        163   99         200   28         237   139    
16   76         53   40         90    223        127   204        164   198        201   56         238   11     
17   152        54   80         91    163        128   133        165   145        202   112        239   22     
18   45         55   160        92    91         129   23         166   63         203   224        240   44     
19   90         56   93         93    182        130   46         167   126        204   221        241   88     
20   180        57   186        94    113        131   92         168   252        205   167        242   176    
21   117        58   105        95    226        132   184        169   229        206   83         243   125    
22   234        59   210        96    217        133   109        170   215        207   166        244   250    
23   201        60   185        97    175        134   218        171   179        208   81         245   233    
24   143        61   111        98    67         135   169        172   123        209   162        246   207    
25   3          62   222        99    134        136   79         173   246        210   89         247   131    
26   6          63   161        100   17         137   158        174   241        211   178        248   27     
27   12         64   95         101   34         138   33         175   255        212   121        249   54     
28   24         65   190        102   68         139   66         176   227        213   242        250   108    
29   48         66   97         103   136        140   132        177   219        214   249        251   216    
30   96         67   194        104   13         141   21         178   171        215   239        252   173    
31   192        68   153        105   26         142   42         179   75         216   195        253   71     
32   157        69   47         106   52         143   84         180   150        217   155        254   142    
33   39         70   94         107   104        144   168        181   49         218   43         \*    0      
34   78         71   188        108   208        145   77         182   98         219   86                      
35   156        72   101        109   189        146   154        183   196        220   172                     
36   37         73   202        110   103        147   41         184   149        221   69                      

Discrete logarithm table for GF(256) with field generator 0x11D

α^j    j         α^j    j         α^j    j         α^j    j         α^j    j         α^j    j         α^j    j      
------ ----- --- ------ ----- --- ------ ----- --- ------ ----- --- ------ ----- --- ------ ----- --- ------ ----- ---
0      \*        37     36        74     37        111    61        148    38        185    60        222    62    
1      0         38     15        75     179       112    202       149    184       186    57        223    90    
2      1         39     33        76     16        113    94        150    180       187    83        224    203   
3      25        40     53        77     145       114    155       151    124       188    71        225    89    
4      2         41     147       78     34        115    159       152    17        189    109       226    95    
5      50        42     142       79     136       116    10        153    68        190    65        227    176   
6      26        43     218       80     54        117    21        154    146       191    162       228    156   
7      198       44     240       81     208       118    121       155    217       192    31        229    169   
8      3         45     18        82     148       119    43        156    35        193    45        230    160   
9      223       46     130       83     206       120    78        157    32        194    67        231    81    
10     51        47     69        84     143       121    212       158    137       195    216       232    11    
11     238       48     29        85     150       122    229       159    46        196    183       233    245   
12     27        49     181       86     219       123    172       160    55        197    123       234    22    
13     104       50     194       87     189       124    115       161    63        198    164       235    235   
14     199       51     125       88     241       125    243       162    209       199    118       236    122   
15     75        52     106       89     210       126    167       163    91        200    196       237    117   
16     4         53     39        90     19        127    87        164    149       201    23        238    44    
17     100       54     249       91     92        128    7         165    188       202    73        239    215   
18     224       55     185       92     131       129    112       166    207       203    236       240    79    
19     14        56     201       93     56        130    192       167    205       204    127       241    174   
20     52        57     154       94     70        131    247       168    144       205    12        242    213   
21     141       58     9         95     64        132    140       169    135       206    111       243    233   
22     239       59     120       96     30        133    128       170    151       207    246       244    230   
23     129       60     77        97     66        134    99        171    178       208    108       245    231   
24     28        61     228       98     182       135    13        172    220       209    161       246    173   
25     193       62     114       99     163       136    103       173    252       210    59        247    232   
26     105       63     166       100    195       137    74        174    190       211    82        248    116   
27     248       64     6         101    72        138    222       175    97        212    41        249    214   
28     200       65     191       102    126       139    237       176    242       213    157       250    244   
29     8         66     139       103    110       140    49        177    86        214    85        251    234   
30     76        67     98        104    107       141    197       178    211       215    170       252    168   
31     113       68     102       105    58        142    254       179    171       216    251       253    80    
32     5         69     221       106    40        143    24        180    20        217    96        254    88    
33     138       70     48        107    84        144    227       181    42        218    134       255    175   
34     101       71     253       108    250       145    165       182    93        219    177                    
35     47        72     226       109    133       146    153       183    158       220    187                    
36     225       73     152       110    186       147    119       184    132       221    204                    
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Leucippus Aug 11 '18 at 16:28
  • @Leucippus I added the table for one of the sixteen primitive polynomials of GF(256) here, in case of link rot. Unfortunately, StackExchange doesn't support tables or attachments so answering this in a pretty way on StackExchange is difficult! Answering the original question completely for all the Galois fields and primitive polynomials would require ~100 pages of tables! – planteen Aug 12 '18 at 20:37
  • 1
    Thanks for adding these. I will add a link to your post from my hand made tables for $GF(8)$ and $GF(16)$ (done to meet with pedagogical objectives only). Is this primitive polynomial the one used in Rijndael/AES? People often ask about that. – Jyrki Lahtonen Aug 13 '18 at 05:12