This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via f925f103c90591776f73863d30159357b08bf71e (commit) via 5a4502fc6bc53e6503169da3028f456b64811a0b (commit) via ccb6eb85729ad0657b5c852cb2a6ddb519d60898 (commit) via f3b6be23045a924b8d8034a9a490b4fe5928684e (commit) via d4ad3409a51f94df403e0ae27e25baab2b0a1bf4 (commit) via 2bbecec83bc1d8ca1b45f98214d2dbbe13950e25 (commit) via db250be8b7363b24708ebc9476aa26fe1754d3c0 (commit) via 39730f7e46405a44abee01532547fed530c6f906 (commit) via 2c92ee7ef4198ba7b7ab67cf079c2262e70414d2 (commit) via d35f27a2c613e5fa66a6d854b662b435f0e4f402 (commit) via db2587a9a5ade3e9ad3f4e3355db2d4639e100b0 (commit) via 0f628d448a0055cfff6ea759790c60520bbff6b8 (commit) via 42e8e9ac8bf029fb94c4b0d79dba115ba7450958 (commit) via 8d3786410c269d5e9838bacb9dd0a4b0524824ef (commit) via be3696f3617fb05bf55347a724e422814b1be19b (commit) via e3f0ac3bb039d95af55176828539ebfd2697f932 (commit) via ffee6ee63f437bab54151da5f31d54385c3247af (commit) via 22e7c58bf12540c95168f079f6b39375c96f6e94 (commit) via aa698a07e99416663b9b829926efefde1c4e0abb (commit) via 34ba6c32491c9b18f78f49855d76c5e60555dd6e (commit) via 0c8009e48f6bcb254ba06a85e9226d1a0459a36e (commit) via d70c5f1ce3e98c3a7409312ccfdc3ce0087a2d49 (commit) via 47932d20fdf72f73e5de4961569fda760200edc6 (commit) via 585af294de9194f2e5e0bd53b4d5e12eba8ba1ba (commit) via 9fd7bf5ec2096b65248d9be983130396de1c32eb (commit) via 539b6fb552d171d202880c3f5ee6e7ca509db98a (commit) via faa8498d122fcce6321140d9f1c062ebc2bc3d79 (commit) via 94bcafaaccc3aba545cc112da8ff9fd828a25a98 (commit) via 84d5cf917d301d91246f013c3e51da35fa26b903 (commit) via 0689cde60fa90e5ddd24d07fec08ea95251d6db5 (commit) via a8ce5f13b5cbf1583fef04d687cef94d18357520 (commit) via e93535eed4262b76597c193a169fbc94fd91bb25 (commit) via b4b6cdaa390cef0e5a42e6c8fc0f605d7879bee5 (commit) via 96ad2312bfc2d1d0d1d23e61113da55d31b7fbc1 (commit) via 55f928652f0b6accc8ba82fc68eeaebb2fd1426d (commit) via 3c5a55ba323f36a255615983afdb21b17f8b1597 (commit) via 3dc3b1fbfb71b0c81e6ce047f48f51d4e13e81dc (commit) via 4cbcb2d11673fdde483753db67343018aa09e3ad (commit) via 14156f2feae2aa5a2835cf6ff0a3b4a2d7dae4df (commit) via 5399f2f78624599910c574e3c7247378118a8af4 (commit) via cd2dfa966f8c08c99feda2d0622ecc27c0361245 (commit) via f831c691a20ca2d0ffbbf707f43eee7600bca6b6 (commit) via e1883c9e050a5cc3ad838c02f943113f3b1e2383 (commit) via 627c9f51e2de51c3bb20f59161ac8ea1b6c2703f (commit) via edf998617f1744a9a92ed0ebb4905149f5731ed5 (commit) via bece10957f7d85107a71662e308dba8fc1d6c578 (commit) via 08d0c1658cd13bb174cc9c01f132bc98d004efa7 (commit) via 60feb6af342d581f798308563b975974986d9a3c (commit) via 503bc79ee960ea4caa72d639cbc5a42c7524a790 (commit) via cfeb9fa2519ede1f34e3a814079a62095f23e64e (commit) via bd9ab1c7a6ba3ecf4532e36b7d431a6c2df2c72b (commit) via 4d2c80472c0623b406f25c07fcca42849f41d847 (commit) via 3d10b69994b9a4629ae5858c4f13b8fc73137fc3 (commit) via 96874082fe02560068588af59817fa2152982638 (commit) via ad317cdf97c0f19d27bca380d06617937a0e548d (commit) via 7f1ea3704569c50a48f1029c0bd8f3f0bf84f43e (commit) via c99bed8f3a710d25d824cdcb1d109f974650906d (commit) via cd46d6263073efb18c69a621d9cc6c50da76359d (commit) via 3768a6331899a4b17dcd89ec82b0295fb1ef667a (commit) via 6a7c5313178504d4c0d211de231c52b795e26c5f (commit) via c9528e9576a391ee865f7efb3df5fb9a69602c40 (commit) via 77ff03881d844a9d6a4bc773086bd8aaecace541 (commit) via 53b114eac3815099760186f90b64a201d7fac69b (commit) via 1bb6291e4e9050d476fefb02f11024898847e2b7 (commit) via 5e064cd9fa626b8fe7cc6d695b5bbf5065e0e54e (commit) via e3cef11dd0161d49dddc09d8e6263722825953f7 (commit) via 520c170d758f2d37554631bf1467ec50e027cd3e (commit) via f73cd6de167b16bae0256fee65c77d11ee18699e (commit) via 1e2435a49ca5380143546f33aebc32e0b935bc54 (commit) via 2237981c5e20dd4efb2e181ad59785e6f9f099bb (commit) from 04c5bbe3d84aa46bd504e647e82a06cb00fe4555 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit f925f103c90591776f73863d30159357b08bf71e Merge: 04c5bbe3 5a4502fc Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Fri Jan 19 19:08:29 2018 +0300
Merge branch 'master' into api-next
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --cc include/odp/api/abi-default/align.h index 2c1a2208,7a95078f..3fc29b25 --- a/include/odp/api/abi-default/align.h +++ b/include/odp/api/abi-default/align.h @@@ -1,7 -1,7 +1,7 @@@ -/* Copyright (c) 2015, Linaro Limited +/* Copyright (c) 2013-2018, Linaro Limited * All rights reserved. * - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-3-Clause */
/** diff --cc test/validation/api/crypto/odp_crypto_test_inp.c index 3ea871d8,ad9784a6..1d92c656 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@@ -1,1359 -1,1244 +1,1296 @@@ - /* Copyright (c) 2014-2018, Linaro Limited -/* Copyright (c) 2014, Linaro Limited -- * All rights reserved. -- * -- * SPDX-License-Identifier: BSD-3-Clause -- */ -- --#include "config.h" -- --#include <odp_api.h> --#include <CUnit/Basic.h> --#include <odp_cunit_common.h> --#include "test_vectors.h" --#include "odp_crypto_test_inp.h" --#include "crypto.h" -- --#define MAX_ALG_CAPA 32 -- --struct suite_context_s { -- odp_bool_t packet; -- odp_crypto_op_mode_t op_mode; -- odp_crypto_op_mode_t pref_mode; -- odp_pool_t pool; -- odp_queue_t queue; --}; -- --static struct suite_context_s suite_context; -- --static int packet_cmp_mem(odp_packet_t pkt, uint32_t offset, -- void *s, uint32_t len) --{ -- uint8_t buf[len]; -- -- odp_packet_copy_to_mem(pkt, offset, len, buf); -- -- return memcmp(buf, s, len); --} -- --static const char *auth_alg_name(odp_auth_alg_t auth) --{ -- switch (auth) { -- case ODP_AUTH_ALG_NULL: -- return "ODP_AUTH_ALG_NULL"; -- case ODP_AUTH_ALG_MD5_HMAC: -- return "ODP_AUTH_ALG_MD5_HMAC"; -- case ODP_AUTH_ALG_SHA1_HMAC: -- return "ODP_AUTH_ALG_SHA1_HMAC"; -- case ODP_AUTH_ALG_SHA256_HMAC: -- return "ODP_AUTH_ALG_SHA256_HMAC"; -- case ODP_AUTH_ALG_SHA512_HMAC: -- return "ODP_AUTH_ALG_SHA512_HMAC"; -- case ODP_AUTH_ALG_AES_GCM: -- return "ODP_AUTH_ALG_AES_GCM"; -- case ODP_AUTH_ALG_AES_GMAC: -- return "ODP_AUTH_ALG_AES_GMAC"; -- default: -- return "Unknown"; -- } --} -- --static const char *cipher_alg_name(odp_cipher_alg_t cipher) --{ -- switch (cipher) { -- case ODP_CIPHER_ALG_NULL: -- return "ODP_CIPHER_ALG_NULL"; -- case ODP_CIPHER_ALG_DES: -- return "ODP_CIPHER_ALG_DES"; -- case ODP_CIPHER_ALG_3DES_CBC: -- return "ODP_CIPHER_ALG_3DES_CBC"; -- case ODP_CIPHER_ALG_AES_CBC: -- return "ODP_CIPHER_ALG_AES_CBC"; -- case ODP_CIPHER_ALG_AES_GCM: -- return "ODP_CIPHER_ALG_AES_GCM"; -- default: -- return "Unknown"; -- } --} -- --static int alg_op(odp_packet_t pkt, -- odp_bool_t *ok, -- odp_crypto_session_t session, - uint8_t *cipher_iv_ptr, - uint8_t *auth_iv_ptr, - uint8_t *op_iv_ptr, -- odp_packet_data_range_t *cipher_range, -- odp_packet_data_range_t *auth_range, -- uint8_t *aad, -- unsigned int plaintext_len) --{ -- int rc; -- odp_crypto_op_result_t result; -- odp_crypto_op_param_t op_params; -- odp_bool_t posted; -- odp_event_subtype_t subtype; -- -- /* Prepare input/output 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; -- -- op_params.cipher_range = *cipher_range; -- op_params.auth_range = *auth_range; - if (cipher_iv_ptr) - op_params.cipher_iv_ptr = cipher_iv_ptr; - if (auth_iv_ptr) - op_params.auth_iv_ptr = auth_iv_ptr; - if (op_iv_ptr) - op_params.override_iv_ptr = op_iv_ptr; -- -- op_params.aad_ptr = aad; -- -- op_params.hash_result_offset = plaintext_len; -- -- rc = odp_crypto_operation(&op_params, &posted, &result); -- if (rc < 0) { -- CU_FAIL("Failed odp_crypto_operation()"); -- return rc; -- } -- -- if (posted) { -- odp_event_t event; -- odp_crypto_compl_t compl_event; -- -- /* Poll completion queue for results */ -- do { -- event = odp_queue_deq(suite_context.queue); -- } while (event == ODP_EVENT_INVALID); -- -- CU_ASSERT(ODP_EVENT_CRYPTO_COMPL == odp_event_type(event)); -- CU_ASSERT(ODP_EVENT_NO_SUBTYPE == odp_event_subtype(event)); -- CU_ASSERT(ODP_EVENT_CRYPTO_COMPL == -- odp_event_types(event, &subtype)); -- CU_ASSERT(ODP_EVENT_NO_SUBTYPE == subtype); -- -- compl_event = odp_crypto_compl_from_event(event); -- CU_ASSERT(odp_crypto_compl_to_u64(compl_event) == -- odp_crypto_compl_to_u64( -- odp_crypto_compl_from_event(event))); -- odp_crypto_compl_result(compl_event, &result); -- odp_crypto_compl_free(compl_event); -- } -- -- CU_ASSERT(result.pkt == pkt); -- CU_ASSERT(result.ctx == (void *)0xdeadbeef); -- CU_ASSERT(ODP_EVENT_PACKET == -- odp_event_type(odp_packet_to_event(result.pkt))); -- CU_ASSERT(ODP_EVENT_PACKET_BASIC == -- odp_event_subtype(odp_packet_to_event(result.pkt))); -- CU_ASSERT(ODP_EVENT_PACKET == -- odp_event_types(odp_packet_to_event(result.pkt), &subtype)); -- CU_ASSERT(ODP_EVENT_PACKET_BASIC == subtype); -- -- *ok = result.ok; -- -- return 0; --} -- --static int alg_packet_op(odp_packet_t pkt, -- odp_bool_t *ok, -- odp_crypto_session_t session, - uint8_t *cipher_iv_ptr, - uint8_t *auth_iv_ptr, - uint8_t *op_iv_ptr, -- odp_packet_data_range_t *cipher_range, -- odp_packet_data_range_t *auth_range, -- uint8_t *aad, -- unsigned int plaintext_len) --{ -- int rc; -- odp_crypto_packet_result_t result; -- odp_crypto_packet_op_param_t op_params; -- odp_event_subtype_t subtype; -- odp_packet_t out_pkt = pkt; -- -- /* Prepare input/output params */ -- memset(&op_params, 0, sizeof(op_params)); -- op_params.session = session; -- -- op_params.cipher_range = *cipher_range; -- op_params.auth_range = *auth_range; - if (cipher_iv_ptr) - op_params.cipher_iv_ptr = cipher_iv_ptr; - if (auth_iv_ptr) - op_params.auth_iv_ptr = auth_iv_ptr; - if (op_iv_ptr) - op_params.override_iv_ptr = op_iv_ptr; -- -- op_params.aad_ptr = aad; -- -- op_params.hash_result_offset = plaintext_len; -- -- rc = odp_crypto_op(&pkt, &out_pkt, &op_params, 1); -- if (rc < 0) { -- CU_FAIL("Failed odp_crypto_packet_op()"); -- return rc; -- } -- -- CU_ASSERT(out_pkt == pkt); -- CU_ASSERT(ODP_EVENT_PACKET == -- odp_event_type(odp_packet_to_event(pkt))); -- CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == -- odp_event_subtype(odp_packet_to_event(pkt))); -- CU_ASSERT(ODP_EVENT_PACKET == -- odp_event_types(odp_packet_to_event(pkt), &subtype)); -- CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); -- -- rc = odp_crypto_result(&result, pkt); -- if (rc < 0) { -- CU_FAIL("Failed odp_crypto_packet_result()"); -- return rc; -- } -- -- if (!result.ok) -- CU_ASSERT(odp_packet_has_error(pkt)); -- -- *ok = result.ok; -- -- return 0; --} -- --static int alg_packet_op_enq(odp_packet_t pkt, -- odp_bool_t *ok, -- odp_crypto_session_t session, - uint8_t *cipher_iv_ptr, - uint8_t *auth_iv_ptr, - uint8_t *op_iv_ptr, -- odp_packet_data_range_t *cipher_range, -- odp_packet_data_range_t *auth_range, -- uint8_t *aad, -- unsigned int plaintext_len) --{ -- int rc; -- odp_event_t event; -- odp_crypto_packet_result_t result; -- odp_crypto_packet_op_param_t op_params; -- odp_event_subtype_t subtype; -- odp_packet_t out_pkt = pkt; -- -- /* Prepare input/output params */ -- memset(&op_params, 0, sizeof(op_params)); -- op_params.session = session; -- -- op_params.cipher_range = *cipher_range; -- op_params.auth_range = *auth_range; - if (cipher_iv_ptr) - op_params.cipher_iv_ptr = cipher_iv_ptr; - if (auth_iv_ptr) - op_params.auth_iv_ptr = auth_iv_ptr; - if (op_iv_ptr) - op_params.override_iv_ptr = op_iv_ptr; -- -- op_params.aad_ptr = aad; -- -- op_params.hash_result_offset = plaintext_len; -- -- rc = odp_crypto_op_enq(&pkt, &pkt, &op_params, 1); -- if (rc < 0) { -- CU_FAIL("Failed odp_crypto_op_enq()"); -- return rc; -- } -- -- /* Poll completion queue for results */ -- do { -- event = odp_queue_deq(suite_context.queue); -- } while (event == ODP_EVENT_INVALID); -- -- CU_ASSERT(ODP_EVENT_PACKET == odp_event_type(event)); -- CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == odp_event_subtype(event)); -- CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(event, &subtype)); -- CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); -- -- pkt = odp_crypto_packet_from_event(event); -- -- CU_ASSERT(out_pkt == pkt); -- CU_ASSERT(ODP_EVENT_PACKET == -- odp_event_type(odp_packet_to_event(pkt))); -- CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == -- odp_event_subtype(odp_packet_to_event(pkt))); -- CU_ASSERT(ODP_EVENT_PACKET == -- odp_event_types(odp_packet_to_event(pkt), &subtype)); -- CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); -- -- rc = odp_crypto_result(&result, pkt); -- if (rc < 0) { -- CU_FAIL("Failed odp_crypto_packet_result()"); -- return rc; -- } -- -- CU_ASSERT((!odp_packet_has_error(pkt)) == result.ok); -- -- *ok = result.ok; -- -- return 0; --} -- --typedef enum crypto_test { -- NORMAL_TEST = 0, /**< Plain execution */ -- REPEAT_TEST, /**< Rerun without reinitializing the session */ -- WRONG_DIGEST_TEST, /**< Check against wrong digest */ -- MAX_TEST, /**< Final mark */ --} crypto_test; -- --/* Basic algorithm run function for async inplace mode. -- * Creates a session from input parameters and runs one operation -- * on input_vec. Checks the output of the crypto operation against -- * output_vec. Operation completion event is dequeued polling the -- * session output queue. Completion context pointer is retrieved -- * and checked against the one set before the operation. -- * Completion event can be a separate buffer or the input packet -- * buffer can be used. -- * */ --static void alg_test(odp_crypto_op_t op, -- odp_cipher_alg_t cipher_alg, -- odp_auth_alg_t auth_alg, -- crypto_test_reference_t *ref, -- odp_bool_t ovr_iv) --{ -- odp_crypto_session_t session; - odp_crypto_capability_t capa; -- int rc; -- odp_crypto_ses_create_err_t status; -- odp_bool_t ok = false; -- int iteration; -- odp_crypto_session_param_t ses_params; - odp_crypto_cipher_capability_t cipher_capa[MAX_ALG_CAPA]; - odp_crypto_auth_capability_t auth_capa[MAX_ALG_CAPA]; -- odp_packet_data_range_t cipher_range; -- odp_packet_data_range_t auth_range; -- odp_crypto_key_t cipher_key = { -- .data = ref->cipher_key, -- .length = ref->cipher_key_length -- }; -- odp_crypto_key_t auth_key = { -- .data = ref->auth_key, -- .length = ref->auth_key_length - }; - odp_crypto_iv_t cipher_iv = { - .data = ovr_iv ? NULL : ref->cipher_iv, - .length = ref->cipher_iv_length -- }; - odp_crypto_iv_t auth_iv = { - .data = ovr_iv ? NULL : ref->auth_iv, - .length = ref->auth_iv_length - odp_crypto_iv_t iv = { - .data = ovr_iv ? NULL : ref->iv, - .length = ref->iv_length -- }; - int num, i; - int found; - - rc = odp_crypto_capability(&capa); - CU_ASSERT(!rc); - - if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC && - !(capa.ciphers.bit.trides_cbc)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_AES_CBC && - !(capa.ciphers.bit.aes_cbc)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_AES_CTR && - !(capa.ciphers.bit.aes_ctr)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_AES_GCM && - !(capa.ciphers.bit.aes_gcm)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_DES && - !(capa.ciphers.bit.des)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_NULL && - !(capa.ciphers.bit.null)) - rc = -1; - - CU_ASSERT(!rc); - CU_ASSERT((~capa.ciphers.all_bits & capa.hw_ciphers.all_bits) == 0); - - if (auth_alg == ODP_AUTH_ALG_AES_GCM && - !(capa.auths.bit.aes_gcm)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_AES_GMAC && - !(capa.auths.bit.aes_gmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_MD5_HMAC && - !(capa.auths.bit.md5_hmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_NULL && - !(capa.auths.bit.null)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_SHA1_HMAC && - !(capa.auths.bit.sha1_hmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_SHA256_HMAC && - !(capa.auths.bit.sha256_hmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_SHA512_HMAC && - !(capa.auths.bit.sha512_hmac)) - rc = -1; - - CU_ASSERT(!rc); - CU_ASSERT((~capa.auths.all_bits & capa.hw_auths.all_bits) == 0); - - num = odp_crypto_cipher_capability(cipher_alg, cipher_capa, - MAX_ALG_CAPA); - - CU_ASSERT(num > 0); - found = 0; - - CU_ASSERT(num <= MAX_ALG_CAPA); - - if (num > MAX_ALG_CAPA) - num = MAX_ALG_CAPA; - - /* Search for the test case */ - for (i = 0; i < num; i++) { - if (cipher_capa[i].key_len == cipher_key.length && - cipher_capa[i].iv_len == cipher_iv.length) { - found = 1; - break; - } - } - - if (!found) { - printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ", " - "iv_len=%" PRIu32 "\n", cipher_alg_name(cipher_alg), - cipher_key.length, cipher_iv.length); - return; - } - - num = odp_crypto_auth_capability(auth_alg, auth_capa, MAX_ALG_CAPA); - - CU_ASSERT(num > 0); - found = 0; - - CU_ASSERT(num <= MAX_ALG_CAPA); - - if (num > MAX_ALG_CAPA) - num = MAX_ALG_CAPA; - - /* Search for the test case */ - for (i = 0; i < num; i++) { - if (auth_capa[i].digest_len == ref->digest_length && - auth_capa[i].iv_len == auth_iv.length && - auth_capa[i].key_len == auth_key.length) { - found = 1; - break; - } - } - - if (!found) { - printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ", " - "digest_len=%" PRIu32 ", iv_len=%" PRIu32 "\n", - auth_alg_name(auth_alg), auth_key.length, - ref->digest_length, auth_iv.length); - return; - } -- -- /* Create a crypto session */ -- odp_crypto_session_param_init(&ses_params); -- ses_params.op = op; -- ses_params.auth_cipher_text = false; -- ses_params.op_mode = suite_context.op_mode; -- ses_params.pref_mode = suite_context.pref_mode; -- ses_params.cipher_alg = cipher_alg; -- ses_params.auth_alg = auth_alg; -- ses_params.compl_queue = suite_context.queue; -- ses_params.output_pool = suite_context.pool; -- ses_params.cipher_key = cipher_key; - ses_params.cipher_iv = cipher_iv; - ses_params.auth_iv = auth_iv; - ses_params.iv = iv; -- ses_params.auth_key = auth_key; -- ses_params.auth_digest_len = ref->digest_length; -- ses_params.auth_aad_len = ref->aad_length; -- -- rc = odp_crypto_session_create(&ses_params, &session, &status); -- CU_ASSERT_FATAL(!rc); -- CU_ASSERT(status == ODP_CRYPTO_SES_CREATE_ERR_NONE); -- CU_ASSERT(odp_crypto_session_to_u64(session) != -- odp_crypto_session_to_u64(ODP_CRYPTO_SESSION_INVALID)); -- -- cipher_range.offset = 0; -- cipher_range.length = ref->length; -- auth_range.offset = 0; -- auth_range.length = ref->length; -- -- /* Prepare input data */ -- odp_packet_t pkt = odp_packet_alloc(suite_context.pool, -- ref->length + ref->digest_length); -- CU_ASSERT(pkt != ODP_PACKET_INVALID); -- if (pkt == ODP_PACKET_INVALID) -- goto cleanup; -- -- for (iteration = NORMAL_TEST; iteration < MAX_TEST; iteration++) { -- /* checking against wrong digest is meaningless for NULL digest -- * or when generating digest */ -- if (iteration == WRONG_DIGEST_TEST && -- (auth_alg == ODP_AUTH_ALG_NULL || -- op == ODP_CRYPTO_OP_ENCODE)) -- continue; -- -- if (op == ODP_CRYPTO_OP_ENCODE) { -- odp_packet_copy_from_mem(pkt, 0, ref->length, -- ref->plaintext); -- } else { -- odp_packet_copy_from_mem(pkt, 0, ref->length, -- ref->ciphertext); -- odp_packet_copy_from_mem(pkt, ref->length, -- ref->digest_length, -- ref->digest); -- if (iteration == WRONG_DIGEST_TEST) { -- uint8_t byte = ~ref->digest[0]; -- -- odp_packet_copy_from_mem(pkt, ref->length, -- 1, &byte); -- } -- } -- -- if (!suite_context.packet) -- rc = alg_op(pkt, &ok, session, - ovr_iv ? ref->cipher_iv : NULL, - ovr_iv ? ref->auth_iv : NULL, - ovr_iv ? ref->iv : NULL, -- &cipher_range, &auth_range, -- ref->aad, ref->length); -- else if (ODP_CRYPTO_ASYNC == suite_context.op_mode) -- rc = alg_packet_op_enq(pkt, &ok, session, - ovr_iv ? ref->cipher_iv : NULL, - ovr_iv ? ref->auth_iv : NULL, - ovr_iv ? ref->iv : NULL, -- &cipher_range, &auth_range, -- ref->aad, ref->length); -- else -- rc = alg_packet_op(pkt, &ok, session, - ovr_iv ? ref->cipher_iv : NULL, - ovr_iv ? ref->auth_iv : NULL, - ovr_iv ? ref->iv : NULL, -- &cipher_range, &auth_range, -- ref->aad, ref->length); -- if (rc < 0) -- break; -- -- if (iteration == WRONG_DIGEST_TEST) { -- CU_ASSERT(!ok); -- continue; -- } -- -- CU_ASSERT(ok); -- -- if (op == ODP_CRYPTO_OP_ENCODE) { -- CU_ASSERT(!packet_cmp_mem(pkt, 0, -- ref->ciphertext, -- ref->length)); -- CU_ASSERT(!packet_cmp_mem(pkt, ref->length, -- ref->digest, -- ref->digest_length)); -- } else { -- CU_ASSERT(!packet_cmp_mem(pkt, 0, -- ref->plaintext, -- ref->length)); -- } -- } -- -- odp_packet_free(pkt); -- --cleanup: -- rc = odp_crypto_session_destroy(session); - CU_ASSERT(!rc); -} - -static void check_alg(odp_crypto_op_t op, - odp_cipher_alg_t cipher_alg, - odp_auth_alg_t auth_alg, - crypto_test_reference_t *ref, - size_t count, - odp_bool_t ovr_iv) -{ - odp_crypto_capability_t capa; - odp_crypto_cipher_capability_t cipher_capa[MAX_ALG_CAPA]; - odp_crypto_auth_capability_t auth_capa[MAX_ALG_CAPA]; - int rc, cipher_num, auth_num, i; - odp_bool_t cipher_tested[MAX_ALG_CAPA]; - odp_bool_t auth_tested[MAX_ALG_CAPA]; - odp_bool_t cipher_ok = false; - odp_bool_t auth_ok = false; - size_t idx; - - rc = odp_crypto_capability(&capa); - CU_ASSERT(!rc); - - if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC && - !(capa.ciphers.bit.trides_cbc)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_AES_CBC && - !(capa.ciphers.bit.aes_cbc)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_AES_CTR && - !(capa.ciphers.bit.aes_ctr)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_AES_GCM && - !(capa.ciphers.bit.aes_gcm)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_DES && - !(capa.ciphers.bit.des)) - rc = -1; - if (cipher_alg == ODP_CIPHER_ALG_NULL && - !(capa.ciphers.bit.null)) - rc = -1; - - CU_ASSERT(!rc); - CU_ASSERT((~capa.ciphers.all_bits & capa.hw_ciphers.all_bits) == 0); - - if (auth_alg == ODP_AUTH_ALG_AES_GCM && - !(capa.auths.bit.aes_gcm)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_AES_GMAC && - !(capa.auths.bit.aes_gmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_MD5_HMAC && - !(capa.auths.bit.md5_hmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_NULL && - !(capa.auths.bit.null)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_SHA1_HMAC && - !(capa.auths.bit.sha1_hmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_SHA256_HMAC && - !(capa.auths.bit.sha256_hmac)) - rc = -1; - if (auth_alg == ODP_AUTH_ALG_SHA512_HMAC && - !(capa.auths.bit.sha512_hmac)) - rc = -1; - -- CU_ASSERT(!rc); - CU_ASSERT((~capa.auths.all_bits & capa.hw_auths.all_bits) == 0); - - cipher_num = odp_crypto_cipher_capability(cipher_alg, cipher_capa, - MAX_ALG_CAPA); - - CU_ASSERT(cipher_num > 0); - CU_ASSERT(cipher_num <= MAX_ALG_CAPA); - if (cipher_num > MAX_ALG_CAPA) - cipher_num = MAX_ALG_CAPA; - - auth_num = odp_crypto_auth_capability(auth_alg, auth_capa, - MAX_ALG_CAPA); - - CU_ASSERT(auth_num > 0); - CU_ASSERT(auth_num <= MAX_ALG_CAPA); - if (auth_num > MAX_ALG_CAPA) - auth_num = MAX_ALG_CAPA; - - memset(cipher_tested, 0, sizeof(cipher_tested)); - memset(auth_tested, 0, sizeof(auth_tested)); - - for (idx = 0; idx < count; idx++) { - int cipher_idx = -1, auth_idx = -1; - - for (i = 0; i < cipher_num; i++) { - if (cipher_capa[i].key_len == - ref[idx].cipher_key_length && - cipher_capa[i].iv_len == - ref[idx].iv_length) { - cipher_idx = i; - break; - } - } - - if (cipher_idx < 0) { - printf("\n Unsupported: alg=%s, key_len=%" PRIu32 - ", iv_len=%" PRIu32 "\n", - cipher_alg_name(cipher_alg), - ref[idx].cipher_key_length, - ref[idx].iv_length); - continue; - } - - for (i = 0; i < auth_num; i++) { - if (auth_capa[i].digest_len == - ref[idx].digest_length && - auth_capa[i].key_len == - ref[idx].auth_key_length) { - auth_idx = i; - break; - } - } - - if (auth_idx < 0) { - printf("\n Unsupported: alg=%s, key_len=%" PRIu32 - ", digest_len=%" PRIu32 "\n", - auth_alg_name(auth_alg), - ref[idx].auth_key_length, - ref[idx].digest_length); - continue; - } - - alg_test(op, cipher_alg, auth_alg, &ref[idx], ovr_iv); - - cipher_tested[cipher_idx] = true; - auth_tested[auth_idx] = true; - } - - for (i = 0; i < cipher_num; i++) { - cipher_ok |= cipher_tested[i]; - if (!cipher_tested[i]) { - /* GMAC-related hacks */ - if (cipher_alg == ODP_CIPHER_ALG_NULL) - continue; - printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " - "iv_len=%" PRIu32 "\n", - cipher_alg_name(cipher_alg), - cipher_capa[i].key_len, - cipher_capa[i].iv_len); - } - } - - for (i = 0; i < auth_num; i++) { - auth_ok |= auth_tested[i]; - if (!auth_tested[i]) - printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " - "digest_len=%" PRIu32 "\n", - auth_alg_name(auth_alg), - auth_capa[i].key_len, - auth_capa[i].digest_len); - } - - /* Verify that we were able to run at least several tests */ - CU_ASSERT(cipher_ok); - CU_ASSERT(auth_ok); --} -- --/** -- * Check if given cipher and authentication algorithms are supported -- * -- * @param cipher Cipher algorithm -- * @param auth Authentication algorithm -- * -- * @retval ODP_TEST_ACTIVE when both algorithms are supported -- * @retval ODP_TEST_INACTIVE when either algorithm is not supported -- */ --static int check_alg_support(odp_cipher_alg_t cipher, odp_auth_alg_t auth) --{ -- odp_crypto_capability_t capability; -- -- if (odp_crypto_capability(&capability)) -- return ODP_TEST_INACTIVE; -- -- if (suite_context.packet) { -- if (suite_context.op_mode == ODP_CRYPTO_SYNC && -- capability.sync_mode == ODP_SUPPORT_NO) -- return ODP_TEST_INACTIVE; -- if (suite_context.op_mode == ODP_CRYPTO_ASYNC && -- capability.async_mode == ODP_SUPPORT_NO) -- return ODP_TEST_INACTIVE; -- } -- -- /* Cipher algorithms */ -- switch (cipher) { -- case ODP_CIPHER_ALG_NULL: -- if (!capability.ciphers.bit.null) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_CIPHER_ALG_DES: -- if (!capability.ciphers.bit.des) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_CIPHER_ALG_3DES_CBC: -- if (!capability.ciphers.bit.trides_cbc) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_CIPHER_ALG_AES_CBC: -- if (!capability.ciphers.bit.aes_cbc) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_CIPHER_ALG_AES_CTR: -- if (!capability.ciphers.bit.aes_ctr) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_CIPHER_ALG_AES_GCM: -- if (!capability.ciphers.bit.aes_gcm) -- return ODP_TEST_INACTIVE; -- break; -- default: -- fprintf(stderr, "Unsupported cipher algorithm\n"); -- return ODP_TEST_INACTIVE; -- } -- -- /* Authentication algorithms */ -- switch (auth) { -- case ODP_AUTH_ALG_NULL: -- if (!capability.auths.bit.null) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_AUTH_ALG_MD5_HMAC: -- if (!capability.auths.bit.md5_hmac) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_AUTH_ALG_SHA1_HMAC: -- if (!capability.auths.bit.sha1_hmac) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_AUTH_ALG_SHA256_HMAC: -- if (!capability.auths.bit.sha256_hmac) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_AUTH_ALG_SHA512_HMAC: -- if (!capability.auths.bit.sha512_hmac) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_AUTH_ALG_AES_GCM: -- if (!capability.auths.bit.aes_gcm) -- return ODP_TEST_INACTIVE; -- break; -- case ODP_AUTH_ALG_AES_GMAC: -- if (!capability.auths.bit.aes_gmac) -- return ODP_TEST_INACTIVE; -- break; -- default: -- fprintf(stderr, "Unsupported authentication algorithm\n"); -- return ODP_TEST_INACTIVE; -- } -- -- return ODP_TEST_ACTIVE; --} -- --static int check_alg_null(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_NULL); --} -- - static void crypto_test_enc_alg_null(void) -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) -void crypto_test_enc_alg_null(void) --{ - unsigned int test_vec_num = (sizeof(null_reference) / - sizeof(null_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_NULL, - &null_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_NULL, - null_reference, - ARRAY_SIZE(null_reference), - false); --} -- - static void crypto_test_dec_alg_null(void) -void crypto_test_dec_alg_null(void) --{ - unsigned int test_vec_num = (sizeof(null_reference) / - sizeof(null_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_NULL, - &null_reference[i], - false); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_NULL, - null_reference, - ARRAY_SIZE(null_reference), - false); --} -- --static int check_alg_3des_cbc(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_3DES_CBC, ODP_AUTH_ALG_NULL); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for 3DES_CBC algorithm. IV for the operation is the session IV. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer.*/ - static void crypto_test_enc_alg_3des_cbc(void) -void crypto_test_enc_alg_3des_cbc(void) --{ - unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / - sizeof(tdes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - &tdes_cbc_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - tdes_cbc_reference, - ARRAY_SIZE(tdes_cbc_reference), - false); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for 3DES_CBC algorithm. IV for the operation is the operation IV. -- * */ - static void crypto_test_enc_alg_3des_cbc_ovr_iv(void) -void crypto_test_enc_alg_3des_cbc_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / - sizeof(tdes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - &tdes_cbc_reference[i], - true); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - tdes_cbc_reference, - ARRAY_SIZE(tdes_cbc_reference), - true); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for 3DES_CBC algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_3des_cbc(void) -void crypto_test_dec_alg_3des_cbc(void) --{ - unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / - sizeof(tdes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - &tdes_cbc_reference[i], - false); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - tdes_cbc_reference, - ARRAY_SIZE(tdes_cbc_reference), - false); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for 3DES_CBC algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_3des_cbc_ovr_iv(void) -void crypto_test_dec_alg_3des_cbc_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / - sizeof(tdes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - &tdes_cbc_reference[i], - true); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_3DES_CBC, - ODP_AUTH_ALG_NULL, - tdes_cbc_reference, - ARRAY_SIZE(tdes_cbc_reference), - true); --} -- --static int check_alg_aes_gcm(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_AES_GCM, ODP_AUTH_ALG_AES_GCM); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for AES128_GCM algorithm. IV for the operation is the session IV. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer.*/ - static void crypto_test_enc_alg_aes_gcm(void) -void crypto_test_enc_alg_aes_gcm(void) --{ - unsigned int test_vec_num = (sizeof(aes_gcm_reference) / - sizeof(aes_gcm_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - &aes_gcm_reference[i], - false); - } - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - aes_gcm_reference, - ARRAY_SIZE(aes_gcm_reference), - false); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for AES128_GCM algorithm. IV for the operation is the session IV. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer.*/ - static void crypto_test_enc_alg_aes_gcm_ovr_iv(void) -void crypto_test_enc_alg_aes_gcm_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(aes_gcm_reference) / - sizeof(aes_gcm_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - &aes_gcm_reference[i], - true); - } - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - aes_gcm_reference, - ARRAY_SIZE(aes_gcm_reference), - true); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for 3DES_CBC algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_aes_gcm(void) -void crypto_test_dec_alg_aes_gcm(void) --{ - unsigned int test_vec_num = (sizeof(aes_gcm_reference) / - sizeof(aes_gcm_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - &aes_gcm_reference[i], - false); - } - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - aes_gcm_reference, - ARRAY_SIZE(aes_gcm_reference), - false); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for 3DES_CBC algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_aes_gcm_ovr_iv(void) -void crypto_test_dec_alg_aes_gcm_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(aes_gcm_reference) / - sizeof(aes_gcm_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - &aes_gcm_reference[i], - true); - } - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_GCM, - ODP_AUTH_ALG_AES_GCM, - aes_gcm_reference, - ARRAY_SIZE(aes_gcm_reference), - true); --} -- --static int check_alg_aes_cbc(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_AES_CBC, ODP_AUTH_ALG_NULL); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for AES128_CBC algorithm. IV for the operation is the session IV. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer.*/ - static void crypto_test_enc_alg_aes_cbc(void) -void crypto_test_enc_alg_aes_cbc(void) --{ - unsigned int test_vec_num = (sizeof(aes_cbc_reference) / - sizeof(aes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - &aes_cbc_reference[i], - false); - } - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - aes_cbc_reference, - ARRAY_SIZE(aes_cbc_reference), - false); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for AES128_CBC algorithm. IV for the operation is the operation IV. -- * */ - static void crypto_test_enc_alg_aes_cbc_ovr_iv(void) -void crypto_test_enc_alg_aes_cbc_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(aes_cbc_reference) / - sizeof(aes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - &aes_cbc_reference[i], - true); - } - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - aes_cbc_reference, - ARRAY_SIZE(aes_cbc_reference), - true); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for AES128_CBC algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_aes_cbc(void) -void crypto_test_dec_alg_aes_cbc(void) --{ - unsigned int test_vec_num = (sizeof(aes_cbc_reference) / - sizeof(aes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - &aes_cbc_reference[i], - false); - } - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - aes_cbc_reference, - ARRAY_SIZE(aes_cbc_reference), - false); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for AES128_CBC algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_aes_cbc_ovr_iv(void) -void crypto_test_dec_alg_aes_cbc_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(aes_cbc_reference) / - sizeof(aes_cbc_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - &aes_cbc_reference[i], - true); - } - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CBC, - ODP_AUTH_ALG_NULL, - aes_cbc_reference, - ARRAY_SIZE(aes_cbc_reference), - true); --} -- --static int check_alg_aes_ctr(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_AES_CTR, ODP_AUTH_ALG_NULL); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for AES128_CTR algorithm. IV for the operation is the session IV. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer.*/ - static void crypto_test_enc_alg_aes_ctr(void) -void crypto_test_enc_alg_aes_ctr(void) --{ - unsigned int test_vec_num = (sizeof(aes_ctr_reference) / - sizeof(aes_ctr_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - &aes_ctr_reference[i], - false); - } - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - aes_ctr_reference, - ARRAY_SIZE(aes_ctr_reference), - false); --} -- --/* This test verifies the correctness of encode (plaintext -> ciphertext) -- * operation for AES128_CTR algorithm. IV for the operation is the operation IV. -- * */ - static void crypto_test_enc_alg_aes_ctr_ovr_iv(void) -void crypto_test_enc_alg_aes_ctr_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(aes_ctr_reference) / - sizeof(aes_ctr_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - &aes_ctr_reference[i], - true); - } - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - aes_ctr_reference, - ARRAY_SIZE(aes_ctr_reference), - true); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for AES128_CTR algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_aes_ctr(void) -void crypto_test_dec_alg_aes_ctr(void) --{ - unsigned int test_vec_num = (sizeof(aes_ctr_reference) / - sizeof(aes_ctr_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - &aes_ctr_reference[i], - false); - } - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - aes_ctr_reference, - ARRAY_SIZE(aes_ctr_reference), - false); --} -- --/* This test verifies the correctness of decode (ciphertext -> plaintext) -- * operation for AES128_CTR algorithm. IV for the operation is the session IV -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_dec_alg_aes_ctr_ovr_iv(void) -void crypto_test_dec_alg_aes_ctr_ovr_iv(void) --{ - unsigned int test_vec_num = (sizeof(aes_ctr_reference) / - sizeof(aes_ctr_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) { - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - &aes_ctr_reference[i], - true); - } - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_AES_CTR, - ODP_AUTH_ALG_NULL, - aes_ctr_reference, - ARRAY_SIZE(aes_ctr_reference), - true); --} -- --static int check_alg_hmac_md5(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_MD5_HMAC); --} -- --/* 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. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_gen_alg_hmac_md5(void) -void crypto_test_gen_alg_hmac_md5(void) --{ - unsigned int test_vec_num = (sizeof(hmac_md5_reference) / - sizeof(hmac_md5_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_MD5_HMAC, - &hmac_md5_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_MD5_HMAC, - hmac_md5_reference, - ARRAY_SIZE(hmac_md5_reference), - false); --} -- - static void crypto_test_check_alg_hmac_md5(void) -void crypto_test_check_alg_hmac_md5(void) --{ - unsigned int test_vec_num = (sizeof(hmac_md5_reference) / - sizeof(hmac_md5_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_MD5_HMAC, - &hmac_md5_reference[i], - false); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_MD5_HMAC, - hmac_md5_reference, - ARRAY_SIZE(hmac_md5_reference), - false); --} -- --static int check_alg_hmac_sha1(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_SHA1_HMAC); --} -- --/* This test verifies the correctness of HMAC_SHA1 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. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_gen_alg_hmac_sha1(void) -void crypto_test_gen_alg_hmac_sha1(void) --{ - unsigned int test_vec_num = (sizeof(hmac_sha1_reference) / - sizeof(hmac_sha1_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA1_HMAC, - &hmac_sha1_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA1_HMAC, - hmac_sha1_reference, - ARRAY_SIZE(hmac_sha1_reference), - false); --} -- - static void crypto_test_check_alg_hmac_sha1(void) -void crypto_test_check_alg_hmac_sha1(void) --{ - unsigned int test_vec_num = (sizeof(hmac_sha1_reference) / - sizeof(hmac_sha1_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA1_HMAC, - &hmac_sha1_reference[i], - false); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA1_HMAC, - hmac_sha1_reference, - ARRAY_SIZE(hmac_sha1_reference), - false); --} -- --static int check_alg_hmac_sha256(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_SHA256_HMAC); --} -- --/* This test verifies the correctness of HMAC_SHA256 digest operation. -- * The output check length is truncated to 16 bytes (128 bits) as -- * returned by the crypto operation API call. -- * Note that hash digest is a one-way operation. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_gen_alg_hmac_sha256(void) -void crypto_test_gen_alg_hmac_sha256(void) --{ - unsigned int test_vec_num = (sizeof(hmac_sha256_reference) / - sizeof(hmac_sha256_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA256_HMAC, - &hmac_sha256_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA256_HMAC, - hmac_sha256_reference, - ARRAY_SIZE(hmac_sha256_reference), - false); --} -- - static void crypto_test_check_alg_hmac_sha256(void) -void crypto_test_check_alg_hmac_sha256(void) --{ - unsigned int test_vec_num = (sizeof(hmac_sha256_reference) / - sizeof(hmac_sha256_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA256_HMAC, - &hmac_sha256_reference[i], - false); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA256_HMAC, - hmac_sha256_reference, - ARRAY_SIZE(hmac_sha256_reference), - false); --} -- --static int check_alg_hmac_sha512(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_SHA512_HMAC); --} -- --/* This test verifies the correctness of HMAC_SHA512 digest operation. -- * The output check length is truncated to 32 bytes (256 bits) as -- * returned by the crypto operation API call. -- * Note that hash digest is a one-way operation. -- * In addition the test verifies if the implementation can use the -- * packet buffer as completion event buffer. -- * */ - static void crypto_test_gen_alg_hmac_sha512(void) -void crypto_test_gen_alg_hmac_sha512(void) --{ - unsigned int test_vec_num = (sizeof(hmac_sha512_reference) / - sizeof(hmac_sha512_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA512_HMAC, - &hmac_sha512_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA512_HMAC, - hmac_sha512_reference, - ARRAY_SIZE(hmac_sha512_reference), - false); --} -- - static void crypto_test_check_alg_hmac_sha512(void) -void crypto_test_check_alg_hmac_sha512(void) --{ - unsigned int test_vec_num = (sizeof(hmac_sha512_reference) / - sizeof(hmac_sha512_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA512_HMAC, - &hmac_sha512_reference[i], - false); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_SHA512_HMAC, - hmac_sha512_reference, - ARRAY_SIZE(hmac_sha512_reference), - false); --} -- --static int check_alg_aes_gmac(void) --{ -- return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_AES_GMAC); - } - - static void crypto_test_gen_alg_aes_gmac(void) - { - unsigned int test_vec_num = (sizeof(aes_gmac_reference) / - sizeof(aes_gmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - &aes_gmac_reference[i], - false); - } - - static void crypto_test_gen_alg_aes_gmac_ovr_iv(void) - { - unsigned int test_vec_num = (sizeof(aes_gmac_reference) / - sizeof(aes_gmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - &aes_gmac_reference[i], - true); --} -- - static void crypto_test_check_alg_aes_gmac(void) -void crypto_test_gen_alg_aes_gmac(void) --{ -- unsigned int test_vec_num = (sizeof(aes_gmac_reference) / -- sizeof(aes_gmac_reference[0])); -- unsigned int i; -- -- for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - &aes_gmac_reference[i], - false); - check_alg(ODP_CRYPTO_OP_ENCODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - aes_gmac_reference, - ARRAY_SIZE(aes_gmac_reference), - false); --} -- - static void crypto_test_check_alg_aes_gmac_ovr_iv(void) -void crypto_test_check_alg_aes_gmac(void) --{ - unsigned int test_vec_num = (sizeof(aes_gmac_reference) / - sizeof(aes_gmac_reference[0])); - unsigned int i; - - for (i = 0; i < test_vec_num; i++) - alg_test(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - &aes_gmac_reference[i], - true); - check_alg(ODP_CRYPTO_OP_DECODE, - ODP_CIPHER_ALG_NULL, - ODP_AUTH_ALG_AES_GMAC, - aes_gmac_reference, - ARRAY_SIZE(aes_gmac_reference), - false); --} -- --int crypto_suite_sync_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 crypto_suite_async_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; --} -- --int crypto_suite_packet_sync_init(void) --{ -- suite_context.packet = true; -- suite_context.op_mode = ODP_CRYPTO_SYNC; -- -- suite_context.pool = odp_pool_lookup("packet_pool"); -- if (suite_context.pool == ODP_POOL_INVALID) -- return -1; -- -- suite_context.queue = ODP_QUEUE_INVALID; -- return 0; --} -- --int crypto_suite_packet_async_init(void) --{ -- suite_context.packet = true; -- suite_context.op_mode = ODP_CRYPTO_ASYNC; -- -- 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; -- return 0; --} -- --odp_testinfo_t crypto_suite[] = { -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_null, -- check_alg_null), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_null, -- check_alg_null), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_3des_cbc, -- check_alg_3des_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_3des_cbc, -- check_alg_3des_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_3des_cbc_ovr_iv, -- check_alg_3des_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_3des_cbc_ovr_iv, -- check_alg_3des_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_cbc, -- check_alg_aes_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_cbc, -- check_alg_aes_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_cbc_ovr_iv, -- check_alg_aes_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_cbc_ovr_iv, -- check_alg_aes_cbc), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_ctr, -- check_alg_aes_ctr), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_ctr, -- check_alg_aes_ctr), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_ctr_ovr_iv, -- check_alg_aes_ctr), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_ctr_ovr_iv, -- check_alg_aes_ctr), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_gcm, -- check_alg_aes_gcm), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_gcm_ovr_iv, -- check_alg_aes_gcm), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_gcm, -- check_alg_aes_gcm), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_gcm_ovr_iv, -- check_alg_aes_gcm), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_md5, -- check_alg_hmac_md5), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_md5, -- check_alg_hmac_md5), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_sha1, -- check_alg_hmac_sha1), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_sha1, -- check_alg_hmac_sha1), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_sha256, -- check_alg_hmac_sha256), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_sha256, -- check_alg_hmac_sha256), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_sha512, -- check_alg_hmac_sha512), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_sha512, -- check_alg_hmac_sha512), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_aes_gmac, - check_alg_aes_gmac), - ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_aes_gmac_ovr_iv, -- check_alg_aes_gmac), -- ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_aes_gmac, - check_alg_aes_gmac), - ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_aes_gmac_ovr_iv, -- check_alg_aes_gmac), -- ODP_TEST_INFO_NULL, --}; -- --int crypto_suite_term(void) --{ -- int i; -- int first = 1; -- -- for (i = 0; crypto_suite[i].pName; i++) { -- if (crypto_suite[i].check_active && -- crypto_suite[i].check_active() == ODP_TEST_INACTIVE) { -- if (first) { -- first = 0; -- printf("\n\n Inactive tests:\n"); -- } -- printf(" %s\n", crypto_suite[i].pName); -- } -- } -- return 0; --} ++/* Copyright (c) 2014-2018, Linaro Limited ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: BSD-3-Clause ++ */ ++ ++#include "config.h" ++ ++#include <odp_api.h> ++#include <CUnit/Basic.h> ++#include <odp_cunit_common.h> ++#include "test_vectors.h" ++#include "odp_crypto_test_inp.h" ++#include "crypto.h" ++ ++#define MAX_ALG_CAPA 32 ++ ++struct suite_context_s { ++ odp_bool_t packet; ++ odp_crypto_op_mode_t op_mode; ++ odp_crypto_op_mode_t pref_mode; ++ odp_pool_t pool; ++ odp_queue_t queue; ++}; ++ ++static struct suite_context_s suite_context; ++ ++static int packet_cmp_mem(odp_packet_t pkt, uint32_t offset, ++ void *s, uint32_t len) ++{ ++ uint8_t buf[len]; ++ ++ odp_packet_copy_to_mem(pkt, offset, len, buf); ++ ++ return memcmp(buf, s, len); ++} ++ ++static const char *auth_alg_name(odp_auth_alg_t auth) ++{ ++ switch (auth) { ++ case ODP_AUTH_ALG_NULL: ++ return "ODP_AUTH_ALG_NULL"; ++ case ODP_AUTH_ALG_MD5_HMAC: ++ return "ODP_AUTH_ALG_MD5_HMAC"; ++ case ODP_AUTH_ALG_SHA1_HMAC: ++ return "ODP_AUTH_ALG_SHA1_HMAC"; ++ case ODP_AUTH_ALG_SHA256_HMAC: ++ return "ODP_AUTH_ALG_SHA256_HMAC"; ++ case ODP_AUTH_ALG_SHA512_HMAC: ++ return "ODP_AUTH_ALG_SHA512_HMAC"; ++ case ODP_AUTH_ALG_AES_GCM: ++ return "ODP_AUTH_ALG_AES_GCM"; ++ case ODP_AUTH_ALG_AES_GMAC: ++ return "ODP_AUTH_ALG_AES_GMAC"; ++ default: ++ return "Unknown"; ++ } ++} ++ ++static const char *cipher_alg_name(odp_cipher_alg_t cipher) ++{ ++ switch (cipher) { ++ case ODP_CIPHER_ALG_NULL: ++ return "ODP_CIPHER_ALG_NULL"; ++ case ODP_CIPHER_ALG_DES: ++ return "ODP_CIPHER_ALG_DES"; ++ case ODP_CIPHER_ALG_3DES_CBC: ++ return "ODP_CIPHER_ALG_3DES_CBC"; ++ case ODP_CIPHER_ALG_AES_CBC: ++ return "ODP_CIPHER_ALG_AES_CBC"; ++ case ODP_CIPHER_ALG_AES_GCM: ++ return "ODP_CIPHER_ALG_AES_GCM"; ++ default: ++ return "Unknown"; ++ } ++} ++ ++static int alg_op(odp_packet_t pkt, ++ odp_bool_t *ok, ++ odp_crypto_session_t session, ++ uint8_t *cipher_iv_ptr, ++ uint8_t *auth_iv_ptr, ++ odp_packet_data_range_t *cipher_range, ++ odp_packet_data_range_t *auth_range, ++ uint8_t *aad, ++ unsigned int plaintext_len) ++{ ++ int rc; ++ odp_crypto_op_result_t result; ++ odp_crypto_op_param_t op_params; ++ odp_bool_t posted; ++ odp_event_subtype_t subtype; ++ ++ /* Prepare input/output 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; ++ ++ op_params.cipher_range = *cipher_range; ++ op_params.auth_range = *auth_range; ++ if (cipher_iv_ptr) ++ op_params.cipher_iv_ptr = cipher_iv_ptr; ++ if (auth_iv_ptr) ++ op_params.auth_iv_ptr = auth_iv_ptr; ++ ++ op_params.aad_ptr = aad; ++ ++ op_params.hash_result_offset = plaintext_len; ++ ++ rc = odp_crypto_operation(&op_params, &posted, &result); ++ if (rc < 0) { ++ CU_FAIL("Failed odp_crypto_operation()"); ++ return rc; ++ } ++ ++ if (posted) { ++ odp_event_t event; ++ odp_crypto_compl_t compl_event; ++ ++ /* Poll completion queue for results */ ++ do { ++ event = odp_queue_deq(suite_context.queue); ++ } while (event == ODP_EVENT_INVALID); ++ ++ CU_ASSERT(ODP_EVENT_CRYPTO_COMPL == odp_event_type(event)); ++ CU_ASSERT(ODP_EVENT_NO_SUBTYPE == odp_event_subtype(event)); ++ CU_ASSERT(ODP_EVENT_CRYPTO_COMPL == ++ odp_event_types(event, &subtype)); ++ CU_ASSERT(ODP_EVENT_NO_SUBTYPE == subtype); ++ ++ compl_event = odp_crypto_compl_from_event(event); ++ CU_ASSERT(odp_crypto_compl_to_u64(compl_event) == ++ odp_crypto_compl_to_u64( ++ odp_crypto_compl_from_event(event))); ++ odp_crypto_compl_result(compl_event, &result); ++ odp_crypto_compl_free(compl_event); ++ } ++ ++ CU_ASSERT(result.pkt == pkt); ++ CU_ASSERT(result.ctx == (void *)0xdeadbeef); ++ CU_ASSERT(ODP_EVENT_PACKET == ++ odp_event_type(odp_packet_to_event(result.pkt))); ++ CU_ASSERT(ODP_EVENT_PACKET_BASIC == ++ odp_event_subtype(odp_packet_to_event(result.pkt))); ++ CU_ASSERT(ODP_EVENT_PACKET == ++ odp_event_types(odp_packet_to_event(result.pkt), &subtype)); ++ CU_ASSERT(ODP_EVENT_PACKET_BASIC == subtype); ++ ++ *ok = result.ok; ++ ++ return 0; ++} ++ ++static int alg_packet_op(odp_packet_t pkt, ++ odp_bool_t *ok, ++ odp_crypto_session_t session, ++ uint8_t *cipher_iv_ptr, ++ uint8_t *auth_iv_ptr, ++ odp_packet_data_range_t *cipher_range, ++ odp_packet_data_range_t *auth_range, ++ uint8_t *aad, ++ unsigned int plaintext_len) ++{ ++ int rc; ++ odp_crypto_packet_result_t result; ++ odp_crypto_packet_op_param_t op_params; ++ odp_event_subtype_t subtype; ++ odp_packet_t out_pkt = pkt; ++ ++ /* Prepare input/output params */ ++ memset(&op_params, 0, sizeof(op_params)); ++ op_params.session = session; ++ ++ op_params.cipher_range = *cipher_range; ++ op_params.auth_range = *auth_range; ++ if (cipher_iv_ptr) ++ op_params.cipher_iv_ptr = cipher_iv_ptr; ++ if (auth_iv_ptr) ++ op_params.auth_iv_ptr = auth_iv_ptr; ++ ++ op_params.aad_ptr = aad; ++ ++ op_params.hash_result_offset = plaintext_len; ++ ++ rc = odp_crypto_op(&pkt, &out_pkt, &op_params, 1); ++ if (rc < 0) { ++ CU_FAIL("Failed odp_crypto_packet_op()"); ++ return rc; ++ } ++ ++ CU_ASSERT(out_pkt == pkt); ++ CU_ASSERT(ODP_EVENT_PACKET == ++ odp_event_type(odp_packet_to_event(pkt))); ++ CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == ++ odp_event_subtype(odp_packet_to_event(pkt))); ++ CU_ASSERT(ODP_EVENT_PACKET == ++ odp_event_types(odp_packet_to_event(pkt), &subtype)); ++ CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); ++ ++ rc = odp_crypto_result(&result, pkt); ++ if (rc < 0) { ++ CU_FAIL("Failed odp_crypto_packet_result()"); ++ return rc; ++ } ++ ++ if (!result.ok) ++ CU_ASSERT(odp_packet_has_error(pkt)); ++ ++ *ok = result.ok; ++ ++ return 0; ++} ++ ++static int alg_packet_op_enq(odp_packet_t pkt, ++ odp_bool_t *ok, ++ odp_crypto_session_t session, ++ uint8_t *cipher_iv_ptr, ++ uint8_t *auth_iv_ptr, ++ odp_packet_data_range_t *cipher_range, ++ odp_packet_data_range_t *auth_range, ++ uint8_t *aad, ++ unsigned int plaintext_len) ++{ ++ int rc; ++ odp_event_t event; ++ odp_crypto_packet_result_t result; ++ odp_crypto_packet_op_param_t op_params; ++ odp_event_subtype_t subtype; ++ odp_packet_t out_pkt = pkt; ++ ++ /* Prepare input/output params */ ++ memset(&op_params, 0, sizeof(op_params)); ++ op_params.session = session; ++ ++ op_params.cipher_range = *cipher_range; ++ op_params.auth_range = *auth_range; ++ if (cipher_iv_ptr) ++ op_params.cipher_iv_ptr = cipher_iv_ptr; ++ if (auth_iv_ptr) ++ op_params.auth_iv_ptr = auth_iv_ptr; ++ ++ op_params.aad_ptr = aad; ++ ++ op_params.hash_result_offset = plaintext_len; ++ ++ rc = odp_crypto_op_enq(&pkt, &pkt, &op_params, 1); ++ if (rc < 0) { ++ CU_FAIL("Failed odp_crypto_op_enq()"); ++ return rc; ++ } ++ ++ /* Poll completion queue for results */ ++ do { ++ event = odp_queue_deq(suite_context.queue); ++ } while (event == ODP_EVENT_INVALID); ++ ++ CU_ASSERT(ODP_EVENT_PACKET == odp_event_type(event)); ++ CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == odp_event_subtype(event)); ++ CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(event, &subtype)); ++ CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); ++ ++ pkt = odp_crypto_packet_from_event(event); ++ ++ CU_ASSERT(out_pkt == pkt); ++ CU_ASSERT(ODP_EVENT_PACKET == ++ odp_event_type(odp_packet_to_event(pkt))); ++ CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == ++ odp_event_subtype(odp_packet_to_event(pkt))); ++ CU_ASSERT(ODP_EVENT_PACKET == ++ odp_event_types(odp_packet_to_event(pkt), &subtype)); ++ CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); ++ ++ rc = odp_crypto_result(&result, pkt); ++ if (rc < 0) { ++ CU_FAIL("Failed odp_crypto_packet_result()"); ++ return rc; ++ } ++ ++ CU_ASSERT((!odp_packet_has_error(pkt)) == result.ok); ++ ++ *ok = result.ok; ++ ++ return 0; ++} ++ ++typedef enum crypto_test { ++ NORMAL_TEST = 0, /**< Plain execution */ ++ REPEAT_TEST, /**< Rerun without reinitializing the session */ ++ WRONG_DIGEST_TEST, /**< Check against wrong digest */ ++ MAX_TEST, /**< Final mark */ ++} crypto_test; ++ ++/* Basic algorithm run function for async inplace mode. ++ * Creates a session from input parameters and runs one operation ++ * on input_vec. Checks the output of the crypto operation against ++ * output_vec. Operation completion event is dequeued polling the ++ * session output queue. Completion context pointer is retrieved ++ * and checked against the one set before the operation. ++ * Completion event can be a separate buffer or the input packet ++ * buffer can be used. ++ * */ ++static void alg_test(odp_crypto_op_t op, ++ odp_cipher_alg_t cipher_alg, ++ odp_auth_alg_t auth_alg, ++ crypto_test_reference_t *ref, ++ odp_bool_t ovr_iv) ++{ ++ odp_crypto_session_t session; ++ int rc; ++ odp_crypto_ses_create_err_t status; ++ odp_bool_t ok = false; ++ int iteration; ++ odp_crypto_session_param_t ses_params; ++ odp_packet_data_range_t cipher_range; ++ odp_packet_data_range_t auth_range; ++ odp_crypto_key_t cipher_key = { ++ .data = ref->cipher_key, ++ .length = ref->cipher_key_length ++ }; ++ odp_crypto_key_t auth_key = { ++ .data = ref->auth_key, ++ .length = ref->auth_key_length ++ }; ++ odp_crypto_iv_t cipher_iv = { ++ .data = ovr_iv ? NULL : ref->cipher_iv, ++ .length = ref->cipher_iv_length ++ }; ++ odp_crypto_iv_t auth_iv = { ++ .data = ovr_iv ? NULL : ref->auth_iv, ++ .length = ref->auth_iv_length ++ }; ++ ++ /* Create a crypto session */ ++ odp_crypto_session_param_init(&ses_params); ++ ses_params.op = op; ++ ses_params.auth_cipher_text = false; ++ ses_params.op_mode = suite_context.op_mode; ++ ses_params.pref_mode = suite_context.pref_mode; ++ ses_params.cipher_alg = cipher_alg; ++ ses_params.auth_alg = auth_alg; ++ ses_params.compl_queue = suite_context.queue; ++ ses_params.output_pool = suite_context.pool; ++ ses_params.cipher_key = cipher_key; ++ ses_params.cipher_iv = cipher_iv; ++ ses_params.auth_iv = auth_iv; ++ ses_params.auth_key = auth_key; ++ ses_params.auth_digest_len = ref->digest_length; ++ ses_params.auth_aad_len = ref->aad_length; ++ ++ rc = odp_crypto_session_create(&ses_params, &session, &status); ++ CU_ASSERT_FATAL(!rc); ++ CU_ASSERT(status == ODP_CRYPTO_SES_CREATE_ERR_NONE); ++ CU_ASSERT(odp_crypto_session_to_u64(session) != ++ odp_crypto_session_to_u64(ODP_CRYPTO_SESSION_INVALID)); ++ ++ cipher_range.offset = 0; ++ cipher_range.length = ref->length; ++ auth_range.offset = 0; ++ auth_range.length = ref->length; ++ ++ /* Prepare input data */ ++ odp_packet_t pkt = odp_packet_alloc(suite_context.pool, ++ ref->length + ref->digest_length); ++ CU_ASSERT(pkt != ODP_PACKET_INVALID); ++ if (pkt == ODP_PACKET_INVALID) ++ goto cleanup; ++ ++ for (iteration = NORMAL_TEST; iteration < MAX_TEST; iteration++) { ++ /* checking against wrong digest is meaningless for NULL digest ++ * or when generating digest */ ++ if (iteration == WRONG_DIGEST_TEST && ++ (auth_alg == ODP_AUTH_ALG_NULL || ++ op == ODP_CRYPTO_OP_ENCODE)) ++ continue; ++ ++ if (op == ODP_CRYPTO_OP_ENCODE) { ++ odp_packet_copy_from_mem(pkt, 0, ref->length, ++ ref->plaintext); ++ } else { ++ odp_packet_copy_from_mem(pkt, 0, ref->length, ++ ref->ciphertext); ++ odp_packet_copy_from_mem(pkt, ref->length, ++ ref->digest_length, ++ ref->digest); ++ if (iteration == WRONG_DIGEST_TEST) { ++ uint8_t byte = ~ref->digest[0]; ++ ++ odp_packet_copy_from_mem(pkt, ref->length, ++ 1, &byte); ++ } ++ } ++ ++ if (!suite_context.packet) ++ rc = alg_op(pkt, &ok, session, ++ ovr_iv ? ref->cipher_iv : NULL, ++ ovr_iv ? ref->auth_iv : NULL, ++ &cipher_range, &auth_range, ++ ref->aad, ref->length); ++ else if (ODP_CRYPTO_ASYNC == suite_context.op_mode) ++ rc = alg_packet_op_enq(pkt, &ok, session, ++ ovr_iv ? ref->cipher_iv : NULL, ++ ovr_iv ? ref->auth_iv : NULL, ++ &cipher_range, &auth_range, ++ ref->aad, ref->length); ++ else ++ rc = alg_packet_op(pkt, &ok, session, ++ ovr_iv ? ref->cipher_iv : NULL, ++ ovr_iv ? ref->auth_iv : NULL, ++ &cipher_range, &auth_range, ++ ref->aad, ref->length); ++ if (rc < 0) ++ break; ++ ++ if (iteration == WRONG_DIGEST_TEST) { ++ CU_ASSERT(!ok); ++ continue; ++ } ++ ++ CU_ASSERT(ok); ++ ++ if (op == ODP_CRYPTO_OP_ENCODE) { ++ CU_ASSERT(!packet_cmp_mem(pkt, 0, ++ ref->ciphertext, ++ ref->length)); ++ CU_ASSERT(!packet_cmp_mem(pkt, ref->length, ++ ref->digest, ++ ref->digest_length)); ++ } else { ++ CU_ASSERT(!packet_cmp_mem(pkt, 0, ++ ref->plaintext, ++ ref->length)); ++ } ++ } ++ ++ odp_packet_free(pkt); ++ ++cleanup: ++ rc = odp_crypto_session_destroy(session); ++ CU_ASSERT(!rc); ++} ++ ++static void check_alg(odp_crypto_op_t op, ++ odp_cipher_alg_t cipher_alg, ++ odp_auth_alg_t auth_alg, ++ crypto_test_reference_t *ref, ++ size_t count, ++ odp_bool_t ovr_iv) ++{ ++ odp_crypto_capability_t capa; ++ odp_crypto_cipher_capability_t cipher_capa[MAX_ALG_CAPA]; ++ odp_crypto_auth_capability_t auth_capa[MAX_ALG_CAPA]; ++ int rc, cipher_num, auth_num, i; ++ odp_bool_t cipher_tested[MAX_ALG_CAPA]; ++ odp_bool_t auth_tested[MAX_ALG_CAPA]; ++ odp_bool_t cipher_ok = false; ++ odp_bool_t auth_ok = false; ++ size_t idx; ++ ++ rc = odp_crypto_capability(&capa); ++ CU_ASSERT(!rc); ++ ++ if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC && ++ !(capa.ciphers.bit.trides_cbc)) ++ rc = -1; ++ if (cipher_alg == ODP_CIPHER_ALG_AES_CBC && ++ !(capa.ciphers.bit.aes_cbc)) ++ rc = -1; ++ if (cipher_alg == ODP_CIPHER_ALG_AES_CTR && ++ !(capa.ciphers.bit.aes_ctr)) ++ rc = -1; ++ if (cipher_alg == ODP_CIPHER_ALG_AES_GCM && ++ !(capa.ciphers.bit.aes_gcm)) ++ rc = -1; ++ if (cipher_alg == ODP_CIPHER_ALG_DES && ++ !(capa.ciphers.bit.des)) ++ rc = -1; ++ if (cipher_alg == ODP_CIPHER_ALG_NULL && ++ !(capa.ciphers.bit.null)) ++ rc = -1; ++ ++ CU_ASSERT(!rc); ++ CU_ASSERT((~capa.ciphers.all_bits & capa.hw_ciphers.all_bits) == 0); ++ ++ if (auth_alg == ODP_AUTH_ALG_AES_GCM && ++ !(capa.auths.bit.aes_gcm)) ++ rc = -1; ++ if (auth_alg == ODP_AUTH_ALG_AES_GMAC && ++ !(capa.auths.bit.aes_gmac)) ++ rc = -1; ++ if (auth_alg == ODP_AUTH_ALG_MD5_HMAC && ++ !(capa.auths.bit.md5_hmac)) ++ rc = -1; ++ if (auth_alg == ODP_AUTH_ALG_NULL && ++ !(capa.auths.bit.null)) ++ rc = -1; ++ if (auth_alg == ODP_AUTH_ALG_SHA1_HMAC && ++ !(capa.auths.bit.sha1_hmac)) ++ rc = -1; ++ if (auth_alg == ODP_AUTH_ALG_SHA256_HMAC && ++ !(capa.auths.bit.sha256_hmac)) ++ rc = -1; ++ if (auth_alg == ODP_AUTH_ALG_SHA512_HMAC && ++ !(capa.auths.bit.sha512_hmac)) ++ rc = -1; ++ ++ CU_ASSERT(!rc); ++ CU_ASSERT((~capa.auths.all_bits & capa.hw_auths.all_bits) == 0); ++ ++ cipher_num = odp_crypto_cipher_capability(cipher_alg, cipher_capa, ++ MAX_ALG_CAPA); ++ ++ CU_ASSERT(cipher_num > 0); ++ CU_ASSERT(cipher_num <= MAX_ALG_CAPA); ++ if (cipher_num > MAX_ALG_CAPA) ++ cipher_num = MAX_ALG_CAPA; ++ ++ auth_num = odp_crypto_auth_capability(auth_alg, auth_capa, ++ MAX_ALG_CAPA); ++ ++ CU_ASSERT(auth_num > 0); ++ CU_ASSERT(auth_num <= MAX_ALG_CAPA); ++ if (auth_num > MAX_ALG_CAPA) ++ auth_num = MAX_ALG_CAPA; ++ ++ memset(cipher_tested, 0, sizeof(cipher_tested)); ++ memset(auth_tested, 0, sizeof(auth_tested)); ++ ++ for (idx = 0; idx < count; idx++) { ++ int cipher_idx = -1, auth_idx = -1; ++ ++ for (i = 0; i < cipher_num; i++) { ++ if (cipher_capa[i].key_len == ++ ref[idx].cipher_key_length && ++ cipher_capa[i].iv_len == ++ ref[idx].cipher_iv_length) { ++ cipher_idx = i; ++ break; ++ } ++ } ++ ++ if (cipher_idx < 0) { ++ printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ++ ", iv_len=%" PRIu32 "\n", ++ cipher_alg_name(cipher_alg), ++ ref[idx].cipher_key_length, ++ ref[idx].cipher_iv_length); ++ continue; ++ } ++ ++ for (i = 0; i < auth_num; i++) { ++ if (auth_capa[i].digest_len == ++ ref[idx].digest_length && ++ auth_capa[i].iv_len == ++ ref[idx].auth_iv_length && ++ auth_capa[i].key_len == ++ ref[idx].auth_key_length) { ++ auth_idx = i; ++ break; ++ } ++ } ++ ++ if (auth_idx < 0) { ++ printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ++ ", iv_len=%" PRIu32 ", digest_len=%" PRIu32 "\n", ++ auth_alg_name(auth_alg), ++ ref[idx].auth_key_length, ++ ref[idx].auth_iv_length, ++ ref[idx].digest_length); ++ continue; ++ } ++ ++ alg_test(op, cipher_alg, auth_alg, &ref[idx], ovr_iv); ++ ++ cipher_tested[cipher_idx] = true; ++ auth_tested[auth_idx] = true; ++ } ++ ++ for (i = 0; i < cipher_num; i++) { ++ cipher_ok |= cipher_tested[i]; ++ if (!cipher_tested[i]) { ++ /* GMAC-related hacks */ ++ if (cipher_alg == ODP_CIPHER_ALG_NULL) ++ continue; ++ printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " ++ "iv_len=%" PRIu32 "\n", ++ cipher_alg_name(cipher_alg), ++ cipher_capa[i].key_len, ++ cipher_capa[i].iv_len); ++ } ++ } ++ ++ for (i = 0; i < auth_num; i++) { ++ auth_ok |= auth_tested[i]; ++ if (!auth_tested[i]) ++ printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " ++ "digest_len=%" PRIu32 "\n", ++ auth_alg_name(auth_alg), ++ auth_capa[i].key_len, ++ auth_capa[i].digest_len); ++ } ++ ++ /* Verify that we were able to run at least several tests */ ++ CU_ASSERT(cipher_ok); ++ CU_ASSERT(auth_ok); ++} ++ ++/** ++ * Check if given cipher and authentication algorithms are supported ++ * ++ * @param cipher Cipher algorithm ++ * @param auth Authentication algorithm ++ * ++ * @retval ODP_TEST_ACTIVE when both algorithms are supported ++ * @retval ODP_TEST_INACTIVE when either algorithm is not supported ++ */ ++static int check_alg_support(odp_cipher_alg_t cipher, odp_auth_alg_t auth) ++{ ++ odp_crypto_capability_t capability; ++ ++ if (odp_crypto_capability(&capability)) ++ return ODP_TEST_INACTIVE; ++ ++ if (suite_context.packet) { ++ if (suite_context.op_mode == ODP_CRYPTO_SYNC && ++ capability.sync_mode == ODP_SUPPORT_NO) ++ return ODP_TEST_INACTIVE; ++ if (suite_context.op_mode == ODP_CRYPTO_ASYNC && ++ capability.async_mode == ODP_SUPPORT_NO) ++ return ODP_TEST_INACTIVE; ++ } ++ ++ /* Cipher algorithms */ ++ switch (cipher) { ++ case ODP_CIPHER_ALG_NULL: ++ if (!capability.ciphers.bit.null) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_CIPHER_ALG_DES: ++ if (!capability.ciphers.bit.des) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_CIPHER_ALG_3DES_CBC: ++ if (!capability.ciphers.bit.trides_cbc) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_CIPHER_ALG_AES_CBC: ++ if (!capability.ciphers.bit.aes_cbc) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_CIPHER_ALG_AES_CTR: ++ if (!capability.ciphers.bit.aes_ctr) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_CIPHER_ALG_AES_GCM: ++ if (!capability.ciphers.bit.aes_gcm) ++ return ODP_TEST_INACTIVE; ++ break; ++ default: ++ fprintf(stderr, "Unsupported cipher algorithm\n"); ++ return ODP_TEST_INACTIVE; ++ } ++ ++ /* Authentication algorithms */ ++ switch (auth) { ++ case ODP_AUTH_ALG_NULL: ++ if (!capability.auths.bit.null) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_AUTH_ALG_MD5_HMAC: ++ if (!capability.auths.bit.md5_hmac) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_AUTH_ALG_SHA1_HMAC: ++ if (!capability.auths.bit.sha1_hmac) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_AUTH_ALG_SHA256_HMAC: ++ if (!capability.auths.bit.sha256_hmac) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_AUTH_ALG_SHA512_HMAC: ++ if (!capability.auths.bit.sha512_hmac) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_AUTH_ALG_AES_GCM: ++ if (!capability.auths.bit.aes_gcm) ++ return ODP_TEST_INACTIVE; ++ break; ++ case ODP_AUTH_ALG_AES_GMAC: ++ if (!capability.auths.bit.aes_gmac) ++ return ODP_TEST_INACTIVE; ++ break; ++ default: ++ fprintf(stderr, "Unsupported authentication algorithm\n"); ++ return ODP_TEST_INACTIVE; ++ } ++ ++ return ODP_TEST_ACTIVE; ++} ++ ++static int check_alg_null(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_NULL); ++} ++ ++#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) ++static void crypto_test_enc_alg_null(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_NULL, ++ null_reference, ++ ARRAY_SIZE(null_reference), ++ false); ++} ++ ++static void crypto_test_dec_alg_null(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_NULL, ++ null_reference, ++ ARRAY_SIZE(null_reference), ++ false); ++} ++ ++static int check_alg_3des_cbc(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_3DES_CBC, ODP_AUTH_ALG_NULL); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for 3DES_CBC algorithm. IV for the operation is the session IV. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer.*/ ++static void crypto_test_enc_alg_3des_cbc(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_3DES_CBC, ++ ODP_AUTH_ALG_NULL, ++ tdes_cbc_reference, ++ ARRAY_SIZE(tdes_cbc_reference), ++ false); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for 3DES_CBC algorithm. IV for the operation is the operation IV. ++ * */ ++static void crypto_test_enc_alg_3des_cbc_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_3DES_CBC, ++ ODP_AUTH_ALG_NULL, ++ tdes_cbc_reference, ++ ARRAY_SIZE(tdes_cbc_reference), ++ true); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for 3DES_CBC algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_3des_cbc(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_3DES_CBC, ++ ODP_AUTH_ALG_NULL, ++ tdes_cbc_reference, ++ ARRAY_SIZE(tdes_cbc_reference), ++ false); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for 3DES_CBC algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_3des_cbc_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_3DES_CBC, ++ ODP_AUTH_ALG_NULL, ++ tdes_cbc_reference, ++ ARRAY_SIZE(tdes_cbc_reference), ++ true); ++} ++ ++static int check_alg_aes_gcm(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_AES_GCM, ODP_AUTH_ALG_AES_GCM); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for AES128_GCM algorithm. IV for the operation is the session IV. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer.*/ ++static void crypto_test_enc_alg_aes_gcm(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_AES_GCM, ++ ODP_AUTH_ALG_AES_GCM, ++ aes_gcm_reference, ++ ARRAY_SIZE(aes_gcm_reference), ++ false); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for AES128_GCM algorithm. IV for the operation is the session IV. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer.*/ ++static void crypto_test_enc_alg_aes_gcm_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_AES_GCM, ++ ODP_AUTH_ALG_AES_GCM, ++ aes_gcm_reference, ++ ARRAY_SIZE(aes_gcm_reference), ++ true); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for 3DES_CBC algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_aes_gcm(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_AES_GCM, ++ ODP_AUTH_ALG_AES_GCM, ++ aes_gcm_reference, ++ ARRAY_SIZE(aes_gcm_reference), ++ false); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for 3DES_CBC algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_aes_gcm_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_AES_GCM, ++ ODP_AUTH_ALG_AES_GCM, ++ aes_gcm_reference, ++ ARRAY_SIZE(aes_gcm_reference), ++ true); ++} ++ ++static int check_alg_aes_cbc(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_AES_CBC, ODP_AUTH_ALG_NULL); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for AES128_CBC algorithm. IV for the operation is the session IV. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer.*/ ++static void crypto_test_enc_alg_aes_cbc(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_AES_CBC, ++ ODP_AUTH_ALG_NULL, ++ aes_cbc_reference, ++ ARRAY_SIZE(aes_cbc_reference), ++ false); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for AES128_CBC algorithm. IV for the operation is the operation IV. ++ * */ ++static void crypto_test_enc_alg_aes_cbc_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_AES_CBC, ++ ODP_AUTH_ALG_NULL, ++ aes_cbc_reference, ++ ARRAY_SIZE(aes_cbc_reference), ++ true); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for AES128_CBC algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_aes_cbc(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_AES_CBC, ++ ODP_AUTH_ALG_NULL, ++ aes_cbc_reference, ++ ARRAY_SIZE(aes_cbc_reference), ++ false); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for AES128_CBC algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_aes_cbc_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_AES_CBC, ++ ODP_AUTH_ALG_NULL, ++ aes_cbc_reference, ++ ARRAY_SIZE(aes_cbc_reference), ++ true); ++} ++ ++static int check_alg_aes_ctr(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_AES_CTR, ODP_AUTH_ALG_NULL); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for AES128_CTR algorithm. IV for the operation is the session IV. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer.*/ ++static void crypto_test_enc_alg_aes_ctr(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_AES_CTR, ++ ODP_AUTH_ALG_NULL, ++ aes_ctr_reference, ++ ARRAY_SIZE(aes_ctr_reference), ++ false); ++} ++ ++/* This test verifies the correctness of encode (plaintext -> ciphertext) ++ * operation for AES128_CTR algorithm. IV for the operation is the operation IV. ++ * */ ++static void crypto_test_enc_alg_aes_ctr_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_AES_CTR, ++ ODP_AUTH_ALG_NULL, ++ aes_ctr_reference, ++ ARRAY_SIZE(aes_ctr_reference), ++ true); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for AES128_CTR algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_aes_ctr(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_AES_CTR, ++ ODP_AUTH_ALG_NULL, ++ aes_ctr_reference, ++ ARRAY_SIZE(aes_ctr_reference), ++ false); ++} ++ ++/* This test verifies the correctness of decode (ciphertext -> plaintext) ++ * operation for AES128_CTR algorithm. IV for the operation is the session IV ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_dec_alg_aes_ctr_ovr_iv(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_AES_CTR, ++ ODP_AUTH_ALG_NULL, ++ aes_ctr_reference, ++ ARRAY_SIZE(aes_ctr_reference), ++ true); ++} ++ ++static int check_alg_hmac_md5(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_MD5_HMAC); ++} ++ ++/* 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. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_gen_alg_hmac_md5(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_MD5_HMAC, ++ hmac_md5_reference, ++ ARRAY_SIZE(hmac_md5_reference), ++ false); ++} ++ ++static void crypto_test_check_alg_hmac_md5(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_MD5_HMAC, ++ hmac_md5_reference, ++ ARRAY_SIZE(hmac_md5_reference), ++ false); ++} ++ ++static int check_alg_hmac_sha1(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_SHA1_HMAC); ++} ++ ++/* This test verifies the correctness of HMAC_SHA1 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. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_gen_alg_hmac_sha1(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_SHA1_HMAC, ++ hmac_sha1_reference, ++ ARRAY_SIZE(hmac_sha1_reference), ++ false); ++} ++ ++static void crypto_test_check_alg_hmac_sha1(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_SHA1_HMAC, ++ hmac_sha1_reference, ++ ARRAY_SIZE(hmac_sha1_reference), ++ false); ++} ++ ++static int check_alg_hmac_sha256(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_SHA256_HMAC); ++} ++ ++/* This test verifies the correctness of HMAC_SHA256 digest operation. ++ * The output check length is truncated to 16 bytes (128 bits) as ++ * returned by the crypto operation API call. ++ * Note that hash digest is a one-way operation. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_gen_alg_hmac_sha256(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_SHA256_HMAC, ++ hmac_sha256_reference, ++ ARRAY_SIZE(hmac_sha256_reference), ++ false); ++} ++ ++static void crypto_test_check_alg_hmac_sha256(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_SHA256_HMAC, ++ hmac_sha256_reference, ++ ARRAY_SIZE(hmac_sha256_reference), ++ false); ++} ++ ++static int check_alg_hmac_sha512(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_SHA512_HMAC); ++} ++ ++/* This test verifies the correctness of HMAC_SHA512 digest operation. ++ * The output check length is truncated to 32 bytes (256 bits) as ++ * returned by the crypto operation API call. ++ * Note that hash digest is a one-way operation. ++ * In addition the test verifies if the implementation can use the ++ * packet buffer as completion event buffer. ++ * */ ++static void crypto_test_gen_alg_hmac_sha512(void) ++{ ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_SHA512_HMAC, ++ hmac_sha512_reference, ++ ARRAY_SIZE(hmac_sha512_reference), ++ false); ++} ++ ++static void crypto_test_check_alg_hmac_sha512(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_SHA512_HMAC, ++ hmac_sha512_reference, ++ ARRAY_SIZE(hmac_sha512_reference), ++ false); ++} ++ ++static int check_alg_aes_gmac(void) ++{ ++ return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_AES_GMAC); ++} ++ ++static void crypto_test_gen_alg_aes_gmac(void) ++{ ++ unsigned int test_vec_num = (sizeof(aes_gmac_reference) / ++ sizeof(aes_gmac_reference[0])); ++ unsigned int i; ++ ++ for (i = 0; i < test_vec_num; i++) ++ check_alg(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_AES_GMAC, ++ aes_gmac_reference, ++ ARRAY_SIZE(aes_gmac_reference), ++ false); ++} ++ ++static void crypto_test_gen_alg_aes_gmac_ovr_iv(void) ++{ ++ unsigned int test_vec_num = (sizeof(aes_gmac_reference) / ++ sizeof(aes_gmac_reference[0])); ++ unsigned int i; ++ ++ for (i = 0; i < test_vec_num; i++) ++ alg_test(ODP_CRYPTO_OP_ENCODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_AES_GMAC, ++ &aes_gmac_reference[i], ++ true); ++} ++ ++static void crypto_test_check_alg_aes_gmac(void) ++{ ++ check_alg(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_AES_GMAC, ++ aes_gmac_reference, ++ ARRAY_SIZE(aes_gmac_reference), ++ false); ++} ++ ++static void crypto_test_check_alg_aes_gmac_ovr_iv(void) ++{ ++ unsigned int test_vec_num = (sizeof(aes_gmac_reference) / ++ sizeof(aes_gmac_reference[0])); ++ unsigned int i; ++ ++ for (i = 0; i < test_vec_num; i++) ++ alg_test(ODP_CRYPTO_OP_DECODE, ++ ODP_CIPHER_ALG_NULL, ++ ODP_AUTH_ALG_AES_GMAC, ++ &aes_gmac_reference[i], ++ true); ++} ++ ++int crypto_suite_sync_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 crypto_suite_async_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; ++} ++ ++int crypto_suite_packet_sync_init(void) ++{ ++ suite_context.packet = true; ++ suite_context.op_mode = ODP_CRYPTO_SYNC; ++ ++ suite_context.pool = odp_pool_lookup("packet_pool"); ++ if (suite_context.pool == ODP_POOL_INVALID) ++ return -1; ++ ++ suite_context.queue = ODP_QUEUE_INVALID; ++ return 0; ++} ++ ++int crypto_suite_packet_async_init(void) ++{ ++ suite_context.packet = true; ++ suite_context.op_mode = ODP_CRYPTO_ASYNC; ++ ++ 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; ++ return 0; ++} ++ ++odp_testinfo_t crypto_suite[] = { ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_null, ++ check_alg_null), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_null, ++ check_alg_null), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_3des_cbc, ++ check_alg_3des_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_3des_cbc, ++ check_alg_3des_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_3des_cbc_ovr_iv, ++ check_alg_3des_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_3des_cbc_ovr_iv, ++ check_alg_3des_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_cbc, ++ check_alg_aes_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_cbc, ++ check_alg_aes_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_cbc_ovr_iv, ++ check_alg_aes_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_cbc_ovr_iv, ++ check_alg_aes_cbc), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_ctr, ++ check_alg_aes_ctr), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_ctr, ++ check_alg_aes_ctr), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_ctr_ovr_iv, ++ check_alg_aes_ctr), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_ctr_ovr_iv, ++ check_alg_aes_ctr), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_gcm, ++ check_alg_aes_gcm), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_enc_alg_aes_gcm_ovr_iv, ++ check_alg_aes_gcm), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_gcm, ++ check_alg_aes_gcm), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_dec_alg_aes_gcm_ovr_iv, ++ check_alg_aes_gcm), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_md5, ++ check_alg_hmac_md5), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_md5, ++ check_alg_hmac_md5), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_sha1, ++ check_alg_hmac_sha1), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_sha1, ++ check_alg_hmac_sha1), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_sha256, ++ check_alg_hmac_sha256), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_sha256, ++ check_alg_hmac_sha256), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_hmac_sha512, ++ check_alg_hmac_sha512), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_hmac_sha512, ++ check_alg_hmac_sha512), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_aes_gmac, ++ check_alg_aes_gmac), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_gen_alg_aes_gmac_ovr_iv, ++ check_alg_aes_gmac), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_aes_gmac, ++ check_alg_aes_gmac), ++ ODP_TEST_INFO_CONDITIONAL(crypto_test_check_alg_aes_gmac_ovr_iv, ++ check_alg_aes_gmac), ++ ODP_TEST_INFO_NULL, ++}; ++ ++int crypto_suite_term(void) ++{ ++ int i; ++ int first = 1; ++ ++ for (i = 0; crypto_suite[i].pName; i++) { ++ if (crypto_suite[i].check_active && ++ crypto_suite[i].check_active() == ODP_TEST_INACTIVE) { ++ if (first) { ++ first = 0; ++ printf("\n\n Inactive tests:\n"); ++ } ++ printf(" %s\n", crypto_suite[i].pName); ++ } ++ } ++ return 0; ++}
-----------------------------------------------------------------------
Summary of changes: .travis.yml | 12 + Makefile.inc | 18 + configure.ac | 12 +- example/Makefile.inc | 12 +- example/ipfragreass/odp_ipfragreass.c | 4 +- example/ipsec_api/.gitignore | 2 +- example/l2fwd_simple/odp_l2fwd_simple.c | 3 +- example/l3fwd/odp_l3fwd_db.h | 4 +- example/switch/odp_switch.c | 4 +- example/traffic_mgmt/odp_traffic_mgmt.c | 1 + helper/Makefile.am | 12 +- helper/cuckootable.c | 8 +- helper/iplookuptable.c | 4 +- helper/m4/configure.m4 | 11 +- helper/test/linux/process.c | 2 + helper/test/linux/pthread.c | 2 + helper/threads.c | 1 + include/Makefile.am | 290 ++- include/README | 79 + .../api => include/odp/api/abi-default}/align.h | 12 +- include/odp/api/abi-default/atomic.h | 70 + .../odp/api/abi-default/barrier.h | 4 +- .../default/api/abi => api/abi-default}/buffer.h | 0 .../odp/api/abi-default/byteorder.h | 43 +- .../api/abi => api/abi-default}/classification.h | 0 .../odp/api/abi-default/cpu.h | 10 +- .../odp/api/abi-default/cpumask.h | 9 +- .../default/api/abi => api/abi-default}/crypto.h | 0 include/odp/api/abi-default/debug.h | 35 + .../default/api/abi => api/abi-default}/event.h | 0 .../odp/api/abi-default/init.h | 6 +- include/odp/api/abi-default/ipsec.h | 41 + .../default/api/abi => api/abi-default}/packet.h | 0 include/odp/api/abi-default/packet_flags.h | 24 + .../odp/api/abi-default/packet_io.h | 21 +- .../default/api/abi => api/abi-default}/pool.h | 0 .../default/api/abi => api/abi-default}/queue.h | 0 .../odp/api/abi-default/rwlock.h | 11 +- .../odp/api/abi-default/rwlock_recursive.h | 10 +- include/odp/api/abi-default/schedule.h | 39 + .../odp/api/abi-default}/schedule_types.h | 12 +- .../api/abi => api/abi-default}/shared_memory.h | 0 .../odp/api/abi-default/spinlock.h | 13 +- .../odp/api/abi-default/spinlock_recursive.h | 10 +- .../odp/api/abi-default/std_clib.h | 12 +- .../odp/api/abi-default}/std_types.h | 9 +- .../cpu.h => include/odp/api/abi-default/sync.h | 12 +- .../odp/api/abi-default/thread.h | 4 +- .../odp/api/abi-default/thrmask.h | 4 +- .../odp/api/abi-default/ticketlock.h | 11 +- .../odp/api/abi-default/time.h | 4 +- include/odp/api/abi-default/timer.h | 54 + .../odp/api/abi-default/traffic_mngr.h | 11 +- .../odp/api/abi-default/version.h | 4 +- .../odp/api/errno.h => include/odp/api/align.h | 11 +- include/odp/api/atomic.h | 28 + .../include => include}/odp/api/barrier.h | 8 +- .../include => include}/odp/api/buffer.h | 18 +- .../api/compiler.h => include/odp/api/byteorder.h | 16 +- .../include => include}/odp/api/chksum.h | 12 +- include/odp/api/classification.h | 33 + .../include => include}/odp/api/cpu.h | 6 +- .../include => include}/odp/api/cpumask.h | 6 +- .../include => include}/odp/api/crypto.h | 12 +- .../odp/api/cpu.h => include/odp/api/debug.h | 12 +- .../include => include}/odp/api/deprecated.h | 4 +- .../include => include}/odp/api/errno.h | 5 +- .../include => include}/odp/api/event.h | 14 +- .../include => include}/odp/api/feature.h | 12 +- .../include => include}/odp/api/hash.h | 12 +- .../include => include}/odp/api/hints.h | 12 +- .../include => include}/odp/api/init.h | 14 +- .../include => include}/odp/api/ipsec.h | 14 +- include/odp/api/packet.h | 33 + .../include => include}/odp/api/packet_flags.h | 9 +- .../include => include}/odp/api/packet_io.h | 14 +- .../include => include}/odp/api/packet_io_stats.h | 4 +- .../include => include}/odp/api/pool.h | 17 +- include/odp/api/queue.h | 32 + .../include => include}/odp/api/random.h | 12 +- .../include => include}/odp/api/rwlock.h | 6 +- .../include => include}/odp/api/rwlock_recursive.h | 6 +- .../include => include}/odp/api/schedule.h | 15 +- .../include => include}/odp/api/schedule_types.h | 6 +- .../include => include}/odp/api/shared_memory.h | 14 +- include/odp/api/spec/align.h | 4 +- include/odp/api/spec/atomic.h | 4 +- include/odp/api/spec/barrier.h | 4 +- include/odp/api/spec/buffer.h | 4 +- include/odp/api/spec/byteorder.h | 4 +- include/odp/api/spec/chksum.h | 4 +- include/odp/api/spec/classification.h | 15 +- include/odp/api/spec/cpu.h | 7 +- include/odp/api/spec/cpumask.h | 4 +- include/odp/api/spec/crypto.h | 4 +- include/odp/api/spec/debug.h | 4 +- include/odp/api/spec/deprecated.h.in | 4 +- include/odp/api/spec/errno.h | 4 +- include/odp/api/spec/event.h | 4 +- include/odp/api/spec/feature.h | 4 +- include/odp/api/spec/hash.h | 4 +- include/odp/api/spec/hints.h | 4 +- include/odp/api/spec/init.h | 4 +- include/odp/api/spec/ipsec.h | 4 +- include/odp/api/spec/packet.h | 4 +- include/odp/api/spec/packet_flags.h | 4 +- include/odp/api/spec/packet_io.h | 4 +- include/odp/api/spec/packet_io_stats.h | 4 +- include/odp/api/spec/pool.h | 4 +- include/odp/api/spec/queue.h | 9 +- include/odp/api/spec/random.h | 4 +- include/odp/api/spec/rwlock.h | 4 +- include/odp/api/spec/rwlock_recursive.h | 4 +- include/odp/api/spec/schedule.h | 24 +- include/odp/api/spec/schedule_types.h | 14 +- include/odp/api/spec/shared_memory.h | 4 +- include/odp/api/spec/spinlock.h | 4 +- include/odp/api/spec/spinlock_recursive.h | 4 +- include/odp/api/spec/std_clib.h | 4 +- include/odp/api/spec/std_types.h | 4 +- include/odp/api/spec/support.h | 4 +- include/odp/api/spec/sync.h | 4 +- include/odp/api/spec/system_info.h | 4 +- include/odp/api/spec/thread.h | 4 +- include/odp/api/spec/threshold.h | 5 +- include/odp/api/spec/thrmask.h | 4 +- include/odp/api/spec/ticketlock.h | 4 +- include/odp/api/spec/time.h | 4 +- include/odp/api/spec/timer.h | 4 +- include/odp/api/spec/traffic_mngr.h | 4 +- include/odp/api/spec/version.h.in | 4 +- .../include => include}/odp/api/spinlock.h | 6 +- .../odp/api/spinlock_recursive.h | 6 +- .../odp/api/cpu.h => include/odp/api/std_clib.h | 15 +- include/odp/api/std_types.h | 29 + .../include => include}/odp/api/support.h | 12 +- .../odp/api/cpu.h => include/odp/api/sync.h | 12 +- .../include => include}/odp/api/system_info.h | 5 +- .../include => include}/odp/api/thread.h | 6 +- .../include => include}/odp/api/threshold.h | 12 +- .../include => include}/odp/api/thrmask.h | 14 +- .../include => include}/odp/api/ticketlock.h | 10 +- .../include => include}/odp/api/time.h | 8 +- .../include => include}/odp/api/timer.h | 20 +- .../include => include}/odp/api/traffic_mngr.h | 13 +- .../include => include}/odp/api/version.h | 7 +- include/odp/arch/arm32-linux/odp/api/abi/align.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/atomic.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/barrier.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/buffer.h | 2 +- .../odp/arch/arm32-linux/odp/api/abi/byteorder.h | 7 + .../arch/arm32-linux/odp/api/abi/classification.h | 2 +- .../odp/arch/arm32-linux/odp/api/abi/cpu.h | 6 +- include/odp/arch/arm32-linux/odp/api/abi/cpumask.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/crypto.h | 2 +- include/odp/arch/arm32-linux/odp/api/abi/debug.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/event.h | 2 +- include/odp/arch/arm32-linux/odp/api/abi/init.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/ipsec.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/packet.h | 2 +- .../arch/arm32-linux/odp/api/abi/packet_flags.h | 7 + .../odp/arch/arm32-linux/odp/api/abi/packet_io.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/pool.h | 2 +- include/odp/arch/arm32-linux/odp/api/abi/queue.h | 2 +- include/odp/arch/arm32-linux/odp/api/abi/rwlock.h | 7 + .../arm32-linux/odp/api/abi/rwlock_recursive.h | 7 + .../odp/arch/arm32-linux/odp/api/abi/schedule.h | 7 + .../arch/arm32-linux/odp/api/abi/schedule_types.h | 7 + .../arch/arm32-linux/odp/api/abi/shared_memory.h | 2 +- .../odp/arch/arm32-linux/odp/api/abi/spinlock.h | 7 + .../arm32-linux/odp/api/abi/spinlock_recursive.h | 7 + .../odp/arch/arm32-linux/odp/api/abi/std_clib.h | 7 + .../odp/arch/arm32-linux/odp/api/abi/std_types.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/sync.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/thread.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/thrmask.h | 7 + .../odp/arch/arm32-linux/odp/api/abi/ticketlock.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/time.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/timer.h | 7 + .../arch/arm32-linux/odp/api/abi/traffic_mngr.h | 7 + include/odp/arch/arm32-linux/odp/api/abi/version.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/align.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/atomic.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/barrier.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/buffer.h | 2 +- .../odp/arch/arm64-linux/odp/api/abi/byteorder.h | 7 + .../arch/arm64-linux/odp/api/abi/classification.h | 2 +- .../odp/arch/arm64-linux/odp/api/abi/cpu.h | 6 +- include/odp/arch/arm64-linux/odp/api/abi/cpumask.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/crypto.h | 2 +- include/odp/arch/arm64-linux/odp/api/abi/debug.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/event.h | 2 +- include/odp/arch/arm64-linux/odp/api/abi/init.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/ipsec.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/packet.h | 2 +- .../arch/arm64-linux/odp/api/abi/packet_flags.h | 7 + .../odp/arch/arm64-linux/odp/api/abi/packet_io.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/pool.h | 2 +- include/odp/arch/arm64-linux/odp/api/abi/queue.h | 2 +- include/odp/arch/arm64-linux/odp/api/abi/rwlock.h | 7 + .../arm64-linux/odp/api/abi/rwlock_recursive.h | 7 + .../odp/arch/arm64-linux/odp/api/abi/schedule.h | 7 + .../arch/arm64-linux/odp/api/abi/schedule_types.h | 7 + .../arch/arm64-linux/odp/api/abi/shared_memory.h | 2 +- .../odp/arch/arm64-linux/odp/api/abi/spinlock.h | 7 + .../arm64-linux/odp/api/abi/spinlock_recursive.h | 7 + .../odp/arch/arm64-linux/odp/api/abi/std_clib.h | 7 + .../odp/arch/arm64-linux/odp/api/abi/std_types.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/sync.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/thread.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/thrmask.h | 7 + .../odp/arch/arm64-linux/odp/api/abi/ticketlock.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/time.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/timer.h | 7 + .../arch/arm64-linux/odp/api/abi/traffic_mngr.h | 7 + include/odp/arch/arm64-linux/odp/api/abi/version.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/align.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/atomic.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/barrier.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/buffer.h | 2 +- .../odp/arch/mips64-linux/odp/api/abi/byteorder.h | 7 + .../arch/mips64-linux/odp/api/abi/classification.h | 2 +- .../odp/arch/mips64-linux/odp/api/abi/cpu.h | 10 +- .../odp/arch/mips64-linux/odp/api/abi/cpumask.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/crypto.h | 2 +- include/odp/arch/mips64-linux/odp/api/abi/debug.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/event.h | 2 +- include/odp/arch/mips64-linux/odp/api/abi/init.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/ipsec.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/packet.h | 2 +- .../arch/mips64-linux/odp/api/abi/packet_flags.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/packet_io.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/pool.h | 2 +- include/odp/arch/mips64-linux/odp/api/abi/queue.h | 2 +- include/odp/arch/mips64-linux/odp/api/abi/rwlock.h | 7 + .../mips64-linux/odp/api/abi/rwlock_recursive.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/schedule.h | 7 + .../arch/mips64-linux/odp/api/abi/schedule_types.h | 7 + .../arch/mips64-linux/odp/api/abi/shared_memory.h | 2 +- .../odp/arch/mips64-linux/odp/api/abi/spinlock.h | 7 + .../mips64-linux/odp/api/abi/spinlock_recursive.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/std_clib.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/std_types.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/sync.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/thread.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/thrmask.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/ticketlock.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/time.h | 7 + include/odp/arch/mips64-linux/odp/api/abi/timer.h | 7 + .../arch/mips64-linux/odp/api/abi/traffic_mngr.h | 7 + .../odp/arch/mips64-linux/odp/api/abi/version.h | 7 + include/odp/arch/power64-linux/odp/api/abi/align.h | 7 + .../odp/arch/power64-linux/odp/api/abi/atomic.h | 7 + .../odp/arch/power64-linux/odp/api/abi/barrier.h | 7 + .../odp/arch/power64-linux/odp/api/abi/buffer.h | 2 +- .../odp/arch/power64-linux/odp/api/abi/byteorder.h | 7 + .../power64-linux/odp/api/abi/classification.h | 2 +- include/odp/arch/power64-linux/odp/api/abi/cpu.h | 8 + .../odp/arch/power64-linux/odp/api/abi/cpumask.h | 7 + .../odp/arch/power64-linux/odp/api/abi/crypto.h | 2 +- include/odp/arch/power64-linux/odp/api/abi/debug.h | 7 + include/odp/arch/power64-linux/odp/api/abi/event.h | 2 +- include/odp/arch/power64-linux/odp/api/abi/init.h | 7 + include/odp/arch/power64-linux/odp/api/abi/ipsec.h | 7 + .../odp/arch/power64-linux/odp/api/abi/packet.h | 2 +- .../arch/power64-linux/odp/api/abi/packet_flags.h | 7 + .../odp/arch/power64-linux/odp/api/abi/packet_io.h | 7 + include/odp/arch/power64-linux/odp/api/abi/pool.h | 2 +- include/odp/arch/power64-linux/odp/api/abi/queue.h | 2 +- .../odp/arch/power64-linux/odp/api/abi/rwlock.h | 7 + .../power64-linux/odp/api/abi/rwlock_recursive.h | 7 + .../odp/arch/power64-linux/odp/api/abi/schedule.h | 7 + .../power64-linux/odp/api/abi/schedule_types.h | 7 + .../arch/power64-linux/odp/api/abi/shared_memory.h | 2 +- .../odp/arch/power64-linux/odp/api/abi/spinlock.h | 7 + .../power64-linux/odp/api/abi/spinlock_recursive.h | 7 + .../odp/arch/power64-linux/odp/api/abi/std_clib.h | 7 + .../odp/arch/power64-linux/odp/api/abi/std_types.h | 7 + include/odp/arch/power64-linux/odp/api/abi/sync.h | 7 + .../odp/arch/power64-linux/odp/api/abi/thread.h | 7 + .../odp/arch/power64-linux/odp/api/abi/thrmask.h | 7 + .../arch/power64-linux/odp/api/abi/ticketlock.h | 7 + include/odp/arch/power64-linux/odp/api/abi/time.h | 7 + include/odp/arch/power64-linux/odp/api/abi/timer.h | 7 + .../arch/power64-linux/odp/api/abi/traffic_mngr.h | 7 + .../odp/arch/power64-linux/odp/api/abi/version.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/align.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/atomic.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/barrier.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/buffer.h | 2 +- .../odp/arch/x86_32-linux/odp/api/abi/byteorder.h | 7 + .../arch/x86_32-linux/odp/api/abi/classification.h | 2 +- .../odp/arch/x86_32-linux/odp/api/abi/cpu.h | 6 +- .../odp/arch/x86_32-linux/odp/api/abi/cpumask.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/crypto.h | 2 +- include/odp/arch/x86_32-linux/odp/api/abi/debug.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/event.h | 2 +- include/odp/arch/x86_32-linux/odp/api/abi/init.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/packet.h | 2 +- .../arch/x86_32-linux/odp/api/abi/packet_flags.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/packet_io.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/pool.h | 2 +- include/odp/arch/x86_32-linux/odp/api/abi/queue.h | 2 +- include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h | 7 + .../x86_32-linux/odp/api/abi/rwlock_recursive.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/schedule.h | 7 + .../arch/x86_32-linux/odp/api/abi/schedule_types.h | 7 + .../arch/x86_32-linux/odp/api/abi/shared_memory.h | 2 +- .../odp/arch/x86_32-linux/odp/api/abi/spinlock.h | 7 + .../x86_32-linux/odp/api/abi/spinlock_recursive.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/std_clib.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/std_types.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/sync.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/thread.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/thrmask.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/ticketlock.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/time.h | 7 + include/odp/arch/x86_32-linux/odp/api/abi/timer.h | 7 + .../arch/x86_32-linux/odp/api/abi/traffic_mngr.h | 7 + .../odp/arch/x86_32-linux/odp/api/abi/version.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/align.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/atomic.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/barrier.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/buffer.h | 2 +- .../odp/arch/x86_64-linux/odp/api/abi/byteorder.h | 7 + .../arch/x86_64-linux/odp/api/abi/classification.h | 2 +- .../odp/arch/x86_64-linux/odp/api/abi/cpu.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/cpumask.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/crypto.h | 2 +- include/odp/arch/x86_64-linux/odp/api/abi/debug.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/event.h | 2 +- include/odp/arch/x86_64-linux/odp/api/abi/init.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/packet.h | 2 +- .../arch/x86_64-linux/odp/api/abi/packet_flags.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/packet_io.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/pool.h | 2 +- include/odp/arch/x86_64-linux/odp/api/abi/queue.h | 2 +- include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h | 7 + .../x86_64-linux/odp/api/abi/rwlock_recursive.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/schedule.h | 7 + .../arch/x86_64-linux/odp/api/abi/schedule_types.h | 7 + .../arch/x86_64-linux/odp/api/abi/shared_memory.h | 2 +- .../odp/arch/x86_64-linux/odp/api/abi/spinlock.h | 7 + .../x86_64-linux/odp/api/abi/spinlock_recursive.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/std_clib.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/std_types.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/sync.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/thread.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/thrmask.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/ticketlock.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/time.h | 7 + include/odp/arch/x86_64-linux/odp/api/abi/timer.h | 7 + .../arch/x86_64-linux/odp/api/abi/traffic_mngr.h | 7 + .../odp/arch/x86_64-linux/odp/api/abi/version.h | 7 + .../include => include}/odp/visibility_begin.h | 0 .../include => include}/odp/visibility_end.h | 0 include/odp_api.h | 1 - platform/Makefile.inc | 2 +- platform/linux-generic/.gitignore | 1 - platform/linux-generic/Makefile.am | 174 +- .../api/cpu_arch.h => aarch64/odp/api/abi/cpu.h} | 8 +- .../arch/arm/odp/api/{cpu_arch.h => abi/cpu.h} | 8 +- .../arch/mips64/odp/api/{cpu_arch.h => abi/cpu.h} | 6 +- .../linux-generic/arch/powerpc/odp/api/abi/cpu.h | 8 + platform/linux-generic/arch/x86/cpu_flags.c | 2 +- .../arch/x86/odp/api/{cpu_arch.h => abi/cpu.h} | 8 +- .../linux-generic/arch/x86/odp_sysinfo_parse.c | 2 +- .../linux-generic/include-abi/odp/api/abi/align.h | 7 + .../linux-generic/include-abi/odp/api/abi/atomic.h | 76 + .../odp/api/abi/barrier.h} | 6 +- .../odp/api/abi/buffer.h} | 11 +- .../odp/api/abi/byteorder.h} | 15 +- .../odp/api/abi/classification.h} | 11 +- .../include-abi/odp/api/abi/cpumask.h | 7 + .../odp/api/abi/crypto.h} | 11 +- .../odp/api => include-abi/odp/api/abi}/debug.h | 19 +- .../odp/api/abi/event.h} | 12 +- .../linux-generic/include-abi/odp/api/abi/init.h | 7 + .../odp/api/abi/ipsec.h} | 4 +- .../linux-generic/include-abi/odp/api/abi/packet.h | 71 + .../include-abi/odp/api/abi/packet_flags.h | 27 + .../odp/api/abi/packet_io.h} | 10 +- .../odp/api/abi/pool.h} | 26 +- .../odp/api/abi/queue.h} | 11 +- .../linux-generic/include-abi/odp/api/abi/rwlock.h | 7 + .../include-abi/odp/api/abi/rwlock_recursive.h | 7 + .../include-abi/odp/api/abi/schedule.h | 7 + .../include-abi/odp/api/abi/schedule_types.h | 7 + .../odp/api/abi/shared_memory.h} | 11 +- .../include-abi/odp/api/abi/spinlock.h | 7 + .../include-abi/odp/api/abi/spinlock_recursive.h | 7 + .../include-abi/odp/api/abi/std_clib.h | 27 + .../include-abi/odp/api/abi/std_types.h | 7 + .../linux-generic/include-abi/odp/api/abi/sync.h | 35 + .../linux-generic/include-abi/odp/api/abi/thread.h | 7 + .../include-abi/odp/api/abi/thrmask.h | 7 + .../include-abi/odp/api/abi/ticketlock.h | 45 + .../linux-generic/include-abi/odp/api/abi/time.h | 7 + .../odp/api/abi/timer.h} | 4 +- .../include-abi/odp/api/abi/traffic_mngr.h | 7 + .../include-abi/odp/api/abi/version.h | 7 + .../include/odp/api/plat/atomic_inlines.h | 315 ++- .../include/odp/api/plat/byteorder_inlines.h | 22 + .../include/odp/api/plat/packet_flag_inlines.h | 19 +- .../plat/{packet_types.h => packet_inline_types.h} | 53 +- .../include/odp/api/plat/packet_inlines.h | 30 +- .../include/odp/api/plat/pool_inline_types.h | 37 + .../plat/{static_inline.h.in => static_inline.h} | 2 +- .../include/odp/api/plat/std_clib_inlines.h | 1 - .../include/odp/api/plat/strong_types.h | 2 + .../include/odp/api/plat/ticketlock_inlines.h | 20 - .../include/odp/api/plat/ticketlock_inlines_api.h | 6 + platform/linux-generic/include/odp/api/std_clib.h | 28 - .../linux-generic/include/odp_atomic_internal.h | 217 +- .../linux-generic/include/odp_buffer_internal.h | 4 +- .../linux-generic/include/odp_ipsec_internal.h | 2 +- platform/linux-generic/include/odp_packet_dpdk.h | 8 +- .../linux-generic/include/odp_packet_internal.h | 7 +- .../linux-generic/include/odp_packet_io_internal.h | 26 + .../include/odp_packet_io_ring_internal.h | 10 +- platform/linux-generic/include/odp_packet_netmap.h | 4 +- platform/linux-generic/include/odp_packet_socket.h | 6 +- platform/linux-generic/include/odp_pool_internal.h | 10 +- .../linux-generic/include/odp_queue_internal.h | 5 +- .../include/odp_queue_scalable_internal.h | 5 +- platform/linux-generic/include/odp_ring_internal.h | 4 +- .../linux-generic/include/odp_schedule_scalable.h | 24 +- .../include/odp_schedule_scalable_ordered.h | 8 +- platform/linux-generic/m4/configure.m4 | 1 - platform/linux-generic/odp_atomic.c | 3 - platform/linux-generic/odp_atomic_api.c | 13 + platform/linux-generic/odp_byteorder.c | 5 +- platform/linux-generic/odp_name_table.c | 8 +- platform/linux-generic/odp_packet.c | 9 +- platform/linux-generic/odp_packet_api.c | 28 + platform/linux-generic/odp_packet_flags.c | 5 - platform/linux-generic/odp_packet_flags_api.c | 15 + platform/linux-generic/odp_packet_io.c | 72 +- platform/linux-generic/odp_pkt_queue.c | 9 +- platform/linux-generic/odp_pool.c | 3 +- platform/linux-generic/odp_queue_scalable.c | 1 + platform/linux-generic/odp_schedule.c | 18 +- platform/linux-generic/odp_schedule_iquery.c | 14 +- platform/linux-generic/odp_schedule_sp.c | 12 +- platform/linux-generic/odp_std_clib.c | 5 +- platform/linux-generic/odp_sync.c | 5 +- platform/linux-generic/odp_ticketlock.c | 12 +- platform/linux-generic/odp_timer.c | 12 +- platform/linux-generic/pktio/dpdk.c | 2 +- platform/linux-generic/pktio/netmap.c | 117 +- platform/linux-generic/pktio/pktio_common.c | 125 + platform/linux-generic/pktio/socket.c | 86 + platform/linux-generic/pktio/socket_mmap.c | 97 +- platform/linux-generic/test/ring/Makefile.am | 3 + scripts/checkpatch.pl | 1 + test/Makefile.inc | 18 +- test/performance/odp_l2fwd.c | 4 +- test/performance/odp_pktio_ordered.c | 4 +- test/performance/odp_sched_latency.c | 4 +- test/performance/odp_scheduling.c | 4 +- test/validation/api/chksum/chksum.c | 6 +- test/validation/api/crypto/odp_crypto_test_inp.c | 2655 ++++++++++---------- test/validation/api/crypto/test_vectors.h | 251 +- test/validation/api/crypto/test_vectors_len.h | 6 +- 466 files changed, 5523 insertions(+), 2775 deletions(-) create mode 100644 Makefile.inc create mode 100644 include/README rename {platform/linux-generic/include/odp/api => include/odp/api/abi-default}/align.h (77%) create mode 100644 include/odp/api/abi-default/atomic.h copy platform/linux-generic/include/odp/api/plat/barrier_types.h => include/odp/api/abi-default/barrier.h (89%) rename include/odp/{arch/default/api/abi => api/abi-default}/buffer.h (100%) copy platform/linux-generic/include/odp/api/plat/byteorder_types.h => include/odp/api/abi-default/byteorder.h (51%) rename include/odp/{arch/default/api/abi => api/abi-default}/classification.h (100%) rename platform/linux-generic/arch/default/odp/api/cpu_arch.h => include/odp/api/abi-default/cpu.h (61%) rename platform/linux-generic/include/odp/api/plat/cpumask_types.h => include/odp/api/abi-default/cpumask.h (85%) rename include/odp/{arch/default/api/abi => api/abi-default}/crypto.h (100%) create mode 100644 include/odp/api/abi-default/debug.h rename include/odp/{arch/default/api/abi => api/abi-default}/event.h (100%) rename platform/linux-generic/include/odp/api/plat/init_types.h => include/odp/api/abi-default/init.h (79%) create mode 100644 include/odp/api/abi-default/ipsec.h rename include/odp/{arch/default/api/abi => api/abi-default}/packet.h (100%) create mode 100644 include/odp/api/abi-default/packet_flags.h copy platform/linux-generic/include/odp/api/plat/packet_io_types.h => include/odp/api/abi-default/packet_io.h (68%) rename include/odp/{arch/default/api/abi => api/abi-default}/pool.h (100%) rename include/odp/{arch/default/api/abi => api/abi-default}/queue.h (100%) rename platform/linux-generic/include/odp/api/plat/rwlock_types.h => include/odp/api/abi-default/rwlock.h (75%) rename platform/linux-generic/include/odp/api/plat/rwlock_recursive_types.h => include/odp/api/abi-default/rwlock_recursive.h (78%) create mode 100644 include/odp/api/abi-default/schedule.h rename {platform/linux-generic/include/odp/api/plat => include/odp/api/abi-default}/schedule_types.h (81%) rename include/odp/{arch/default/api/abi => api/abi-default}/shared_memory.h (100%) rename platform/linux-generic/include/odp/api/plat/spinlock_types.h => include/odp/api/abi-default/spinlock.h (65%) rename platform/linux-generic/include/odp/api/plat/spinlock_recursive_types.h => include/odp/api/abi-default/spinlock_recursive.h (71%) copy platform/linux-generic/include/odp/api/cpu.h => include/odp/api/abi-default/std_clib.h (51%) rename {platform/linux-generic/include/odp/api => include/odp/api/abi-default}/std_types.h (83%) copy platform/linux-generic/include/odp/api/cpu.h => include/odp/api/abi-default/sync.h (51%) rename platform/linux-generic/include/odp/api/plat/thread_types.h => include/odp/api/abi-default/thread.h (85%) rename platform/linux-generic/include/odp/api/plat/thrmask_types.h => include/odp/api/abi-default/thrmask.h (91%) rename platform/linux-generic/include/odp/api/plat/ticketlock_types.h => include/odp/api/abi-default/ticketlock.h (72%) rename platform/linux-generic/include/odp/api/plat/time_types.h => include/odp/api/abi-default/time.h (93%) create mode 100644 include/odp/api/abi-default/timer.h rename platform/linux-generic/include/odp/api/plat/traffic_mngr_types.h => include/odp/api/abi-default/traffic_mngr.h (95%) rename platform/linux-generic/include/odp/api/plat/version_types.h => include/odp/api/abi-default/version.h (91%) copy platform/linux-generic/include/odp/api/errno.h => include/odp/api/align.h (50%) create mode 100644 include/odp/api/atomic.h rename {platform/linux-generic/include => include}/odp/api/barrier.h (70%) rename {platform/linux-generic/include => include}/odp/api/buffer.h (58%) rename platform/linux-generic/include/odp/api/compiler.h => include/odp/api/byteorder.h (56%) rename {platform/linux-generic/include => include}/odp/api/chksum.h (72%) create mode 100644 include/odp/api/classification.h copy {platform/linux-generic/include => include}/odp/api/cpu.h (76%) rename {platform/linux-generic/include => include}/odp/api/cpumask.h (74%) rename {platform/linux-generic/include => include}/odp/api/crypto.h (64%) copy platform/linux-generic/include/odp/api/cpu.h => include/odp/api/debug.h (51%) rename {platform/linux-generic/include => include}/odp/api/deprecated.h (82%) rename {platform/linux-generic/include => include}/odp/api/errno.h (83%) rename {platform/linux-generic/include => include}/odp/api/event.h (65%) rename {platform/linux-generic/include => include}/odp/api/feature.h (71%) rename {platform/linux-generic/include => include}/odp/api/hash.h (73%) rename {platform/linux-generic/include => include}/odp/api/hints.h (71%) rename {platform/linux-generic/include => include}/odp/api/init.h (65%) rename {platform/linux-generic/include => include}/odp/api/ipsec.h (67%) create mode 100644 include/odp/api/packet.h rename {platform/linux-generic/include => include}/odp/api/packet_flags.h (60%) rename {platform/linux-generic/include => include}/odp/api/packet_io.h (57%) rename {platform/linux-generic/include => include}/odp/api/packet_io_stats.h (79%) rename {platform/linux-generic/include => include}/odp/api/pool.h (54%) create mode 100644 include/odp/api/queue.h rename {platform/linux-generic/include => include}/odp/api/random.h (70%) rename {platform/linux-generic/include => include}/odp/api/rwlock.h (75%) rename {platform/linux-generic/include => include}/odp/api/rwlock_recursive.h (70%) rename {platform/linux-generic/include => include}/odp/api/schedule.h (63%) rename {platform/linux-generic/include => include}/odp/api/schedule_types.h (71%) rename {platform/linux-generic/include => include}/odp/api/shared_memory.h (62%) rename {platform/linux-generic/include => include}/odp/api/spinlock.h (73%) rename {platform/linux-generic/include => include}/odp/api/spinlock_recursive.h (69%) copy platform/linux-generic/include/odp/api/cpu.h => include/odp/api/std_clib.h (55%) create mode 100644 include/odp/api/std_types.h rename {platform/linux-generic/include => include}/odp/api/support.h (73%) rename platform/linux-generic/include/odp/api/cpu.h => include/odp/api/sync.h (51%) rename {platform/linux-generic/include => include}/odp/api/system_info.h (82%) rename {platform/linux-generic/include => include}/odp/api/thread.h (74%) rename {platform/linux-generic/include => include}/odp/api/threshold.h (72%) rename {platform/linux-generic/include => include}/odp/api/thrmask.h (65%) rename {platform/linux-generic/include => include}/odp/api/ticketlock.h (60%) rename {platform/linux-generic/include => include}/odp/api/time.h (76%) rename {platform/linux-generic/include => include}/odp/api/timer.h (54%) rename {platform/linux-generic/include => include}/odp/api/traffic_mngr.h (62%) rename {platform/linux-generic/include => include}/odp/api/version.h (73%) create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/align.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/atomic.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/barrier.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/byteorder.h copy platform/linux-generic/arch/arm/odp/api/cpu_arch.h => include/odp/arch/arm32-linux/odp/api/abi/cpu.h (84%) create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/cpumask.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/debug.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/init.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/ipsec.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/packet_io.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/rwlock.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/schedule.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/spinlock.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/std_clib.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/std_types.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/sync.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/thread.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/thrmask.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/time.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/timer.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/version.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/align.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/atomic.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/barrier.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/byteorder.h rename platform/linux-generic/arch/aarch64/odp/api/cpu_arch.h => include/odp/arch/arm64-linux/odp/api/abi/cpu.h (84%) create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/cpumask.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/debug.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/init.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/ipsec.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/packet_io.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/rwlock.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/schedule.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/spinlock.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/std_clib.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/std_types.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/sync.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/thread.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/thrmask.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/time.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/timer.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/version.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/align.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/atomic.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/barrier.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/byteorder.h copy platform/linux-generic/arch/mips64/odp/api/cpu_arch.h => include/odp/arch/mips64-linux/odp/api/abi/cpu.h (65%) create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/cpumask.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/debug.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/init.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/ipsec.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/packet_flags.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/packet_io.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/rwlock.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/rwlock_recursive.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/schedule.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/schedule_types.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/spinlock.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/spinlock_recursive.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/std_clib.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/std_types.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/sync.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/thread.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/thrmask.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/ticketlock.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/time.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/timer.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/traffic_mngr.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/version.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/align.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/atomic.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/barrier.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/byteorder.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/cpu.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/cpumask.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/debug.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/init.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/ipsec.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/packet_flags.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/packet_io.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/rwlock.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/schedule.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/schedule_types.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/spinlock.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/std_clib.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/std_types.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/sync.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/thread.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/thrmask.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/ticketlock.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/time.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/timer.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/version.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/align.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/atomic.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/barrier.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h copy platform/linux-generic/arch/x86/odp/api/cpu_arch.h => include/odp/arch/x86_32-linux/odp/api/abi/cpu.h (79%) create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/debug.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/init.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/schedule.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/std_clib.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/std_types.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/sync.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/thread.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/time.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/timer.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/version.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/align.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/atomic.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/barrier.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h rename platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h => include/odp/arch/x86_64-linux/odp/api/abi/cpu.h (65%) create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/debug.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/init.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/schedule.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/std_clib.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/std_types.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/sync.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/thread.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/time.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/timer.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/version.h rename {platform/linux-generic/include => include}/odp/visibility_begin.h (100%) rename {platform/linux-generic/include => include}/odp/visibility_end.h (100%) copy platform/linux-generic/arch/{arm/odp/api/cpu_arch.h => aarch64/odp/api/abi/cpu.h} (77%) rename platform/linux-generic/arch/arm/odp/api/{cpu_arch.h => abi/cpu.h} (77%) rename platform/linux-generic/arch/mips64/odp/api/{cpu_arch.h => abi/cpu.h} (83%) create mode 100644 platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h rename platform/linux-generic/arch/x86/odp/api/{cpu_arch.h => abi/cpu.h} (69%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/align.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/atomic.h rename platform/linux-generic/{include/odp/api/plat/barrier_types.h => include-abi/odp/api/abi/barrier.h} (82%) rename platform/linux-generic/{include/odp/api/plat/buffer_types.h => include-abi/odp/api/abi/buffer.h} (73%) rename platform/linux-generic/{include/odp/api/plat/byteorder_types.h => include-abi/odp/api/abi/byteorder.h} (85%) rename platform/linux-generic/{include/odp/api/plat/classification_types.h => include-abi/odp/api/abi/classification.h} (74%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/cpumask.h rename platform/linux-generic/{include/odp/api/plat/crypto_types.h => include-abi/odp/api/abi/crypto.h} (71%) rename platform/linux-generic/{include/odp/api => include-abi/odp/api/abi}/debug.h (74%) rename platform/linux-generic/{include/odp/api/plat/event_types.h => include-abi/odp/api/abi/event.h} (80%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/init.h rename platform/linux-generic/{include/odp/api/plat/ipsec_types.h => include-abi/odp/api/abi/ipsec.h} (88%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/packet.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/packet_flags.h rename platform/linux-generic/{include/odp/api/plat/packet_io_types.h => include-abi/odp/api/abi/packet_io.h} (83%) rename platform/linux-generic/{include/odp/api/plat/pool_types.h => include-abi/odp/api/abi/pool.h} (52%) rename platform/linux-generic/{include/odp/api/plat/queue_types.h => include-abi/odp/api/abi/queue.h} (74%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/rwlock.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/rwlock_recursive.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/schedule.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/schedule_types.h rename platform/linux-generic/{include/odp/api/plat/shared_memory_types.h => include-abi/odp/api/abi/shared_memory.h} (73%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/spinlock.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/spinlock_recursive.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/std_clib.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/std_types.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/sync.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/thread.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/thrmask.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/ticketlock.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/time.h rename platform/linux-generic/{include/odp/api/plat/timer_types.h => include-abi/odp/api/abi/timer.h} (92%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/traffic_mngr.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/version.h rename platform/linux-generic/include/odp/api/plat/{packet_types.h => packet_inline_types.h} (78%) create mode 100644 platform/linux-generic/include/odp/api/plat/pool_inline_types.h rename platform/linux-generic/include/odp/api/plat/{static_inline.h.in => static_inline.h} (96%) delete mode 100644 platform/linux-generic/include/odp/api/std_clib.h create mode 100644 platform/linux-generic/odp_atomic_api.c create mode 100644 platform/linux-generic/odp_packet_api.c create mode 100644 platform/linux-generic/odp_packet_flags_api.c
hooks/post-receive