4 #ifndef TLTZCRYPT_API_H_
5 #define TLTZCRYPT_API_H_
14 /* Command ID's for communication Trustlet Connector -> Trustlet. */
15 #define CMD_ENCRYPT_TZ_CRYPT 0x00000001
16 #define CMD_DECRYPT_TZ_CRYPT 0x00000002
17 #define CMD_WRAPIDENTITY_TZ_CRYPT 0x00000003
18 #define CMD_UNWRAPIDENTITY_TZ_CRYPT 0x00000004
19 #define CMD_HASH_TZ_CRYPT 0x00000005
22 #define RET_TL_OK 0x00000000
25 #define RET_ERR_ENCRYPT_TZ_CRYPT 0x10000001
26 #define RET_ERR_DECRYPT_TZ_CRYPT 0x10000002
27 #define RET_ERR_WRAPIDENTITY_TZ_CRYPT 0x10000003
28 #define RET_ERR_UNWRAPIDENTITY_TZ_CRYPT 0x10000004
29 #define RET_ERR_HASH_TZ_CRYPT 0x10000005
31 /* Termination codes */
32 #define EXIT_ERROR ((uint32_t)(-1))
34 #define SIZE_CHUNK 1024
35 #define SIZE_SECUREOBJECT 1116 // SO SIZE for 1024 byte (predefined)
36 #define SIZE_HASHAPPIDENTITY 32
37 #define SIZE_WRAPAPPIDENTITY 124
39 /* TCI message data. */
44 //uint8_t data[MAX_DATA_LEN];
52 //uint8_t data[MAX_DATA_LEN];
57 uint8_t input_data[SIZE_CHUNK];
58 uint8_t output_data[SIZE_SECUREOBJECT];
62 uint8_t hash_identity[SIZE_HASHAPPIDENTITY];
63 uint8_t wrap_identity[SIZE_WRAPAPPIDENTITY];
68 tci_cmd_t cmd; /* Command message structure */
69 tci_resp_t resp; /* Response message structure */
78 #define TL_TZ_CRYPT_UUID { { 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7 } }
84 #endif /* TLTZCRYPT_API_H_ */