A keymaster::Serializable that wraps another keymaster::Serializable, encrypting the data with a TPM to ensure privacy.
This implementation randomly generates a unique key which only exists inside the TPM, and uses it to encrypt the data from the other Serializable instance. The encrypted data, together with information about the unique key is stored in the output data. The unique key information is something that can only be decoded using a TPM, which will detect if the key is corrupted. However, this implementation will not detect if the encrypted data is corrupted, which could break the other Serializable instance on deserialization. This class should be used with something else to verify that the data hasn't been tampered with.
The serialization format is: [tpm key public data] [tpm key private data] [uint32_t: block_size] [uint32_t: encrypted_length] [encrypted_data]
The actual length of [encrypted_data] in the serialized format is [encrypted_length] rounded up to the nearest multiple of [block_size]. [encrypted_length] is the true length of the data before encryption, without padding.