You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

12 lines
320 B

#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));
}