| 251 | |
| 252 | |
| 253 | bool bip32_pubkey(const struct ext_key *bip32_base, |
| 254 | struct pubkey *pubkey, u32 index) |
| 255 | { |
| 256 | const uint32_t flags = BIP32_FLAG_KEY_PUBLIC | BIP32_FLAG_SKIP_HASH; |
| 257 | struct ext_key ext; |
| 258 | |
| 259 | if (index >= BIP32_INITIAL_HARDENED_CHILD) |
| 260 | return false; |
| 261 | |
| 262 | if (bip32_key_from_parent(bip32_base, index, flags, &ext) != WALLY_OK) |
| 263 | return false; |
| 264 | |
| 265 | if (!secp256k1_ec_pubkey_parse(secp256k1_ctx, &pubkey->pubkey, |
| 266 | ext.pub_key, sizeof(ext.pub_key))) |
| 267 | return false; |
| 268 | return true; |
| 269 | } |
no outgoing calls
no test coverage detected