Copyright(c) 2011-2016 Intel Corporation All rights reserved.
Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
+ modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
struct perf start, stop;
/* Initialise our cipher context, which can use same input vectors */
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
+ EVP_CIPHER_CTX *ctx;
+ ctx = EVP_CIPHER_CTX_new();
printf("aes_xts_128_dec_perf:\n");
/* Encrypt and compare decrypted output */
XTS_AES_128_enc(key2, key1, tinit, TEST_LEN, pt, ct);
XTS_AES_128_dec(key2, key1, tinit, TEST_LEN, ct, dt);
- openssl_aes_128_xts_dec(&ctx, keyssl, tinit, ct, refdt);
+ openssl_aes_128_xts_dec(ctx, keyssl, tinit, ct, refdt);
if (memcmp(dt, refdt, TEST_LEN)) {
printf("ISA-L and OpenSSL results don't match\n");
return -1;
/* Time OpenSSL decryption */
perf_start(&start);
for (i = 0; i < TEST_LOOPS; i++)
- openssl_aes_128_xts_dec(&ctx, keyssl, tinit, ct, refdt);
+ openssl_aes_128_xts_dec(ctx, keyssl, tinit, ct, refdt);
perf_stop(&stop);
printf("aes_xts_128_openssl_dec" TEST_TYPE_STR ": ");
perf_print(stop, start, (long long)TEST_LEN * i);
+ EVP_CIPHER_CTX_free(ctx);
+
return 0;
}