From patchwork Wed Mar 18 15:40:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45967 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 206A52153B for ; Wed, 18 Mar 2015 15:40:55 +0000 (UTC) Received: by lbvn10 with SMTP id n10sf8039999lbv.1 for ; Wed, 18 Mar 2015 08:40:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=wo6iWvWAMFmHA5l5d0hffs6uhvAslKAHXUNjlsBZaiQ=; b=jBzsW7h+Aa4zmqwgdwbUY6eHiEXyKT7B/VJeNaIaEyHCKXTlFLM4PBl00CpaO/YiVk o4oHTlfZ/kcK/njOk8KscYHYEkx6yGVmE6PuyAgO5l55KSSwfNF+zxjuAZH1AzrFNNQb rxHk9DVb6X27VFxdY9gx9UfitA8QnrMHuyWrjY+O+Dec+IW+/duBKrXiMQgmd9SSDnME 6kOHu9R3JQlhG0YdgcOdb1GHQxjQOgOWAfNmTBHhsfLFDGVQGYDM8yEOIXKiqgxQKCdD U4jiZLvroxxbX7+k5r8jqI3mzHJEc54V1LWj+6nPAmtpz46ylx/WmmsSrzXTYbdNKFSO NlbQ== X-Gm-Message-State: ALoCoQlmDquO5CDWbZHa63QOMUMiWzBEp6tH0ffo+Te/XFb/CZCZAsmkUXh+ct/tmDqh8YgFaM6a X-Received: by 10.180.9.228 with SMTP id d4mr516851wib.1.1426693253879; Wed, 18 Mar 2015 08:40:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.134 with SMTP id ky6ls161456lac.76.gmail; Wed, 18 Mar 2015 08:40:53 -0700 (PDT) X-Received: by 10.152.23.133 with SMTP id m5mr39664514laf.71.1426693253543; Wed, 18 Mar 2015 08:40:53 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id qm5si13165092lbb.81.2015.03.18.08.40.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 08:40:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labjg1 with SMTP id jg1so39369835lab.2 for ; Wed, 18 Mar 2015 08:40:53 -0700 (PDT) X-Received: by 10.152.5.194 with SMTP id u2mr65078881lau.88.1426693253428; Wed, 18 Mar 2015 08:40:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1235986lbj; Wed, 18 Mar 2015 08:40:52 -0700 (PDT) X-Received: by 10.55.23.204 with SMTP id 73mr112017526qkx.47.1426693251676; Wed, 18 Mar 2015 08:40:51 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id j86si16956621qkh.14.2015.03.18.08.40.49 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Mar 2015 08:40:51 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YYG5P-00051z-Cz; Wed, 18 Mar 2015 15:40:47 +0000 Received: from mail-lb0-f170.google.com ([209.85.217.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YYG5D-00051I-Kr for lng-odp@lists.linaro.org; Wed, 18 Mar 2015 15:40:35 +0000 Received: by lbbsy1 with SMTP id sy1so32654224lbb.1 for ; Wed, 18 Mar 2015 08:40:30 -0700 (PDT) X-Received: by 10.112.223.7 with SMTP id qq7mr65093130lbc.81.1426693229988; Wed, 18 Mar 2015 08:40:29 -0700 (PDT) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id pd1sm2671263lbc.9.2015.03.18.08.40.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 08:40:29 -0700 (PDT) From: Taras Kondratiuk To: mike.holmes@linaro.org, robking@cisco.com Date: Wed, 18 Mar 2015 17:40:21 +0200 Message-Id: <1426693221-31018-3-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426693221-31018-1-git-send-email-taras.kondratiuk@linaro.org> References: <1426693221-31018-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 2/2] validation: crypto: combine sync and async tests X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Sync and Async crypto tests are almost identical and have a lot duplicated code. Move unique configuration into testsuite's init function and reuse Async test code for both Sync and Async. Signed-off-by: Taras Kondratiuk --- test/validation/Makefile.am | 3 +- ...ypto_test_async_inp.c => odp_crypto_test_inp.c} | 49 +++- ...ypto_test_async_inp.h => odp_crypto_test_inp.h} | 8 +- test/validation/crypto/odp_crypto_test_sync_inp.c | 271 --------------------- test/validation/crypto/odp_crypto_test_sync_inp.h | 17 -- test/validation/odp_crypto.c | 9 +- 6 files changed, 50 insertions(+), 307 deletions(-) rename test/validation/crypto/{odp_crypto_test_async_inp.c => odp_crypto_test_inp.c} (90%) rename test/validation/crypto/{odp_crypto_test_async_inp.h => odp_crypto_test_inp.h} (62%) delete mode 100644 test/validation/crypto/odp_crypto_test_sync_inp.c delete mode 100644 test/validation/crypto/odp_crypto_test_sync_inp.h diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 0833181..9862c6b 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -42,8 +42,7 @@ dist_odp_classification_SOURCES = classification/odp_classification_tests.c \ classification/odp_classification_basic.c \ odp_classification.c $(ODP_CU_COMMON) odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto -dist_odp_crypto_SOURCES = crypto/odp_crypto_test_async_inp.c \ - crypto/odp_crypto_test_sync_inp.c \ +dist_odp_crypto_SOURCES = crypto/odp_crypto_test_inp.c \ odp_crypto.c $(ODP_CU_COMMON) dist_odp_init_SOURCES = odp_init.c dist_odp_init_abort_SOURCES = odp_init_abort.c diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_inp.c similarity index 90% rename from test/validation/crypto/odp_crypto_test_async_inp.c rename to test/validation/crypto/odp_crypto_test_inp.c index 527e98a..5f688d6 100644 --- a/test/validation/crypto/odp_crypto_test_async_inp.c +++ b/test/validation/crypto/odp_crypto_test_inp.c @@ -6,8 +6,16 @@ #include #include -#include #include "test_vectors.h" +#include "odp_crypto_test_inp.h" + +struct suite_context_s { + enum odp_crypto_op_mode pref_mode; + odp_pool_t pool; + odp_queue_t queue; +}; + +static struct suite_context_s suite_context; /* Basic algorithm run function for async inplace mode. * Creates a session from input parameters and runs one operation @@ -38,21 +46,16 @@ static void alg_test(enum odp_crypto_op op, odp_crypto_compl_t compl_event; odp_crypto_op_result_t result; - odp_queue_t compl_queue = odp_queue_lookup("crypto-out"); - CU_ASSERT(compl_queue != ODP_QUEUE_INVALID); - odp_pool_t pool = odp_pool_lookup("packet_pool"); - CU_ASSERT(pool != ODP_POOL_INVALID); - /* Create a crypto session */ odp_crypto_session_params_t ses_params; memset(&ses_params, 0, sizeof(ses_params)); ses_params.op = op; ses_params.auth_cipher_text = false; - ses_params.pref_mode = ODP_CRYPTO_ASYNC; + ses_params.pref_mode = suite_context.pref_mode; ses_params.cipher_alg = cipher_alg; ses_params.auth_alg = auth_alg; - ses_params.compl_queue = compl_queue; - ses_params.output_pool = pool; + ses_params.compl_queue = suite_context.queue; + ses_params.output_pool = suite_context.pool; ses_params.cipher_key = cipher_key; ses_params.iv = ses_iv; ses_params.auth_key = auth_key; @@ -64,7 +67,7 @@ static void alg_test(enum odp_crypto_op op, odp_crypto_session_to_u64(ODP_CRYPTO_SESSION_INVALID)); /* Prepare input data */ - odp_packet_t pkt = odp_packet_alloc(pool, input_vec_len); + odp_packet_t pkt = odp_packet_alloc(suite_context.pool, input_vec_len); CU_ASSERT(pkt != ODP_PACKET_INVALID); uint8_t *data_addr = odp_packet_data(pkt); memcpy(data_addr, input_vec, input_vec_len); @@ -295,7 +298,31 @@ static void alg_hmac_md5(void) } } -CU_TestInfo test_array_async[] = { +int suite_sync_inp_init(void) +{ + suite_context.pool = odp_pool_lookup("packet_pool"); + if (suite_context.pool == ODP_POOL_INVALID) + return -1; + + suite_context.queue = ODP_QUEUE_INVALID; + suite_context.pref_mode = ODP_CRYPTO_SYNC; + return 0; +} + +int suite_async_inp_init(void) +{ + suite_context.pool = odp_pool_lookup("packet_pool"); + if (suite_context.pool == ODP_POOL_INVALID) + return -1; + suite_context.queue = odp_queue_lookup("crypto-out"); + if (suite_context.queue == ODP_QUEUE_INVALID) + return -1; + + suite_context.pref_mode = ODP_CRYPTO_ASYNC; + return 0; +} + +CU_TestInfo test_array_inp[] = { {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc }, {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc }, {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv }, diff --git a/test/validation/crypto/odp_crypto_test_async_inp.h b/test/validation/crypto/odp_crypto_test_inp.h similarity index 62% rename from test/validation/crypto/odp_crypto_test_async_inp.h rename to test/validation/crypto/odp_crypto_test_inp.h index ffad83c..a3a5d8d 100644 --- a/test/validation/crypto/odp_crypto_test_async_inp.h +++ b/test/validation/crypto/odp_crypto_test_inp.h @@ -8,10 +8,14 @@ #include "CUnit/TestDB.h" -/* Suite name */ +/* Suite names */ #define ODP_CRYPTO_ASYNC_INP "odp_crypto_async_inp" +#define ODP_CRYPTO_SYNC_INP "odp_crypto_sync_inp" /* Suite test array */ -CU_TestInfo test_array_async[1]; +extern CU_TestInfo test_array_inp[]; + +int suite_sync_inp_init(void); +int suite_async_inp_init(void); #endif diff --git a/test/validation/crypto/odp_crypto_test_sync_inp.c b/test/validation/crypto/odp_crypto_test_sync_inp.c deleted file mode 100644 index 477ae54..0000000 --- a/test/validation/crypto/odp_crypto_test_sync_inp.c +++ /dev/null @@ -1,271 +0,0 @@ -#include -#include -#include -#include "test_vectors.h" - -/* Basic algorithm run function for sync inplace. - * Creates a session from input parameters and runs one operation - * on input_vec. Checks the output of the crypto operation against - * output_vec. - */ -static void alg_test(enum odp_crypto_op op, - enum odp_cipher_alg cipher_alg, - odp_crypto_iv_t ses_iv, - uint8_t *op_iv_ptr, - odp_crypto_key_t cipher_key, - enum odp_auth_alg auth_alg, - odp_crypto_key_t auth_key, - uint8_t *input_vec, - unsigned int input_vec_len, - uint8_t *output_vec, - unsigned int output_vec_len) -{ - odp_crypto_session_t session; - int rc; - enum odp_crypto_ses_create_err status; - odp_bool_t posted; - odp_crypto_op_result_t result; - - odp_queue_t compl_queue = odp_queue_lookup("crypto-out"); - CU_ASSERT(compl_queue != ODP_QUEUE_INVALID); - odp_pool_t pool = odp_pool_lookup("packet_pool"); - CU_ASSERT(pool != ODP_POOL_INVALID); - - /* Create a crypto session */ - odp_crypto_session_params_t ses_params; - memset(&ses_params, 0, sizeof(ses_params)); - ses_params.op = op; - ses_params.auth_cipher_text = false; - ses_params.pref_mode = ODP_CRYPTO_SYNC; - ses_params.cipher_alg = cipher_alg; - ses_params.auth_alg = auth_alg; - ses_params.compl_queue = ODP_QUEUE_INVALID; - ses_params.output_pool = pool; - ses_params.cipher_key = cipher_key; - ses_params.iv = ses_iv; - ses_params.auth_key = auth_key; - - /* TEST : odp_crypto_session_create */ - rc = odp_crypto_session_create(&ses_params, &session, &status); - CU_ASSERT(!rc); - CU_ASSERT(status == ODP_CRYPTO_SES_CREATE_ERR_NONE); - - /* Prepare input data */ - odp_packet_t pkt = odp_packet_alloc(pool, input_vec_len); - CU_ASSERT(pkt != ODP_PACKET_INVALID); - uint8_t *data_addr = odp_packet_data(pkt); - memcpy(data_addr, input_vec, input_vec_len); - const int data_off = 0; - - /* Prepare input/output params */ - odp_crypto_op_params_t op_params; - memset(&op_params, 0, sizeof(op_params)); - op_params.session = session; - op_params.pkt = pkt; - op_params.out_pkt = pkt; - op_params.ctx = (void *)0xdeadbeef; - if (cipher_alg != ODP_CIPHER_ALG_NULL && - auth_alg == ODP_AUTH_ALG_NULL) { - op_params.cipher_range.offset = data_off; - op_params.cipher_range.length = input_vec_len; - if (op_iv_ptr) - op_params.override_iv_ptr = op_iv_ptr; - } else if (cipher_alg == ODP_CIPHER_ALG_NULL && - auth_alg != ODP_AUTH_ALG_NULL) { - op_params.auth_range.offset = data_off; - op_params.auth_range.length = input_vec_len; - op_params.hash_result_offset = data_off; - } else { - CU_FAIL("%s : not implemented for combined alg mode\n"); - } - - /* TEST : odp_crypto_operation */ - rc = odp_crypto_operation(&op_params, &posted, &result); - CU_ASSERT(!rc); - /* indication that the operation completed */ - CU_ASSERT(!posted); - - /* TEST: results were ok */ - CU_ASSERT(result.ok); - CU_ASSERT(result.auth_status.alg_err == ODP_CRYPTO_ALG_ERR_NONE); - CU_ASSERT(result.auth_status.hw_err == ODP_CRYPTO_HW_ERR_NONE); - CU_ASSERT(result.cipher_status.alg_err == ODP_CRYPTO_ALG_ERR_NONE); - CU_ASSERT(result.cipher_status.hw_err == ODP_CRYPTO_HW_ERR_NONE); - - /* TEST : operation output was correct */ - CU_ASSERT(!memcmp(data_addr, output_vec, output_vec_len)); - - CU_ASSERT(result.ctx == (void *)0xdeadbeef); - - rc = odp_crypto_session_destroy(session); - CU_ASSERT(!rc); - - odp_packet_free(pkt); -} - -#define SYNC_INP_ENC_ALG_3DES_CBC "ENC_ALG_3DES_CBC" -static void enc_alg_3des_cbc(void) -{ - odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, - auth_key = { .data = NULL, .length = 0 }; - odp_crypto_iv_t iv; - unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/ - sizeof(tdes_cbc_reference_length[0])); - unsigned int i; - for (i = 0; i < test_vec_num; i++) { - cipher_key.data = tdes_cbc_reference_key[i]; - cipher_key.length = sizeof(tdes_cbc_reference_key[i]); - iv.data = tdes_cbc_reference_iv[i]; - iv.length = sizeof(tdes_cbc_reference_iv[i]); - - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_3DES_CBC, - iv, - NULL, - cipher_key, - ODP_AUTH_ALG_NULL, - auth_key, - tdes_cbc_reference_plaintext[i], - tdes_cbc_reference_length[i], - tdes_cbc_reference_ciphertext[i], - tdes_cbc_reference_length[i]); - } -} - -/* This test verifies the correctness of decode (ciphertext -> plaintext) - * operation for 3DES_CBC algorithm. IV for the operation is the session IV - * */ -#define SYNC_INP_DEC_ALG_3DES_CBC "DEC_ALG_3DES_CBC" -static void dec_alg_3des_cbc(void) -{ - odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, - auth_key = { .data = NULL, .length = 0 }; - odp_crypto_iv_t iv = { .data = NULL, .length = 0 }; - unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/ - sizeof(tdes_cbc_reference_length[0])); - - unsigned int i; - for (i = 0; i < test_vec_num; i++) { - cipher_key.data = tdes_cbc_reference_key[i]; - cipher_key.length = sizeof(tdes_cbc_reference_key[i]); - iv.data = tdes_cbc_reference_iv[i]; - iv.length = sizeof(tdes_cbc_reference_iv[i]); - - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_3DES_CBC, - iv, - NULL, - cipher_key, - ODP_AUTH_ALG_NULL, - auth_key, - tdes_cbc_reference_ciphertext[i], - tdes_cbc_reference_length[i], - tdes_cbc_reference_plaintext[i], - tdes_cbc_reference_length[i]); - } -} - -/* This test verifies the correctness of HMAC_MD5 digest operation. - * The output check length is truncated to 12 bytes (96 bits) as - * returned by the crypto operation API call. - * Note that hash digest is a one-way operation. - * */ -#define SYNC_INP_ALG_HMAC_MD5 "ALG_HMAC_MD5" -static void alg_hmac_md5(void) -{ - odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, - auth_key = { .data = NULL, .length = 0 }; - odp_crypto_iv_t iv = { .data = NULL, .length = 0 }; - - unsigned int test_vec_num = (sizeof(hmac_md5_reference_length)/ - sizeof(hmac_md5_reference_length[0])); - - unsigned int i; - for (i = 0; i < test_vec_num; i++) { - auth_key.data = hmac_md5_reference_key[i]; - auth_key.length = sizeof(hmac_md5_reference_key[i]); - - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - iv, - iv.data, - cipher_key, - ODP_AUTH_ALG_MD5_96, - auth_key, - hmac_md5_reference_plaintext[i], - hmac_md5_reference_length[i], - hmac_md5_reference_digest[i], - HMAC_MD5_96_CHECK_LEN); - } -} - -/* This test verifies the correctness of encode (plaintext -> ciphertext) - * operation for 3DES_CBC algorithm. IV for the operation is the operation IV. - * */ -#define SYNC_INP_ENC_ALG_3DES_CBC_OVR_IV "ENC_ALG_3DES_CBC_OVR_IV" -static void enc_alg_3des_cbc_ovr_iv(void) -{ - odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, - auth_key = { .data = NULL, .length = 0 }; - odp_crypto_iv_t iv = { .data = NULL, .length = TDES_CBC_IV_LEN }; - unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/ - sizeof(tdes_cbc_reference_length[0])); - - unsigned int i; - for (i = 0; i < test_vec_num; i++) { - cipher_key.data = tdes_cbc_reference_key[i]; - cipher_key.length = sizeof(tdes_cbc_reference_key[i]); - - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_3DES_CBC, - iv, - tdes_cbc_reference_iv[i], - cipher_key, - ODP_AUTH_ALG_NULL, - auth_key, - tdes_cbc_reference_plaintext[i], - tdes_cbc_reference_length[i], - tdes_cbc_reference_ciphertext[i], - tdes_cbc_reference_length[i]); - } -} - -/* This test verifies the correctness of decode (ciphertext -> plaintext) - * operation for 3DES_CBC algorithm. IV for the operation is the session IV. - * */ -#define SYNC_INP_DEC_ALG_3DES_CBC_OVR_IV "DEC_ALG_3DES_CBC_OVR_IV" -static void dec_alg_3des_cbc_ovr_iv(void) -{ - odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, - auth_key = { .data = NULL, .length = 0 }; - odp_crypto_iv_t iv = { .data = NULL, .length = TDES_CBC_IV_LEN }; - unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/ - sizeof(tdes_cbc_reference_length[0])); - - unsigned int i; - for (i = 0; i < test_vec_num; i++) { - cipher_key.data = tdes_cbc_reference_key[i]; - cipher_key.length = sizeof(tdes_cbc_reference_key[i]); - - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_3DES_CBC, - iv, - tdes_cbc_reference_iv[i], - cipher_key, - ODP_AUTH_ALG_NULL, - auth_key, - tdes_cbc_reference_ciphertext[i], - tdes_cbc_reference_length[i], - tdes_cbc_reference_plaintext[i], - tdes_cbc_reference_length[i]); - } -} - -CU_TestInfo test_array_sync[] = { - {SYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc }, - {SYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc }, - {SYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv }, - {SYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv }, - {SYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 }, - CU_TEST_INFO_NULL, -}; diff --git a/test/validation/crypto/odp_crypto_test_sync_inp.h b/test/validation/crypto/odp_crypto_test_sync_inp.h deleted file mode 100644 index 6a8511d..0000000 --- a/test/validation/crypto/odp_crypto_test_sync_inp.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef ODP_CRYPTO_TEST_SYNC_INP_ -#define ODP_CRYPTO_TEST_SYNC_INP_ - -#include "CUnit/TestDB.h" - -/* Suite name */ -#define ODP_CRYPTO_SYNC_INP "odp_crypto_sync_inp" - -/* Suite test array */ -CU_TestInfo test_array_sync[1]; - -#endif diff --git a/test/validation/odp_crypto.c b/test/validation/odp_crypto.c index 4126ac1..f364b1a 100644 --- a/test/validation/odp_crypto.c +++ b/test/validation/odp_crypto.c @@ -6,8 +6,7 @@ #include #include "odp_cunit_common.h" -#include "odp_crypto_test_async_inp.h" -#include "odp_crypto_test_sync_inp.h" +#include "odp_crypto_test_inp.h" #define SHM_PKT_POOL_SIZE (512*2048*2) #define SHM_PKT_POOL_BUF_SIZE (1024 * 32) @@ -16,8 +15,10 @@ #define SHM_COMPL_POOL_BUF_SIZE 128 CU_SuiteInfo odp_testsuites[] = { - {ODP_CRYPTO_SYNC_INP, NULL, NULL, NULL, NULL, test_array_sync }, - {ODP_CRYPTO_ASYNC_INP, NULL, NULL, NULL, NULL, test_array_async }, + {ODP_CRYPTO_SYNC_INP, suite_sync_inp_init, NULL, NULL, NULL, + test_array_inp}, + {ODP_CRYPTO_ASYNC_INP, suite_async_inp_init, NULL, NULL, NULL, + test_array_inp}, CU_SUITE_INFO_NULL, };