go-ethereum/vendor/github.com/ethereum/ethash/src/libethash/sha3.h

32 lines
543 B
C
Raw Normal View History

2015-02-28 19:58:37 +00:00
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "compiler.h"
#include <stdint.h>
#include <stdlib.h>
2015-05-05 05:50:04 +00:00
struct ethash_h256;
2015-04-07 11:17:27 +00:00
2015-02-28 19:58:37 +00:00
#define decsha3(bits) \
2015-05-05 05:50:04 +00:00
int sha3_##bits(uint8_t*, size_t, uint8_t const*, size_t);
2015-02-28 19:58:37 +00:00
decsha3(256)
decsha3(512)
2015-05-05 05:50:04 +00:00
static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t const size)
2015-04-07 11:17:27 +00:00
{
2015-05-05 05:50:04 +00:00
sha3_256((uint8_t*)ret, 32, data, size);
2015-02-28 19:58:37 +00:00
}
2015-05-05 05:50:04 +00:00
static inline void SHA3_512(uint8_t* ret, uint8_t const* data, size_t const size)
2015-04-07 11:17:27 +00:00
{
2015-05-05 05:50:04 +00:00
sha3_512(ret, 64, data, size);
2015-02-28 19:58:37 +00:00
}
#ifdef __cplusplus
}
2015-04-07 11:17:27 +00:00
#endif