- AES_KEY key;
- AES_set_decrypt_key(aes_key, 128, &key);
- AES_cbc_encrypt(indata, outdata, sizeof(indata), &key, iv, AES_DECRYPT);
-
+ //AES_KEY key;
+ //AES_set_decrypt_key(aes_key, 128, &key);
+ //AES_cbc_encrypt(indata, outdata, sizeof(indata), &key, iv, AES_DECRYPT);
+
+ aes_context ctx;
+ aes_init(&ctx);
+ aes_setkey_dec(&ctx, aes_key, 128);
+ aes_crypt_cbc(&ctx,AES_DECRYPT,sizeof(indata), iv, indata,outdata );