6#ifndef ESYS_CRYPTO_OSSL_H
7#define ESYS_CRYPTO_OSSL_H
16#include "tss2_common.h"
18#include "tss2_tpm2_types.h"
24#define OSSL_FREE(S, TYPE) \
26 TYPE##_free((void *)(S)); \
34 const uint8_t *buffer,
45#define iesys_crypto_rsa_pk_encrypt_internal iesys_cryptossl_pk_encrypt
46#define iesys_crypto_hash_start_internal iesys_cryptossl_hash_start
47#define iesys_crypto_hash_update_internal iesys_cryptossl_hash_update
48#define iesys_crypto_hash_finish_internal iesys_cryptossl_hash_finish
49#define iesys_crypto_hash_abort_internal iesys_cryptossl_hash_abort
58 const uint8_t *buffer,
69#define iesys_crypto_hmac_start_internal iesys_cryptossl_hmac_start
70#define iesys_crypto_hmac_start2b_internal iesys_cryptossl_hmac_start2b
71#define iesys_crypto_hmac_update_internal iesys_cryptossl_hmac_update
72#define iesys_crypto_hmac_update2b_internal iesys_cryptossl_hmac_update2b
73#define iesys_crypto_hmac_finish_internal iesys_cryptossl_hmac_finish
74#define iesys_crypto_hmac_finish2b_internal iesys_cryptossl_hmac_finish2b
75#define iesys_crypto_hmac_abort_internal iesys_cryptossl_hmac_abort
77TSS2_RC iesys_cryptossl_random2b(TPM2B_NONCE *nonce,
size_t num_bytes,
void *userdata);
79TSS2_RC iesys_cryptossl_pk_encrypt(TPM2B_PUBLIC *key,
88TSS2_RC iesys_cryptossl_sym_aes_encrypt(uint8_t *key,
89 TPM2_ALG_ID tpm_sym_alg,
90 TPMI_AES_KEY_BITS key_bits,
97TSS2_RC iesys_cryptossl_sym_aes_decrypt(uint8_t *key,
98 TPM2_ALG_ID tpm_sym_alg,
99 TPMI_AES_KEY_BITS key_bits,
100 TPM2_ALG_ID tpm_mode,
106#if HAVE_EVP_SM4_CFB && !defined(OPENSSL_NO_SM4)
107TSS2_RC iesys_cryptossl_sym_sm4_encrypt(uint8_t *key,
108 TPM2_ALG_ID tpm_sym_alg,
109 TPMI_SM4_KEY_BITS key_bits,
110 TPM2_ALG_ID tpm_mode,
116TSS2_RC iesys_cryptossl_sym_sm4_decrypt(uint8_t *key,
117 TPM2_ALG_ID tpm_sym_alg,
118 TPMI_SM4_KEY_BITS key_bits,
119 TPM2_ALG_ID tpm_mode,
126TSS2_RC iesys_cryptossl_get_ecdh_point(TPM2B_PUBLIC *key,
128 TPM2B_ECC_PARAMETER *Z,
134#define iesys_crypto_get_random2b_internal iesys_cryptossl_random2b
135#define iesys_crypto_get_ecdh_point_internal iesys_cryptossl_get_ecdh_point
136#define iesys_crypto_aes_encrypt_internal iesys_cryptossl_sym_aes_encrypt
137#define iesys_crypto_aes_decrypt_internal iesys_cryptossl_sym_aes_decrypt
138#if HAVE_EVP_SM4_CFB && !defined(OPENSSL_NO_SM4)
139#define iesys_crypto_sm4_encrypt_internal iesys_cryptossl_sym_sm4_encrypt
140#define iesys_crypto_sm4_decrypt_internal iesys_cryptossl_sym_sm4_decrypt
142#define iesys_crypto_sm4_encrypt_internal NULL
143#define iesys_crypto_sm4_decrypt_internal NULL
146TSS2_RC iesys_cryptossl_init(
void *userdata);
148#define iesys_crypto_init_internal iesys_cryptossl_init
Definition esys_crypto_mbed.c:32