10#include "tss2_tpm2_types.h"
11#include "tss2-sys/sysapi_util.h"
13#include "esys_crypto_ossl.h"
15#include "esys_crypto_mbed.h"
17#define _iesys_crypto_aes_decrypt NULL;
18#define _iesys_crypto_aes_encrypt NULL;
19#define _iesys_crypto_get_ecdh_point NULL;
20#define _iesys_crypto_hash_abort NULL;
21#define _iesys_crypto_hash_finish NULL;
22#define _iesys_crypto_hash_start NULL;
23#define _iesys_crypto_hash_update NULL;
24#define _iesys_crypto_hmac_abort NULL;
25#define _iesys_crypto_hmac_finish NULL;
26#define _iesys_crypto_hmac_start NULL;
27#define _iesys_crypto_hmac_update NULL;
28#define _iesys_crypto_init NULL;
29#define _iesys_crypto_get_random2b NULL;
30#define _iesys_crypto_rsa_pk_encrypt NULL;
37#define AES_BLOCK_SIZE_IN_BYTES 16
39TSS2_RC iesys_crypto_hash_get_digest_size(TPM2_ALG_ID hashAlg,
size_t *size);
41TSS2_RC iesys_crypto_pHash(
44 const uint8_t rcBuffer[4],
45 const uint8_t ccBuffer[4],
46 const TPM2B_NAME *name1,
47 const TPM2B_NAME *name2,
48 const TPM2B_NAME *name3,
49 const uint8_t *pBuffer,
54#define iesys_crypto_cpHash(ectx, alg, ccBuffer, name1, name2, name3, \
55 cpBuffer, cpBuffer_size, cpHash, cpHash_size) \
56 iesys_crypto_pHash(ectx, alg, NULL, ccBuffer, name1, name2, name3, cpBuffer, \
57 cpBuffer_size, cpHash, cpHash_size)
58#define iesys_crypto_rpHash(ectx, alg, rcBuffer, ccBuffer, rpBuffer, rpBuffer_size, \
59 rpHash, rpHash_size) \
60 iesys_crypto_pHash(ectx, alg, rcBuffer, ccBuffer, NULL, NULL, NULL, rpBuffer, \
61 rpBuffer_size, rpHash, rpHash_size)
63TSS2_RC iesys_crypto_hmac_finish2b(
68TSS2_RC iesys_crypto_hmac_update2b(
73TSS2_RC iesys_crypto_hash_update2b(
78TSS2_RC iesys_crypto_rsa_pk_encrypt(
80 TPM2B_PUBLIC * pub_tpm_key,
88TSS2_RC iesys_crypto_hash_start(
93TSS2_RC iesys_crypto_hash_update(
96 const uint8_t *buffer,
99TSS2_RC iesys_crypto_hash_finish(
105TSS2_RC iesys_crypto_hash_abort(
109TSS2_RC iesys_crypto_hmac_start(
116TSS2_RC iesys_crypto_hmac_update(
119 const uint8_t *buffer,
122TSS2_RC iesys_crypto_hmac_finish(
128TSS2_RC iesys_crypto_hmac_abort(
132TSS2_RC iesys_crypto_get_random2b(
137TSS2_RC iesys_crypto_get_ecdh_point(
141 TPM2B_ECC_PARAMETER *Z,
146 TSS2_RC iesys_crypto_aes_encrypt(
149 TPM2_ALG_ID tpm_sym_alg,
150 TPMI_AES_KEY_BITS key_bits,
151 TPM2_ALG_ID tpm_mode,
156TSS2_RC iesys_crypto_aes_decrypt(
159 TPM2_ALG_ID tpm_sym_alg,
160 TPMI_AES_KEY_BITS key_bits,
161 TPM2_ALG_ID tpm_mode,
166TSS2_RC iesys_crypto_authHmac(
171 const uint8_t *pHash,
173 const TPM2B_NONCE *nonceNewer,
174 const TPM2B_NONCE *nonceOlder,
175 const TPM2B_NONCE *nonceDecrypt,
176 const TPM2B_NONCE *nonceEncrypt,
177 TPMA_SESSION sessionAttributes,
180TSS2_RC iesys_crypto_KDFaHmac(
187 TPM2B_NONCE *contextU,
188 TPM2B_NONCE *contextV,
193TSS2_RC iesys_crypto_KDFa(
199 TPM2B_NONCE *contextU,
200 TPM2B_NONCE *contextV,
202 uint32_t *counterInOut,
204 BOOL use_digest_size);
206TSS2_RC iesys_xor_parameter_obfuscation(
208 TPM2_ALG_ID hash_alg,
211 TPM2B_NONCE * contextU,
212 TPM2B_NONCE * contextV,
216TSS2_RC iesys_crypto_KDFe(
219 TPM2B_ECC_PARAMETER *Z,
221 TPM2B_ECC_PARAMETER *partyUInfo,
222 TPM2B_ECC_PARAMETER *partyVInfo,
226TSS2_RC iesys_initialize_crypto_backend(
Definition tss2_esys.h:356
Definition esys_crypto_mbed.c:34