blob: cc10cc236d5bf310ab214357ddf394cfc7e88ba3 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2007
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * che_sw_driver.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * Cipher/Hash Engine software driver.
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 *
60 * removed!
61 * removed!
62 * removed!
63 *
64 * removed!
65 * removed!
66 * removed!
67 * removed!
68 * removed!
69 * removed!
70 * removed!
71 *
72 * removed!
73 * removed!
74 * removed!
75 *
76 * removed!
77 * removed!
78 * removed!
79 *
80 * removed!
81 * removed!
82 * removed!
83 *
84 * removed!
85 * removed!
86 * removed!
87 *
88 * removed!
89 * removed!
90 * removed!
91 *
92 * removed!
93 * removed!
94 * removed!
95 *
96 * removed!
97 * removed!
98 * removed!
99 *
100 * removed!
101 * removed!
102 * removed!
103 *
104 * removed!
105 * removed!
106 * removed!
107 *
108 * removed!
109 * removed!
110 * removed!
111 *
112 * removed!
113 * removed!
114 * removed!
115 *
116 * removed!
117 * removed!
118 * removed!
119 *
120 *------------------------------------------------------------------------------
121 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
122 *============================================================================
123 ****************************************************************************/
124
125#ifndef _CHE_SW_Driver_H
126#define _CHE_SW_Driver_H
127
128#include "che_api.h"
129
130
131#if !defined(__CHE_WIN32_STANDALONE__)
132
133#define malloc get_ctrl_buffer
134#define free free_ctrl_buffer
135#endif /* !defined(__CHE_WIN32_STANDALONE__) */
136
137#include "kal_public_api.h"
138#include "kal_general_types.h"
139
140extern kal_bool che_sw_des(
141 STCHE *che_context,
142 CHE_TYPE type,
143 CHE_OPERATION_MODE mode,
144 CHE_ACTION act,
145 kal_uint8 *data_src,
146 kal_uint8 *data_dst,
147 kal_int32 length,
148 kal_bool last_block);
149
150extern kal_bool che_sw_aes(
151 STCHE *che_context,
152 CHE_OPERATION_MODE mode,
153 CHE_ACTION act,
154 kal_uint8 *data_src,
155 kal_uint8 *encryptedData,
156 kal_int32 length,
157 kal_bool last_block,
158 void *aes_param);
159
160extern kal_bool che_sw_md5(
161 STCHE *che_context,
162 kal_uint8 *data_src,
163 kal_uint8 *data_dst,
164 kal_int32 length,
165 kal_bool last_block);
166
167extern kal_bool che_sw_sha_1(
168 STCHE *che_context,
169 kal_uint8 *data_src,
170 kal_uint8 *data_dst,
171 kal_int32 length,
172 kal_bool last_block);
173
174extern kal_bool che_sw_rc4(
175 STCHE *che_context,
176 CHE_OPERATION_MODE mode,
177 kal_uint8 *data_src,
178 kal_uint8 *data_dst,
179 kal_uint32 length,
180 kal_bool last_block);
181
182extern kal_bool che_sw_md4(
183 STCHE *che_context,
184 kal_uint8 *data_src,
185 kal_uint8 *data_dst,
186 kal_int32 length,
187 kal_bool last_block);
188
189extern kal_bool che_sw_mac(
190 CHE_TYPE type,
191 STCHE *che_context,
192 kal_uint8 *data_src,
193 kal_uint8 *data_dst,
194 kal_int32 length,
195 kal_bool last_block);
196
197extern kal_bool che_sw_rsa_key_from_string(
198 STCHE *che_context,
199 CHE_ACTION act,
200 kal_uint8 *data_src,
201 kal_uint8 *data_dst,
202 kal_int32 length,
203 kal_bool last_block);
204
205extern kal_bool che_sw_dh(
206 STCHE *che_context,
207 CHE_ACTION act,
208 kal_uint8 *data_src,
209 kal_uint8 *data_dst,
210 kal_int32 length,
211 kal_bool last_block);
212
213#if 0
214/* under construction !*/
215/* under construction !*/
216/* under construction !*/
217/* under construction !*/
218/* under construction !*/
219/* under construction !*/
220/* under construction !*/
221/* under construction !*/
222/* under construction !*/
223/* under construction !*/
224/* under construction !*/
225/* under construction !*/
226/* under construction !*/
227/* under construction !*/
228/* under construction !*/
229/* under construction !*/
230/* under construction !*/
231/* under construction !*/
232/* under construction !*/
233#endif
234
235#if !defined(__CHE_NO_SHA256__)
236
237extern kal_bool che_sw_sha_256(
238 STCHE *che_context,
239 kal_uint8 *data_src,
240 kal_uint8 *data_dst,
241 kal_int32 length,
242 kal_bool last_block);
243
244extern kal_bool che_sw_sha_224(
245 STCHE *che_context,
246 kal_uint8 *data_src,
247 kal_uint8 *data_dst,
248 kal_int32 length,
249 kal_bool last_block);
250
251#endif
252#endif /* _CHE_SW_Driver_H */
253