Skip to content

Commit

Permalink
ccan: rename ripemd160 functions
Browse files Browse the repository at this point in the history
The symbols were being pulled in from libwally instead of the from our
own CCAN. Do the same trick we use for sha256.
  • Loading branch information
morehouse authored and rustyrussell committed Jul 10, 2023
1 parent 1606ef1 commit 33da575
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ccan_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define LIGHTNING_CCAN_COMPAT_H

/* Magical file included from config.h (ie. everywhere) which renames
* sha256 routines so they don't clash with libwally-core's internal ones */
* sha256 and ripemd160 routines so they don't clash with libwally-core's
* internal ones */

/* So, for obvious reasons, this is an exception to the usual rule that we
#include "config.h"
Expand All @@ -21,4 +22,19 @@
#define sha256_be16(ctx, v) ccan_sha256_be16(ctx, v)
#define sha256_be32(ctx, v) ccan_sha256_be32(ctx, v)
#define sha256_be64(ctx, v) ccan_sha256_be64(ctx, v)

#define ripemd160(sha, p, size) ccan_ripemd160(sha, p, size)
#define ripemd160_init(ctx) ccan_ripemd160_init(ctx)
#define ripemd160_update(ctx, p, size) ccan_ripemd160_update(ctx, p, size)
#define ripemd160_done(ripemd160, res) ccan_ripemd160_done(ripemd160, res)
#define ripemd160_u8(ctx, v) ccan_ripemd160_u8(ctx, v)
#define ripemd160_u16(ctx, v) ccan_ripemd160_u16(ctx, v)
#define ripemd160_u32(ctx, v) ccan_ripemd160_u32(ctx, v)
#define ripemd160_u64(ctx, v) ccan_ripemd160_u64(ctx, v)
#define ripemd160_le16(ctx, v) ccan_ripemd160_le16(ctx, v)
#define ripemd160_le32(ctx, v) ccan_ripemd160_le32(ctx, v)
#define ripemd160_le64(ctx, v) ccan_ripemd160_le64(ctx, v)
#define ripemd160_be16(ctx, v) ccan_ripemd160_be16(ctx, v)
#define ripemd160_be32(ctx, v) ccan_ripemd160_be32(ctx, v)
#define ripemd160_be64(ctx, v) ccan_ripemd160_be64(ctx, v)
#endif /* LIGHTNING_CCAN_COMPAT_H */

0 comments on commit 33da575

Please sign in to comment.