diff options
Diffstat (limited to 'include/linux/ccp.h')
-rw-r--r-- | include/linux/ccp.h | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/include/linux/ccp.h b/include/linux/ccp.h index 90a1fbe84219..fa0261748920 100644 --- a/include/linux/ccp.h +++ b/include/linux/ccp.h | |||
@@ -292,6 +292,60 @@ struct ccp_sha_engine { | |||
292 | * final sha cmd */ | 292 | * final sha cmd */ |
293 | }; | 293 | }; |
294 | 294 | ||
295 | /***** 3DES engine *****/ | ||
296 | enum ccp_des3_mode { | ||
297 | CCP_DES3_MODE_ECB = 0, | ||
298 | CCP_DES3_MODE_CBC, | ||
299 | CCP_DES3_MODE_CFB, | ||
300 | CCP_DES3_MODE__LAST, | ||
301 | }; | ||
302 | |||
303 | enum ccp_des3_type { | ||
304 | CCP_DES3_TYPE_168 = 1, | ||
305 | CCP_DES3_TYPE__LAST, | ||
306 | }; | ||
307 | |||
308 | enum ccp_des3_action { | ||
309 | CCP_DES3_ACTION_DECRYPT = 0, | ||
310 | CCP_DES3_ACTION_ENCRYPT, | ||
311 | CCP_DES3_ACTION__LAST, | ||
312 | }; | ||
313 | |||
314 | /** | ||
315 | * struct ccp_des3_engine - CCP SHA operation | ||
316 | * @type: Type of 3DES operation | ||
317 | * @mode: cipher mode | ||
318 | * @action: 3DES operation (decrypt/encrypt) | ||
319 | * @key: key to be used for this 3DES operation | ||
320 | * @key_len: length of key (in bytes) | ||
321 | * @iv: IV to be used for this AES operation | ||
322 | * @iv_len: length in bytes of iv | ||
323 | * @src: input data to be used for this operation | ||
324 | * @src_len: length of input data used for this operation (in bytes) | ||
325 | * @dst: output data produced by this operation | ||
326 | * | ||
327 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
328 | * - type, mode, action, key, key_len, src, dst, src_len | ||
329 | * - iv, iv_len for any mode other than ECB | ||
330 | * | ||
331 | * The iv variable is used as both input and output. On completion of the | ||
332 | * 3DES operation the new IV overwrites the old IV. | ||
333 | */ | ||
334 | struct ccp_des3_engine { | ||
335 | enum ccp_des3_type type; | ||
336 | enum ccp_des3_mode mode; | ||
337 | enum ccp_des3_action action; | ||
338 | |||
339 | struct scatterlist *key; | ||
340 | u32 key_len; /* In bytes */ | ||
341 | |||
342 | struct scatterlist *iv; | ||
343 | u32 iv_len; /* In bytes */ | ||
344 | |||
345 | struct scatterlist *src, *dst; | ||
346 | u64 src_len; /* In bytes */ | ||
347 | }; | ||
348 | |||
295 | /***** RSA engine *****/ | 349 | /***** RSA engine *****/ |
296 | /** | 350 | /** |
297 | * struct ccp_rsa_engine - CCP RSA operation | 351 | * struct ccp_rsa_engine - CCP RSA operation |
@@ -541,7 +595,7 @@ struct ccp_ecc_engine { | |||
541 | enum ccp_engine { | 595 | enum ccp_engine { |
542 | CCP_ENGINE_AES = 0, | 596 | CCP_ENGINE_AES = 0, |
543 | CCP_ENGINE_XTS_AES_128, | 597 | CCP_ENGINE_XTS_AES_128, |
544 | CCP_ENGINE_RSVD1, | 598 | CCP_ENGINE_DES3, |
545 | CCP_ENGINE_SHA, | 599 | CCP_ENGINE_SHA, |
546 | CCP_ENGINE_RSA, | 600 | CCP_ENGINE_RSA, |
547 | CCP_ENGINE_PASSTHRU, | 601 | CCP_ENGINE_PASSTHRU, |
@@ -589,6 +643,7 @@ struct ccp_cmd { | |||
589 | union { | 643 | union { |
590 | struct ccp_aes_engine aes; | 644 | struct ccp_aes_engine aes; |
591 | struct ccp_xts_aes_engine xts; | 645 | struct ccp_xts_aes_engine xts; |
646 | struct ccp_des3_engine des3; | ||
592 | struct ccp_sha_engine sha; | 647 | struct ccp_sha_engine sha; |
593 | struct ccp_rsa_engine rsa; | 648 | struct ccp_rsa_engine rsa; |
594 | struct ccp_passthru_engine passthru; | 649 | struct ccp_passthru_engine passthru; |