AES encrypt modes implemented in C