Here is some C code which will add and multiply numbers in the characteristic 2 finite field of order 2, used for example by Rijndael algorithm or Reed–Solomon, using the Russian Peasant Multiplication algorithm: