From 9624a1a10eeec459ea0eaf57593c8bd8b9a16f31 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 21 Feb 2017 15:15:28 +1030 Subject: [PATCH] libwally: fix hmac_sha256 name clash. This is a workaround; eventually libwally will be a nice shared library that we won't have to bundle, and clashing with internal symbols won't be a problem. Signed-off-by: Rusty Russell --- libwally-core/1README | 1 + libwally-core/src/hmac.c | 2 +- libwally-core/src/hmac.h | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 libwally-core/1README diff --git a/libwally-core/1README b/libwally-core/1README new file mode 100644 index 000000000..af609d927 --- /dev/null +++ b/libwally-core/1README @@ -0,0 +1 @@ +Stolen from 3b025127cbf11912f8b95e7ff3c905d74e8433ce, with hmac_256 -> hmac_256_internal to avoid name clash diff --git a/libwally-core/src/hmac.c b/libwally-core/src/hmac.c index 6eeafdf16..1983f3b23 100644 --- a/libwally-core/src/hmac.c +++ b/libwally-core/src/hmac.c @@ -8,7 +8,7 @@ #define SHA_T sha256 #define SHA_CTX_MEMBER u32 #define SHA_PRE(name) sha256 ## name -#define HMAC_FUNCTION hmac_sha256 +#define HMAC_FUNCTION hmac_sha256_internal #define WALLY_HMAC_FUNCTION wally_hmac_sha256 #include "hmac.inl" diff --git a/libwally-core/src/hmac.h b/libwally-core/src/hmac.h index 865a7ff45..12ddb8641 100644 --- a/libwally-core/src/hmac.h +++ b/libwally-core/src/hmac.h @@ -5,7 +5,7 @@ struct sha256; struct sha512; /** - * hmac_sha256 - Compute an HMAC using SHA-256 + * hmac_sha256_internal - Compute an HMAC using SHA-256 * * @sha: Destination for the resulting HMAC. * @key: The key for the hash @@ -13,7 +13,7 @@ struct sha512; * @msg: The message to hash * @msg_len: The length of @msg in bytes. */ -void hmac_sha256(struct sha256 *sha, +void hmac_sha256_internal(struct sha256 *sha, const unsigned char *key, size_t key_len, const unsigned char *msg, size_t msg_len);