Samsung Internal API reference  2.0
tees_wrapped_with_rek.h
Go to the documentation of this file.
1 
9 #ifndef _TEES_WRAPPED_WITH_REK_H
10 #define _TEES_WRAPPED_WITH_REK_H
11 
12 #include <core/crypto_info.h>
13 #include <stdint.h>
14 #include <tee_internal_api.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
35 #define KM_KW_MAX_SALT_LEN 60
36 #define KM_KW_MAX_IV_LEN 12
37 #define KM_KW_MAX_AAD_LEN 32
38 #define KM_KW_MAX_KEY_LEN 32
39 #define KM_KW_MAX_INPUT_LEN 4096
40 #define KM_KW_MAX_TAG_LEN 16
41 
45 enum kw_mode {
46  WRAP,
47  UNWRAP,
48 };
49 
53 typedef struct wrapped_wkth_rek_t {
54  uint8_t salt[KM_KW_MAX_SALT_LEN];
55  uint32_t salt_len;
56  uint8_t iv[KM_KW_MAX_IV_LEN];
57  uint32_t iv_len;
58  uint8_t aad[KM_KW_MAX_AAD_LEN];
59  uint32_t aad_len;
60  uint8_t plaintext_key[KM_KW_MAX_INPUT_LEN];
61  uint32_t plaintext_key_len;
62  uint8_t encrypted_key[KM_KW_MAX_INPUT_LEN];
63  uint32_t encrypted_key_len;
64  uint8_t auth_tag[KM_KW_MAX_TAG_LEN];
65  uint32_t auth_tag_len;
66  uint32_t kw_mode;
67 } WRAP_REK;
68 
83 DSO_EXPORT TEE_Result TEES_WrappedWithREK(WRAP_REK *data);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* !__TEES_WRAPPED_WITH_REK__ */
90 
#define KM_KW_MAX_IV_LEN
Definition: tees_wrapped_with_rek.h:36
kw_mode
Wrapping mode. WRAP or UNWRAP.
Definition: tees_wrapped_with_rek.h:45
#define KM_KW_MAX_INPUT_LEN
Definition: tees_wrapped_with_rek.h:39
struct wrapped_wkth_rek_t WRAP_REK
Structure for wrapping with REK.
TEE_Result TEES_WrappedWithREK(WRAP_REK *data)
Wrapping with REK.
Structure for wrapping with REK.
Definition: tees_wrapped_with_rek.h:53
#define KM_KW_MAX_AAD_LEN
Definition: tees_wrapped_with_rek.h:37
#define KM_KW_MAX_TAG_LEN
Definition: tees_wrapped_with_rek.h:40
#define KM_KW_MAX_SALT_LEN
Definition: tees_wrapped_with_rek.h:35