Forums - Elliptic Curve Cryptography (ECC)

1 post / 0 new
Elliptic Curve Cryptography (ECC)
qinjingyu
Join Date: 18 Apr 18
Posts: 1
Posted: Thu, 2018-04-19 00:19

I'm using the CSR_uEnergy_SDK-3.0.3  and the ECC libs  with a CSR102x chip, but i can't generate thECDH shared secret while using the below public key as peer public key:

f465e43ff23d3f1b9dc7dfc04da8758184dbc966204796eccf0d6cf5e16500cc0201d048bcbbd899eeefc424164e33c201c2b010ca6b4d43a8a155cad8ecb279

And this public key is one of data of the PB-ADV provisioning sample data in the SIG mesh profile -> 8 Sample data -> 8.7 PB-ADV provisioning sample data -> Device Public Key .

The mesh public key using NIST P-256 Elliptic Curve, and the CSR_uEnergy_SDK-3.0.3 support NIST P-256, but why the CSR_uEnergy_SDK-3.0.3 treat the mesh sample public key as a invalid public key?

 


 
status = EccGenerateKeyPair(&my_keypair);
 
static uint16 peer_public_key[] =
{
    0, 0xf465, 0xe43f, 0xf23d, 0x3f1b, 0x9dc7, 0xdfc0, 0x4da8, 0x7581, 0x84db, 0xc966, 0x2047, 0x96ec, 0xcf0d, 0x6cf5, 0xe165, 0x00cc,
    0, 0x0201, 0xd048, 0xbcbb, 0xd899, 0xeeef, 0xc424, 0x164e, 0x33c2, 0x01c2, 0xb010, 0xca6b, 0x4d43, 0xa8a1, 0x55ca, 0xd8ec, 0xb279
};
 
static uint16 shared_key[EC_P256_SHARED_SECRET_BUF_SIZE_WORDS];
static ecdh_context my_ctx =
{
    .keypair = my_keypair,
    .peer_public_key = peer_public_key,
    .shared_secret = shared_key
};
 
status_t AppProcessEvent(msg_t * msg)
{
switch (msg->header.id)
{
if (((ecc_msg_t *)msg)->body.generate_key_pair_cfm.status == sys_status_success)
{
status = EccGenerateSharedSecret(&my_ctx);
}
break;
 
// the generate_shared_secret_cfm.status == ecc_status_param_public with this peer_public_key
if (((ecc_msg_t *)msg)->body.generate_shared_secret_cfm.status == sys_status_success)
{
// only success while using the peer_public_key = my_keypair.public_key
}
break;
 
default:
break;
}
 
}
Any one can help? Thanks.

Best Regards,

Qin

 

 

 
  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.