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.
32 lines
543 B
32 lines
543 B
10 years ago
|
#pragma once
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
#include "compiler.h"
|
||
|
#include <stdint.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
10 years ago
|
struct ethash_h256;
|
||
10 years ago
|
|
||
10 years ago
|
#define decsha3(bits) \
|
||
10 years ago
|
int sha3_##bits(uint8_t*, size_t, uint8_t const*, size_t);
|
||
10 years ago
|
|
||
|
decsha3(256)
|
||
|
decsha3(512)
|
||
|
|
||
10 years ago
|
static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t const size)
|
||
10 years ago
|
{
|
||
10 years ago
|
sha3_256((uint8_t*)ret, 32, data, size);
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
static inline void SHA3_512(uint8_t* ret, uint8_t const* data, size_t const size)
|
||
10 years ago
|
{
|
||
10 years ago
|
sha3_512(ret, 64, data, size);
|
||
10 years ago
|
}
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
10 years ago
|
#endif
|