-
Notifications
You must be signed in to change notification settings - Fork 6
/
bech32.patch
32 lines (30 loc) · 946 Bytes
/
bech32.patch
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
diff --git a/ref/c/segwit_addr.c b/ref/c/segwit_addr.c
index 390b3da..d6f100c 100644
--- a/ref/c/segwit_addr.c
+++ b/ref/c/segwit_addr.c
@@ -153,7 +153,7 @@ bech32_encoding bech32_decode(char* hrp, uint8_t *data, size_t *data_len, const
}
}
-static int convert_bits(uint8_t* out, size_t* outlen, int outbits, const uint8_t* in, size_t inlen, int inbits, int pad) {
+int convert_bits(uint8_t* out, size_t* outlen, int outbits, const uint8_t* in, size_t inlen, int inbits, int pad) {
uint32_t val = 0;
int bits = 0;
uint32_t maxv = (((uint32_t)1) << outbits) - 1;
diff --git a/ref/c/segwit_addr.h b/ref/c/segwit_addr.h
index 096870f..9a70e41 100644
--- a/ref/c/segwit_addr.h
+++ b/ref/c/segwit_addr.h
@@ -131,4 +131,14 @@ bech32_encoding bech32_decode(
const char *input
);
+int convert_bits(
+ uint8_t* out,
+ size_t* outlen,
+ int outbits,
+ const uint8_t* in,
+ size_t inlen,
+ int inbits,
+ int pad
+);
+
#endif