From d00002ee69339a23fa6522b8455b606b12600a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Vejpustek?= Date: Fri, 2 Aug 2024 17:06:11 +0200 Subject: [PATCH] refactor(crypto): use secp256k1 submodule in bip32 [no changelog] --- crypto/bip32.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crypto/bip32.c b/crypto/bip32.c index ee44c24e3c..319e419409 100644 --- a/crypto/bip32.c +++ b/crypto/bip32.c @@ -300,8 +300,12 @@ int hdnode_public_ckd_cp(const ecdsa_curve *curve, const curve_point *parent, hmac_sha512(parent_chain_code, 32, data, sizeof(data), I); bn_read_be(I, &c); if (bn_is_less(&c, &curve->order)) { // < order - scalar_multiply(curve, &c, child); // b = c * G - point_add(curve, parent, child); // b = a + b + // b = c * G + uint8_t child_pubkey[65] = {0}; + ecdsa_get_public_key65(curve, I, child_pubkey); + ecdsa_read_pubkey(curve, child_pubkey, child); + + point_add(curve, parent, child); // b = a + b if (!point_is_infinity(child)) { if (child_chain_code) { memcpy(child_chain_code, I + 32, 32);