[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160629022337.GB23390@gondor.apana.org.au>
Date: Wed, 29 Jun 2016 10:23:37 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Andy Lutomirski <luto@...capital.net>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
David Miller <davem@...emloft.net>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net-next] tcp: md5: use kmalloc() backed scratch areas
On Tue, Jun 28, 2016 at 10:35:31AM -0700, Andy Lutomirski wrote:
>
> Do you mean this code:
Yes.
> I'm wondering why support for scatterlists is all-or-nothing. Why
> can't we initialize a hash object and then alternate between passing
> it scatterlists and pointers?
Because once you have started hashing the hash state is not stored
in a consistent format. Our software code may maintain one format
while a hardware implementation could do something else altogether.
So you have to stick with one implementation throughout a particular
hashing session.
> I'm guessing that ahash enables async operation and shash is
> synchronous only. If I'm right, I understand why ahash requires a
> scatterlist. What I don't understand is why shash can't also accept a
> scatterlist. It appears that most of the ahash users in the tree
> actually want synchronous crypto and are presumably using ahash for
> some other reason such as ahash's ability to hash via scatterlist (in
> this case, struct page *).
ahash is meant to be the interface everyone uses regardless of
whether they want sync-only or async. shash should only be used
for small amounts of hashing on virtual addresses.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists