SE050: ECDH - Se05x_API_ECGenSharedSecret

Showing results for 
Search instead for 
Did you mean: 

SE050: ECDH - Se05x_API_ECGenSharedSecret

Contributor III


I am calling this API from my context session (SCP03 encrypted), using a valid object id that identifies a valid EC key that exists in persistent memory and passing the public key and length 

Se05x_API_ECGenSharedSecret(&session->s_ctx, kid, key, key_len, secret, len);

The kid is a valid object id.

secret: is a valid pointer to a buffer of 512 bytes

secret_len: is a valid pointer pointing to the number 512

The key:

I/TC: public key : 32 bytes, x=32, y=32

I/TC: se050: ecc: : public x:
I/TC: se050: ecc: : 36.3f.84.e8.c6.39.32.df
I/TC: se050: ecc: : f6.12.f0.85.21.b4.b6.e5

I/TC: se050: ecc: : public y:
I/TC: se050: ecc: : 34.b9.56.6b.99.17.32.b3
I/TC: se050: ecc: : 38.9d.d0.f9.b3.26.a9.93 13.18.a8.11.d8.30.e8.7b

The key array is formed as: 0x04 + public_x + public_y

With the length = 1 + 32 + 32

The curve id of the kid is kSE05x_ECCurve_NIST_P256

The response I get from the SE050 to this APDU request is 0x6985

Since the kid - object with the private key - is valid, is there anything in the formatting of the public key that could be causing this call to fail?

Labels (1)
0 Kudos
1 Reply

Contributor III

please close this case. the public key being used to get the secret had an incorrect byte in it.

thanks and sorry about it.

0 Kudos