Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> writes: > On Wed, May 22, 2024 at 04:42:52PM +0530, Kamlesh Gurudasani wrote: >> >> For incremental hasing, we have to keep the FRAG bit set. >> For last packet, we have to unset the FRAG bit and then send the last >> packet in. But we don't have a way to know if it is last packet. > > I don't understand. Can't your user just submit the request as > a digest instead of init+update+final? Wouldn't that already work > with your driver as is? Thanks for the response Herbert. The way I understand algif_hash calls the digest function[0] if entire file(file whose SHA needs to be calculated) is less than 16 * PAGE_SIZE(4 kb for us) For any file more than 64 kb, it will fall back to init->update->finup[1] Implementing init-> update -> finup (SA2UL supports this) But with this selftest will fail for init -> update -> final(SA2UL doesn't support this) Hence we suggested that if we can save 64kb(size of one update) in context so in final we have one update available.(kind of virtual finup). This will pass the self test as well. Let me know what you think. Kamlesh [0]https://elixir.bootlin.com/linux/latest/source/crypto/algif_hash.c#L137 [1]https://elixir.bootlin.com/linux/latest/source/crypto/algif_hash.c#L151