Have you ever think about doing AES (Rijndael) finite field multiplication in hardware instead of software. If that so, you got the same question as me. I was wondering how to do AES (Rijndael) finite field multiplication on Logic Gates. After long path way through google. Finally, i found an idea on how to solve this problem. It was just circular left shift by one and conditional XOR by certain constant. Sounds nice and fun.
My previous was about implementing finite field mltiplication bt two, but here i expanded it into full 8 bit by 8 bit finite field multiplication for AES (Rijndael). Hopefully, if you are the one that questioning about how to implement galois field or finite field multiplication of AES (Rijndael) algorithm on hardware (especially logic gates), you will find this picture satisfy and answer your question. All of this picture is only to show you how to do C = (A x B) mod N. where N here is x8 + x4 + x3 + x1 + 1 or simply 0x1b. Just for that simple equation, we gone through this complicated path🙂 .
If you mad enough, you can expand this picture to universal finite field multiplication, not only for AES, but for any finite field multiplication. Thats gonna be cool. If you got it, you can easily implement RSA encryption using logic gates. Isn’t that mad enough🙂 .
You can freely use and redistribute this picture under the term of GNU Public License v3.0.
Note : I just expanded this picture from my previous post about galois field.
PROOFING AND BENCHMARK
To proof that my circuit work well, lets compare theoretical and real result. If they are the same, means the circuit is OK. For picture, lets define “1” as RED and “0” as BLUE.
For theoretical part, Lets do this :
(0x8c x 0x57) mod 0x1b = … ?
0x8c = 10001100 = (0x80 + 0x08 + 0x04)
0x57 = 01010111
(0x8c x 0x57) = (0x57 x 0x04) + (0x57 x 0x08) + (0x57 x 0x80)
Lets go further step by Step
(0x57 x 0x01) = 0x57
(0x57 x 0x02) = 10101110 = 0xae
(0x57 x 0x04) = 01011100 ^ 00011011 = 01000111 = 0x47
(0x57 x 0x08) = 10001110 = 0x8e
(0x57 x 0x10) = 00011100 ^ 00011011 = 00000111 = 0x07
(0x57 x 0x20) = 00001110 = 0x0e
(0x57 x 0x40) = 00011100 = 0x1b
(0x57 x 0x80) = 00111000 = 0x38
Previously, we stated that:
(0x8c x 0x57) = (0x57 x 0x80) + (0x57 x 0x08) + (0x57 x 0x04)
(0x8c x 0x57) = 0x47 ^ 0x8e ^ 0x38 = 0xf1
Finally, check the picture. It is shows 0xf1 as well. Nice!!! now i can proof that my circuit work properly😉 .
Download picture source
AES (Rijndael) Simulator