Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • This is an excellent answer, thank you very much @ebux. From the sounds of things it looks like you've identified the intermediate 9 rounds of AES with the SubBytes step (the first pattern you found) and the MixColumns step (the second pattern, XORing with previous results) within each round. That makes me wonder then about the ShiftRows and AddRoundKey steps. During decryption the last round (10th) will simply add the original key using bitwise XOR, have you seen anything like this at the end of the function? Commented Feb 15, 2016 at 12:27
  • The AES works with the expanded key and not the original key in each round. In the end of the last round, the result of the lookup is stored in the output buffer, which can mean an AddRoundKey step or a mix of some other steps also. Commented Feb 15, 2016 at 12:34
  • Indeed it works with the expanded key in all but the first round of encryption (last round of decryption) which is when it uses the original key as the first 16 bytes of the expanded key are simply the encryption key itself. I see, I will take another look myself. Commented Feb 15, 2016 at 12:46
  • You are right, but the last ShiftRows and SubBytes steps can be combined with the last AddRoundKey step. Commented Feb 15, 2016 at 12:57
  • Ah I see — have you any thoughts on how it is performing the ShiftRows step? Also, may have missed it in your question but where are the lookup tables stored (i.e. ``table0`)? Commented Feb 15, 2016 at 13:04