31#ifndef TEE_API_TYPES_KEYSTONE_H
32#define TEE_API_TYPES_KEYSTONE_H
34#ifndef DOXYGEN_SHOULD_SKIP_THIS
39#if CRYPTLIB==MBEDCRYPT
40#ifndef DOXYGEN_SHOULD_SKIP_THIS
41# define MBEDTLS_CONFIG_FILE "mbed-crypto-config.h"
44# include "mbedtls/gcm.h"
45# include "mbedtls/aes.h"
47# include "ed25519/ed25519.h"
48#elif CRYPTLIB==WOLFCRYPT
49#ifndef DOXYGEN_SHOULD_SKIP_THIS
51# define HAVE_AES_CBC 1
52# define HAVE_AES_DECRYPT 1
54# define HAVE_FIPS_VERSION 2
55# define HAVE_ED25519 1
56# define HAVE_ED25519_SIGN 1
57# define HAVE_ED25519_VERIFY 1
58# define WOLFSSL_SHA512 1
59# define WOLFSSL_SHA3 1
60# define WOLFSSL_SHA3_SMALL 1
61# define WOLFCRYPT_ONLY 1
62# define WOLF_CRYPT_PORT_H
64# include "wolfssl/wolfcrypt/sha3.h"
65# include "wolfssl/wolfcrypt/aes.h"
66# include "wolfssl/wolfcrypt/sha512.h"
67# include "wolfssl/wolfcrypt/ed25519.h"
70# include "ed25519/ed25519.h"
71# include "tiny_AES_c/aes.h"
72#ifndef DOXYGEN_SHOULD_SKIP_THIS
77#ifndef DOXYGEN_SHOULD_SKIP_THIS
78#define SHA_LENGTH (256/8)
79#define TEE_OBJECT_NONCE_SIZE 16
80#define TEE_OBJECT_KEY_SIZE 32
81#define TEE_OBJECT_SKEY_SIZE 64
82#define TEE_OBJECT_AAD_SIZE 16
83#define TEE_OBJECT_TAG_SIZE 16
91#if CRYPTLIB==MBEDCRYPT
95#elif CRYPTLIB==WOLFCRYPT
99 unsigned int aegcm_aadsz;
100 unsigned char aegcm_aad[TEE_OBJECT_AAD_SIZE];
104 struct AES_ctx
aectx;
107 unsigned char aeiv[TEE_OBJECT_NONCE_SIZE];
109 unsigned char pubkey[TEE_OBJECT_KEY_SIZE];
110 unsigned char prikey[TEE_OBJECT_SKEY_SIZE];
118#if CRYPTLIB==MBEDCRYPT
121#elif CRYPTLIB==WOLFCRYPT
123 unsigned char persist_iv[TEE_OBJECT_NONCE_SIZE];
Definition: tee_api_tee_types.h:87
mbedtls_gcm_context aegcmctx
Definition: tee_api_tee_types.h:94
int flags
Definition: tee_api_tee_types.h:89
unsigned char aeiv[TEE_OBJECT_NONCE_SIZE]
Definition: tee_api_tee_types.h:107
int aegcm_state
Definition: tee_api_tee_types.h:106
unsigned char prikey[TEE_OBJECT_SKEY_SIZE]
Definition: tee_api_tee_types.h:110
mbedtls_aes_context aectx
Definition: tee_api_tee_types.h:93
unsigned char pubkey[TEE_OBJECT_KEY_SIZE]
Definition: tee_api_tee_types.h:109
unsigned char aekey[32]
Definition: tee_api_tee_types.h:108
sha3_ctx_t ctx
Definition: tee_api_tee_types.h:92
int alg
Definition: tee_api_tee_types.h:90
int mode
Definition: tee_api_tee_types.h:88
Definition: tee_api_tee_types.h:114
int desc
Definition: tee_api_tee_types.h:117
unsigned int type
Definition: tee_api_tee_types.h:115
int flags
Definition: tee_api_tee_types.h:116
mbedtls_aes_context persist_ctx
Definition: tee_api_tee_types.h:119
unsigned char persist_iv[TEE_OBJECT_NONCE_SIZE]
Definition: tee_api_tee_types.h:120
unsigned char private_key[TEE_OBJECT_SKEY_SIZE]
Definition: tee_api_tee_types.h:129
unsigned char public_key[TEE_OBJECT_KEY_SIZE]
Definition: tee_api_tee_types.h:128