Re: Question about ahash export and import
flat view
From: Christophe LEROY <hidden>
Date: 2017-09-27 14:59:59
Le 27/09/2017 à 11:08, Herbert Xu a écrit :
On Tue, Sep 26, 2017 at 01:09:05PM +0200, Kamil Konieczny wrote:quoted
Can import() be called without _any_ init(), for example after reboot of machine ? Is following scenario valid:Of course it can. import must restore the state of the request to that at the time when export was called. import does not need to be called after init. init simply resets the hash state for new update/final calls.quoted
init(), update() 0 or more times, export(), save exported data to pernament storage reboot machine load crypto driver, import() saved state ?Yes this must be supported. Basically after any update call is complete (you've called the completion function), you should be able to call export and completely extract the partial (as opposed to finalised) hash state.
Can we consider that once an export has been done, no new update call will be performed prior to doing an init or an import ? Or should it be possible to continue with an update or a final/finup call after an export ?
Remember we need to support an arbitrarily large number of concurrent hashing operations. So you cannot keep a hash state in hardware indefinitely just because the user has not called finalize on it. Cheers,
Christophe