Fixed some compiler errors and moved context creation to aes_encrypt/decrypt