Re: TPM2_Sign vs TPM2_RSA_Decrypt
"Jarkko Sakkinen" <[email protected]> Fri, 17 May 2024 20:58:51 +0300
| Newsgroups | dev.linux.lists.tpm2 |
|---|---|
| Message-ID | <[email protected]> |
On Thu May 16, 2024 at 6:20 PM EEST, Jarkko Sakkinen wrote: > On Thu May 16, 2024 at 5:14 PM EEST, wrote: > > TPM2_EncryptDecrypt2 is for Symmetric encryption (i.e. AES) only. > > > > I'd still recommend to go for TPM2_Sign(). > > Note also that switching may be hard later down the road, since the key= usage flags are define during creation. > > So backwards compatibility is nasty here. > > > > Feel free to CC me. > > I'll do what I can. > > Great I get that but I'd still start with the existing code because it > was how it was done. I'm strong believer of "change only by stimulus" > and it is rare for feature patch set anyway land in the first round. In the case of asymmetric keys, the hash comes from outside and it is signed by the TPM so to be neutral to the source, TPM2_RSA_Decrypt does make sense. It is more robust in this case. BR, Jarkko