lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR04MB4445DACDF6F1AF1CDABC6E7A8C490@VI1PR04MB4445.eurprd04.prod.outlook.com>
Date:   Fri, 22 Nov 2019 11:05:59 +0000
From:   Iuliana Prodan <iuliana.prodan@....com>
To:     Herbert Xu <herbert@...dor.apana.org.au>
CC:     Horia Geanta <horia.geanta@....com>,
        Aymen Sghaier <aymen.sghaier@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Tom Lendacky <thomas.lendacky@....com>,
        Gary Hook <gary.hook@....com>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH 08/12] crypto: caam - support crypto_engine framework for
 SKCIPHER algorithms

On 11/22/2019 12:33 PM, Herbert Xu wrote:
> On Mon, Nov 18, 2019 at 12:30:41AM +0200, Iuliana Prodan wrote:
>>
>> +static int transfer_request_to_engine(struct crypto_engine *engine,
>> +				      struct crypto_async_request *req)
>> +{
>> +	switch (crypto_tfm_alg_type(req->tfm)) {
>> +	case CRYPTO_ALG_TYPE_SKCIPHER:
>> +		return crypto_transfer_skcipher_request_to_engine(engine,
>> +								  skcipher_request_cast(req));
>> +	default:
>> +		return -EINVAL;
>> +	}
>> +}
> 
> Please don't do this.  As you can see the crypto engine interface
> wants to you to use the correct type for the request object.  That's
> what you should do to.

Sorry, but I don't understand what is wrong here? I'm using the correct 
type, the specific type, for the request when sending it to crypto engine.
This transfer_request_to_engine function is called from caam_jr_enqueue, 
where I have all types of request, so I'm using the async_request, and 
when transferring to crypto engine I cast it to the specific type.


> In fact I don't understand why you're only using the crypto engine
> for the backlog case.  Wouldn't it be much simpler if you used the
> engine unconditionally?

I believe is an overhead to sent all request to crypto engine since most 
of them can be directly executed by hw.
Also, in case there is no need for backlog and the hw is busy we can 
drop the request.

Thanks,
Iulia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ