forked from samr7/vanitygen
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathutil.h
63 lines (51 loc) · 2.33 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Vanitygen, vanity bitcoin address generator
* Copyright (C) 2011 <[email protected]>
*
* Vanitygen is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* Vanitygen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Vanitygen. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __VG_UTIL_H__
#define __VG_UTIL_H__
#include <stdio.h>
#include <openssl/ossl_typ.h>
#include <openssl/ec.h>
void fdumphex(FILE *fp, const unsigned char *src, size_t len);
void fdumpbn(FILE *fp, const BIGNUM *bn);
void dumphex(const unsigned char *src, size_t len);
void dumpbn(const BIGNUM *bn);
void vg_b58_encode_check(void *buf, size_t len, char *result);
int vg_b58_decode_check(const char *input, void *buf, size_t len);
void vg_encode_compressed_address(const EC_POINT *ppoint,
const EC_GROUP *pgroup, int testnet, char *result);
void vg_encode_address(const EC_POINT *ppoint, const EC_GROUP *pgroup,
int testnet, char *result);
void vg_encode_script_address(const EC_POINT *ppoint, const EC_GROUP *pgroup,
int testnet, char *result);
void vg_encode_privkey_compressed(
const EC_KEY *pkey, int addrtype, char *result);
void vg_encode_privkey(const EC_KEY *pkey, int addrtype, char *result);
int vg_set_privkey(const BIGNUM *bnpriv, EC_KEY *pkey);
int vg_decode_privkey(const char *b58encoded, EC_KEY *pkey, int *addrtype);
int vg_protect_encode_privkey(char *out, const EC_KEY *pkey, int keytype,
int parameter_group, const char *pass);
int vg_protect_decode_privkey(
EC_KEY *pkey, int *keytype, const char *encoded, const char *pass);
int vg_pkcs8_encode_privkey(
char *out, int outlen, const EC_KEY *pkey, const char *pass);
int vg_decode_privkey_any(
EC_KEY *pkey, int *addrtype, const char *input, const char *pass);
int vg_read_range_file(
FILE *fp, const char ***pat_list, int *pat_count, int *pat_alloc);
int vg_read_file(FILE *fp, char ***result, int *rescount);
#endif /* !defined (__VG_UTIL_H__) */