Re: [PATCH v3 3/7] Add SPAcc ahash support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 21, 2024 at 07:38:06AM +0530, Pavitrakumar Managutte wrote:
. 
> 1. Are the export/import functions mandatory? Documentation doesn’t

Yes.

> 2. What do you think of having import/export as optional functions, instead?

You still can't support partial hashing even without import and
export.

There is no limit to the number of partial hashes that may be in
place.  At some point your hardware is going to run out of memory
for the partial states.

> 3. Besides no access to the partial hash inside the hardware, how should
> 
>     partial data chunks to "update" be handled, that are smaller than the
> algo
> 
>     block size? Are implementations supposed to include data not

You keep them in the partial hash state as is.  Look at how the
software sha1 code handles it for example.

> 4. Also, how keys are handled for keyed hashes? The key may not be part
> 
>     of the state (e.g. for security reasons the key could be write-only).
> It is not
> 
>     clear if the key should be set again before calling ‘import’.

Keys are stored in the tfm, possibly as a partial hash state.

> 5. In the kernel we don’t see use of export/import besides the test manager
> 
>     case. Is this feature used/expected in general? How about allowing the
> 
>     function to return an error like n2 driver does, and still allow the
> 
>     test-manager to pass?

It's used by algif.  But in general partial hashing is required by
all users that do not use digest.  As I said, you cannot limit the
number of ongoing partial hashes based on the amount of memory in
your device.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux