From 696869093eac354dd99bbdfd90549bbac913f4e5 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 17 Aug 2014 11:43:44 +0000 Subject: [PATCH] Accept const data for b58check --- base58.c | 4 ++-- base58.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base58.c b/base58.c index c042573..5e643fa 100644 --- a/base58.c +++ b/base58.c @@ -97,10 +97,10 @@ bool my_dblsha256(void *hash, const void *data, size_t datasz) return b58_sha256_impl(buf, data, datasz) && b58_sha256_impl(hash, buf, sizeof(buf)); } -int b58check(void *bin, size_t binsz, const char *base58str, size_t b58sz) +int b58check(const void *bin, size_t binsz, const char *base58str, size_t b58sz) { unsigned char buf[32]; - unsigned char *binc = bin; + const uint8_t *binc = bin; unsigned i; if (!my_dblsha256(buf, bin, binsz - 4)) return -2; diff --git a/base58.h b/base58.h index 8ae312f..0e07433 100644 --- a/base58.h +++ b/base58.h @@ -7,6 +7,6 @@ extern bool (*b58_sha256_impl)(void *, const void *, size_t); extern bool b58tobin(void *bin, size_t binsz, const char *b58, size_t b58sz); -extern int b58check(void *bin, size_t binsz, const char *b58, size_t b58sz); +extern int b58check(const void *bin, size_t binsz, const char *b58, size_t b58sz); #endif