Add EncryptDataForCa and Tpm2bPublicToTpmtPublic.

EncryptDataForCa encrypts data for the Chrome OS attestation CA.
Tpm2bPublicToTpmtPublic converts a serialized TPM2B_PUBLIC into a
serialized TPMT_PUBLIC. These functions are needed to construct
certificate signing requests for the attestation CA.

BUG=b:354037334

Change-Id: Icc2ee25e0e3e29ba79486477f1de02046289632d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/6300249
Auto-Submit: Johnathan Van Why <[email protected]>
Tested-by: Johnathan Van Why <[email protected]>
Reviewed-by: Vadim Sukhomlinov <[email protected]>
Commit-Queue: Johnathan Van Why <[email protected]>
3 files changed