libbtc
bitcoinclibrary
|
#include "btc/ecc_key.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "btc/ecc.h"
#include "btc/hash.h"
#include "random.h"
#include "ripemd160.h"
#include "utils.h"
Go to the source code of this file.
Functions | |
void | btc_privkey_init (btc_key *privkey) |
btc_bool | btc_privkey_is_valid (btc_key *privkey) |
void | btc_privkey_cleanse (btc_key *privkey) |
void | btc_privkey_gen (btc_key *privkey) |
btc_bool | btc_privkey_verify_pubkey (btc_key *privkey, btc_pubkey *pubkey) |
void | btc_pubkey_init (btc_pubkey *pubkey) |
btc_bool | btc_pubkey_is_valid (btc_pubkey *pubkey) |
void | btc_pubkey_cleanse (btc_pubkey *pubkey) |
void | btc_pubkey_get_hash160 (const btc_pubkey *pubkey, uint8_t *hash160) |
void | btc_pubkey_from_key (btc_key *privkey, btc_pubkey *pubkey_inout) |
btc_bool | btc_key_sign_hash (const btc_key *privkey, const uint8_t *hash, unsigned char *sigout, size_t *outlen) |
btc_bool | btc_pubkey_verify_sig (const btc_pubkey *pubkey, const uint8_t *hash, unsigned char *sigder, int len) |
btc_bool btc_key_sign_hash | ( | const btc_key * | privkey, |
const uint8_t * | hash, | ||
unsigned char * | sigout, | ||
size_t * | outlen | ||
) |
Definition at line 130 of file ecc_key.c.
References ecc_sign(), and btc_key_::privkey.
Referenced by btc_privkey_verify_pubkey().
void btc_privkey_cleanse | ( | btc_key * | privkey | ) |
void btc_privkey_gen | ( | btc_key * | privkey | ) |
Definition at line 60 of file ecc_key.c.
References BTC_ECKEY_PKEY_LENGTH, ecc_verify_privatekey(), btc_key_::privkey, and random_bytes().
void btc_privkey_init | ( | btc_key * | privkey | ) |
Definition at line 48 of file ecc_key.c.
References ecc_verify_privatekey(), and btc_key_::privkey.
btc_bool btc_privkey_verify_pubkey | ( | btc_key * | privkey, |
btc_pubkey * | pubkey | ||
) |
Definition at line 71 of file ecc_key.c.
References btc_hash(), btc_key_sign_hash(), btc_pubkey_verify_sig(), and random_bytes().
void btc_pubkey_cleanse | ( | btc_pubkey * | pubkey | ) |
Definition at line 103 of file ecc_key.c.
References BTC_ECKEY_UNCOMPRESSED_LENGTH, and btc_pubkey_::pubkey.
void btc_pubkey_from_key | ( | btc_key * | privkey, |
btc_pubkey * | pubkey_inout | ||
) |
Definition at line 118 of file ecc_key.c.
References BTC_ECKEY_COMPRESSED_LENGTH, btc_pubkey_::compressed, ecc_get_pubkey(), btc_key_::privkey, and btc_pubkey_::pubkey.
void btc_pubkey_get_hash160 | ( | const btc_pubkey * | pubkey, |
uint8_t * | hash160 | ||
) |
Definition at line 112 of file ecc_key.c.
References BTC_ECKEY_COMPRESSED_LENGTH, BTC_ECKEY_UNCOMPRESSED_LENGTH, btc_pubkey_::compressed, btc_pubkey_::pubkey, and ripemd160().
Referenced by btc_tx_add_p2pkh_out().
void btc_pubkey_init | ( | btc_pubkey * | pubkey | ) |
Definition at line 87 of file ecc_key.c.
References BTC_ECKEY_UNCOMPRESSED_LENGTH, btc_pubkey_::compressed, and btc_pubkey_::pubkey.
btc_bool btc_pubkey_is_valid | ( | btc_pubkey * | pubkey | ) |
Definition at line 97 of file ecc_key.c.
References btc_pubkey_::compressed, ecc_verify_pubkey(), and btc_pubkey_::pubkey.
btc_bool btc_pubkey_verify_sig | ( | const btc_pubkey * | pubkey, |
const uint8_t * | hash, | ||
unsigned char * | sigder, | ||
int | len | ||
) |
Definition at line 136 of file ecc_key.c.
References btc_pubkey_::compressed, ecc_verify_sig(), and btc_pubkey_::pubkey.
Referenced by btc_privkey_verify_pubkey().