Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbbGBIBH (ORCPT ); Thu, 2 Jul 2015 04:01:07 -0400 Received: from mail.eperm.de ([89.247.134.16]:47880 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395AbbGBIBB (ORCPT ); Thu, 2 Jul 2015 04:01:01 -0400 From: Stephan Mueller To: Lokesh Vutla Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, davem@davemloft.net, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, t-kristo@ti.com, nsekhar@ti.com Subject: Re: [PATCH 08/10] crypto: omap-aes: gmc: Add algo info Date: Thu, 02 Jul 2015 10:00:52 +0200 Message-ID: <1996807.vhgJsDVnGm@tauon.atsec.com> User-Agent: KMail/4.14.9 (Linux/4.0.6-300.fc22.x86_64; KDE/4.14.9; x86_64; ; ) In-Reply-To: <1435814320-30347-9-git-send-email-lokeshvutla@ti.com> References: <1435814320-30347-1-git-send-email-lokeshvutla@ti.com> <1435814320-30347-9-git-send-email-lokeshvutla@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2036 Lines: 64 Am Donnerstag, 2. Juli 2015, 10:48:38 schrieb Lokesh Vutla: Hi Lokesh, >Now the driver supports gcm mode, add omap-aes-gcm >algo info to omap-aes driver. > >Signed-off-by: Lokesh Vutla >--- > drivers/crypto/omap-aes.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > >diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c >index e5e9a19..11f3850 100644 >--- a/drivers/crypto/omap-aes.c >+++ b/drivers/crypto/omap-aes.c >@@ -789,6 +789,28 @@ static struct crypto_alg algs_ctr[] = { > .decrypt = omap_aes_ctr_decrypt, > } > }, >+{ >+ .cra_name = "gcm(aes)", >+ .cra_driver_name = "gcm-aes-omap", >+ .cra_priority = 100, Why did you choose the priority 100? The software implementations commonly use 100. crypto/gcm.c uses the prio of the underlying cipher. In case of ARM, there seem to be assembler implementations of AES which have the prio of 200 or 300. So, such software implementation of gcm(aes) would have a higher precedence than your hw implementation. So, if a user would use gcm(aes), isn't it more likely that he gets the software implementation? >+ .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC | >+ CRYPTO_ALG_KERN_DRIVER_ONLY, >+ .cra_blocksize = AES_BLOCK_SIZE, >+ .cra_ctxsize = sizeof(struct omap_aes_ctx), >+ .cra_alignmask = 0xf, >+ .cra_type = &crypto_aead_type, >+ .cra_module = THIS_MODULE, >+ .cra_init = omap_aes_gcm_cra_init, >+ .cra_exit = omap_aes_cra_exit, >+ .cra_u.aead = { >+ .maxauthsize = AES_BLOCK_SIZE, >+ .geniv = "eseqiv", >+ .ivsize = AES_BLOCK_SIZE, >+ .setkey = omap_aes_gcm_setkey, >+ .encrypt = omap_aes_gcm_encrypt, >+ .decrypt = omap_aes_gcm_decrypt, >+ } >+}, > }; > > static struct omap_aes_algs_info omap_aes_algs_info_ecb_cbc[] = { Ciao Stephan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/