Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ref/c/segwit_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int bech32_decode(char* hrp, uint8_t *data, size_t *data_len, const char *input)
return chk == 1;
}

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;
Expand Down
14 changes: 13 additions & 1 deletion ref/c/segwit_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int bech32_encode(
* data_len: Pointer to a size_t that will be updated to be the number
* of entries in data.
* In: input: Pointer to a null-terminated Bech32 string.
* Returns 1 if succesful.
* Returns 1 if successful.
*/
int bech32_decode(
char *hrp,
Expand All @@ -98,4 +98,16 @@ int bech32_decode(
const char *input
);

/** Change bit encoding
* Out: out: pointer to a buffer containing re-encoded data
* outlen: pointer the length of the output buffer
* In: outbits: bit length of the encoded output
* in: pointer to a buffer containing data to be encoded
* inlen: length of the input buffer
* inbits: bit length of the input
* pad: enable padding
* Returns 1 if successful.
*/
int convert_bits(uint8_t* out, size_t* outlen, int outbits, const uint8_t* in, size_t inlen, int inbits, int pad);

#endif