From patchwork Sat Jan 27 06:00:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126038 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp842235ljd; Fri, 26 Jan 2018 22:04:38 -0800 (PST) X-Google-Smtp-Source: AH8x225kMzxsntUvgSFpD118YHrbX8rZhbLBwMPQBkIf1za0uLIfteUVP/UYsmt6wbDlhjSbv5W2 X-Received: by 10.55.40.41 with SMTP id o41mr24609602qkh.176.1517033077872; Fri, 26 Jan 2018 22:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517033077; cv=none; d=google.com; s=arc-20160816; b=SGgjXbNQF1n4K3fwhnjIcIcYVOD/yWOWSqYKOaE7Cb6s/bso6yl40/Cv03Y5UJjnxb 5MBN7GsbXCnqQ4Vef9cgIabIRNFXY05Ao375JOF1OyMdRlugElEPePfYXuoS+/ilj/xB NcssfDTnM/ajiqPNxK4gCDmExcgOUebyZmu6GL3ymxz/COC1nsydWTSzWfG5QNYkR1H4 sxnXDnRPH4+HZhScUwQiC2xovcTVHgJPc6NbH65p17RnzPl6ANnY/410QzQHjSxASHAA knG2TQK9hnCCD/4+d4NdoB960HL3bNx4f189ZlasbP2iRVaNIroMdsIuEBjGR7jEaECM AlTw== 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=ODbUxtio5CZDNZhBznrqcGbXuWqQlRa+yTA2H3yUMWs=; b=NXz9OGzQ3hNjiYPW6KwoUAqFG47AAHRthfRhFUMGWJUF4vgwc5GjOYmlemMJAIzvJL Lhkul15pPl5nzxuDKrG/kBoDJEtWw1qgALrWt0Fcj0Vt5atEcRh9r1xf2l3M1R7U83HN 4r+0ooOPBMF+vqyNE+plc7Qs4RQ40Z9XmvLrf8peUtfgP7i4NyI7ZGRwa7qriqlptDG6 rK0uB4hnIwzQ19GNY+cLzoGTdvk64DfvBtL/NOdksLuSYj8Z9rcTZAEMZgmkF+3xtCro rNRpdPlOOBDVkW/pBIv2hpbb/lWGsBJGdO6NBp35D/Dfs6BEMeXtDKFj/G5B9zq0I/vX qPTw== 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 e67si2848585qkc.148.2018.01.26.22.04.37; Fri, 26 Jan 2018 22:04: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 8A125617BF; Sat, 27 Jan 2018 06:04: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 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 C4214617DA; Sat, 27 Jan 2018 06:00:50 +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 A10EE617B9; Sat, 27 Jan 2018 06:00:25 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 2BA60616FE for ; Sat, 27 Jan 2018 06:00:18 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward101p.mail.yandex.net (Yandex) with ESMTP id F12066A82E3A for ; Sat, 27 Jan 2018 09:00:16 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Aie5D07zlz-0G3OJuZK; Sat, 27 Jan 2018 09:00:16 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id JSKreAboNf-0GNmTr9m; Sat, 27 Jan 2018 09: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: Sat, 27 Jan 2018 09:00:01 +0300 Message-Id: <1517032810-971-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517032810-971-1-git-send-email-odpbot@yandex.ru> References: <1517032810-971-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 434 Subject: [lng-odp] [PATCH API-NEXT v1 7/16] validation: crypto: use single definitions for AES key lengths 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 Merge defines for AES-CBC/CTR/GCM keys. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 434 (lumag:crypto-upd) ** https://github.com/Linaro/odp/pull/434 ** Patch: https://github.com/Linaro/odp/pull/434.patch ** Base sha: 0bdad6d2562166eec4abeb957b6bb5067de9fe94 ** Merge commit sha: 8cc286211b098976aafc39992f510742cefc7118 **/ test/validation/api/crypto/test_vectors.h | 32 +++++++++++------------ test/validation/api/crypto/test_vectors_len.h | 37 +++++++-------------------- 2 files changed, 25 insertions(+), 44 deletions(-) diff --git a/test/validation/api/crypto/test_vectors.h b/test/validation/api/crypto/test_vectors.h index 9c0b844d1..ff69717db 100644 --- a/test/validation/api/crypto/test_vectors.h +++ b/test/validation/api/crypto/test_vectors.h @@ -74,7 +74,7 @@ static crypto_test_reference_t tdes_cbc_reference[] = { static crypto_test_reference_t aes_cbc_reference[] = { { - .cipher_key_length = AES128_CBC_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b, 0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06}, .cipher_iv_length = AES_CBC_IV_LEN, @@ -86,7 +86,7 @@ static crypto_test_reference_t aes_cbc_reference[] = { 0x27, 0x08, 0x94, 0x2d, 0xbe, 0x77, 0x18, 0x1a } }, { - .cipher_key_length = AES128_CBC_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0, 0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a}, .cipher_iv_length = AES_CBC_IV_LEN, @@ -103,7 +103,7 @@ static crypto_test_reference_t aes_cbc_reference[] = { 0x1b, 0x82, 0x66, 0xbe, 0xa6, 0xd6, 0x1a, 0xb1 } }, { - .cipher_key_length = AES128_CBC_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x6c, 0x3e, 0xa0, 0x47, 0x76, 0x30, 0xce, 0x21, 0xa2, 0xce, 0x33, 0x4a, 0xa7, 0x46, 0xc2, 0xcd}, .cipher_iv_length = AES_CBC_IV_LEN, @@ -119,7 +119,7 @@ static crypto_test_reference_t aes_cbc_reference[] = { 0x85, 0x79, 0x69, 0x5d, 0x83, 0xba, 0x26, 0x84 } }, { - .cipher_key_length = AES128_CBC_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x56, 0xe4, 0x7a, 0x38, 0xc5, 0x59, 0x89, 0x74, 0xbc, 0x46, 0x90, 0x3d, 0xba, 0x29, 0x03, 0x49}, .cipher_iv_length = AES_CBC_IV_LEN, @@ -144,7 +144,7 @@ static crypto_test_reference_t aes_cbc_reference[] = { 0x49, 0xa5, 0x3e, 0x87, 0xf4, 0xc3, 0xda, 0x55 } }, { - .cipher_key_length = AES192_CBC_KEY_LEN, + .cipher_key_length = AES192_KEY_LEN, .cipher_key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c}, @@ -162,7 +162,7 @@ static crypto_test_reference_t aes_cbc_reference[] = { 0x53, 0x1c, 0xc6, 0x98, 0x85, 0xc3, 0x00, 0xe6}, }, { - .cipher_key_length = AES256_CBC_KEY_LEN, + .cipher_key_length = AES256_KEY_LEN, .cipher_key = { 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23, @@ -188,7 +188,7 @@ static crypto_test_reference_t aes_cbc_reference[] = { static crypto_test_reference_t aes_ctr_reference[] = { { - .cipher_key_length = AES128_CTR_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}, .cipher_iv_length = AES_CTR_IV_LEN, @@ -213,7 +213,7 @@ static crypto_test_reference_t aes_ctr_reference[] = { 0x79, 0x21, 0x70, 0xa0, 0xf3, 0x00, 0x9c, 0xee } }, { - .cipher_key_length = AES192_CTR_KEY_LEN, + .cipher_key_length = AES192_KEY_LEN, .cipher_key = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b}, @@ -239,7 +239,7 @@ static crypto_test_reference_t aes_ctr_reference[] = { 0x5a, 0x97, 0xda, 0xec, 0x58, 0xc6, 0xb0, 0x50 } }, { - .cipher_key_length = AES256_CTR_KEY_LEN, + .cipher_key_length = AES256_KEY_LEN, .cipher_key = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, @@ -272,7 +272,7 @@ static crypto_test_reference_t aes_ctr_reference[] = { */ static crypto_test_reference_t aes_gcm_reference[] = { { - .cipher_key_length = AES128_GCM_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34}, .cipher_iv_length = AES_GCM_IV_LEN, @@ -305,7 +305,7 @@ static crypto_test_reference_t aes_gcm_reference[] = { 0x2f, 0xd0, 0x47, 0x96, 0x56, 0x2d, 0xfd, 0xb4 } }, { - .cipher_key_length = AES128_GCM_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08}, .cipher_iv_length = AES_GCM_IV_LEN, @@ -335,7 +335,7 @@ static crypto_test_reference_t aes_gcm_reference[] = { 0xc3, 0x09, 0xe9, 0xd8, 0x5a, 0x41, 0xad, 0x4a } }, { - .cipher_key_length = AES128_GCM_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, .cipher_iv_length = AES_GCM_IV_LEN, @@ -365,7 +365,7 @@ static crypto_test_reference_t aes_gcm_reference[] = { 0x8a, 0xd2, 0xb6, 0x9e, 0x47, 0x99, 0xc7, 0x1d } }, { - .cipher_key_length = AES128_GCM_KEY_LEN, + .cipher_key_length = AES128_KEY_LEN, .cipher_key = { 0x3d, 0xe0, 0x98, 0x74, 0xb3, 0x88, 0xe6, 0x49, 0x19, 0x88, 0xd0, 0xc3, 0x60, 0x7e, 0xae, 0x1f}, .cipher_iv_length = AES_GCM_IV_LEN, @@ -388,7 +388,7 @@ static crypto_test_reference_t aes_gcm_reference[] = { 0x95, 0xf1, 0x12, 0xe4, 0xe7, 0xd0, 0x5d, 0x35 } }, { - .cipher_key_length = AES192_GCM_KEY_LEN, + .cipher_key_length = AES192_KEY_LEN, .cipher_key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c}, @@ -413,7 +413,7 @@ static crypto_test_reference_t aes_gcm_reference[] = { 0x18, 0x02, 0x7b, 0x5b, 0x4c, 0xd7, 0xa6, 0x36 } }, { - .cipher_key_length = AES256_GCM_KEY_LEN, + .cipher_key_length = AES256_KEY_LEN, .cipher_key = { 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23, @@ -446,7 +446,7 @@ static crypto_test_reference_t aes_gcm_reference[] = { static crypto_test_reference_t aes_gmac_reference[] = { { - .auth_key_length = AES128_GCM_KEY_LEN, + .auth_key_length = AES128_KEY_LEN, .auth_key = { 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34}, .auth_iv_length = AES_GCM_IV_LEN, diff --git a/test/validation/api/crypto/test_vectors_len.h b/test/validation/api/crypto/test_vectors_len.h index 2551b054c..8933017b4 100644 --- a/test/validation/api/crypto/test_vectors_len.h +++ b/test/validation/api/crypto/test_vectors_len.h @@ -17,43 +17,24 @@ #define TDES_CBC_KEY_LEN 24 #define TDES_CBC_IV_LEN 8 -/* AES-CBC common */ -#define AES_CBC_IV_LEN 16 - -/* AES128-CBC */ -#define AES128_CBC_KEY_LEN 16 +/* AES common */ -/* AES192-CBC */ -#define AES192_CBC_KEY_LEN 24 +#define AES128_KEY_LEN 16 -/* AES256-CBC */ -#define AES256_CBC_KEY_LEN 32 +#define AES192_KEY_LEN 24 -/* AES-CBC common */ -#define AES_CTR_IV_LEN 16 +#define AES256_KEY_LEN 32 -/* AES128-CTR */ -#define AES128_CTR_KEY_LEN 16 - -/* AES192-CTR */ -#define AES192_CTR_KEY_LEN 24 +/* AES-CBC */ +#define AES_CBC_IV_LEN 16 -/* AES256-CTR */ -#define AES256_CTR_KEY_LEN 32 +/* AES-CTR */ +#define AES_CTR_IV_LEN 16 -/* AES-GCM common */ +/* AES-GCM */ #define AES_GCM_IV_LEN 12 #define AES_GCM_DIGEST_LEN 16 -/* AES128-GCM */ -#define AES128_GCM_KEY_LEN 16 - -/* AES192-GCM */ -#define AES192_GCM_KEY_LEN 24 - -/* AES256-GCM */ -#define AES256_GCM_KEY_LEN 32 - /* HMAC-MD5 */ #define HMAC_MD5_KEY_LEN 16 #define HMAC_MD5_96_CHECK_LEN 12