Samsung Internal API reference  2.0
tees_secure_object.h
Go to the documentation of this file.
1 
65 #ifndef _TEES_SECURE_OBJECT_H
66 #define _TEES_SECURE_OBJECT_H
67 
68 #include <tee_internal_api.h>
69 #include <core/crypto_info.h>
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
91 #define SO_TAG_LEN (16)
92 #define SO_IV_LEN (16)
93 #define SO_AC_LEN (4)
94 #define SO_MAGIC_NUMBER_LEN (4)
95 #define SO_TA_ID_LEN (16)
96 #define SO_AUTH_ID_LEN (16)
97 
100 #define SO_HEADER_SIZE_STATIC \
101  ((SO_TAG_LEN) + (SO_IV_LEN) + (SO_AC_LEN) + (SO_MAGIC_NUMBER_LEN))
102 
106 #define SO_OUT_BUF_SIZE(in_len, delegated) \
107  ((in_len) + SO_HEADER_SIZE_STATIC + ((delegated) ? (SO_TA_ID_LEN + SO_AUTH_ID_LEN) : 0))
108 
135 DSO_EXPORT TEE_Result TEES_WrapSecureObject(
136  const unsigned char *in,
137  uint32_t in_len,
138  unsigned char *out,
139  uint32_t *out_len,
140  SO_AccessControlInfoType *ac);
141 
165 DSO_EXPORT TEE_Result TEES_UnwrapSecureObject(
166  const unsigned char *in,
167  uint32_t in_len,
168  unsigned char *out,
169  uint32_t *out_len);
170 
194 DSO_EXPORT TEE_Result TEES_CheckSecureObjectCreator(
195  const unsigned char *in,
196  uint32_t in_len,
197  SO_AccessControlInfoType *ac);
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif //_TEES_SECURE_OBJECT_H
204 
TEE_Result TEES_WrapSecureObject(const unsigned char *in, uint32_t in_len, unsigned char *out, uint32_t *out_len, SO_AccessControlInfoType *ac)
Encrypt and sign input data.
TEE_Result TEES_UnwrapSecureObject(const unsigned char *in, uint32_t in_len, unsigned char *out, uint32_t *out_len)
Decrypt and verify wrapped data.
TEE_Result TEES_CheckSecureObjectCreator(const unsigned char *in, uint32_t in_len, SO_AccessControlInfoType *ac)
Check UUID and AUTH_ID of creator on wrapped data.