forked from EasyX-Community/node8-multi-hashing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathethash.h
31 lines (24 loc) · 920 Bytes
/
ethash.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef ETHASH_H
#define ETHASH_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ethash_params {
unsigned epochs;
unsigned epoch_length;
unsigned cache_size;
unsigned dag_size;
} ethash_params;
bool ethash_init_epoch(uint32_t epoch_number);
void ethash_get_epoch_data(uint32_t epoch_number, uint8_t* cache, uint8_t* dag);
void ethash_hash(const char* input, char* output, uint32_t len, uint32_t epoch_number);
bool ethash_verify(const char* header_hash, const char* mix_hash, uint64_t nonce, uint32_t epoch_number);
// Add support for both share submission methods
void ethash_submit_hash(const char* header_hash, const char* nonce, const char* mix_hash, char* output, uint32_t epoch_number);
void ethash_submit_work(const char* header, const char* nonce, const char* mixhash, char* output, uint32_t epoch_number);
#ifdef __cplusplus
}
#endif
#endif