PSOC 6 Crypto

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

cross mob
Francesco
Level 1
Level 1
First reply posted First question asked Welcome!

Hello,

I am able to perform the following transactions in order with success:

Cy_Crypto_Sha_Run(), Cy_Crypto_Rsa_Proc(), Cy_Crypto_Aes_Init()

 

If I change the order it does not work anymore:

Cy_Crypto_Aes_Init(), Cy_Crypto_Sha_Run(), Cy_Crypto_Rsa_Proc()

 

Why I am unable to perform a Sha_Run()/Rsa_Proc() if i perform a Aes_init() before?

 

Thank you,

Francesco

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Pushyanth_K
Moderator
Moderator
Moderator
100 sign-ins 10 solutions authored 50 replies posted

 

HI @Francesco ,


If you call the functions in the order:
1.Cy_Crypto_Aes_Init()
2.Cy_Crypto_Rsa_Proc()
3.Cy_Crypto_Aes_Ecb_Run()

The Cy_Crypto_Rsa_Proc() overwrites the key placed in the Crypto Memory buffer address. In the attached image, you can see that the Crypto memory buffer is cleared (Using Cy_Crypto_Core_Memset()). So if you call the Cy_Crypto_Aes_Ecb_Run() after Rsa_Proc(), then the encryption of AES will not happen with the actual key. But it will not affect the Rsa_Proc(). Can you confirm whether Rsa_Proc() or Aes_Ecb() that is getting affected?


Regards,

View solution in original post

0 Likes
4 Replies
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Francesco ,

The Init functions are only to initialize the different techniques offered by the respective crypto block. For example, Cy_Crypto_Aes_Init() is needed for AES operations. If you want to use a different encryption scheme for AES, then you need to call  Cy_Crypto_Aes_Init()You must initialize this technique again after using any other encryption technique.

Gautami_12_0-1668490185366.png

Please refer to the  PDL and try to implement the project accordingly.

Gautami_12_1-1668490255958.png

Warm Regards,
Gautami J

 

 

 

0 Likes
Hello Gautami,



The issue is I am able to perform a RSA_PROC() but it doesn't work
anymore if I perform an AES_INIT() before. Any thoughts on how the
AES_INIT() may impact the RSA_PROC()?



Thank you,



Francesco


--
Francesco Giordano, Eng.
Hardware & Firmware Developer at Hexoskin

+1 888 887 2044 | www.hexoskin.com




Montréal: 5800, rue Saint-Denis, Suite 601, Montréal (Québec) H2S 3L5
The content of this email, its attachments, linked documents, and
referred documents, is confidential.
100+ Research Publications with Hexoskin Data
Discover Hexoskin Connected Health Platform
Monitoring Solutions to track COVID-19 Symptoms Remotely & Continuously

Visit the Hexoskin Support Community
0 Likes
lock attach
Attachments are accessible only for community members.
Pushyanth_K
Moderator
Moderator
Moderator
100 sign-ins 10 solutions authored 50 replies posted

 

HI @Francesco ,


If you call the functions in the order:
1.Cy_Crypto_Aes_Init()
2.Cy_Crypto_Rsa_Proc()
3.Cy_Crypto_Aes_Ecb_Run()

The Cy_Crypto_Rsa_Proc() overwrites the key placed in the Crypto Memory buffer address. In the attached image, you can see that the Crypto memory buffer is cleared (Using Cy_Crypto_Core_Memset()). So if you call the Cy_Crypto_Aes_Ecb_Run() after Rsa_Proc(), then the encryption of AES will not happen with the actual key. But it will not affect the Rsa_Proc(). Can you confirm whether Rsa_Proc() or Aes_Ecb() that is getting affected?


Regards,
0 Likes
Pushyanth_K
Moderator
Moderator
Moderator
100 sign-ins 10 solutions authored 50 replies posted

Please let us know if your query was resolved.

We will lock the thread in 3 days.

If your problem is not resolved, please create a new thread and we will be happy to help. 

 

Regards,

Pushyanth

0 Likes