From patchwork Tue Dec 26 00:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122715 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp344117qgn; Mon, 25 Dec 2017 16:01:03 -0800 (PST) X-Google-Smtp-Source: ACJfBouMADOu3GFAPr8OHRurv4Z5rXYVd6kCgFDrJLHdDBf0KYmBeEeFpIK88kw+1HmaQBJ1dvtp X-Received: by 10.200.48.93 with SMTP id g29mr2330561qte.168.1514246463068; Mon, 25 Dec 2017 16:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514246463; cv=none; d=google.com; s=arc-20160816; b=EfmlEH0TqijajT7EoTdiobFHP5qcAf1QyDS/l4hhCqIS/wuCyIulRB1mhWNSlBed2R Su5mKVBSfoLrMPCk/dWsbfXAbNt1uEUG/BQGulaxDKZjWtyZUv3yFCG7VYOdzlrf8jal RKF97X4yJFUvP5RZQKszXUtVxf8ZuBwmnVha4GZz0xuZJZm8NOr1y3coQbgD+nr9eT1K v2eGnJaA4DgaP4LX3Kfy+aEK192QgR6q8ddiemLH4p+JP2TCpucWTAA1X6x35VQqR9zZ 3pStcw2uU/jqt/z12JMq1fzx81EeAjn3iKZjZfQBQH2QPLyJ5Th0HyNBwEG67OTdB6rL ySWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=4m+cY5tZw58+d1S2hBhf+Poelob18xCYl5Ea+vMC0xU=; b=pOjB7/YnNKmJF0IGhdjL92EZtzAbyORtJY3gXCudE5Qw3L+3unjWIjze1gvLTdF8sG 3DpUvOMt+5qEmAx3CgfjLawUkjPJreFUia+UhvQpURq2LSfPf/EMxn2Z2hWMYoeMUIzs ySIyMK6vdzatLaWqkO2o7vIPsJyw5GhJpDnRzyuxCbSAzwfJNfTC8N+uGwepb74x3P4Z mFd3QClowaZyxtVs6SsqyZiYpIsjKZvErnGQJCHhO61s2i22WZUdPOY6DrwdERkm0CNc 0FEl2DWorGYPriZCovb/3sJQ1sETH9B8mG76z7AdzkJppj5ZkPfcHw5cPFOI8M2T5L3G iCAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id s3si690047qkd.74.2017.12.25.16.01.02; Mon, 25 Dec 2017 16:01:03 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id ABFB16090D; Tue, 26 Dec 2017 00:01:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D7B526038C; Tue, 26 Dec 2017 00:00:23 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8906C60388; Tue, 26 Dec 2017 00:00:17 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id EA55960388 for ; Tue, 26 Dec 2017 00:00:15 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 6C1761803627 for ; Tue, 26 Dec 2017 03:00:14 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id i7WQ74l9ut-0Ei4C7VA; Tue, 26 Dec 2017 03:00:14 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KJPc042sLp-0D4qWkfe; Tue, 26 Dec 2017 03:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 26 Dec 2017 03:00:09 +0300 Message-Id: <1514246413-23329-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> References: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v4 1/5] api: crypto: add separate auth IV X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov GMAC auth algorithm requires IV to work. Instead of hacking the ODP_CIPHER_ALG_NULL iv to include value for ODP_AUTH_ALG_GMAC, provide separate iv (in auth capability, session params and operation params). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 352 (lumag:crypto_gmac_iv) ** https://github.com/Linaro/odp/pull/352 ** Patch: https://github.com/Linaro/odp/pull/352.patch ** Base sha: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: f8286ad8cd8b0ed8d10af7071eaa5c8cb28520a0 **/ include/odp/api/spec/crypto.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 81fecbc36..033056591 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -327,6 +327,9 @@ typedef struct odp_crypto_session_param_t { */ odp_crypto_key_t auth_key; + /** Authentication Initialization Vector (IV) */ + odp_crypto_iv_t auth_iv; + /** Authentication digest length in bytes * * Use odp_crypto_auth_capability() for supported digest lengths. @@ -397,6 +400,9 @@ typedef struct odp_crypto_op_param_t { /** Override session IV pointer */ uint8_t *override_iv_ptr; + /** Override session authentication IV pointer */ + uint8_t *override_auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -433,6 +439,9 @@ typedef struct odp_crypto_packet_op_param_t { /** Override session IV pointer */ uint8_t *override_iv_ptr; + /** Override session authentication IV pointer */ + uint8_t *override_auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -598,6 +607,9 @@ typedef struct odp_crypto_auth_capability_t { /** Key length in bytes */ uint32_t key_len; + /** IV length in bytes */ + uint32_t iv_len; + /** Additional Authenticated Data (AAD) lengths */ struct { /** Minimum AAD length in bytes */ From patchwork Tue Dec 26 00:00:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122716 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp344620qgn; Mon, 25 Dec 2017 16:01:37 -0800 (PST) X-Google-Smtp-Source: ACJfBouv88nzM2PUG2sgaGLA5qf73MQF4VlHp37q3DAc5DsyizKFcvYq1DHfJ+f4r1kJ/uoF6B0q X-Received: by 10.237.37.85 with SMTP id w21mr12481073qtc.268.1514246496866; Mon, 25 Dec 2017 16:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514246496; cv=none; d=google.com; s=arc-20160816; b=CuTcqtBSGHCA/fXy5cBTeWU51QUb/IqWwlyIDh8yQvBfJVERbvfHMV7pRR5Lr7iscZ 2zMuT7lPeMnoM7mfr+Kjmwxvu2J3XnBsnTXOPHX9Vm/3JcZs5BY/gt0RwcSS3NaHy4yg 74jLkhpyNyiSZvWysv9DN6x6qePprazpFaCbfFw4PJq5Qxqq53/Gk6FZTyKCJsmzLT9W 5Nnpx2m4own21q54hXrGAVsaEUxpFQAP4Kz9MpaHeHYMuK6I90bOJXCcYsUk7+IZyX6X Nrm1MQqst+lhLO9PU9qNAC1/Q8UioeB8qNvsHZ5rogc9KvTiH3HSfC/mE5/UdtUqDHWW K7HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=G37EPOn3yWykSordJsYazhsGSL0gGCYY4I67SaapKhU=; b=sucr6CyXY6JGQXQ0MqlnwjpQvulXjSwST8lkKCZZPqpF5Oso3lln4muMrT3GCcvj3t g1TdvnKyh4hcOgPhE8XxBatLRhuECwttvY7SmgLU5Rh4qfspLbVDSInwOsI1pIDGxQou e2PeBOlh0+GVC0sGcDSc04oBws6T69+fT/swnMHk2JqLKr2I5zdGjH0qjFZnSJJNRL8p BfNDqoEHbtthpHaDgqlMoXtS5Crb26p2kR/2IL1bB/G5Ui7vWEAs1ckaL9mLxGBkLo8B sigdusIej0cwgSAFer/TBjlbUyqGqQ7RsMZ+WVEF/R8xDUCsbr6asqWyrbwJDg3+wNJ5 rD1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 6si6493424qkw.219.2017.12.25.16.01.36; Mon, 25 Dec 2017 16:01:36 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 8A12A60922; Tue, 26 Dec 2017 00:01:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3DC57608BB; Tue, 26 Dec 2017 00:00:30 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 60B0860130; Tue, 26 Dec 2017 00:00:20 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id B528C60130 for ; Tue, 26 Dec 2017 00:00:16 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 3787534C388D for ; Tue, 26 Dec 2017 03:00:15 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Kw4hTKz4aU-0FKKiO0f; Tue, 26 Dec 2017 03:00:15 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KJPc042sLp-0E4qx2KF; Tue, 26 Dec 2017 03:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 26 Dec 2017 03:00:10 +0300 Message-Id: <1514246413-23329-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> References: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v4 2/5] validation: crypto: stop declaring test functions as public X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov There is no use to declare test functions as public, they are defined and used in the same file. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 352 (lumag:crypto_gmac_iv) ** https://github.com/Linaro/odp/pull/352 ** Patch: https://github.com/Linaro/odp/pull/352.patch ** Base sha: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: f8286ad8cd8b0ed8d10af7071eaa5c8cb28520a0 **/ test/validation/api/crypto/crypto.h | 30 ------------- test/validation/api/crypto/odp_crypto_test_inp.c | 56 ++++++++++++------------ 2 files changed, 28 insertions(+), 58 deletions(-) diff --git a/test/validation/api/crypto/crypto.h b/test/validation/api/crypto/crypto.h index 078a1909f..7c248d9eb 100644 --- a/test/validation/api/crypto/crypto.h +++ b/test/validation/api/crypto/crypto.h @@ -9,36 +9,6 @@ #include "odp_cunit_common.h" -/* test functions: */ -void crypto_test_enc_alg_null(void); -void crypto_test_dec_alg_null(void); -void crypto_test_enc_alg_3des_cbc(void); -void crypto_test_enc_alg_3des_cbc_ovr_iv(void); -void crypto_test_dec_alg_3des_cbc(void); -void crypto_test_dec_alg_3des_cbc_ovr_iv(void); -void crypto_test_enc_alg_aes_cbc(void); -void crypto_test_enc_alg_aes_cbc_ovr_iv(void); -void crypto_test_dec_alg_aes_cbc(void); -void crypto_test_dec_alg_aes_cbc_ovr_iv(void); -void crypto_test_enc_alg_aes_ctr(void); -void crypto_test_enc_alg_aes_ctr_ovr_iv(void); -void crypto_test_dec_alg_aes_ctr(void); -void crypto_test_dec_alg_aes_ctr_ovr_iv(void); -void crypto_test_enc_alg_aes_gcm(void); -void crypto_test_enc_alg_aes_gcm_ovr_iv(void); -void crypto_test_dec_alg_aes_gcm(void); -void crypto_test_dec_alg_aes_gcm_ovr_iv(void); -void crypto_test_gen_alg_hmac_md5(void); -void crypto_test_check_alg_hmac_md5(void); -void crypto_test_gen_alg_hmac_sha1(void); -void crypto_test_check_alg_hmac_sha1(void); -void crypto_test_gen_alg_hmac_sha256(void); -void crypto_test_check_alg_hmac_sha256(void); -void crypto_test_gen_alg_hmac_sha512(void); -void crypto_test_check_alg_hmac_sha512(void); -void crypto_test_gen_alg_aes_gmac(void); -void crypto_test_check_alg_aes_gmac(void); - /* test arrays: */ extern odp_testinfo_t crypto_suite[]; diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index f1da6989c..389aadf3d 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -628,7 +628,7 @@ static int check_alg_null(void) return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_NULL); } -void crypto_test_enc_alg_null(void) +static void crypto_test_enc_alg_null(void) { unsigned int test_vec_num = (sizeof(null_reference) / sizeof(null_reference[0])); @@ -642,7 +642,7 @@ void crypto_test_enc_alg_null(void) false); } -void crypto_test_dec_alg_null(void) +static void crypto_test_dec_alg_null(void) { unsigned int test_vec_num = (sizeof(null_reference) / sizeof(null_reference[0])); @@ -665,7 +665,7 @@ static int check_alg_3des_cbc(void) * 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.*/ -void crypto_test_enc_alg_3des_cbc(void) +static void crypto_test_enc_alg_3des_cbc(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -682,7 +682,7 @@ void crypto_test_enc_alg_3des_cbc(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for 3DES_CBC algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_3des_cbc_ovr_iv(void) +static void crypto_test_enc_alg_3des_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -701,7 +701,7 @@ void crypto_test_enc_alg_3des_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_3des_cbc(void) +static void crypto_test_dec_alg_3des_cbc(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -720,7 +720,7 @@ void crypto_test_dec_alg_3des_cbc(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_3des_cbc_ovr_iv(void) +static void crypto_test_dec_alg_3des_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(tdes_cbc_reference) / sizeof(tdes_cbc_reference[0])); @@ -743,7 +743,7 @@ static int check_alg_aes_gcm(void) * 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.*/ -void crypto_test_enc_alg_aes_gcm(void) +static void crypto_test_enc_alg_aes_gcm(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -762,7 +762,7 @@ void crypto_test_enc_alg_aes_gcm(void) * 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.*/ -void crypto_test_enc_alg_aes_gcm_ovr_iv(void) +static void crypto_test_enc_alg_aes_gcm_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -782,7 +782,7 @@ void crypto_test_enc_alg_aes_gcm_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_gcm(void) +static void crypto_test_dec_alg_aes_gcm(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -802,7 +802,7 @@ void crypto_test_dec_alg_aes_gcm(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_gcm_ovr_iv(void) +static void crypto_test_dec_alg_aes_gcm_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_gcm_reference) / sizeof(aes_gcm_reference[0])); @@ -826,7 +826,7 @@ static int check_alg_aes_cbc(void) * 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.*/ -void crypto_test_enc_alg_aes_cbc(void) +static void crypto_test_enc_alg_aes_cbc(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -844,7 +844,7 @@ void crypto_test_enc_alg_aes_cbc(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for AES128_CBC algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_aes_cbc_ovr_iv(void) +static void crypto_test_enc_alg_aes_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -864,7 +864,7 @@ void crypto_test_enc_alg_aes_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_cbc(void) +static void crypto_test_dec_alg_aes_cbc(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -884,7 +884,7 @@ void crypto_test_dec_alg_aes_cbc(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_cbc_ovr_iv(void) +static void crypto_test_dec_alg_aes_cbc_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_cbc_reference) / sizeof(aes_cbc_reference[0])); @@ -908,7 +908,7 @@ static int check_alg_aes_ctr(void) * 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.*/ -void crypto_test_enc_alg_aes_ctr(void) +static void crypto_test_enc_alg_aes_ctr(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -926,7 +926,7 @@ void crypto_test_enc_alg_aes_ctr(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for AES128_CTR algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_aes_ctr_ovr_iv(void) +static void crypto_test_enc_alg_aes_ctr_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -946,7 +946,7 @@ void crypto_test_enc_alg_aes_ctr_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_ctr(void) +static void crypto_test_dec_alg_aes_ctr(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -966,7 +966,7 @@ void crypto_test_dec_alg_aes_ctr(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_ctr_ovr_iv(void) +static void crypto_test_dec_alg_aes_ctr_ovr_iv(void) { unsigned int test_vec_num = (sizeof(aes_ctr_reference) / sizeof(aes_ctr_reference[0])); @@ -993,7 +993,7 @@ static int check_alg_hmac_md5(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_md5(void) +static void crypto_test_gen_alg_hmac_md5(void) { unsigned int test_vec_num = (sizeof(hmac_md5_reference) / sizeof(hmac_md5_reference[0])); @@ -1007,7 +1007,7 @@ void crypto_test_gen_alg_hmac_md5(void) false); } -void crypto_test_check_alg_hmac_md5(void) +static void crypto_test_check_alg_hmac_md5(void) { unsigned int test_vec_num = (sizeof(hmac_md5_reference) / sizeof(hmac_md5_reference[0])); @@ -1033,7 +1033,7 @@ static int check_alg_hmac_sha1(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha1(void) +static void crypto_test_gen_alg_hmac_sha1(void) { unsigned int test_vec_num = (sizeof(hmac_sha1_reference) / sizeof(hmac_sha1_reference[0])); @@ -1047,7 +1047,7 @@ void crypto_test_gen_alg_hmac_sha1(void) false); } -void crypto_test_check_alg_hmac_sha1(void) +static void crypto_test_check_alg_hmac_sha1(void) { unsigned int test_vec_num = (sizeof(hmac_sha1_reference) / sizeof(hmac_sha1_reference[0])); @@ -1073,7 +1073,7 @@ static int check_alg_hmac_sha256(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha256(void) +static void crypto_test_gen_alg_hmac_sha256(void) { unsigned int test_vec_num = (sizeof(hmac_sha256_reference) / sizeof(hmac_sha256_reference[0])); @@ -1087,7 +1087,7 @@ void crypto_test_gen_alg_hmac_sha256(void) false); } -void crypto_test_check_alg_hmac_sha256(void) +static void crypto_test_check_alg_hmac_sha256(void) { unsigned int test_vec_num = (sizeof(hmac_sha256_reference) / sizeof(hmac_sha256_reference[0])); @@ -1113,7 +1113,7 @@ static int check_alg_hmac_sha512(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha512(void) +static void crypto_test_gen_alg_hmac_sha512(void) { unsigned int test_vec_num = (sizeof(hmac_sha512_reference) / sizeof(hmac_sha512_reference[0])); @@ -1127,7 +1127,7 @@ void crypto_test_gen_alg_hmac_sha512(void) false); } -void crypto_test_check_alg_hmac_sha512(void) +static void crypto_test_check_alg_hmac_sha512(void) { unsigned int test_vec_num = (sizeof(hmac_sha512_reference) / sizeof(hmac_sha512_reference[0])); @@ -1146,7 +1146,7 @@ static int check_alg_aes_gmac(void) return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_AES_GMAC); } -void crypto_test_gen_alg_aes_gmac(void) +static void crypto_test_gen_alg_aes_gmac(void) { unsigned int test_vec_num = (sizeof(aes_gmac_reference) / sizeof(aes_gmac_reference[0])); @@ -1160,7 +1160,7 @@ void crypto_test_gen_alg_aes_gmac(void) false); } -void crypto_test_check_alg_aes_gmac(void) +static void crypto_test_check_alg_aes_gmac(void) { unsigned int test_vec_num = (sizeof(aes_gmac_reference) / sizeof(aes_gmac_reference[0])); From patchwork Tue Dec 26 00:00:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122718 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp345981qgn; Mon, 25 Dec 2017 16:03:37 -0800 (PST) X-Google-Smtp-Source: ACJfBov1qOLjWgOM11y7h3xHni9T76O7pYzPQnnlHYgIoZ0LnzprzFYVvZwXQKMSuqeibKhmwQxn X-Received: by 10.200.42.153 with SMTP id b25mr33248793qta.285.1514246617557; Mon, 25 Dec 2017 16:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514246617; cv=none; d=google.com; s=arc-20160816; b=Wkh8L90KlTPXr+VrVBxltE1pNMohPiW/9hfpHjUusssOh0eMcsUbBurj4azm9WwZ0j nBWQfqRozpD+DKQB54jq/NYqptMLeDuJoh4czWthIhuPelVrt6cEwEVBdEC4FSt3GkXD N7k2wRNBHuIp2GLXNqBdJzVN7sJfiJKt69vIppW1PiYvq81xoufyEiv8NZnOTsj7O7xW aQ67Ci1/naQcCLPQ5XcwkTY13bvmKBSCDVx4my+RFSprY79iZiMmkPAoay984P9fT683 jaVCiBf/EB2OWU3QCqgrAbqaBNEDn+hbjY8rbqFJix+9H6sh0sxph6V/z/qrrjPEJMhf Kqaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=xxSYQL8YevH0k0SjFJqH5Nr5fq1Vi1ToC/jrU7zUczA=; b=WlrHhncl66HjKHtsdrFZB86kpAsdeacTbxCV+SQgyOa89WuXqWGPT3I3RhQTBuiTgU cGkJD7QF0IgQkWqSgNPqxVjNQSzdFQSYfjHXf7/Fpo8mChXZjLZWN54JDQenJ7vAfMIn mFBLAWAkFGvltIpbUqSskYdech/6YjFIFFtUUNcrYZWtMuhhmwbfOS26Xkue/5TfiC5I S3EaN1C/jQ6o05TZmsxAq0Zc4gHxu0ZPmoKW7qAuU1Kb1MBkqIohvqOYZtQTCvM1tWKO SJJq4VjrAQ/Me/xO82tFm3Z3Y3UxKsVkz7isHKubfwRokSKH4U1276dAqxeb2vJhuqlc Ls6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id e17si4183686qki.137.2017.12.25.16.03.37; Mon, 25 Dec 2017 16:03:37 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 43640608AA; Tue, 26 Dec 2017 00:03:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E29B7608E2; Tue, 26 Dec 2017 00:00:37 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9066760388; Tue, 26 Dec 2017 00:00:22 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 4E1156038C for ; Tue, 26 Dec 2017 00:00:17 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward102o.mail.yandex.net (Yandex) with ESMTP id DE2395A017D1 for ; Tue, 26 Dec 2017 03:00:15 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id d4R0b8i1jF-0FMqJPq6; Tue, 26 Dec 2017 03:00:15 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KJPc042sLp-0F44QkZn; Tue, 26 Dec 2017 03:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 26 Dec 2017 03:00:11 +0300 Message-Id: <1514246413-23329-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> References: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v4 3/5] validation: crypto: use auth IV for GMAC test case X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Change GMAC testing code to use new auth IV fields. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 352 (lumag:crypto_gmac_iv) ** https://github.com/Linaro/odp/pull/352 ** Patch: https://github.com/Linaro/odp/pull/352.patch ** Base sha: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: f8286ad8cd8b0ed8d10af7071eaa5c8cb28520a0 **/ test/validation/api/crypto/odp_crypto_test_inp.c | 61 ++++++++++++++++++++++-- test/validation/api/crypto/test_vectors.h | 8 ++-- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 389aadf3d..d9b43c0b1 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -79,6 +79,7 @@ static int alg_op(odp_packet_t pkt, odp_bool_t *ok, odp_crypto_session_t session, uint8_t *op_iv_ptr, + uint8_t *op_auth_iv_ptr, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range, uint8_t *aad, @@ -99,8 +100,10 @@ static int alg_op(odp_packet_t pkt, op_params.cipher_range = *cipher_range; op_params.auth_range = *auth_range; - if (op_iv_ptr) + if (op_iv_ptr) { op_params.override_iv_ptr = op_iv_ptr; + op_params.override_auth_iv_ptr = op_auth_iv_ptr; + } op_params.aad_ptr = aad; @@ -154,6 +157,7 @@ static int alg_packet_op(odp_packet_t pkt, odp_bool_t *ok, odp_crypto_session_t session, uint8_t *op_iv_ptr, + uint8_t *op_auth_iv_ptr, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range, uint8_t *aad, @@ -171,8 +175,10 @@ static int alg_packet_op(odp_packet_t pkt, op_params.cipher_range = *cipher_range; op_params.auth_range = *auth_range; - if (op_iv_ptr) + if (op_iv_ptr) { op_params.override_iv_ptr = op_iv_ptr; + op_params.override_auth_iv_ptr = op_auth_iv_ptr; + } op_params.aad_ptr = aad; @@ -211,6 +217,7 @@ static int alg_packet_op_enq(odp_packet_t pkt, odp_bool_t *ok, odp_crypto_session_t session, uint8_t *op_iv_ptr, + uint8_t *op_auth_iv_ptr, odp_packet_data_range_t *cipher_range, odp_packet_data_range_t *auth_range, uint8_t *aad, @@ -229,8 +236,10 @@ static int alg_packet_op_enq(odp_packet_t pkt, op_params.cipher_range = *cipher_range; op_params.auth_range = *auth_range; - if (op_iv_ptr) + if (op_iv_ptr) { op_params.override_iv_ptr = op_iv_ptr; + op_params.override_auth_iv_ptr = op_auth_iv_ptr; + } op_params.aad_ptr = aad; @@ -321,6 +330,10 @@ static void alg_test(odp_crypto_op_t op, .data = ovr_iv ? NULL : ref->iv, .length = ref->iv_length }; + odp_crypto_iv_t auth_iv = { + .data = ovr_iv ? NULL : ref->auth_iv, + .length = ref->auth_iv_length + }; int num, i; int found; @@ -414,6 +427,7 @@ static void alg_test(odp_crypto_op_t op, /* 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; @@ -422,8 +436,9 @@ static void alg_test(odp_crypto_op_t op, if (!found) { printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ", " - "digest_len=%" PRIu32 "\n", auth_alg_name(auth_alg), - auth_key.length, ref->digest_length); + "digest_len=%" PRIu32 ", iv_len=%" PRIu32 "\n", + auth_alg_name(auth_alg), auth_key.length, + ref->digest_length, auth_iv.length); return; } @@ -439,6 +454,7 @@ static void alg_test(odp_crypto_op_t op, ses_params.output_pool = suite_context.pool; ses_params.cipher_key = cipher_key; ses_params.iv = 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; @@ -487,16 +503,19 @@ static void alg_test(odp_crypto_op_t op, if (!suite_context.packet) rc = alg_op(pkt, &ok, session, ovr_iv ? ref->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->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->iv : NULL, + ovr_iv ? ref->auth_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); if (rc < 0) @@ -1160,6 +1179,20 @@ static void crypto_test_gen_alg_aes_gmac(void) 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) { unsigned int test_vec_num = (sizeof(aes_gmac_reference) / @@ -1174,6 +1207,20 @@ static void crypto_test_check_alg_aes_gmac(void) 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"); @@ -1281,8 +1328,12 @@ odp_testinfo_t crypto_suite[] = { 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, }; diff --git a/test/validation/api/crypto/test_vectors.h b/test/validation/api/crypto/test_vectors.h index f2ce9eb2f..90b020356 100644 --- a/test/validation/api/crypto/test_vectors.h +++ b/test/validation/api/crypto/test_vectors.h @@ -16,6 +16,8 @@ typedef struct crypto_test_reference_s { uint8_t auth_key[MAX_KEY_LEN]; uint32_t iv_length; uint8_t iv[MAX_IV_LEN]; + uint32_t auth_iv_length; + uint8_t auth_iv[MAX_IV_LEN]; uint32_t length; uint8_t plaintext[MAX_DATA_LEN]; uint8_t ciphertext[MAX_DATA_LEN]; @@ -447,9 +449,9 @@ static crypto_test_reference_t aes_gmac_reference[] = { .auth_key_length = AES128_GCM_KEY_LEN, .auth_key = { 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x22, 0x43, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, + .auth_iv_length = AES_GCM_IV_LEN, + .auth_iv = { 0x22, 0x43, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, .length = 68, .plaintext = { 0x00, 0x00, 0x43, 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, From patchwork Tue Dec 26 00:00:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122717 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp345490qgn; Mon, 25 Dec 2017 16:02:49 -0800 (PST) X-Google-Smtp-Source: ACJfBot3fE5sOUCW6NEx2XBA+Ovujn7/YpbGkAby5BHHQobnlfVxREeWoCioPaP51VgTVYzoKmkk X-Received: by 10.200.35.182 with SMTP id q51mr29103957qtq.302.1514246569097; Mon, 25 Dec 2017 16:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514246569; cv=none; d=google.com; s=arc-20160816; b=wIcXiuFKZNY/VxUA9X8HVHYv7vyw8G1feR1O/q+yv8GtV/rmAzjb59WwWCZ3ubKnQY tUk08dyPWGhGMsAJ02j3rSgB7+ICX2U8wuzk8Ww58ySX59FiFaEzPfOz8ZOnzZ/vIC1q t3/c/dpvpLY9u7zZLv5KAZx+RUgt55iJmRIx8d+N1gNEJqwDQ9HapbcvB1pLmrecsXzY qXoCVCYGsuKbT64yX3dviysL4NPyXMcY5JaHt6iRVGYcmPtAsigxAjFpLLpZNldMlHge DVQFhCKfoydCr+g49M5taew/ZbdyHQ9UX816r/0L618uxUMkkQWbFhHzyUKmsDFGBpmd TR9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=YjgqaGFbYAwuGngWrtv9j3cPl/3bgaae3riDrArEZ4g=; b=FFT1W0wcG4baeSbliZzovjaSdya8DLW5wZ15ZNLmjf3mwayeETpgrYzmsRL5iPw4Wo EdeqeoRfEOE/qvTJ7fddY6dPXbeXfDMKblSTTOdULoasN3cZbuHyCp/uBi60Jj0RPfpU zUh5pI9uAKmllI9TyTTfElK/pu7Gl30twPnD1lH9kLwdjDECQ06+8axw4lBVAlfpBBly gatxgyIFYP20cWlUBuivEPOmAihWcSBsf7AZc6nyYQOYj9tOQgdt2g96gSI+IqyR+Q8M l8Ow/RSTScwgTAH0Je6YGK5oQzDztdsjNHNPWKwBFQVkNZIPRkbNsicT0F+6Qu+WfYHT xtPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id i202si3720978qke.210.2017.12.25.16.02.48; Mon, 25 Dec 2017 16:02:49 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D2BFD6095F; Tue, 26 Dec 2017 00:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 90EC9608B5; Tue, 26 Dec 2017 00:00:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2E4AE608AA; Tue, 26 Dec 2017 00:00:22 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id EC95560388 for ; Tue, 26 Dec 2017 00:00:17 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 7184E6A835F5 for ; Tue, 26 Dec 2017 03:00:16 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 7T7Zc3Kkue-0GR4rb12; Tue, 26 Dec 2017 03:00:16 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KJPc042sLp-0F4ShpMf; Tue, 26 Dec 2017 03:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 26 Dec 2017 03:00:12 +0300 Message-Id: <1514246413-23329-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> References: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v4 4/5] linux-gen: crypto: move session type to odp_crypto module X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov There is no point in having odp_crypto_generic_session_t definition in global include file. Move it to odp_crypto module. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 352 (lumag:crypto_gmac_iv) ** https://github.com/Linaro/odp/pull/352 ** Patch: https://github.com/Linaro/odp/pull/352.patch ** Base sha: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: f8286ad8cd8b0ed8d10af7071eaa5c8cb28520a0 **/ platform/linux-generic/Makefile.am | 1 - .../linux-generic/include/odp_crypto_internal.h | 73 ---------------------- platform/linux-generic/odp_crypto.c | 46 +++++++++++++- 3 files changed, 44 insertions(+), 76 deletions(-) delete mode 100644 platform/linux-generic/include/odp_crypto_internal.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 4371e7a99..5f00e3f6e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -138,7 +138,6 @@ noinst_HEADERS = \ include/odp_classification_inlines.h \ include/odp_classification_internal.h \ include/odp_config_internal.h \ - include/odp_crypto_internal.h \ include/odp_debug_internal.h \ include/odp_errno_define.h \ include/odp_forward_typedefs_internal.h \ diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h deleted file mode 100644 index 32178d9de..000000000 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_CRYPTO_INTERNAL_H_ -#define ODP_CRYPTO_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define MAX_IV_LEN 64 -#define OP_RESULT_MAGIC 0x91919191 - -/** Forward declaration of session structure */ -typedef struct odp_crypto_generic_session odp_crypto_generic_session_t; - -/** - * Algorithm handler function prototype - */ -typedef -odp_crypto_alg_err_t (*crypto_func_t)(odp_packet_t pkt, - const odp_crypto_packet_op_param_t *param, - odp_crypto_generic_session_t *session); - -/** - * Per crypto session data structure - */ -struct odp_crypto_generic_session { - struct odp_crypto_generic_session *next; - - /* Session creation parameters */ - odp_crypto_session_param_t p; - - odp_bool_t do_cipher_first; - - struct { - /* Copy of session IV data */ - uint8_t iv_data[MAX_IV_LEN]; - uint8_t key_data[EVP_MAX_KEY_LENGTH]; - - const EVP_CIPHER *evp_cipher; - crypto_func_t func; - } cipher; - - struct { - uint8_t key[EVP_MAX_KEY_LENGTH]; - uint32_t key_length; - union { - const EVP_MD *evp_md; - const EVP_CIPHER *evp_cipher; - }; - crypto_func_t func; - } auth; -}; - -/** - * Per session creation operation result - */ -typedef struct odp_crypto_generic_session_result { - odp_crypto_ses_create_err_t rc; - odp_crypto_session_t session; -} odp_crypto_generic_session_result_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 69e6d0dad..ea47f1de2 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -89,6 +88,49 @@ static const odp_crypto_auth_capability_t auth_capa_aes_gcm[] = { static const odp_crypto_auth_capability_t auth_capa_aes_gmac[] = { {.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +/** Forward declaration of session structure */ +typedef struct odp_crypto_generic_session_t odp_crypto_generic_session_t; + +/** + * Algorithm handler function prototype + */ +typedef +odp_crypto_alg_err_t (*crypto_func_t)(odp_packet_t pkt, + const odp_crypto_packet_op_param_t *param, + odp_crypto_generic_session_t *session); + +/** + * Per crypto session data structure + */ +struct odp_crypto_generic_session_t { + odp_crypto_generic_session_t *next; + + /* Session creation parameters */ + odp_crypto_session_param_t p; + + odp_bool_t do_cipher_first; + + struct { + /* Copy of session IV data */ + uint8_t iv_data[EVP_MAX_IV_LENGTH]; + uint8_t key_data[EVP_MAX_KEY_LENGTH]; + + const EVP_CIPHER *evp_cipher; + crypto_func_t func; + } cipher; + + struct { + uint8_t key[EVP_MAX_KEY_LENGTH]; + uint32_t key_length; + uint32_t bytes; + union { + const EVP_MD *evp_md; + const EVP_CIPHER *evp_cipher; + }; + crypto_func_t func; + } auth; +}; + typedef struct odp_crypto_global_s odp_crypto_global_t; struct odp_crypto_global_s { @@ -860,7 +902,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, /* Copy parameters */ session->p = *param; - if (session->p.iv.length > MAX_IV_LEN) { + if (session->p.iv.length > EVP_MAX_IV_LENGTH) { ODP_DBG("Maximum IV length exceeded\n"); *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; goto err; From patchwork Tue Dec 26 00:00:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122719 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp346535qgn; Mon, 25 Dec 2017 16:04:24 -0800 (PST) X-Google-Smtp-Source: ACJfBovvfWGyuRbEZkNYb39QImkVDaXWn9EmJ8UUsCPp1Tu6hhtrFV330OGOO/FbDyiwRXtHEVgA X-Received: by 10.55.22.72 with SMTP id g69mr24096qkh.172.1514246664636; Mon, 25 Dec 2017 16:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514246664; cv=none; d=google.com; s=arc-20160816; b=r6+ZarHtOXQT9OgQNJWRy7+Bgg3mf/RHzlurcg5D22L4+nnEoITq2DFtaSP48AIXC7 wycs2Y+Tpvpa6Nh0qjwsP29movBQXLLsjWek1OCkptH8qFovz3puy+pP+CSHsSBF8fHu vSqx13c+krztuaMKh7wU3LrCoCpBhgFS8LIevpTiWQ+QwzeLZD8+jgVGQYvHHAcVGHvZ fSTVTcC8pYKPgqlpmzU9WQSroxrdS0dNj81wYWqHwX3X/drVxSJt5m1ISAbxJfmKLRO+ Do1W1PPA3rBuljwL5EHC1aCzvDa+YhiwFmTxZbuoTvyPJZzMhToS7miYmu69f5PeabK2 b9Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=RJ6Ljp5WVVAOysaH96xquRnXRDWKQ3/JMr9ohqcpilk=; b=FB5v2aFxSiZH/VzJhFcFe1cx0t21fhcA82ZGnaVniniJWM2l7Sd0ht6flrFyy8VwI+ EWsyllrOKHmclR1O2jSZa1MfKlk8FowSQyw9gFetB7+8ujPhQgAb+8G2EipQbIHqnpKO prD3bJAOwwu8hXWWzNTPr3FN45yBE/A27BImRVjSg7YGiCswFkSvmOxTXzYAClKKXyOV zZMFW2fjrOWgY75l7WBnmYqpGCbXCPre0GSjk5GxjsdzagPLGnXF+oSaO/on0If/4OuG iOeYBEGxZR92Dl4CKRDODgOawbEQ0vui5sZudwfJ9GX3slHWyTs12+Rd69I76Fp9lvVH Yfaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 6si6496953qkw.219.2017.12.25.16.04.24; Mon, 25 Dec 2017 16:04:24 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5FD9C608E8; Tue, 26 Dec 2017 00:04:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 58B1B60916; Tue, 26 Dec 2017 00:00:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B198060509; Tue, 26 Dec 2017 00:00:24 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 0EE1260509 for ; Tue, 26 Dec 2017 00:00:18 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 1908C6A835F6 for ; Tue, 26 Dec 2017 03:00:17 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qpu1hfN0aK-0HYGdnkK; Tue, 26 Dec 2017 03:00:17 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id KJPc042sLp-0G4C00wP; Tue, 26 Dec 2017 03:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 26 Dec 2017 03:00:13 +0300 Message-Id: <1514246413-23329-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> References: <1514246413-23329-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 352 Subject: [lng-odp] [PATCH API-NEXT v4 5/5] linux-gen: crypto, ipsec: use auth_iv. X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Separate handling of authentication IV data. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 352 (lumag:crypto_gmac_iv) ** https://github.com/Linaro/odp/pull/352 ** Patch: https://github.com/Linaro/odp/pull/352.patch ** Base sha: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: f8286ad8cd8b0ed8d10af7071eaa5c8cb28520a0 **/ platform/linux-generic/odp_crypto.c | 35 ++++++++++++++++++++++------------ platform/linux-generic/odp_ipsec.c | 6 ++++-- platform/linux-generic/odp_ipsec_sad.c | 2 +- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index ea47f1de2..e3c30e841 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -36,9 +36,7 @@ * Keep sorted: first by key length, then by IV length */ static const odp_crypto_cipher_capability_t cipher_capa_null[] = { -{.key_len = 0, .iv_len = 0}, -/* Special case for GMAC */ -{.key_len = 0, .iv_len = 12} }; +{.key_len = 0, .iv_len = 0} }; static const odp_crypto_cipher_capability_t cipher_capa_trides_cbc[] = { {.key_len = 24, .iv_len = 8} }; @@ -86,7 +84,8 @@ static const odp_crypto_auth_capability_t auth_capa_aes_gcm[] = { {.digest_len = 16, .key_len = 0, .aad_len = {.min = 8, .max = 12, .inc = 4} } }; static const odp_crypto_auth_capability_t auth_capa_aes_gmac[] = { -{.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +{.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0}, + .iv_len = 12 } }; /** Forward declaration of session structure */ typedef struct odp_crypto_generic_session_t odp_crypto_generic_session_t; @@ -121,6 +120,7 @@ struct odp_crypto_generic_session_t { struct { uint8_t key[EVP_MAX_KEY_LENGTH]; + uint8_t iv_data[EVP_MAX_IV_LENGTH]; uint32_t key_length; uint32_t bytes; union { @@ -640,10 +640,10 @@ odp_crypto_alg_err_t aes_gmac_gen(odp_packet_t pkt, uint8_t block[EVP_MAX_MD_SIZE]; int ret; - if (param->override_iv_ptr) - iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) - iv_ptr = session->cipher.iv_data; + if (param->override_auth_iv_ptr) + iv_ptr = param->override_auth_iv_ptr; + else if (session->p.auth_iv.data) + iv_ptr = session->auth.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -679,10 +679,10 @@ odp_crypto_alg_err_t aes_gmac_check(odp_packet_t pkt, uint8_t block[EVP_MAX_MD_SIZE]; int ret; - if (param->override_iv_ptr) - iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) - iv_ptr = session->cipher.iv_data; + if (param->override_auth_iv_ptr) + iv_ptr = param->override_auth_iv_ptr; + else if (session->p.auth_iv.data) + iv_ptr = session->auth.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -908,11 +908,21 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, goto err; } + if (session->p.auth_iv.length > EVP_MAX_IV_LENGTH) { + ODP_DBG("Maximum auth IV length exceeded\n"); + *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; + goto err; + } + /* Copy IV data */ if (session->p.iv.data) memcpy(session->cipher.iv_data, session->p.iv.data, session->p.iv.length); + if (session->p.auth_iv.data) + memcpy(session->auth.iv_data, session->p.auth_iv.data, + session->p.auth_iv.length); + /* Derive order */ if (ODP_CRYPTO_OP_ENCODE == param->op) session->do_cipher_first = param->auth_cipher_text; @@ -1101,6 +1111,7 @@ odp_crypto_operation(odp_crypto_op_param_t *param, packet_param.session = param->session; packet_param.override_iv_ptr = param->override_iv_ptr; + packet_param.override_auth_iv_ptr = param->override_auth_iv_ptr; packet_param.hash_result_offset = param->hash_result_offset; packet_param.aad_ptr = param->aad_ptr; packet_param.cipher_range = param->cipher_range; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index b023d308d..d8c8fc0f0 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -478,6 +478,7 @@ static int ipsec_in_esp(odp_packet_t *pkt, state->in.hdr_len - ipsec_sa->icv_len; param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; state->esp.aad.spi = esp.spi; state->esp.aad.seq_no = esp.seq_no; @@ -560,7 +561,7 @@ static int ipsec_in_ah(odp_packet_t *pkt, return -1; } - param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; state->in.hdr_len = (ah.ah_len + 2) * 4; state->in.trl_len = 0; @@ -1080,6 +1081,7 @@ static int ipsec_out_esp(odp_packet_t *pkt, } param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; memset(&esp, 0, sizeof(esp)); esp.spi = odp_cpu_to_be_32(ipsec_sa->spi); @@ -1229,7 +1231,7 @@ static int ipsec_out_ah(odp_packet_t *pkt, return -1; } - param->override_iv_ptr = state->iv; + param->override_auth_iv_ptr = state->iv; if (odp_packet_extend_head(pkt, hdr_len, NULL, NULL) < 0) { status->error.alg = 1; diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 845a73dea..56a75f3e5 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -409,7 +409,7 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) ipsec_sa->use_counter_iv = 1; ipsec_sa->esp_iv_len = 8; ipsec_sa->esp_block_len = 16; - crypto_param.iv.length = 12; + crypto_param.auth_iv.length = 12; break; default: break;