Browse Source
There's no good reason to support them, and this way every key is 33 bytes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>ppa-0.6.1
Rusty Russell
9 years ago
10 changed files with 20 additions and 49 deletions
@ -1,11 +1,12 @@ |
|||||
#include "address.h" |
#include "address.h" |
||||
#include "pubkey.h" |
#include "pubkey.h" |
||||
|
#include <ccan/mem/mem.h> |
||||
#include <ccan/crypto/sha256/sha256.h> |
#include <ccan/crypto/sha256/sha256.h> |
||||
|
|
||||
void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr) |
void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr) |
||||
{ |
{ |
||||
struct sha256 h; |
struct sha256 h; |
||||
|
|
||||
sha256(&h, key->der, pubkey_derlen(key)); |
sha256(&h, memcheck(key->der, sizeof(key->der)), sizeof(key->der)); |
||||
ripemd160(&addr->addr, h.u.u8, sizeof(h)); |
ripemd160(&addr->addr, h.u.u8, sizeof(h)); |
||||
} |
} |
||||
|
Loading…
Reference in new issue