6 #ifndef ESYS_CRYPTO_OSSL_H
7 #define ESYS_CRYPTO_OSSL_H
10 #include "tss2_tpm2_types.h"
11 #include "tss2-sys/sysapi_util.h"
17 #define OSSL_FREE(S,TYPE) if((S) != NULL) {TYPE##_free((void*) (S)); (S)=NULL;}
19 TSS2_RC iesys_cryptossl_hash_start(
24 TSS2_RC iesys_cryptossl_hash_update(
26 const uint8_t *buffer,
size_t size,
29 TSS2_RC iesys_cryptossl_hash_finish(
35 void iesys_cryptossl_hash_abort(
39 #define _iesys_crypto_rsa_pk_encrypt iesys_cryptossl_pk_encrypt
40 #define _iesys_crypto_hash_start iesys_cryptossl_hash_start
41 #define _iesys_crypto_hash_update iesys_cryptossl_hash_update
42 #define _iesys_crypto_hash_finish iesys_cryptossl_hash_finish
43 #define _iesys_crypto_hash_abort iesys_cryptossl_hash_abort
45 TSS2_RC iesys_cryptossl_hmac_start(
52 TSS2_RC iesys_cryptossl_hmac_update(
54 const uint8_t *buffer,
58 TSS2_RC iesys_cryptossl_hmac_finish(
64 void iesys_cryptossl_hmac_abort(
68 #define _iesys_crypto_hmac_start iesys_cryptossl_hmac_start
69 #define _iesys_crypto_hmac_start2b iesys_cryptossl_hmac_start2b
70 #define _iesys_crypto_hmac_update iesys_cryptossl_hmac_update
71 #define _iesys_crypto_hmac_update2b iesys_cryptossl_hmac_update2b
72 #define _iesys_crypto_hmac_finish iesys_cryptossl_hmac_finish
73 #define _iesys_crypto_hmac_finish2b iesys_cryptossl_hmac_finish2b
74 #define _iesys_crypto_hmac_abort iesys_cryptossl_hmac_abort
76 TSS2_RC iesys_cryptossl_random2b(
81 TSS2_RC iesys_cryptossl_pk_encrypt(
92 TSS2_RC iesys_cryptossl_sym_aes_encrypt(
94 TPM2_ALG_ID tpm_sym_alg,
95 TPMI_AES_KEY_BITS key_bits,
102 TSS2_RC iesys_cryptossl_sym_aes_decrypt(
104 TPM2_ALG_ID tpm_sym_alg,
105 TPMI_AES_KEY_BITS key_bits,
106 TPM2_ALG_ID tpm_mode,
112 #if HAVE_EVP_SM4_CFB && !defined(OPENSSL_NO_SM4)
113 TSS2_RC iesys_cryptossl_sym_sm4_encrypt(
115 TPM2_ALG_ID tpm_sym_alg,
116 TPMI_SM4_KEY_BITS key_bits,
117 TPM2_ALG_ID tpm_mode,
123 TSS2_RC iesys_cryptossl_sym_sm4_decrypt(
125 TPM2_ALG_ID tpm_sym_alg,
126 TPMI_SM4_KEY_BITS key_bits,
127 TPM2_ALG_ID tpm_mode,
134 TSS2_RC iesys_cryptossl_get_ecdh_point(
137 TPM2B_ECC_PARAMETER *Z,
143 #define _iesys_crypto_get_random2b iesys_cryptossl_random2b
144 #define _iesys_crypto_get_ecdh_point iesys_cryptossl_get_ecdh_point
145 #define _iesys_crypto_aes_encrypt iesys_cryptossl_sym_aes_encrypt
146 #define _iesys_crypto_aes_decrypt iesys_cryptossl_sym_aes_decrypt
147 #if HAVE_EVP_SM4_CFB && !defined(OPENSSL_NO_SM4)
148 #define _iesys_crypto_sm4_encrypt iesys_cryptossl_sym_sm4_encrypt
149 #define _iesys_crypto_sm4_decrypt iesys_cryptossl_sym_sm4_decrypt
151 #define _iesys_crypto_sm4_encrypt NULL
152 #define _iesys_crypto_sm4_decrypt NULL
155 TSS2_RC iesys_cryptossl_init(
void *userdata);
157 #define _iesys_crypto_init iesys_cryptossl_init
Definition: esys_crypto_mbed.c:34