SE050: ECDH - Se05x_API_ECGenSharedSecret

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SE050: ECDH - Se05x_API_ECGenSharedSecret

1,007 Views
jorge_ramirez
Contributor III

Hi,

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: : 04.bf.cd.44.48.a7.e6.d9 36.3f.84.e8.c6.39.32.df
I/TC: se050: ecc: : f6.12.f0.85.21.b4.b6.e5 4d.ad.46.7a.d4.c1.bf.6c

I/TC: se050: ecc: : public y:
I/TC: se050: ecc: : 34.b9.56.6b.99.17.32.b3 f9.0b.bf.7c.a5.75.a3.61
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

965 Views
jorge_ramirez
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