cancel
Showing results for 
Search instead for 
Did you mean: 

STSAFE-A120 ephemeral key Slot 0xff ECDH reuse?

simeonf
Associate

I'm running example 03_ECDH from https://github.com/STMicroelectronics/STSAFE-A120_examples/tree/main/Applications/Projects/03_ECDH

I modified the example to use ED25519 / Curve25519. I pasted the public key of some key I generated on my PC into the C source. After a power-cycle the asymmetric key info of the A120 looks like this:

 

 

-----------------------------------------------------------------------------------------

Global usage limit : 65535

------+----------------------------------------------------------------------------------

| ASYMMETRIC KEY INFO

------+----------+------------+---------------+------------+---------+-------------------

SLOT | PRESENCE | TYPE | EdDSA Variant | Gen Key AC | Sig Gen | Key establishment

------+----------+------------+---------------+------------+---------+-------------------
0x00 | x | NIST_P_256 | None | Forbidden | x | .
0x01 | x | ED25519 | Pure | Free | x | .
0x02 | . | . | None | Free | x | .
0x03 | . | . | None | Free | x | .
0x04 | . | . | None | Free | x | .
0xFF | . | . | None | Free | . | x

----------------------------------------------------------------------------------------------------------------

- Generate CURVE25519 in slot 0xFF

- Press any key to continue -

----------------------------------------------------------------------------------------------------------------[0m

  Then I run the stsafea_generate_ecc_key_pair() for slot 0xff and use the public key that is spit out there to generate a shared secret on my PC and on the target. The public key does not change across power cycles.

The asymmetric key table info after stsafea_generate_ecc_key_pair() does not change. Slot 0xFF is still indicated as unused (this seems odd to me).

stse_ecc_establish_shared_secret will now always create the same shared secret. when running stse_ecc_establish_shared_secret()

I expect slot 0xff to generate a new key pair on stsafea_generate_ecc_key_pair(). What am I doing wrong?

0 REPLIES 0