Question

How can I combine two ECDSA private/public keypairs into one? I know it's done with modular addition in openssl, I just don't understand how that works. Can anyone explain that to me?

Was it helpful?

Solution

You can do that by adding two private keys

privkey = privateA + privateB (mod order)

or, in OpenSSL code:

BN_mod_add_quick(privkey, privateA, privateB, order);

Here order is the smallest number where order = s - j, such that sP = jP for a point P on the elliptic curve. The public key of your new private key is pubkey = privkey * G, or:

EC_POINT_mul(group, pubkey, privkey, NULL, NULL, ctx);

The values of order and generator point G are curve parameters and are set when creating and setting group(an EC_GROUP object).

OTHER TIPS

ECDSA private key - is just a number, order of base point. You can just add two private keys (i.e. numbers), reducing sum modulo base point order, and exponentiating the base point to this order. But why should you need this?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top