BOLOS TEE
bolos_crypto_platform_tee.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * BOLOS TEE
4 * (c) 2016, 2017 Ledger
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 ********************************************************************************/
18 
29 #ifndef __BOLOS_CRYPTO_PLATFORM_TEE_H__
30 
31 #define __BOLOS_CRYPTO_PLATFORM_TEE_H__
32 
33 typedef uint32_t bls_crypto_handle_t;
34 
36  bls_crypto_handle_t header;
37 };
38 typedef struct bls_ripemd160_s bls_ripemd160_t;
39 
40 struct bls_sha256_s {
41  bls_crypto_handle_t header;
42 };
43 typedef struct bls_sha256_s bls_sha256_t;
44 
45 struct bls_sha512_s {
46  bls_crypto_handle_t header;
47 };
48 typedef struct bls_sha512_s bls_sha512_t;
49 
50 struct bls_sha3_s {
51  bls_crypto_handle_t header;
52 };
53 typedef struct bls_sha3_s bls_sha3_t;
54 
55 struct bls_sha1_s {
56  bls_crypto_handle_t header;
57 };
58 typedef struct bls_sha1_s bls_sha1_t;
59 
60 
61 //typedef struct bls_crypto_handle_t bls_hash_t;
62 typedef bls_crypto_handle_t bls_hash_t;
63 
64 /* ======================================================================= */
65 /* HASH MAC */
66 /* ======================================================================= */
67 
69  bls_crypto_handle_t handle;
70 };
71 typedef struct bls_hmac_ripemd160_s bls_hmac_ripemd160_t;
72 
74  bls_crypto_handle_t handle;
75 };
76 typedef struct bls_hmac_sha256_s bls_hmac_sha256_t;
77 
79  bls_crypto_handle_t handle;
80 };
81 typedef struct bls_hmac_sha512_s bls_hmac_sha512_t;
82 
83 struct bls_hmac_s {
84  bls_crypto_handle_t handle;
85 };
86 typedef struct bls_hmac_s bls_hmac_t;
87 
88 
89 
90 /* ####################################################################### */
91 /* CIPHER/SIGNATURE */
92 /* ####################################################################### */
93 /* - DES
94  * - ECDSA
95  * - ECDH
96  * - RSA
97  */
98 
99 
100 /* ======================================================================= */
101 /* DES */
102 /* ======================================================================= */
103 
104 
105 #define CX_DES_BLOCK_SIZE 8
106 
108  bls_crypto_handle_t handle;
109 } ;
110 
111 typedef struct bls_des_key_s bls_des_key_t;
112 
113 
114 /* ======================================================================= */
115 /* AES */
116 /* ======================================================================= */
117 
118 
120  bls_crypto_handle_t handle;
121 };
122 
123 typedef struct bls_aes_key_s bls_aes_key_t;
124 
125 
126 /* ======================================================================= */
127 /* RSA */
128 /* ======================================================================= */
129 
131  bls_crypto_handle_t handle;
132 };
133 typedef struct bls_rsa_abstract_public_key_s bls_rsa_abstract_public_key_t;
134 
136  bls_crypto_handle_t handle;
137 };
138 typedef struct bls_rsa_abstract_private_key_s bls_rsa_abstract_private_key_t;
139 
140 
141 /* ======================================================================= */
142 /* ECDSA */
143 /* ======================================================================= */
144 
145 typedef struct bls_curve_domain_s {
146  bls_curve_t curve;
148 
150  bls_crypto_handle_t handle;
151 };
152 
154  bls_crypto_handle_t handle;
155 };
156 
157 typedef struct bls_ecfp_public_key_s bls_ecfp_public_key_t;
158 typedef struct bls_ecfp_private_key_s bls_ecfp_private_key_t;
159 
160 #endif //__BOLOS_CRYPTO_PLATFORM_TEE_H__
Definition: bolos_crypto_platform_tee.h:83
Definition: bolos_crypto_platform_tee.h:73
Definition: bolos_crypto_platform_tee.h:145
Definition: bolos_crypto_platform_tee.h:45
Definition: bolos_crypto_platform_tee.h:149
Definition: bolos_crypto_platform_tee.h:107
Definition: bolos_crypto_platform_tee.h:119
Definition: bolos_crypto_platform_tee.h:130
Definition: bolos_crypto_platform_tee.h:50
Definition: bolos_crypto_platform_tee.h:135
Definition: bolos_crypto_platform_tee.h:40
Definition: bolos_crypto_platform_tee.h:153
Definition: bolos_crypto_platform_tee.h:55
Definition: bolos_crypto_platform_tee.h:68
Definition: bolos_crypto_platform_tee.h:35
Definition: bolos_crypto_platform_tee.h:78