#include <stdio.h>
#include <polarssl/aes.h>

int main(int argc, char **argv)
{
	u8 key[0x10] = {/* insert key.*/};
	u8 iv[0x10] = {/* insert iv */};
	u8 msg[] = 
	{
		0xA4, 0xF9, 0x6C, 0x1E, 0x00, 0x06, 0x3F, 0x11, 0x7E, 0x9B, 0xA4, 0x66, 0xBE, 0xA8, 0x11, 0x6A, 
		0xDA, 0x44, 0x8B, 0xEB, 0x41, 0x6B, 0xD0, 0xA7, 0x15, 0x16, 0x85, 0xD6, 0x41, 0xEE, 0xD0, 0x72, 
		0xDB, 0xE1, 0x8B, 0x85, 0xB1, 0x2A, 0xFD, 0x59, 0x34, 0xAC, 0xDD, 0xB8, 0x0B, 0x64, 0x04, 0xA7, 
		0xBA, 0xF1, 0x72, 0x80, 0xAC, 0xAB, 0x64, 0x45, 0xF8, 0x1B, 0x6F, 0xDF, 0x26, 0x63, 0x0E, 0x56, 
		0xA5, 0xD3, 0x63, 0xF6, 0x41, 0x2D, 0x31, 0x36, 0x9D, 0xAF, 0x7B, 0x81, 0xB9, 0x06, 0xCF, 0xAD, 
		0x85, 0x13, 0x2B, 0x26, 0xCA, 0xB4, 0xBB, 0x0E, 0x4E, 0xD6, 0xAF, 0x72, 0x25, 0x62, 0xD6, 0xD0, 
		0x46, 0x11, 0x68, 0x2E, 0xF8, 0x3D, 0xFC, 0x8D, 0xDA, 0x57, 0x9F, 0x96, 0x15, 0xDB, 0x10, 0x70, 
		0x3A, 0x11, 0x2D, 0xE6, 0xBA, 0x55, 0x6F, 0x77, 0xA3, 0x8F, 0x81, 0x9F, 0x55, 0xE4, 0x66, 0x08, 
		0x4F, 0x34, 0xAA, 0x27, 0xD3, 0x02, 0x0C, 0xD7, 0x25, 0x95, 0x3B, 0x3F, 0x0A, 0xEB, 0x15, 0x86, 
		0x42, 0x88, 0x46, 0xF0, 0xD0, 0x54, 0x4C, 0x9F, 0xBC, 0xF1, 0x86, 0xEC, 0xD7, 0x34, 0xE4, 0xC4, 
		0x6B, 0x03, 0xA9, 0x29, 0xE6, 0xBA, 0x59, 0x09, 0x71, 0xF1, 0xD4, 0x1D, 0x8F, 0x54, 0x8A, 0x78, 
		0x94, 0xC4, 0x1C, 0x56, 0x8C, 0xFF, 0xBB, 0xF9, 0x49, 0xEC, 0x24, 0xB7, 0xC9, 0x7D, 0xCA, 0x73, 
		0x9E, 0x03, 0x66, 0xA6, 0xE9, 0x91, 0x01, 0x8E, 0xFE, 0x13, 0x76, 0x09, 0x99, 0xEF, 0x33, 0x10, 
		0x9F, 0xF5, 0x9C, 0x2F, 0x41, 0x23, 0x29, 0x8D, 0x4F, 0x10, 0x5F, 0x29, 0x12, 0x91, 0xBB, 0x9F, 
		0x16, 0xDC, 0xDA, 0x83, 0x97, 0xD6, 0x14, 0x72, 0xD4, 0xD5, 0x2F, 0xFD, 0xB7, 0x99, 0x9E, 0x95, 
		0x38, 0x6C, 0x30, 0x39, 0x42, 0xF6, 0xFD, 0x65, 0xB8, 0x81, 0xAC, 0x3B, 0x00, 0xFE, 0x92, 0x52, 
		0x9D, 0xD6, 0x1E, 0xA7, 0x73, 0xBE, 0xE4, 0xA6, 0x9E, 0x70, 0xD6, 0xE1, 0x9B, 0xDE, 0x05, 0x79, 
		0x65, 0x7C, 0x10, 0x05, 0xAD, 0x52, 0xC9, 0x94, 0x12, 0xFD, 0xB6, 0xB9, 0x24, 0xDF, 0xA5, 0xC8, 
		0x74, 0x51, 0x12, 0x82, 0x22, 0x9E, 0x52, 0x4D, 0x3E, 0x9B, 0x6F, 0x0F, 0x1C, 0xEA, 0x8B, 0x31
	};
	aes_context aes_ctxt;
	aes_setkey_dec(&aes_ctxt, key, 0x10*8);
	aes_crypt_cbc(&aes_ctxt, AES_DECRYPT, sizeof(msg), iv, msg, msg);
	printf("%s", msg);
	return 0;
}