| 325 | } |
| 326 | |
| 327 | bool CPubKey::Decompress() { |
| 328 | if (!IsValid()) |
| 329 | return false; |
| 330 | secp256k1_pubkey pubkey; |
| 331 | if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) { |
| 332 | return false; |
| 333 | } |
| 334 | unsigned char pub[SIZE]; |
| 335 | size_t publen = SIZE; |
| 336 | secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, SECP256K1_EC_UNCOMPRESSED); |
| 337 | Set(pub, pub + publen); |
| 338 | return true; |
| 339 | } |
| 340 | |
| 341 | bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc, uint256* bip32_tweak_out) const { |
| 342 | assert(IsValid()); |