2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
18 * @author Kyungwook Tak (k.tak@samsung.com)
20 * @brief Type definitions
32 #define API __attribute__ ((visibility("default")))
33 #define UNUSED __attribute__ ((unused))
36 WAE_DOWNLOADED_NORMAL_APP = 0,
37 WAE_DOWNLOADED_GLOBAL_APP = 1,
41 typedef struct _raw_buffer_s {
46 typedef struct _crypto_element_s {
52 typedef struct _crypto_element_map_s crypto_element_map_s;
54 raw_buffer_s *buffer_create(size_t size);
55 raw_buffer_s *buffer_create_managed(unsigned char *buf, size_t size);
56 void buffer_destroy(raw_buffer_s *);
57 bool is_buffer_valid(const raw_buffer_s *);
59 crypto_element_s *crypto_element_create(raw_buffer_s *dek, raw_buffer_s *iv);
60 void crypto_element_destroy(crypto_element_s *c);
61 bool is_crypto_element_valid(const crypto_element_s *);
63 extern const size_t MAX_MAP_ELEMENT_SIZE;
65 void crypto_element_map_destroy(crypto_element_map_s *);
66 int crypto_element_map_add(crypto_element_map_s **map, const char *key, crypto_element_s *value);
67 void crypto_element_map_remove(crypto_element_map_s **map, const char *key);
68 crypto_element_s *crypto_element_map_get(crypto_element_map_s *map, const char *key);
74 #endif /* __WAE_TYPES_H */