2015-06-12 11:53:27 +09:30
|
|
|
#include "address.h"
|
2015-06-02 11:53:59 +09:30
|
|
|
#include "pubkey.h"
|
2016-03-30 16:54:16 +10:30
|
|
|
#include <ccan/mem/mem.h>
|
2016-01-22 06:38:08 +10:30
|
|
|
#include <ccan/crypto/sha256/sha256.h>
|
2015-05-29 07:08:27 +09:30
|
|
|
|
2015-06-02 11:53:59 +09:30
|
|
|
void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr)
|
2015-05-29 07:08:27 +09:30
|
|
|
{
|
|
|
|
struct sha256 h;
|
|
|
|
|
2016-03-30 16:54:16 +10:30
|
|
|
sha256(&h, memcheck(key->der, sizeof(key->der)), sizeof(key->der));
|
2015-07-09 15:43:36 +09:30
|
|
|
ripemd160(&addr->addr, h.u.u8, sizeof(h));
|
2015-05-29 07:08:27 +09:30
|
|
|
}
|