TPM-SDK data conversion implementation. More...
#include "epid/member/tpm2/ibm_tss/conversion.h"
#include <string.h>
#include <tss2/TPM_Types.h>
#include "epid/common/math/ecgroup.h"
#include "epid/common/src/memory.h"
#include "epid/common/types.h"
Functions | |
TPMI_ALG_HASH | EpidtoTpm2HashAlg (HashAlg hash_alg) |
Maps HashAlg to TPM type. More... | |
HashAlg | Tpm2toEpidHashAlg (TPMI_ALG_HASH tpm_hash_alg) |
Maps TPMI_ALG_HASH to HashAlg. More... | |
EpidStatus | ReadTpm2FfElement (OctStr256 const *str, TPM2B_ECC_PARAMETER *tpm_data) |
Converts serialized FfElement into TPM type. More... | |
EpidStatus | WriteTpm2FfElement (TPM2B_ECC_PARAMETER const *tpm_data, OctStr256 *str) |
Converts TPM finite field element types into serialized FfElement. More... | |
EpidStatus | ReadTpm2EcPoint (G1ElemStr const *p_str, TPM2B_ECC_POINT *tpm_point) |
Converts ECPoint string to TMP ECPoint structure. More... | |
EpidStatus | WriteTpm2EcPoint (TPM2B_ECC_POINT const *tpm_point, G1ElemStr *p_str) |
Serializes TMP ECPoint to ECPoint string. More... | |
TPM-SDK data conversion implementation.
TPMI_ALG_HASH EpidtoTpm2HashAlg | ( | HashAlg | hash_alg | ) |
Maps HashAlg to TPM type.
Maps Intel(R) EPID SDK HashAlg into TPMI_ALG_HASH.
[in] | hash_alg | Code of the hash algorithm |
EpidStatus ReadTpm2EcPoint | ( | G1ElemStr const * | p_str, |
TPM2B_ECC_POINT * | tpm_point | ||
) |
Converts ECPoint string to TMP ECPoint structure.
[in] | p_str | The serialized EcPoint to convert. |
[out] | tpm_point | The TPM EC point representation. |
EpidStatus ReadTpm2FfElement | ( | OctStr256 const * | str, |
TPM2B_ECC_PARAMETER * | tpm_data | ||
) |
Converts serialized FfElement into TPM type.
[in] | str | Serialized Intel(R) EPID SDK FfElement |
[out] | tpm_data | tpm type data. |
HashAlg Tpm2toEpidHashAlg | ( | TPMI_ALG_HASH | tpm_hash_alg | ) |
Maps TPMI_ALG_HASH to HashAlg.
Maps TPM hash code TPMI_ALG_HASH into HashAlg.
[in] | tpm_hash_alg | Code of the hash algorithm in TPM |
EpidStatus WriteTpm2EcPoint | ( | TPM2B_ECC_POINT const * | tpm_point, |
G1ElemStr * | p_str | ||
) |
Serializes TMP ECPoint to ECPoint string.
[in] | tpm_point | The TPM EC point to convert. |
[in] | p_str | The target string. |
EpidStatus WriteTpm2FfElement | ( | TPM2B_ECC_PARAMETER const * | tpm_data, |
OctStr256 * | str | ||
) |
Converts TPM finite field element types into serialized FfElement.
[in] | tpm_data | The TPM finite field data, typically TPM2B_DIGEST or TPM2B_ECC_PARAMETER. |
[out] | str | The target buffer. |