12 #define CRYPTOCOP_SESSION_ID_NONE (0)
17 #define ETRAXCRYPTOCOP_IOCTYPE (250)
19 #define CRYPTOCOP_IO_CREATE_SESSION _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 1, struct strcop_session_op)
20 #define CRYPTOCOP_IO_CLOSE_SESSION _IOW(ETRAXCRYPTOCOP_IOCTYPE, 2, struct strcop_session_op)
21 #define CRYPTOCOP_IO_PROCESS_OP _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 3, struct strcop_crypto_op)
22 #define CRYPTOCOP_IO_MAXNR (3)
78 #define CRYPTOCOP_CSUM_LENGTH (2)
79 #define CRYPTOCOP_MAX_DIGEST_LENGTH (20)
80 #define CRYPTOCOP_MAX_IV_LENGTH (16)
81 #define CRYPTOCOP_MAX_KEY_LENGTH (32)
128 cryptocop_alg_csum = 0,
129 cryptocop_alg_mem2mem,
136 } cryptocop_algorithm;
138 typedef u8 cryptocop_tfrm_id;
141 struct cryptocop_operation;
143 typedef void (cryptocop_callback)(
struct cryptocop_operation*,
void*);
145 struct cryptocop_transform_init {
146 cryptocop_algorithm alg;
154 cryptocop_tfrm_id
tid;
155 struct cryptocop_transform_init *
next;
160 cryptocop_source_dma = 0,
161 cryptocop_source_des,
162 cryptocop_source_3des,
163 cryptocop_source_aes,
164 cryptocop_source_md5,
165 cryptocop_source_sha1,
166 cryptocop_source_csum,
167 cryptocop_source_none,
171 struct cryptocop_desc_cfg {
172 cryptocop_tfrm_id
tid;
173 cryptocop_source
src;
175 struct cryptocop_desc_cfg *
next;
178 struct cryptocop_desc {
180 struct cryptocop_desc_cfg *
cfg;
181 struct cryptocop_desc *
next;
186 #define CRYPTOCOP_NO_FLAG (0x00)
187 #define CRYPTOCOP_ENCRYPT (0x01)
188 #define CRYPTOCOP_DECRYPT (0x02)
189 #define CRYPTOCOP_EXPLICIT_IV (0x04)
191 struct cryptocop_tfrm_cfg {
192 cryptocop_tfrm_id
tid;
205 struct cryptocop_tfrm_cfg *
next;
210 struct cryptocop_dma_list_operation{
225 struct cryptocop_tfrm_operation{
227 struct cryptocop_tfrm_cfg *tfrm_cfg;
228 struct cryptocop_desc *
desc;
230 struct iovec *indata;
234 struct iovec *outdata;
240 struct cryptocop_operation {
241 cryptocop_callback *
cb;
247 int operation_status;
250 unsigned int use_dmalists:1;
252 unsigned int fast_callback:1;
255 struct cryptocop_dma_list_operation list_op;
256 struct cryptocop_tfrm_operation tfrm_op;