[tpm2] Hash sequence duplication without ContextSave/ContextLoad

Petr Gotthard <petr.gotthard at centrum.cz> Mon, 16 May 2022 18:29:22 +0200
Newsgroups dev.linux.lists.tpm2
Message-ID <[email protected]>
Hello,
 
I need to duplicate a hash sequence. This is to implement TPM-based version of OpenSSL's EVP_MD_CTX_dup.
 
Background: EVP_MD_CTX_dup can be used to duplicate the message digest state. This is useful [...] if large amounts of data are to be hashed which only differ in the last few bytes.
 
 
So far I am using ContextSave/ContextLoad, but Windows is blocking these TPM commands.
https://docs.microsoft.com/en-us/windows/win32/tbs/command-blocking
 
Is there some other way to duplicate a TPM hash sequence, please?
 
 
Petr