16#include "tss2_common.h"
18#include "tss2_tpm2_types.h"
19#include "util/tpm2b.h"
21#include "esys_crypto_ossl.h"
23#include "esys_crypto_mbed.h"
25#define iesys_crypto_aes_decrypt_internal NULL;
26#define iesys_crypto_aes_encrypt_internal NULL;
27#define iesys_crypto_sm4_decrypt_internal NULL;
28#define iesys_crypto_sm4_encrypt_internal NULL;
29#define iesys_crypto_get_ecdh_point_internal NULL;
30#define iesys_crypto_hash_abort_internal NULL;
31#define iesys_crypto_hash_finish_internal NULL;
32#define iesys_crypto_hash_start_internal NULL;
33#define iesys_crypto_hash_update_internal NULL;
34#define iesys_crypto_hmac_abort_internal NULL;
35#define iesys_crypto_hmac_finish_internal NULL;
36#define iesys_crypto_hmac_start_internal NULL;
37#define iesys_crypto_hmac_update_internal NULL;
38#define iesys_crypto_init_internal NULL;
39#define iesys_crypto_get_random2b_internal NULL;
40#define iesys_crypto_rsa_pk_encrypt_internal NULL;
47#define AES_BLOCK_SIZE_IN_BYTES 16
48#define SM4_BLOCK_SIZE_IN_BYTES 16
54 const uint8_t rcBuffer[4],
55 const uint8_t ccBuffer[4],
56 const TPM2B_NAME *name1,
57 const TPM2B_NAME *name2,
58 const TPM2B_NAME *name3,
59 const uint8_t *pBuffer,
64#define iesys_crypto_cpHash(ectx, alg, ccBuffer, name1, name2, name3, cpBuffer, cpBuffer_size, \
65 cpHash, cpHash_size) \
66 iesys_crypto_pHash(ectx, alg, NULL, ccBuffer, name1, name2, name3, cpBuffer, cpBuffer_size, \
68#define iesys_crypto_rpHash(ectx, alg, rcBuffer, ccBuffer, rpBuffer, rpBuffer_size, rpHash, \
70 iesys_crypto_pHash(ectx, alg, rcBuffer, ccBuffer, NULL, NULL, NULL, rpBuffer, rpBuffer_size, \
86 TPM2B_PUBLIC *pub_tpm_key,
100 const uint8_t *buffer,
119 const uint8_t *buffer,
136 TPM2B_ECC_PARAMETER *Z,
143 TPM2_ALG_ID tpm_sym_alg,
144 TPMI_AES_KEY_BITS key_bits,
145 TPM2_ALG_ID tpm_mode,
152 TPM2_ALG_ID tpm_sym_alg,
153 TPMI_AES_KEY_BITS key_bits,
154 TPM2_ALG_ID tpm_mode,
161 TPM2_ALG_ID tpm_sym_alg,
162 TPMI_SM4_KEY_BITS key_bits,
163 TPM2_ALG_ID tpm_mode,
170 TPM2_ALG_ID tpm_sym_alg,
171 TPMI_SM4_KEY_BITS key_bits,
172 TPM2_ALG_ID tpm_mode,
181 const uint8_t *pHash,
183 const TPM2B_NONCE *nonceNewer,
184 const TPM2B_NONCE *nonceOlder,
185 const TPM2B_NONCE *nonceDecrypt,
186 const TPM2B_NONCE *nonceEncrypt,
187 TPMA_SESSION sessionAttributes,
196 TPM2B_NONCE *contextU,
197 TPM2B_NONCE *contextV,
207 TPM2B_NONCE *contextU,
208 TPM2B_NONCE *contextV,
210 uint32_t *counterInOut,
212 BOOL use_digest_size);
215 TPM2_ALG_ID hash_alg,
218 TPM2B_NONCE *contextU,
219 TPM2B_NONCE *contextV,
225 TPM2B_ECC_PARAMETER *Z,
227 TPM2B_ECC_PARAMETER *partyUInfo,
228 TPM2B_ECC_PARAMETER *partyVInfo,
TSS2_RC iesys_crypto_hash_get_digest_size(TPM2_ALG_ID hashAlg, size_t *size)
Definition esys_crypto.c:32
Definition tss2_esys.h:384
Definition esys_crypto_mbed.c:32