* ahash alg that does not implement import/export failed to register
@ 2015-12-19 1:31 Tim Chen
2015-12-19 2:33 ` Herbert Xu
0 siblings, 1 reply; 3+ messages in thread
From: Tim Chen @ 2015-12-19 1:31 UTC (permalink / raw)
To: Herbert Xu, Russell King - ARM Linux
Cc: linux-kernel, ; linux-crypto, megha.dey
Herbert,
There are some ahash algorithms like x86's sha1-mb and
ghash that failed to register because of the newly added
check of non-zero statesize from commit 8996eafd. But
since there are algorithms that do not implement an import or
export, there is no state required for them. Wonder if the check
should be modified to something like:
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 9c1dc8d..f512183 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -544,7 +544,10 @@ static int ahash_prepare_alg(struct ahash_alg *alg)
struct crypto_alg *base = &alg->halg.base;
if (alg->halg.digestsize > PAGE_SIZE / 8 ||
- alg->halg.statesize > PAGE_SIZE / 8 ||
+ alg->halg.statesize > PAGE_SIZE / 8)
+ return -EINVAL;
+
+ if ((alg->import || alg->export) &&
alg->halg.statesize == 0)
return -EINVAL;
Thanks.
Tim
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ahash alg that does not implement import/export failed to register
2015-12-19 1:31 ahash alg that does not implement import/export failed to register Tim Chen
@ 2015-12-19 2:33 ` Herbert Xu
[not found] ` <568E7AFB.8080905@amd.com>
0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2015-12-19 2:33 UTC (permalink / raw)
To: Tim Chen
Cc: Russell King - ARM Linux, linux-kernel, ; linux-crypto, megha.dey
On Fri, Dec 18, 2015 at 05:31:34PM -0800, Tim Chen wrote:
> Herbert,
>
> There are some ahash algorithms like x86's sha1-mb and
> ghash that failed to register because of the newly added
> check of non-zero statesize from commit 8996eafd. But
> since there are algorithms that do not implement an import or
> export, there is no state required for them. Wonder if the check
> should be modified to something like:
No import and export are required by algif_hash so they must be
implemented.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ahash alg that does not implement import/export failed to register
[not found] ` <568E7AFB.8080905@amd.com>
@ 2016-01-08 9:54 ` Herbert Xu
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2016-01-08 9:54 UTC (permalink / raw)
To: Tom Lendacky
Cc: Tim Chen, Russell King - ARM Linux, linux-kernel, linux-crypto,
megha.dey
On Thu, Jan 07, 2016 at 08:49:31AM -0600, Tom Lendacky wrote:
>
> Is it expected that import and export should work across algorithm
> implementations (eg. export sha1 state from hardware driver and import
> into sha1-generic algorithm)? Or is the state purely meant for use by
> the driver only? I see a few hardware drivers exporting/importing
> to/from sha1_state and sha256_state and that is what prompts this
> question.
For algorithms in general there is no requirement for the states
to be exported in a particular format. For certain special cases
such as crc32c we do require a specific format but you don't have
to worry about this for SHA.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-08 9:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 1:31 ahash alg that does not implement import/export failed to register Tim Chen
2015-12-19 2:33 ` Herbert Xu
[not found] ` <568E7AFB.8080905@amd.com>
2016-01-08 9:54 ` Herbert Xu
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®