Lines Matching +full:aes +full:- +full:cmac
1 /* SPDX-License-Identifier: GPL-2.0-only */
17 #include <crypto/aes.h>
27 * ccp_present - check if a CCP device is present
29 * Returns zero if a CCP device is present, -ENODEV otherwise.
34 #define CCP_VMASK ((unsigned int)((1 << CCP_VSIZE) - 1))
39 * ccp_version - get the version of the CCP
46 * ccp_enqueue_cmd - queue an operation for processing by the CCP
55 * result in a return code of -EBUSY.
61 * will be -EINPROGRESS. Any other "err" value during callback is
65 * the return code is -EINPROGRESS or
66 * the return code is -EBUSY and CCP_CMD_MAY_BACKLOG flag is set
74 return -ENODEV; in ccp_present()
84 return -ENODEV; in ccp_enqueue_cmd()
90 /***** AES engine *****/
92 * ccp_aes_type - AES key size
94 * @CCP_AES_TYPE_128: 128-bit key
95 * @CCP_AES_TYPE_192: 192-bit key
96 * @CCP_AES_TYPE_256: 256-bit key
106 * ccp_aes_mode - AES operation mode
113 * @CCP_AES_MODE_CMAC: CMAC mode
130 * ccp_aes_mode - AES operation mode
132 * @CCP_AES_ACTION_DECRYPT: AES decrypt operation
133 * @CCP_AES_ACTION_ENCRYPT: AES encrypt operation
145 * struct ccp_aes_engine - CCP AES operation
146 * @type: AES operation key size
147 * @mode: AES operation mode
148 * @action: AES operation (decrypt/encrypt)
149 * @key: key to be used for this AES operation
151 * @iv: IV to be used for this AES operation
156 * @cmac_final: indicates final operation when running in CMAC mode
157 * @cmac_key: K1/K2 key used in final CMAC operation
161 * - type, mode, action, key, key_len, src, dst, src_len
162 * - iv, iv_len for any mode other than ECB
163 * - cmac_final for CMAC mode
164 * - cmac_key, cmac_key_len for CMAC mode if cmac_final is non-zero
167 * AES operation the new IV overwrites the old IV.
185 u32 cmac_final; /* Indicates final cmac cmd */
186 struct scatterlist *cmac_key; /* K1/K2 cmac key required for
187 * final cmac cmd */
193 /***** XTS-AES engine *****/
195 * ccp_xts_aes_unit_size - XTS unit size
213 * struct ccp_xts_aes_engine - CCP XTS AES operation
214 * @action: AES operation (decrypt/encrypt)
216 * @key: key to be used for this XTS AES operation
218 * @iv: IV to be used for this XTS AES operation
226 * - action, unit_size, key, key_len, iv, iv_len, src, dst, src_len, final
229 * AES operation the new IV overwrites the old IV.
250 * ccp_sha_type - type of SHA operation
252 * @CCP_SHA_TYPE_1: SHA-1 operation
253 * @CCP_SHA_TYPE_224: SHA-224 operation
254 * @CCP_SHA_TYPE_256: SHA-256 operation
266 * struct ccp_sha_engine - CCP SHA operation
279 * - type, ctx, ctx_len, src, src_len, final
280 * - msg_bits if final is non-zero
323 * struct ccp_des3_engine - CCP SHA operation
329 * @iv: IV to be used for this AES operation
336 * - type, mode, action, key, key_len, src, dst, src_len
337 * - iv, iv_len for any mode other than ECB
359 * struct ccp_rsa_engine - CCP RSA operation
370 * - key_size, exp, exp_len, mod, mod_len, src, dst, src_len
387 * ccp_passthru_bitwise - type of bitwise passthru operation
405 * ccp_passthru_byteswap - type of byteswap passthru operation
408 * @CCP_PASSTHRU_BYTESWAP_32BIT: swap bytes within 32-bit words
409 * @CCP_PASSTHRU_BYTESWAP_256BIT: swap bytes within 256-bit words
419 * struct ccp_passthru_engine - CCP pass-through operation
427 * @final: indicate final pass-through operation
430 * - bit_mod, byte_swap, src, dst, src_len
431 * - mask, mask_len if bit_mod is not CCP_PASSTHRU_BITWISE_NOOP
447 * struct ccp_passthru_nomap_engine - CCP pass-through operation
456 * @final: indicate final pass-through operation
459 * - bit_mod, byte_swap, src, dst, src_len
460 * - mask, mask_len if bit_mod is not CCP_PASSTHRU_BITWISE_NOOP
476 #define CCP_ECC_MODULUS_BYTES 48 /* 384-bits */
481 * ccp_ecc_function - type of ECC function
483 * @CCP_ECC_FUNCTION_MMUL_384BIT: 384-bit modular multiplication
484 * @CCP_ECC_FUNCTION_MADD_384BIT: 384-bit modular addition
485 * @CCP_ECC_FUNCTION_MINV_384BIT: 384-bit multiplicative inverse
486 * @CCP_ECC_FUNCTION_PADD_384BIT: 384-bit point addition
487 * @CCP_ECC_FUNCTION_PMUL_384BIT: 384-bit point multiplication
488 * @CCP_ECC_FUNCTION_PDBL_384BIT: 384-bit point doubling
500 * struct ccp_ecc_modular_math - CCP ECC modular math parameters
522 * struct ccp_ecc_point - CCP ECC point definition
537 * struct ccp_ecc_point_math - CCP ECC point math parameters
563 * struct ccp_ecc_engine - CCP ECC operation
572 * - function, mod, mod_len
573 * - operand, operand_len, operand_count, output, output_len, output_count
574 * - ecc_result
592 * ccp_engine - CCP operation identifiers
594 * @CCP_ENGINE_AES: AES operation
595 * @CCP_ENGINE_XTS_AES: 128-bit XTS AES operation
599 * @CCP_ENGINE_PASSTHRU: pass-through operation
620 * struct ccp_cmd - CCP operation request
633 * - engine, callback
634 * - See the operation structures below for what is required for each
652 struct ccp_aes_engine aes; member