My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
crypto_task.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * Header for Crypto task implementation
25  */
26 
27 
28 #ifndef __OTZ_APP_CRYPTO_TASK_H__
29 #define __OTZ_APP_CRYPTO_TASK_H__
30 
31 #include <sw_types.h>
32 #include <secure_api.h>
33 
40 typedef struct crypto_global
41 {
42 #ifdef OTZONE_ASYNC_NOTIFY_SUPPORT
43  int data_available;
44 #endif
46 
47 
56 void crypto_task(int task_id, sw_tls* tls);
69 int crypto_task_init(sa_config_t *psa_config);
70 
81 int crypto_task_exit(void* data);
82 
83 
101 int process_otz_crypto_cmd(void *req_buf, u32 req_buf_len,
102  void *res_buf, u32 res_buf_len,
103  struct otzc_encode_meta *meta_data,
104  u32 *ret_res_buf_len);
105 
123 int process_otz_crypto_svc(u32 svc_cmd_id, void *req_buf, u32 req_buf_len,
124  void *resp_buf, u32 res_buf_len,
125  struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len);
139 int process_otz_crypto_digest_cmd(void *req_buf, u32 req_buf_len,
140  void *res_buf, u32 res_buf_len,
141  struct otzc_encode_meta *meta_data,
142  u32 *ret_res_buf_len,u32 svc_cmd_id);
143 
148 
153 
167 int process_otz_crypto_hmac_cmd(void *req_buf, u32 req_buf_len,
168  void *res_buf, u32 res_buf_len,
169  struct otzc_encode_meta *meta_data,
170  u32 *ret_res_buf_len,u32 svc_cmd_id);
171 
185 int process_otz_crypto_cipher_cmd(void *req_buf, u32 req_buf_len,
186  void *res_buf, u32 res_buf_len,
187  struct otzc_encode_meta *meta_data,
188  u32 *ret_res_buf_len,u32 svc_cmd_id);
189 #endif /* __OTZ_APP_TASK2_H__ */
190 
int process_otz_crypto_svc(u32 svc_cmd_id, void *req_buf, u32 req_buf_len, void *resp_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len)
Process crypto service.
Task local storage.
Definition: task.h:79
int process_otz_crypto_cipher_cmd(void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len, u32 svc_cmd_id)
int process_otz_crypto_cmd(void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len)
Encrypts the data for the user supplied buffer.
void process_otz_crypto_load_libs()
Adds all digest and encryption algorithms to internal table.
Definition: crypto_task.c:69
int process_otz_crypto_digest_cmd(void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len, u32 svc_cmd_id)
Secure API configuration details for task.
Definition: task.h:40
void crypto_task(int task_id, sw_tls *tls)
Crypto task entry point.
Definition: crypto_task.c:580
Global variables for the task should be defined as a member of the global structure.
Definition: crypto_task.h:40
struct crypto_global crypto_global
Global variables for the task should be defined as a member of the global structure.
int crypto_task_exit(void *data)
Crypto task exit.
Definition: crypto_task.c:629
u8 * data
Definition: fat32.c:40
Metadata used for encoding/decoding.
Definition: otz_common.h:93
int process_otz_crypto_hmac_cmd(void *req_buf, u32 req_buf_len, void *res_buf, u32 res_buf_len, struct otzc_encode_meta *meta_data, u32 *ret_res_buf_len, u32 svc_cmd_id)
void process_otz_crypto_unload_libs()
Removes all ciphers and digests from the table.
Definition: crypto_task.c:80
int crypto_task_init(sa_config_t *psa_config)
: Crypto task init
Definition: crypto_task.c:599