Skip to main content
Associate II
August 7, 2024
Question

SPC58EC CRYPTO SW Crypto Libs for ECC signature, sign verify

  • August 7, 2024
  • 1 reply
  • 4456 views

 

I am currently developing with SPC5STUDIO and want to verify a signed message using ECDSA.

To do this, I am studying the example in ecc.h.

When I ran the example code:

retval = ECCinitEC(&ECparams, &mb);
retval = ECCinitPoint(&G, &ECparams, &mb);
retval = ECCsetPointGenerator(G, &ECparams);
retval = ECCinitPoint(&PubKey, &ECparams, &mb);
retval = ECCinitPrivKey(&privkey, &ECparams, &mb);
retval = ECCsetPrivKeyValue(privkey, ecc_160_privkey, sizeof(ecc_160_privkey));

 

These functions executed without any issues, and I confirmed that the keys and parameters were correctly set in each variable.

However, when I call the function retval = ECCscalarMul(G, privkey, PubKey, &ECparams, &mb);, the system stops working and crashes.

If you have any insights or comments on this issue, I would greatly appreciate it.

Thank you.

best regrds.

1 reply

Erwan YVIN
ST Employee
August 13, 2024

Hello ,

i recommend to check the PC, R14, R13 with your debugger

Maybe it is a stack pointer overflow 

     Best regards

                 Erwan

Associate II
August 14, 2024

Thank you for your response. Are PC, R13, and R14 referring to core registers? If so, what are these registers specifically, and what should I be checking in each of them? If it turns out that stack pointer overflow is indeed the issue, how can I resolve the problem? Thank you.