Hi,
I am trying to implement an elliptic curve scheme in micro_ecc, wherein the secret key is the addition of two random numbers and the public key is derived from the secret key as follows
priv_key = (a+b)
public_key = (a+b)G .
I have checked the code in micro_ecc the key pair generation is defined in uECC_make_key() in uECC.c but it seems that the implementation cannot be modified to add any new elements. I have run the code in pkg_micro-ecc-with-hwrng example given in tests folder. Can someone tell me how I can randomly select the secret key and then generate the key pair as mentioned above? If micro_ecc in Riot does not support it, can I do the same in the relic.
Not sure whether this is a question about RIOT pkg
or the uECC API. Can you clarify?
- Working with local copies of a
pkg
repository is possible while pointing to it during RIOT compilation: PKG_SOURCE_LOCAL=<path>
- There is uECC_compute_public_key in uECC, have you checked that?
The question is about the uECC in RIOT and I want to find out if the secret key generation method can be modified to add some other elements to it. I also need to know about a few more functions namely, multiplicative inverse **(1/r)**
of a random number **r**
, message authentication code (MAC), and point addition computation in uECC. I have checked the uECC_compute_public_key and I believe it can be used once I figure out the secret key generation. I am new to RIOT and UECC so asking basic questions. Thanks.
RIOT only provides the integration of uECC, so extending the external library is not much of a RIOT problem. What prevents you from simply extending your (local) version of uECC as a first step?
AFAIK we don’t have a primitive for calculating the a multiplicative inverse but this would probably be the right place to add it. There are couple of MACs in sys/crypto.
Generally, I would recommend relic over uECC if you wanted to do specific stuff with the ability to switch curves and multiplication algorithms.
Alright. So, I will check relic or extend uECC. Thanks for your help.