core-lightning/bitcoin/address.c
Rusty Russell 8f64eb90af Switch over to CCAN's ripemd160.
Avoids handing naked u8 arrays around, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09 15:43:36 +09:30

12 lines
265 B
C

#include <ccan/crypto/sha256/sha256.h>
#include "address.h"
#include "pubkey.h"
void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr)
{
struct sha256 h;
sha256(&h, key->key, pubkey_len(key));
ripemd160(&addr->addr, h.u.u8, sizeof(h));
}