2015-06-12 11:53:27 +09:30
|
|
|
#ifndef LIGHTNING_BITCOIN_SHADOUBLE_H
|
|
|
|
#define LIGHTNING_BITCOIN_SHADOUBLE_H
|
2016-01-22 06:38:08 +10:30
|
|
|
#include "config.h"
|
2015-05-26 14:08:12 +09:30
|
|
|
#include <ccan/crypto/sha256/sha256.h>
|
2020-05-16 10:59:05 +09:30
|
|
|
#include <ccan/short_types/short_types.h>
|
2015-05-26 14:08:12 +09:30
|
|
|
|
|
|
|
/* To explicitly distinguish between single sha and bitcoin's standard double */
|
|
|
|
struct sha256_double {
|
|
|
|
struct sha256 sha;
|
|
|
|
};
|
|
|
|
|
|
|
|
void sha256_double(struct sha256_double *shadouble, const void *p, size_t len);
|
|
|
|
|
|
|
|
void sha256_double_done(struct sha256_ctx *sha256, struct sha256_double *res);
|
2020-05-16 10:59:05 +09:30
|
|
|
|
|
|
|
/* marshal/unmarshal functions */
|
|
|
|
void fromwire_sha256_double(const u8 **cursor, size_t *max,
|
|
|
|
struct sha256_double *sha256d);
|
|
|
|
void towire_sha256_double(u8 **pptr, const struct sha256_double *sha256d);
|
2015-06-12 11:53:27 +09:30
|
|
|
#endif /* LIGHTNING_BITCOIN_SHADOUBLE_H */
|