From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755801AbeARKvg (ORCPT ); Thu, 18 Jan 2018 05:51:36 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:43098 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755395AbeARKve (ORCPT ); Thu, 18 Jan 2018 05:51:34 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180118105131euoutp01478a195b81bf06a15c7bd05147c032f5~K4frD2PyQ0440404404euoutp01e X-AuditID: cbfec7f1-f793a6d00000326b-87-5a607c326fc8 Subject: Re: [PATCH v2] crypto/ahash: Require export/import in ahash From: Kamil Konieczny To: Herbert Xu Cc: "David S. Miller" , Bartlomiej Zolnierkiewicz , linux-crypto@vger.kernel.org, linux-kernel Message-id: <9370ae6a-71fd-52b9-bfeb-af44956dea0e@partner.samsung.com> Date: Thu, 18 Jan 2018 11:51:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset="utf-8" Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42LZduznOV2jmoQog9mfNC02zljPajHnfAuL RfcrGYv7934yWVzeNYfNgdVjy8qbTB7bDqh69G1ZxejxeZNcAEsUl01Kak5mWWqRvl0CV8aF 5Z/ZC/4KVyw5rd/AOFGgi5GTQ0LARGLdmReMELaYxIV769m6GLk4hASWMkrM6ljADpIQEvjM KNHwORqmYfHOm4wQRcsYJV63/ofqeMYocafnBzNIlbCAi8SGV4fAbDYBc4lH288wgdgiAjoS K18uZgVpYBbYwCix49JNsASvgJvE6mVfwWwWAVWJ7t+tLCC2qECERNezXawQNYISPybfA4tz CrhLTDq0gw3EZhbQlHjxZRILhC0u0dx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e1ZHCgmkJ5akZqemFqQWwWSZODilGhh1FPPjVwo2 s75wCrDJXLv441sxly8c726aPL144vPZlRf5903LOVnBsLBWd0mIBEf/n4ZLD+d4vjXaFZA7 eUbR9S8+EVKbz/+xNCmb49QpxXv/6erlPC2l/ip6s+y6C8/uvnhH87q+Y/QhxV9JbzuXrH/S NfGs5n4ttyWeDXcOPnM825D+svCAEktxRqKhFnNRcSIA+PXZ8HQCAAA= X-CMS-MailID: 20180118105130eucas1p19b15ab2e6ae6b7c4fafea3c52dec5e9b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180116183836eucas1p18da0aa4ef25452069e8f64ef95950f53 X-RootMTR: 20180116183836eucas1p18da0aa4ef25452069e8f64ef95950f53 References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.01.2018 19:38, Kamil Konieczny wrote: > Export and import were optional in async hash. As most drivers were > rewritten, they become mandatory now, so correct init of ahash > transformation. > > Signed-off-by: Kamil Konieczny Please drop this patch, as there is one more driver needed for convert, namely bfin_crc.c I will also prepare this as patch series, to be sure that this patch is last > --- > This is resend of previous patch. As Bartlomiej Zolnierkiewicz pointed out, > there are still three crypto drivers that didn't have export/import implemented: > > drivers/crypto/mxs-dcp.c > drivers/crypto/n2_core.c > drivers/crypto/ux500/hash/hash_core.c > > I have no documentation for them, so I sended patches with the behaviour taken > from crypto framework, but maybe that hardware is capable of import/export, > so proper implementation is possible. Unfortunatly, there is no maintainer > for any of these files. > > Please take this patch after these remainig drivers will be patched. > > crypto/ahash.c | 18 ++---------------- > 1 file changed, 2 insertions(+), 16 deletions(-) > > diff --git a/crypto/ahash.c b/crypto/ahash.c > index 3a35d67de7d9..7a8906d5af53 100644 > --- a/crypto/ahash.c > +++ b/crypto/ahash.c > @@ -434,16 +434,6 @@ static int ahash_def_finup(struct ahash_request *req) > return ahash_def_finup_finish1(req, err); > } > > -static int ahash_no_export(struct ahash_request *req, void *out) > -{ > - return -ENOSYS; > -} > - > -static int ahash_no_import(struct ahash_request *req, const void *in) > -{ > - return -ENOSYS; > -} > - > static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) > { > struct crypto_ahash *hash = __crypto_ahash_cast(tfm); > @@ -451,8 +441,8 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) > > hash->setkey = ahash_nosetkey; > hash->has_setkey = false; > - hash->export = ahash_no_export; > - hash->import = ahash_no_import; > + hash->export = alg->export; > + hash->import = alg->import; > > if (tfm->__crt_alg->cra_type != &crypto_ahash_type) > return crypto_init_shash_ops_async(tfm); > @@ -467,10 +457,6 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) > hash->setkey = alg->setkey; > hash->has_setkey = true; > } > - if (alg->export) > - hash->export = alg->export; > - if (alg->import) > - hash->import = alg->import; > > return 0; > } > -- Best regards, Kamil Konieczny Samsung R&D Institute Poland