From: Kamil Konieczny <k.konieczny@partner.samsung.com>
To: Marek Vasut <marex@denx.de>, linux-crypto@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Sonic Zhang <sonic.zhang@analog.com>,
Fabio Estevam <fabio.estevam@freescale.com>,
Shawn Guo <shawn.guo@linaro.org>,
Tom Lendacky <thomas.lendacky@amd.com>,
Jan Engelhardt <jengelh@inai.de>,
Arvind Yadav <arvind.yadav.cs@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Joakim Bech <joakim.bech@linaro.org>,
linux-kernel@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH 5/5] crypto: ahash.c: Require export/import in ahash
Date: Fri, 19 Jan 2018 10:53:51 +0100 [thread overview]
Message-ID: <9246bbcb-6cd0-8bc9-8286-02c44e6d01bc@partner.samsung.com> (raw)
In-Reply-To: <5db6f843-cc51-09f2-f388-8dade440c6bc@denx.de>
On 18.01.2018 22:31, Marek Vasut wrote:
> On 01/18/2018 07:34 PM, Kamil Konieczny wrote:
>> Export and import are mandatory in async hash. As drivers were
>> rewritten, drop empty wrappers and correct init of ahash transformation.
>
> Are you moving checks from the core subsystem to drivers ? This looks
> really nonsensical and the commit message doesn't explain the rationale
> for that at all.
I am removing checks from core. Export and import were optional in beginnig
of crypto framework, but as time goes on they become mandatory.
>
>> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
>> ---
>> crypto/ahash.c | 18 ++----------------
>> 1 file changed, 2 insertions(+), 16 deletions(-)
>>
>> diff --git a/crypto/ahash.c b/crypto/ahash.c
>> index 3a35d67de7d9..c3cce508c1d4 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,6 @@ 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;
>>
>> if (tfm->__crt_alg->cra_type != &crypto_ahash_type)
>> return crypto_init_shash_ops_async(tfm);
>> @@ -462,15 +450,13 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
>> hash->final = alg->final;
>> hash->finup = alg->finup ?: ahash_def_finup;
>> hash->digest = alg->digest;
>> + hash->export = alg->export;
>> + hash->import = alg->import;
>>
>> if (alg->setkey) {
>> 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
next prev parent reply other threads:[~2018-01-19 9:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180118183438eucas1p2e2e7be8625ae0950c519e27424f9301a@eucas1p2.samsung.com>
2018-01-18 18:33 ` [PATCH v3 0/5] " Kamil Konieczny
[not found] ` <CGME20180118183438eucas1p27a0802d5d4ce9013cff72e0ddaccd630@eucas1p2.samsung.com>
2018-01-18 18:34 ` [PATCH v3 1/5] crypto: mxs-dcp: Add empty hash export and import Kamil Konieczny
[not found] ` <CGME20180118183439eucas1p26bfb3043619ddcbc25474ac98e5638ff@eucas1p2.samsung.com>
2018-01-18 18:34 ` [PATCH 2/5] crypto: n2_core: " Kamil Konieczny
[not found] ` <CGME20180118183440eucas1p21e1a425cbafe3cbb3856d97fd94228e5@eucas1p2.samsung.com>
2018-01-18 18:34 ` [PATCH 3/5] crypto: ux500/hash: Add empty " Kamil Konieczny
[not found] ` <CGME20180118183440eucas1p2d435e0100eaf03d3967b28c29a2c91b3@eucas1p2.samsung.com>
2018-01-18 18:34 ` [PATCH 4/5] crypto: bfin_crc: Add empty hash " Kamil Konieczny
[not found] ` <CGME20180118183441eucas1p2ee3f046a594945299ea7b75ffb13e2ca@eucas1p2.samsung.com>
2018-01-18 18:34 ` [PATCH 5/5] crypto: ahash.c: Require export/import in ahash Kamil Konieczny
2018-01-18 21:31 ` Marek Vasut
2018-01-19 9:53 ` Kamil Konieczny [this message]
2018-01-19 10:08 ` Marek Vasut
2018-01-19 10:53 ` Kamil Konieczny
2018-02-15 15:41 ` [PATCH v3 0/5] " Herbert Xu
2018-02-15 16:27 ` Marek Vasut
2018-02-15 17:00 ` Kamil Konieczny
2018-02-15 17:06 ` Marek Vasut
2018-02-15 18:06 ` Kamil Konieczny
2018-02-15 18:32 ` Marek Vasut
2018-02-16 9:16 ` Kamil Konieczny
2018-02-16 9:49 ` Marek Vasut
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=9246bbcb-6cd0-8bc9-8286-02c44e6d01bc@partner.samsung.com \
--to=k.konieczny@partner.samsung.com \
--cc=arvind.yadav.cs@gmail.com \
--cc=b.zolnierkie@samsung.com \
--cc=davem@davemloft.net \
--cc=fabio.estevam@freescale.com \
--cc=herbert@gondor.apana.org.au \
--cc=jengelh@inai.de \
--cc=joakim.bech@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=shawn.guo@linaro.org \
--cc=sonic.zhang@analog.com \
--cc=thomas.lendacky@amd.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
all inboxes | Powered by JetHome®