ModusToolbox AES code example

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
skxo_3327291
Level 1
Level 1

Dear Cypress,

I have some questions about CE220454_PSoC6_CryptoAESDemo, using ModusToolBox.

-  First, does Cy_Crypto_Aes_Ecb_Run() function call the HW acceleration inside the PSoC6?

I ask this question because this function is present in the file cy_crypto.c  (in components/PSOC6pdl/drivers/source/ folder).

In this folder, other files describing crypto-functions are present such as cy_crypto_core_aes_v2.c and cy_crypto_core_aes_v1.c

Due to the non avaibility of the crypto library and the different versioning,  I would like to know:

- What are the differences between these three files?

- Can I use cy_crypto_core_aes_v2.c to perform HW aes acceleration on PSoC6?

- If yes can you provide example code please?

- Can you provide performance test and number of cycles for AES128 encryption using cy_crypto and cy_crypto_core_aes_v1/v2?

Thank you

Regards

sk

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Answering all your questions:

Q. Does Cy_Crypto_Aes_Ecb_Run() function call the HW acceleration inside the PSoC6?

Ans. Yes, all the functions located in the cy_crypto* files provide HW acceleration for the crypto operations inside PSoC6 MXCRYPTO IP block.

Q. What are the differences between these three files?

Ans. The differences between these files are in the usage model:

- Cy_Crypto_Aes_Ecb_Run() located in the "cy_crypto.c" file uses Client/Server model. In this model, firmware should start Crypto Server before any crypto operations.

The current revision of the cyrpto driver contains an appropriate example code of snippets.

- "cy_crypto_core_aes_v2.c" and "cy_crypto_core_aes_v1.c" provide functionality that uses Direct Calls model. The code snippets for this model will be added in the next version of the crypto driver (v2.40)

Q. Can I use cy_crypto_core_aes_v2.c to perform HW aes acceleration on PSoC6?

Ans. cy_crypto_core_aes_v2.c provides AES functionality only for MXCRYPTO_ver2 based chips (PSoC6A-2M or Traveo) not for PSoC6A-BLE2.

For PSoC6A-BLE2 crypto driver have AES implementation located in the cy_crypto_core_aes_v1.c

For Direct Calls usage model you should use only hardware independent functions located in the cy_crypto_core_aes.h file not directly from cy_crypto_core_aes_v1 or cy_crypto_core_aes_v2. Driver will select appropriate functionality automatically.

If yes can you provide example code please?

aes_hw.png

Q. Can you provide performance test and number of cycles for AES128 encryption using cy_crypto and cy_crypto_core_aes_v1/v2?

Ans. Currently, we do not have these values.

Regards,

Dheeraj

View solution in original post

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Answering all your questions:

Q. Does Cy_Crypto_Aes_Ecb_Run() function call the HW acceleration inside the PSoC6?

Ans. Yes, all the functions located in the cy_crypto* files provide HW acceleration for the crypto operations inside PSoC6 MXCRYPTO IP block.

Q. What are the differences between these three files?

Ans. The differences between these files are in the usage model:

- Cy_Crypto_Aes_Ecb_Run() located in the "cy_crypto.c" file uses Client/Server model. In this model, firmware should start Crypto Server before any crypto operations.

The current revision of the cyrpto driver contains an appropriate example code of snippets.

- "cy_crypto_core_aes_v2.c" and "cy_crypto_core_aes_v1.c" provide functionality that uses Direct Calls model. The code snippets for this model will be added in the next version of the crypto driver (v2.40)

Q. Can I use cy_crypto_core_aes_v2.c to perform HW aes acceleration on PSoC6?

Ans. cy_crypto_core_aes_v2.c provides AES functionality only for MXCRYPTO_ver2 based chips (PSoC6A-2M or Traveo) not for PSoC6A-BLE2.

For PSoC6A-BLE2 crypto driver have AES implementation located in the cy_crypto_core_aes_v1.c

For Direct Calls usage model you should use only hardware independent functions located in the cy_crypto_core_aes.h file not directly from cy_crypto_core_aes_v1 or cy_crypto_core_aes_v2. Driver will select appropriate functionality automatically.

If yes can you provide example code please?

aes_hw.png

Q. Can you provide performance test and number of cycles for AES128 encryption using cy_crypto and cy_crypto_core_aes_v1/v2?

Ans. Currently, we do not have these values.

Regards,

Dheeraj

0 Likes