]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crypto/isa-l/isa-l_crypto/aes/xts_128_dec_ossl_perf.c
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / crypto / isa-l / isa-l_crypto / aes / xts_128_dec_ossl_perf.c
index bfde35570166087f52ef5d6e7e991d68b4883eca..5dc8989927a273ba0f593aa953d01abfc8339d70 100644 (file)
@@ -2,7 +2,7 @@
   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.
@@ -90,8 +90,8 @@ int main(void)
        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");
 
@@ -115,7 +115,7 @@ int main(void)
        /* 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;
@@ -132,10 +132,12 @@ int main(void)
        /* 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;
 }