Re: crypto API - async semantics

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

 



On 10/12/2017 12:49 PM, Herbert Xu wrote:
> On Thu, Oct 12, 2017 at 09:39:34AM +0000, Horia Geantă wrote:
>>
>> Taking ascii art from crypto API docs:
>>
>> DATA -----------.
>>                 v
>>  .init() -> .update() -> .final()      ! .update() might not be called
>>              ^    |         |            at all in this scenario.
>>              '----'         '---> HASH
>>
>> My question was referring to the case where multiple update() operations
>> are issued in parallel for the same request object.
>> For e.g. let's say a crypto API client wants to hash a 4GB file, and
>> does this by issuing update() repeatedly and performing
>> wait_for_completion() at the very end.
> 
> That is most certainly not legal.  Is dm-crypt doing that?
> 
dm-crypt is issuing requests (aead / skcipher) in parallel, however a
new request object is allocated each time, which seems legit.

My confusion was due to mixing parallelism at different levels:
-at request object level - issuing multiple requests for the same
request object (ahash update() case)
-at tfm object level - issuing multiple requests for different request
objects (dm-crypt case)

As you pointed out, the first is not legal, while the latter is
perfectly fine.

Thanks,
Horia




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

  Powered by Linux