libbtc
bitcoinclibrary
|
Go to the source code of this file.
Data Structures | |
struct | btc_hdnode |
Macros | |
#define | BTC_BIP32_CHAINCODE_SIZE 32 |
#define | btc_hdnode_private_ckd_prime(X, I) btc_hdnode_private_ckd((X), ((I) | 0x80000000)) |
Functions | |
LIBBTC_API btc_bool | btc_hdnode_public_ckd (btc_hdnode *inout, uint32_t i) |
LIBBTC_API btc_bool | btc_hdnode_from_seed (const uint8_t *seed, int seed_len, btc_hdnode *out) |
LIBBTC_API btc_bool | btc_hdnode_private_ckd (btc_hdnode *inout, uint32_t i) |
LIBBTC_API void | btc_hdnode_fill_public_key (btc_hdnode *node) |
LIBBTC_API void | btc_hdnode_serialize_public (const btc_hdnode *node, const btc_chain *chain, char *str, int strsize) |
LIBBTC_API void | btc_hdnode_serialize_private (const btc_hdnode *node, const btc_chain *chain, char *str, int strsize) |
LIBBTC_API btc_bool | btc_hdnode_deserialize (const char *str, const btc_chain *chain, btc_hdnode *node) |
LIBBTC_API btc_bool | btc_hd_generate_key (btc_hdnode *node, const char *keypath, const uint8_t *privkeymaster, const uint8_t *chaincode) |
derive btc_hdnode including private key from master private key More... | |
#define BTC_BIP32_CHAINCODE_SIZE 32 |
Copyright (c) 2013-2014 Tomas Dzetkulic Copyright (c) 2013-2014 Pavol Rusnak Copyright (c) 2015 Douglas J. Bakkumk Copyright (c) 2015 Jonas Schnelli
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 39 of file bip32.h.
Referenced by btc_hd_generate_key(), btc_hdnode_deserialize(), btc_hdnode_from_seed(), btc_hdnode_private_ckd(), btc_hdnode_public_ckd(), and btc_hdnode_serialize().
#define btc_hdnode_private_ckd_prime | ( | X, | |
I | |||
) | btc_hdnode_private_ckd((X), ((I) | 0x80000000)) |
Definition at line 52 of file bip32.h.
Referenced by btc_hd_generate_key().
LIBBTC_API btc_bool btc_hd_generate_key | ( | btc_hdnode * | node, |
const char * | keypath, | ||
const uint8_t * | privkeymaster, | ||
const uint8_t * | chaincode | ||
) |
derive btc_hdnode including private key from master private key
Definition at line 245 of file bip32.c.
References BTC_BIP32_CHAINCODE_SIZE, BTC_ECKEY_PKEY_LENGTH, btc_hdnode_fill_public_key(), btc_hdnode_private_ckd(), btc_hdnode_private_ckd_prime, btc_hdnode::chain_code, btc_hdnode::child_num, btc_hdnode::depth, btc_hdnode::fingerprint, btc_hdnode::private_key, and strlens.
LIBBTC_API btc_bool btc_hdnode_deserialize | ( | const char * | str, |
const btc_chain * | chain, | ||
btc_hdnode * | node | ||
) |
Definition at line 216 of file bip32.c.
References btc_chain::b58prefix_bip32_privkey, btc_chain::b58prefix_bip32_pubkey, btc_base58_decode_check(), BTC_BIP32_CHAINCODE_SIZE, BTC_ECKEY_COMPRESSED_LENGTH, BTC_ECKEY_PKEY_LENGTH, btc_hdnode_fill_public_key(), btc_hdnode::chain_code, btc_hdnode::child_num, btc_hdnode::depth, btc_hdnode::fingerprint, btc_hdnode::private_key, btc_hdnode::public_key, and read_be().
LIBBTC_API void btc_hdnode_fill_public_key | ( | btc_hdnode * | node | ) |
Definition at line 178 of file bip32.c.
References BTC_ECKEY_COMPRESSED_LENGTH, ecc_get_pubkey(), btc_hdnode::private_key, and btc_hdnode::public_key.
Referenced by btc_hd_generate_key(), btc_hdnode_deserialize(), btc_hdnode_from_seed(), and btc_hdnode_private_ckd().
LIBBTC_API btc_bool btc_hdnode_from_seed | ( | const uint8_t * | seed, |
int | seed_len, | ||
btc_hdnode * | out | ||
) |
Definition at line 61 of file bip32.c.
References BTC_BIP32_CHAINCODE_SIZE, BTC_ECKEY_PKEY_LENGTH, btc_hdnode_fill_public_key(), btc_hdnode::chain_code, btc_hdnode::child_num, btc_hdnode::depth, ecc_verify_privatekey(), btc_hdnode::fingerprint, hmac_sha512(), and btc_hdnode::private_key.
LIBBTC_API btc_bool btc_hdnode_private_ckd | ( | btc_hdnode * | inout, |
uint32_t | i | ||
) |
Definition at line 124 of file bip32.c.
References BTC_BIP32_CHAINCODE_SIZE, BTC_ECKEY_COMPRESSED_LENGTH, BTC_ECKEY_PKEY_LENGTH, btc_hdnode_fill_public_key(), btc_hdnode::chain_code, btc_hdnode::child_num, btc_hdnode::depth, ecc_private_key_tweak_add(), ecc_verify_privatekey(), btc_hdnode::fingerprint, hmac_sha512(), btc_hdnode::private_key, btc_hdnode::public_key, ripemd160(), sha256_Raw(), and write_be().
Referenced by btc_hd_generate_key().
LIBBTC_API btc_bool btc_hdnode_public_ckd | ( | btc_hdnode * | inout, |
uint32_t | i | ||
) |
Definition at line 83 of file bip32.c.
References BTC_BIP32_CHAINCODE_SIZE, BTC_ECKEY_COMPRESSED_LENGTH, btc_hdnode::chain_code, btc_hdnode::child_num, btc_hdnode::depth, ecc_public_key_tweak_add(), btc_hdnode::fingerprint, hmac_sha512(), btc_hdnode::private_key, btc_hdnode::public_key, ripemd160(), sha256_Raw(), and write_be().
LIBBTC_API void btc_hdnode_serialize_private | ( | const btc_hdnode * | node, |
const btc_chain * | chain, | ||
char * | str, | ||
int | strsize | ||
) |
Definition at line 209 of file bip32.c.
References btc_chain::b58prefix_bip32_privkey, and btc_hdnode_serialize().
LIBBTC_API void btc_hdnode_serialize_public | ( | const btc_hdnode * | node, |
const btc_chain * | chain, | ||
char * | str, | ||
int | strsize | ||
) |
Definition at line 203 of file bip32.c.
References btc_chain::b58prefix_bip32_pubkey, and btc_hdnode_serialize().