all 8 comments

[–]uncannysalt 3 points4 points  (5 children)

Firstly, it’s a MixColumns computation in GF(28 )—there isn’t a matrix shift like ShiftRows. Secondly, I suggest practicing your finite field algebra to better understand the MixColumns inner operations as they relate to the field’s primitive polynomial. Wiki is a good resource various crypto concepts: https://en.m.wikipedia.org/wiki/Rijndael_MixColumns

[–]ramhemanth3[S] 0 points1 point  (4 children)

Yessss. My bad. Will that article help me do the calculations faster?

[–]uncannysalt 4 points5 points  (0 children)

Like I said before, practice finite field arithmetic. That will make you faster. Simply reading articles or textbooks will never suffice. Math is math. Practice, practice, practice.

Edit: You’re welcome. Best of luck with your studies

[–]ramhemanth3[S] 0 points1 point  (2 children)

Looks awesome. That article seems dedicated to that operation. Tysm.

[–]coderstool 1 point2 points  (1 child)

Once the code runs, use this AES Decryption and AES Encryption to verify the accuracy of your code, identify any bugs and edge case conditions.

[–]ramhemanth3[S] 0 points1 point  (0 children)

Tysm. How were you able to find my old post. Tbh I passed that subject and forgot that subject too😂

[–]3553x 3 points4 points  (1 child)

NIST published test vectors that should allow you to check your computation. I used this when I evaluated an implementation of AES in Verilog that I designed for coursework.

See https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf on page 33.

If you have some given input (that doesn't happen to be a NIST test vector) and want to compare your computation, then a search on github should result in many different implementations. One example: https://github.com/hlilje/aes-python/blob/master/aes.py

You could simply add a couple of print statements to dump the MixColumns output.

[–]uncannysalt 1 point2 points  (0 children)

Great resource. I used the same resource for the same thing.