From patchwork Sun May 28 14:40:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 100615 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1063208qge; Sun, 28 May 2017 07:41:24 -0700 (PDT) X-Received: by 10.98.153.4 with SMTP id d4mr12960168pfe.223.1495982483987; Sun, 28 May 2017 07:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495982483; cv=none; d=google.com; s=arc-20160816; b=SRIeYJfD3F6p7atPOGaHrA/JKcySo+sFg4GNDImNjbam5yAlqp+9iMOw4/iXptiAMI hg1tqPYUb6QCbMyVE7O53ENG7pQpgZ4UHz2o1CEJ+Nh008QluQ194PwtRVNRsfk6GXtK P3OQ7eG6EobqlpqL06sum8TjcLM0WjUR3GJuMAXMN+8UKKr5PPmCz+2VmoeWIZzRL7LH zLlo/ZzVp2K/MTXmroLdR/iVBioFp4kXj9EzmSyWLHtnUUQ23E7peTSYeMLmAoiQ60aq vWd9B2555tZDFqBbE5UFWJoR27Fsa1nbjZFwUxObzJIxPYCDWpULCyN7HcT+KLrrrH0d zh2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=iFI4L4wF5Y8HpWAuZUlvRXc1ScNeOVLWXx0atm2y7N0=; b=KsvD8p9qMCq3X4yCJG50gW1AlDpAuAKd/spEDNpvJHeHP9JEbkJWJFqKA/XGByE5Q0 El199PB3kWSAluSW9etRyRtYJpZe97LhZwfBILuJnYrMJpAuMBXjS+l+5Fk1EjW98SKD iDCZwc8QVBAO3E7FE+xMXCuKo4GlPHMoz+K4RES2gox+cGVqbEM4J/lEJWABVUmJmIiG iE13Bl4ND8tvf5I2++xmFnByaOCIIl8bfmhsf4rPPEnaT7B/YsZ+c7En0IUya0tOIWBz 2EQrj4+PN6UrHPTnj3JebdlTnp+iIUj6TJzdMsKJCzT5Qsea2/TkN3IqHJBTajIwMXIa NGiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h83si7521621pfk.207.2017.05.28.07.41.23; Sun, 28 May 2017 07:41:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750891AbdE1Okz (ORCPT + 1 other); Sun, 28 May 2017 10:40:55 -0400 Received: from foss.arm.com ([217.140.101.70]:42086 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbdE1Okx (ORCPT ); Sun, 28 May 2017 10:40:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 96C77344; Sun, 28 May 2017 07:40:52 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB8DD3F52A; Sun, 28 May 2017 07:40:50 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 01/12] staging: ccree: correct coding style violations Date: Sun, 28 May 2017 17:40:26 +0300 Message-Id: <1495982440-10047-2-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495982440-10047-1-git-send-email-gilad@benyossef.com> References: <1495982440-10047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org cc_crypto_ctx.h had multiple coding style violations reported by checkpatch. Fix them all. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 66 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 34 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/cc_crypto_ctx.h b/drivers/staging/ccree/cc_crypto_ctx.h index ac39d34..0823b0f 100644 --- a/drivers/staging/ccree/cc_crypto_ctx.h +++ b/drivers/staging/ccree/cc_crypto_ctx.h @@ -14,7 +14,6 @@ * along with this program; if not, see . */ - #ifndef _CC_CRYPTO_CTX_H_ #define _CC_CRYPTO_CTX_H_ @@ -28,7 +27,7 @@ #define CC_CTX_SIZE_LOG2 7 #endif #endif -#define CC_CTX_SIZE (1<> 2) #define CC_DRV_DES_IV_SIZE 8 @@ -54,13 +53,13 @@ #define CC_AES_KEY_SIZE_MAX CC_AES_256_BIT_KEY_SIZE #define CC_AES_KEY_SIZE_WORDS_MAX (CC_AES_KEY_SIZE_MAX >> 2) -#define CC_MD5_DIGEST_SIZE 16 -#define CC_SHA1_DIGEST_SIZE 20 -#define CC_SHA224_DIGEST_SIZE 28 -#define CC_SHA256_DIGEST_SIZE 32 +#define CC_MD5_DIGEST_SIZE 16 +#define CC_SHA1_DIGEST_SIZE 20 +#define CC_SHA224_DIGEST_SIZE 28 +#define CC_SHA256_DIGEST_SIZE 32 #define CC_SHA256_DIGEST_SIZE_IN_WORDS 8 -#define CC_SHA384_DIGEST_SIZE 48 -#define CC_SHA512_DIGEST_SIZE 64 +#define CC_SHA384_DIGEST_SIZE 48 +#define CC_SHA512_DIGEST_SIZE 64 #define CC_SHA1_BLOCK_SIZE 64 #define CC_SHA1_BLOCK_SIZE_IN_WORDS 16 @@ -83,18 +82,17 @@ #define CC_HMAC_BLOCK_SIZE_MAX CC_HASH_BLOCK_SIZE_MAX -#define CC_MULTI2_SYSTEM_KEY_SIZE 32 -#define CC_MULTI2_DATA_KEY_SIZE 8 -#define CC_MULTI2_SYSTEM_N_DATA_KEY_SIZE (CC_MULTI2_SYSTEM_KEY_SIZE + CC_MULTI2_DATA_KEY_SIZE) -#define CC_MULTI2_BLOCK_SIZE 8 -#define CC_MULTI2_IV_SIZE 8 -#define CC_MULTI2_MIN_NUM_ROUNDS 8 -#define CC_MULTI2_MAX_NUM_ROUNDS 128 - +#define CC_MULTI2_SYSTEM_KEY_SIZE 32 +#define CC_MULTI2_DATA_KEY_SIZE 8 +#define CC_MULTI2_SYSTEM_N_DATA_KEY_SIZE (CC_MULTI2_SYSTEM_KEY_SIZE + \ + CC_MULTI2_DATA_KEY_SIZE) +#define CC_MULTI2_BLOCK_SIZE 8 +#define CC_MULTI2_IV_SIZE 8 +#define CC_MULTI2_MIN_NUM_ROUND 8 +#define CC_MULTI2_MAX_NUM_ROUND 128 #define CC_DRV_ALG_MAX_BLOCK_SIZE CC_HASH_BLOCK_SIZE_MAX - enum drv_engine_type { DRV_ENGINE_NULL = 0, DRV_ENGINE_AES = 1, @@ -178,7 +176,6 @@ enum drv_multi2_mode { DRV_MULTI2_RESERVE32B = S32_MAX }; - /* drv_crypto_key_type[1:0] is mapped to cipher_do[1:0] */ /* drv_crypto_key_type[2] is mapped to cipher_config2 */ enum drv_crypto_key_type { @@ -208,7 +205,6 @@ struct drv_ctx_generic { enum drv_crypto_alg alg; } __attribute__((__may_alias__)); - struct drv_ctx_hash { enum drv_crypto_alg alg; /* DRV_CRYPTO_ALG_HASH */ enum drv_hash_mode mode; @@ -218,13 +214,14 @@ struct drv_ctx_hash { CC_DIGEST_SIZE_MAX]; }; -/* !!!! drv_ctx_hmac should have the same structure as drv_ctx_hash except - k0, k0_size fields */ +/* NOTE! drv_ctx_hmac should have the same structure as drv_ctx_hash except + * k0, k0_size fields + */ struct drv_ctx_hmac { enum drv_crypto_alg alg; /* DRV_CRYPTO_ALG_HMAC */ enum drv_hash_mode mode; u8 digest[CC_DIGEST_SIZE_MAX]; - u32 k0[CC_HMAC_BLOCK_SIZE_MAX/sizeof(u32)]; + u32 k0[CC_HMAC_BLOCK_SIZE_MAX / sizeof(u32)]; u32 k0_size; /* reserve to end of allocated context size */ u8 reserved[CC_CTX_SIZE - 3 * sizeof(u32) - @@ -240,16 +237,17 @@ struct drv_ctx_cipher { u32 key_size; /* numeric value in bytes */ u32 data_unit_size; /* required for XTS */ /* block_state is the AES engine block state. - * It is used by the host to pass IV or counter at initialization. - * It is used by SeP for intermediate block chaining state and for - * returning MAC algorithms results. */ + * It is used by the host to pass IV or counter at initialization. + * It is used by SeP for intermediate block chaining state and for + * returning MAC algorithms results. + */ u8 block_state[CC_AES_BLOCK_SIZE]; u8 key[CC_AES_KEY_SIZE_MAX]; u8 xex_key[CC_AES_KEY_SIZE_MAX]; /* reserve to end of allocated context size */ u32 reserved[CC_DRV_CTX_SIZE_WORDS - 7 - - CC_AES_BLOCK_SIZE/sizeof(u32) - 2 * - (CC_AES_KEY_SIZE_MAX/sizeof(u32))]; + CC_AES_BLOCK_SIZE / sizeof(u32) - 2 * + (CC_AES_KEY_SIZE_MAX / sizeof(u32))]; }; /* authentication and encryption with associated data class */ @@ -269,20 +267,20 @@ struct drv_ctx_aead { u8 key[CC_AES_KEY_SIZE_MAX]; /* reserve to end of allocated context size */ u32 reserved[CC_DRV_CTX_SIZE_WORDS - 8 - - 3 * (CC_AES_BLOCK_SIZE/sizeof(u32)) - - CC_AES_KEY_SIZE_MAX/sizeof(u32)]; + 3 * (CC_AES_BLOCK_SIZE / sizeof(u32)) - + CC_AES_KEY_SIZE_MAX / sizeof(u32)]; }; /*******************************************************************/ /***************** MESSAGE BASED CONTEXTS **************************/ /*******************************************************************/ - /* Get the address of a @member within a given @ctx address - @ctx: The context address - @type: Type of context structure - @member: Associated context field */ -#define GET_CTX_FIELD_ADDR(ctx, type, member) (ctx + offsetof(type, member)) + * @ctx: The context address + * @type: Type of context structure + * @member: Associated context field + */ +#define GET_CTX_FIELD_ADDR(ctx, type, member) ((ctx) + offsetof(type, member)) #endif /* _CC_CRYPTO_CTX_H_ */ From patchwork Sun May 28 14:40:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 100619 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1063417qge; Sun, 28 May 2017 07:42:01 -0700 (PDT) X-Received: by 10.99.175.18 with SMTP id w18mr13771626pge.183.1495982520934; Sun, 28 May 2017 07:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495982520; cv=none; d=google.com; s=arc-20160816; b=U4b+IlGpqcOng7omvuAGjuu6GWTckVa4puKg/aNh8njrqG+h+KZAYsfLOgPn9u/bKH M2RWQKfLajhGFfDHvNpVwtzPtinlbk1J6q0OhOaNKiF6Re+mwqwq6A6LSKtiOYQU7wF8 XD63QR9NFC0n4oxA0208GaKJl6NrA5Rrwx3klm2tbY8D34TWOioC7k1Nl+iIZffzlpt1 3TllypI4NbKipbQH+riyf2mol0Np4o+9Qpj0xoa+TZ0Z2r282Fa5ldWgftodIkyUoNZY smaRm6cEKVDcm2GfHzlu6Bdu5cecZdSnH3HDCVWxsmPs/s/oLGr4hw6+X1SYhgsMuAMq RlLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=jr35bArraOZB5qk0heRaxa6iJ01WN8YI/CbS1OLlluc=; b=gZlM+632sNWtCMKl5hJi6XaE1rRA3k3I95osjJJZjLQ3mwsLsY+dDMoB+OjaNauUBs 82Qoebu0K00jguoN+uNgr934ia/BCeBca+ohXoOji6koChQoIdRNgN2gdbdZBECK8ui3 bqQ/Y0GqM9RfPwtdeMMt3cwSDBvTXW6SxDxzWzQQwEraAVA6qLZyhuludCMpXQZND+2J enZWRSuBhFL2/Ht2MvMeZUfFR87bLcYcCohlpNkHfIoxeUyiMXgzxnOwxI8lmSQiWAs5 vxQV0SEV/6rjsEGQoz+m/CCS27twuzbJYyXlu4x5IjBAjpT8QQr3rH3l5o0AC5gptPFj Yrsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si7135782pfh.193.2017.05.28.07.42.00; Sun, 28 May 2017 07:42:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbdE1Ol3 (ORCPT + 1 other); Sun, 28 May 2017 10:41:29 -0400 Received: from foss.arm.com ([217.140.101.70]:42156 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbdE1Ol1 (ORCPT ); Sun, 28 May 2017 10:41:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 27F3F15BE; Sun, 28 May 2017 07:41:27 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5BDAD3F52A; Sun, 28 May 2017 07:41:25 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 08/12] staging: ccree: remove unused struct Date: Sun, 28 May 2017 17:40:33 +0300 Message-Id: <1495982440-10047-9-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495982440-10047-1-git-send-email-gilad@benyossef.com> References: <1495982440-10047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org struct SepHashPrivateContext is not used anywhere in the code. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/hash_defs.h | 17 ----------------- 1 file changed, 17 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/hash_defs.h b/drivers/staging/ccree/hash_defs.h index 6138970..9e01219 100644 --- a/drivers/staging/ccree/hash_defs.h +++ b/drivers/staging/ccree/hash_defs.h @@ -57,22 +57,5 @@ enum HashCipherDoPadding { HASH_CIPHER_DO_PADDING_RESERVE32 = S32_MAX, }; -typedef struct SepHashPrivateContext { - /* The current length is placed at the end of the context buffer because the hash - context is used for all HMAC operations as well. HMAC context includes a 64 bytes - K0 field. The size of struct drv_ctx_hash reserved field is 88/184 bytes depend if t - he SHA512 is supported ( in this case teh context size is 256 bytes). - The size of struct drv_ctx_hash reseved field is 20 or 52 depend if the SHA512 is supported. - This means that this structure size (without the reserved field can be up to 20 bytes , - in case sha512 is not suppported it is 20 bytes (SEP_HASH_LENGTH_WORDS define to 2 ) and in the other - case it is 28 (SEP_HASH_LENGTH_WORDS define to 4) */ - u32 reserved[(sizeof(struct drv_ctx_hash)/sizeof(u32)) - SEP_HASH_LENGTH_WORDS - 3]; - u32 CurrentDigestedLength[SEP_HASH_LENGTH_WORDS]; - u32 KeyType; - u32 dataCompleted; - u32 hmacFinalization; - /* no space left */ -} SepHashPrivateContext_s; - #endif /*_HASH_DEFS_H__*/ From patchwork Sun May 28 14:40:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 100623 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1063727qge; Sun, 28 May 2017 07:42:48 -0700 (PDT) X-Received: by 10.101.86.67 with SMTP id m3mr13632032pgs.137.1495982568720; Sun, 28 May 2017 07:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495982568; cv=none; d=google.com; s=arc-20160816; b=ftwcMlYcFovq7H7RS79krGG9CH4jjmVivcEDHcd3qL02YBrQuUq76gRPVDnMchZlOG yLF5q27e1KHFheFHG0knOQoC+T4L52xgV6Q7CfR4LttpH8woyMy0XSLGmDVm19rUFj6o wakIayNxmFxEwN7DE7cRJb3lQ062aBEs+0sOUpsf20gBxooZFFI+hlIcqFsQFOseWe/h qoZ+454zWo18SqAaGyGWGLfF5xUVOS4ybKRAG0UOOwBXAF6FM2BKiDRlLnmUe7U85dU6 w1AL/kD4B4pDq+Ocu+VOfhqCzbAwEzrjWm4tjGlOKPqz6mGydPaWsmskkDqfLqDI/juE EYLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=U1qnvl6V0OpVPU1cw2fqfrDE/IfjXMF5XMAlEt05DRM=; b=K/2UFOEtKKwU0lIycxBMWhc1wwSk6424KYOekKgysI8NaP4OJ2hAXbPwYQ+Vtt3wsa fRf8h3vFQpmO1OOcFztTVtWCLJdRp/yZdKFs3cOG0ehjn+H9xwYPRCMlZLy4ucVoiEui iQpr3JBSD7n7SNG8RJK/gecOVxVdNuLtcPenPaSNgnz5VHYA6sxkBOKZBXneust4fNK0 hTZ6jeR8/OBOMyBd6aUP7f9ZHpWR9jy5hdtR09mJqNHJNWHAM9xGOlSQN1xbU91YuhEA P7c5aYHXMLhXT2FeDACiTaaRxgCgXG73cTzesKtOz7XYwcm+w2OkTfkn+CtBC0gWjQ68 mDqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h68si7226258pfc.414.2017.05.28.07.42.48; Sun, 28 May 2017 07:42:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750992AbdE1OmX (ORCPT + 1 other); Sun, 28 May 2017 10:42:23 -0400 Received: from foss.arm.com ([217.140.101.70]:42168 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbdE1Olm (ORCPT ); Sun, 28 May 2017 10:41:42 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F0825344; Sun, 28 May 2017 07:41:31 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2FAE23F52A; Sun, 28 May 2017 07:41:29 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 09/12] staging: ccree: use snake_case for hash enums Date: Sun, 28 May 2017 17:40:34 +0300 Message-Id: <1495982440-10047-10-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495982440-10047-1-git-send-email-gilad@benyossef.com> References: <1495982440-10047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hash enum were named using CamelCase, move over to snake_case. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 4 ++-- drivers/staging/ccree/hash_defs.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/drivers/staging/ccree/cc_hw_queue_defs.h index adc9e31..ec2113a 100644 --- a/drivers/staging/ccree/cc_hw_queue_defs.h +++ b/drivers/staging/ccree/cc_hw_queue_defs.h @@ -505,7 +505,7 @@ static inline void set_cipher_config0(struct cc_hw_desc *pdesc, * @config: Any one of the modes defined in [CC7x-DESC] */ static inline void set_cipher_config1(struct cc_hw_desc *pdesc, - enum HashConfig1Padding config) + enum cc_hash_conf_pad config) { pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_CONF1, config); } @@ -598,7 +598,7 @@ static inline void set_setup_mode(struct cc_hw_desc *pdesc, * @config: Any one of the cipher do defined in [CC7x-DESC] */ static inline void set_cipher_do(struct cc_hw_desc *pdesc, - enum HashCipherDoPadding config) + enum cc_hash_cipher_pad config) { pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_DO, (config & HW_KEY_MASK_CIPHER_DO)); diff --git a/drivers/staging/ccree/hash_defs.h b/drivers/staging/ccree/hash_defs.h index 9e01219..872ed97 100644 --- a/drivers/staging/ccree/hash_defs.h +++ b/drivers/staging/ccree/hash_defs.h @@ -44,14 +44,14 @@ #define HASH_LARVAL_SHA512 0x5be0cd19, 0x137e2179, 0x1f83d9ab, 0xfb41bd6b, 0x9b05688c, 0x2b3e6c1f, 0x510e527f, 0xade682d1, 0xa54ff53a, 0x5f1d36f1, 0x3c6ef372, 0xfe94f82b, 0xbb67ae85, 0x84caa73b, 0x6a09e667, 0xf3bcc908 #endif -enum HashConfig1Padding { +enum cc_hash_conf_pad { HASH_PADDING_DISABLED = 0, HASH_PADDING_ENABLED = 1, HASH_DIGEST_RESULT_LITTLE_ENDIAN = 2, HASH_CONFIG1_PADDING_RESERVE32 = S32_MAX, }; -enum HashCipherDoPadding { +enum cc_hash_cipher_pad { DO_NOT_PAD = 0, DO_PAD = 1, HASH_CIPHER_DO_PADDING_RESERVE32 = S32_MAX, From patchwork Sun May 28 14:40:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 100621 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1063431qge; Sun, 28 May 2017 07:42:02 -0700 (PDT) X-Received: by 10.99.120.202 with SMTP id t193mr13960879pgc.35.1495982522042; Sun, 28 May 2017 07:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495982522; cv=none; d=google.com; s=arc-20160816; b=f+n0gta/JIua967EBtRAwK0OuvMD2iID7u/Py7+jjY7bfAYAPCNPVA/cvGE7Mpgqn7 k940fGv9JGrEGDkWrb0pFNntbQzThPo88Qa73Ho/ntTA6vsSAuKv6QgHb9f3IursT1vT vPQDtS18D0K/4HKY5j6af5rx88h4Jt/5IZwd0RV+Dksb6dENvcU3P+nlEIuPvDZzSGG8 h+maJHpBV3c0wSyKvPr+dagodMA6VjSUk2mKEmPGOZSRgg6S5rit4YDD0oILxuNPwJnk P0BBOiDfrj9D+foww8D6HFGj7aWViQk0T6AnFJi+r0uh8V/wFcJPYF9aMX9eF9Shkq87 B1og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=6sFtd3nc2hFtjDUTctWA5p0zH1zBHgNnY8YLE70vMTw=; b=IQlKlGg7DrC2vR885B7fnTQccloXDEpwn3/DAMHl07UZPtilKf2kWECi6gPi6hbtIR eKtT6EFfdiuP4R+iBbntciWZUVLgcCSo5KdPX1WSEaJOQgEX9pD2fHMpzkl7pDSgo8/3 WIqDT3bgfmtjKSQx9FQFrwmR3gsKsw819YCnE5ULSBo/+t8qHkm3aHGizLGMSXdj1FM0 CyMxw/KDRnT4ne82Czr+9kIx+XZdlSTo5PpuXDpkT14U6YdTvw2pZWFvphB60/cewMbj 2ukL3u3f1wV6DD3sl3jTCQ9QlJIScBdw5iFh3ULOfh5/h7WCCd/PLmm8SjyEHbR10QGL aFGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si7135782pfh.193.2017.05.28.07.42.01; Sun, 28 May 2017 07:42:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750996AbdE1Olx (ORCPT + 1 other); Sun, 28 May 2017 10:41:53 -0400 Received: from foss.arm.com ([217.140.101.70]:42186 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbdE1Olw (ORCPT ); Sun, 28 May 2017 10:41:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5FBB15BF; Sun, 28 May 2017 07:41:41 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07CBE3F52A; Sun, 28 May 2017 07:41:39 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 11/12] staging: ccree: remove dead code Date: Sun, 28 May 2017 17:40:36 +0300 Message-Id: <1495982440-10047-12-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495982440-10047-1-git-send-email-gilad@benyossef.com> References: <1495982440-10047-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Remove some unused macro definitions from hash definitions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/hash_defs.h | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) -- 2.1.4 diff --git a/drivers/staging/ccree/hash_defs.h b/drivers/staging/ccree/hash_defs.h index 872ed97..f52656f 100644 --- a/drivers/staging/ccree/hash_defs.h +++ b/drivers/staging/ccree/hash_defs.h @@ -14,36 +14,11 @@ * along with this program; if not, see . */ -#ifndef _HASH_DEFS_H__ -#define _HASH_DEFS_H__ +#ifndef _HASH_DEFS_H_ +#define _HASH_DEFS_H_ #include "cc_crypto_ctx.h" -/* this files provides definitions required for hash engine drivers */ -#ifndef CC_CONFIG_HASH_SHA_512_SUPPORTED -#define SEP_HASH_LENGTH_WORDS 2 -#else -#define SEP_HASH_LENGTH_WORDS 4 -#endif - -#ifdef BIG__ENDIAN -#define OPAD_CURRENT_LENGTH 0x40000000, 0x00000000 , 0x00000000, 0x00000000 -#define HASH_LARVAL_MD5 0x76543210, 0xFEDCBA98, 0x89ABCDEF, 0x01234567 -#define HASH_LARVAL_SHA1 0xF0E1D2C3, 0x76543210, 0xFEDCBA98, 0x89ABCDEF, 0x01234567 -#define HASH_LARVAL_SHA224 0XA44FFABE, 0XA78FF964, 0X11155868, 0X310BC0FF, 0X39590EF7, 0X17DD7030, 0X07D57C36, 0XD89E05C1 -#define HASH_LARVAL_SHA256 0X19CDE05B, 0XABD9831F, 0X8C68059B, 0X7F520E51, 0X3AF54FA5, 0X72F36E3C, 0X85AE67BB, 0X67E6096A -#define HASH_LARVAL_SHA384 0X1D48B547, 0XA44FFABE, 0X0D2E0CDB, 0XA78FF964, 0X874AB48E, 0X11155868, 0X67263367, 0X310BC0FF, 0XD8EC2F15, 0X39590EF7, 0X5A015991, 0X17DD7030, 0X2A299A62, 0X07D57C36, 0X5D9DBBCB, 0XD89E05C1 -#define HASH_LARVAL_SHA512 0X19CDE05B, 0X79217E13, 0XABD9831F, 0X6BBD41FB, 0X8C68059B, 0X1F6C3E2B, 0X7F520E51, 0XD182E6AD, 0X3AF54FA5, 0XF1361D5F, 0X72F36E3C, 0X2BF894FE, 0X85AE67BB, 0X3BA7CA84, 0X67E6096A, 0X08C9BCF3 -#else -#define OPAD_CURRENT_LENGTH 0x00000040, 0x00000000, 0x00000000, 0x00000000 -#define HASH_LARVAL_MD5 0x10325476, 0x98BADCFE, 0xEFCDAB89, 0x67452301 -#define HASH_LARVAL_SHA1 0xC3D2E1F0, 0x10325476, 0x98BADCFE, 0xEFCDAB89, 0x67452301 -#define HASH_LARVAL_SHA224 0xbefa4fa4, 0x64f98fa7, 0x68581511, 0xffc00b31, 0xf70e5939, 0x3070dd17, 0x367cd507, 0xc1059ed8 -#define HASH_LARVAL_SHA256 0x5be0cd19, 0x1f83d9ab, 0x9b05688c, 0x510e527f, 0xa54ff53a, 0x3c6ef372, 0xbb67ae85, 0x6a09e667 -#define HASH_LARVAL_SHA384 0X47B5481D, 0XBEFA4FA4, 0XDB0C2E0D, 0X64F98FA7, 0X8EB44A87, 0X68581511, 0X67332667, 0XFFC00B31, 0X152FECD8, 0XF70E5939, 0X9159015A, 0X3070DD17, 0X629A292A, 0X367CD507, 0XCBBB9D5D, 0XC1059ED8 -#define HASH_LARVAL_SHA512 0x5be0cd19, 0x137e2179, 0x1f83d9ab, 0xfb41bd6b, 0x9b05688c, 0x2b3e6c1f, 0x510e527f, 0xade682d1, 0xa54ff53a, 0x5f1d36f1, 0x3c6ef372, 0xfe94f82b, 0xbb67ae85, 0x84caa73b, 0x6a09e667, 0xf3bcc908 -#endif - enum cc_hash_conf_pad { HASH_PADDING_DISABLED = 0, HASH_PADDING_ENABLED = 1, @@ -57,5 +32,5 @@ enum cc_hash_cipher_pad { HASH_CIPHER_DO_PADDING_RESERVE32 = S32_MAX, }; -#endif /*_HASH_DEFS_H__*/ +#endif /*_HASH_DEFS_H_*/