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?

有帮助吗?

解决方案

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).

其他提示

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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top