botan icon indicating copy to clipboard operation
botan copied to clipboard

Issue with implementing EC Point addition with a scalar private key

Open skaht opened this issue 2 years ago • 1 comments

Having an issue romancing the existing Botan object interface to mimic the functionality shown here with a short standalone example, likely my inexperience. Was thinking EC_Point could help with implementing bx-ec-add for curves other than just secp256k1.

Here is a more specific context. What if a Kpar (parent public key) passed into a "Public parent key → public child key" HD derivation function is explicitly passed as an uncompressed public key instead of a compressed public key embedded in the front portion of an hmac hash to avoid a conversion from a compressed input public key to to an uncompressed public key? Then calculating, the child uncompressed public key requires support of elliptic curve point addition with G*scalar HD key offset, and subsequently converting an uncompressed public key (for internal and external consumption) to a compressed public key becomes trivial.

skaht avatar May 13 '23 01:05 skaht

Test Vectors:

% bx ec-add 0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2 6539ae80b3618c22f5f8cc4171d04835570bda8db11b5bf1779afae7ec7c79c3 027c4b09ffb985c298afe7e5813266cbfcb7780b480ac294b0b43dc21f2be3d13c

% bx ec-add 027c4b09ffb985c298afe7e5813266cbfcb7780b480ac294b0b43dc21f2be3d13c f9015a95c832036e67f19de70420ff3c8b190598aa5e640af1d78c4ef04c680d 02e740d213a1aa5746c66bae1ecda3b95d7f64d4bf8aff9d93702fc302f28df0f1

skaht avatar May 13 '23 01:05 skaht