mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
15f7ec436c
Obviously, haven't run it in a while. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 lines
320 B
C
13 lines
320 B
C
#include "address.h"
|
|
#include "pubkey.h"
|
|
#include <ccan/crypto/sha256/sha256.h>
|
|
#include <ccan/mem/mem.h>
|
|
|
|
void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr)
|
|
{
|
|
struct sha256 h;
|
|
|
|
sha256(&h, memcheck(key->der, sizeof(key->der)), sizeof(key->der));
|
|
ripemd160(&addr->addr, h.u.u8, sizeof(h));
|
|
}
|