23 #include <adi_processor.h> 24 #include <adi_callback.h> 25 #include <rtos_map/adi_rtos_map.h> 27 #include <adi_crypto_config.h> 56 #if (defined (__ADUCM4x50__) && (1 == ADI_CRYPTO_ENABLE_PKSTOR_SUPPORT)) 57 ADI_CRYPTO_PK_ALREADY_ENABLED,
58 ADI_CRYPTO_PK_ALREADY_DISABLED,
59 ADI_CRYPTO_PK_NOT_ENABLED,
60 ADI_CRYPTO_PK_INVALID_KUWLEN,
61 ADI_CRYPTO_PK_INVALID_KEY_INDEX,
62 ADI_CRYPTO_PK_CMD_BUSY,
63 ADI_CRYPTO_PK_CMD_FAULT,
64 ADI_CRYPTO_PK_CMD_ECC_FAULT,
80 #if defined (__ADUCM4x50__) 83 ADI_CRYPTO_RESERVED_EVENT,
96 #if defined (__ADUCM4x50__) 97 #if (1 == ADI_CRYPTO_ENABLE_PKSTOR_SUPPORT) 98 #define ADI_CRYPTO_MEMORY_SIZE (100u + ADI_SEM_SIZE) 100 #define ADI_CRYPTO_MEMORY_SIZE (92u + ADI_SEM_SIZE) 102 #elif defined (__ADUCM302x__) 103 #define ADI_CRYPTO_MEMORY_SIZE (88u + ADI_SEM_SIZE) 105 #error Crypto driver is not ported to this proccesor 113 #define ADI_CRYPTO_SHA_HASH_BYTES (256u/8u) 115 #if defined (__ADUCM4x50__) 117 #define ADI_CRYPTO_HMAC_HASH_BYTES (256u/8u) 134 #if defined (__ADUCM4x50__) 143 #if defined (__ADUCM4x50__) 169 #if defined (__ADUCM4x50__) 176 #if defined (__ADUCM4x50__) 177 #if ((1 == ADI_CRYPTO_ENABLE_PKSTOR_SUPPORT) || (1 == ADI_CRYPTO_ENABLE_HMAC_SUPPORT)) 181 ADI_PK_KUW_LEN_128 = (1u << BITP_CRYPT_CFG_KUWKEYLEN),
182 ADI_PK_KUW_LEN_256 = (2u << BITP_CRYPT_CFG_KUWKEYLEN),
183 ADI_PK_KUW_LEN_512 = (3u << BITP_CRYPT_CFG_KUWKEYLEN),
184 } ADI_CRYPTO_PK_KUW_LEN;
189 #if (defined (__ADUCM4x50__) && (1 == ADI_CRYPTO_ENABLE_PKSTOR_SUPPORT)) 193 ADI_PK_CMD_WRAP_KUW = (0x1 << BITP_CRYPT_PRKSTORCFG_CMD),
194 ADI_PK_CMD_UNWRAP_KUW = (0x2 << BITP_CRYPT_PRKSTORCFG_CMD),
195 ADI_PK_CMD_RESET_KUW = (0x3 << BITP_CRYPT_PRKSTORCFG_CMD),
196 ADI_PK_CMD_USE_KEY = (0x4 << BITP_CRYPT_PRKSTORCFG_CMD),
197 ADI_PK_CMD_USE_DEV_KEY = (0x5 << BITP_CRYPT_PRKSTORCFG_CMD),
199 ADI_PK_CMD_RETRIEVE_KEY = (0x8 << BITP_CRYPT_PRKSTORCFG_CMD),
200 ADI_PK_CMD_STORE_KEY = (0x9 << BITP_CRYPT_PRKSTORCFG_CMD),
201 ADI_PK_CMD_ERASE_KEY = (0xA << BITP_CRYPT_PRKSTORCFG_CMD),
202 ADI_PK_CMD_ERASE_PAGE = (0xB << BITP_CRYPT_PRKSTORCFG_CMD),
212 #if defined (__ADUCM4x50__) 247 #if (defined (__ADUCM4x50__) && (1 == ADI_CRYPTO_ENABLE_PKSTOR_SUPPORT)) 254 ADI_CRYPTO_PK_KUW_LEN pkKuwLen;
272 #if (ADI_CRYPTO_ENABLE_DMA_SUPPORT == 1) 276 #if (defined (__ADUCM4x50__) && (1 == ADI_CRYPTO_ENABLE_PKSTOR_SUPPORT))
ADI_CRYPTO_AES_BYTE_SWAP eAesByteSwap
ADI_CRYPTO_CODING_MODE eCodingMode
ADI_CRYPTO_SHA_BYTE_SWAP eShaByteSwap
ADI_CRYPTO_RESULT adi_crypto_GetBuffer(ADI_CRYPTO_HANDLE const hDevice, ADI_CRYPTO_TRANSACTION **const ppBuffer)
Get the submitted transaction buffer back from the driver.
ADI_CRYPTO_AES_KEY_LEN eAesKeyLen
ADI_CRYPTO_RESULT adi_crypto_RegisterCallback(ADI_CRYPTO_HANDLE const hDevice, ADI_CALLBACK const pfCallback, void *const pCBParam)
Register a user callback function.
ADI_CRYPTO_RESULT adi_crypto_Enable(ADI_CRYPTO_HANDLE const hDevice, bool const bEnable)
Enable/Disable the device. Enabling the device causes the submitted buffer to be processed.
ADI_CRYPTO_RESULT adi_crypto_Open(uint32_t const nDeviceNum, void *const pMemory, uint32_t const nMemorySize, ADI_CRYPTO_HANDLE *const phDevice)
Opens a Crypto device instance.
ADI_CRYPTO_KEY_BYTE_SWAP eKeyByteSwap
ADI_CRYPTO_RESULT adi_crypto_SubmitBuffer(ADI_CRYPTO_HANDLE const hDevice, ADI_CRYPTO_TRANSACTION *const pBuffer)
Submit a Crypto transaction buffer for processing.
struct __ADI_CRYPTO_DEV_DATA_TYPE * ADI_CRYPTO_HANDLE
ADI_CRYPTO_RESULT adi_crypto_IsBufferAvailable(ADI_CRYPTO_HANDLE const hDevice, bool *const pbAvailable)
Peek function to know whether a submitted transaction is complete.
ADI_CRYPTO_RESULT adi_crypto_Close(ADI_CRYPTO_HANDLE const hDevice)
Close the given device instance.
ADI_CRYPTO_CIPHER_MODE eCipherMode