linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: Stephan Mueller <smueller@chronox.de>
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, 2 Jul 2015 15:24:58 +0530	[thread overview]
Message-ID: <55950A72.4040004@ti.com> (raw)
In-Reply-To: <1996807.vhgJsDVnGm@tauon.atsec.com>

On Thursday 02 July 2015 01:30 PM, Stephan Mueller wrote:
> 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 <lokeshvutla@ti.com>
>> ---
>> 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.
Yes, you are right.
Other hw algos in omap-aes also uses priority 100.
Only sw and hw implementations are enabled right now and both are at same priority.
And till now its lucky enough that hw algo gets picked.

Ill change the priority to 300 for all the modes.
Thanks for pointing it.

Regards,
Lokesh
> 
> 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
> 

  reply	other threads:[~2015-07-02  9:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02  5:18 [PATCH 00/10] crypto: omap-aes: Add support for GCM mode Lokesh Vutla
2015-07-02  5:18 ` [PATCH 01/10] crypto: omap-aes: Add support for lengths not aligned with AES_BLOCK_SIZE Lokesh Vutla
2015-07-02  7:53   ` Felipe Balbi
2015-07-02  9:26     ` Lokesh Vutla
2015-07-06  7:38   ` Herbert Xu
2015-07-02  5:18 ` [PATCH 02/10] crypto: omap-aes: Fix configuring of AES mode Lokesh Vutla
2015-07-02  7:57   ` Felipe Balbi
2015-07-02  9:43     ` Lokesh Vutla
2015-07-02  5:18 ` [PATCH 03/10] crypto: aead: Add aead_request_cast() api Lokesh Vutla
2015-07-02  7:58   ` Felipe Balbi
2015-07-02  9:46     ` Lokesh Vutla
2015-07-06  7:41   ` Herbert Xu
2015-07-02  5:18 ` [PATCH 04/10] crypto: omap-aes: Use BIT() macro Lokesh Vutla
2015-07-02  7:59   ` Felipe Balbi
2015-07-06  7:42     ` Herbert Xu
2015-07-02  5:18 ` [PATCH 05/10] crypto: omap-aes: Add support for GCM mode Lokesh Vutla
2015-07-02  8:04   ` Felipe Balbi
2015-07-02 10:10     ` Lokesh Vutla
2015-07-02  5:18 ` [PATCH 06/10] crypto: omap-aes: gcm: Handle inputs properly Lokesh Vutla
2015-07-02  8:04   ` Felipe Balbi
2015-07-02 10:13     ` Lokesh Vutla
2015-07-02  5:18 ` [PATCH 07/10] crypto: omap-aes: gcm: Add support for unaligned lengths Lokesh Vutla
2015-07-02  8:05   ` Felipe Balbi
2015-07-02  5:18 ` [PATCH 08/10] crypto: omap-aes: gmc: Add algo info Lokesh Vutla
2015-07-02  8:00   ` Stephan Mueller
2015-07-02  9:54     ` Lokesh Vutla [this message]
2015-07-02  9:56       ` Stephan Mueller
2015-07-06  7:35   ` Herbert Xu
2015-07-06  8:15     ` Lokesh Vutla
2015-07-02  5:18 ` [PATCH 09/10] crypto: omap-aes: gcm: Add support for PIO mode Lokesh Vutla
2015-07-02  8:06   ` Felipe Balbi
2015-07-02 10:17     ` Lokesh Vutla
2015-07-02  5:18 ` [PATCH 10/10] crypto: tcrypt: Added speed tests for Async AEAD crypto alogrithms Lokesh Vutla
2015-07-06  7:44   ` Herbert Xu
2015-07-06  8:45     ` Lokesh Vutla
2015-07-06  8:49       ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55950A72.4040004@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=smueller@chronox.de \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).