9 #if defined(_M_X64) && ENABLE_SSE 10 #include <smmintrin.h> 11 #elif defined(__MIC__) 12 #include <immintrin.h> 20 #define NODE_WORDS (64/4) 21 #define MIX_WORDS (ETHASH_MIX_BYTES/4) 22 #define MIX_NODES (MIX_WORDS / NODE_WORDS) 30 #if defined(_M_X64) && ENABLE_SSE 32 #elif defined(__MIC__) 38 static inline uint8_t ethash_h256_get(
ethash_h256_t const* hash,
unsigned int i)
43 static inline void ethash_h256_set(
ethash_h256_t* hash,
unsigned int i, uint8_t v)
54 static inline bool ethash_check_difficulty(
60 for (
int i = 0; i < 32; i++) {
61 if (ethash_h256_get(hash, i) == ethash_h256_get(boundary, i)) {
64 return ethash_h256_get(hash, i) < ethash_h256_get(boundary, i);
158 const uint64_t nonce,
ethash_full_t ethash_full_new_internal(char const *dirname, ethash_h256_t const seed_hash, uint64_t full_size, ethash_light_t const light, ethash_callback_t callback)
Allocate and initialize a new ethash_full handler.
bool ethash_compute_full_data(void *mem, uint64_t full_size, ethash_light_t const light, ethash_callback_t callback)
Compute the memory data for a full node's memory.
uint64_t ethash_get_cachesize(uint64_t const block_number)
bool ethash_quick_check_difficulty(ethash_h256_t const *header_hash, uint64_t const nonce, ethash_h256_t const *mix_hash, ethash_h256_t const *boundary)
Difficulty quick check for POW preverification.
void ethash_quick_hash(ethash_h256_t *return_hash, ethash_h256_t const *header_hash, const uint64_t nonce, ethash_h256_t const *mix_hash)
uint64_t double_words[NODE_WORDS/2]
ethash_light_t ethash_light_new_internal(uint64_t cache_size, ethash_h256_t const *seed)
Allocate and initialize a new ethash_light handler.
Type of a seedhash/blockhash e.t.c.
void ethash_calculate_dag_item(node *const ret, uint32_t node_index, ethash_light_t const cache)
uint32_t words[NODE_WORDS]
int(* ethash_callback_t)(unsigned)
ethash_return_value_t ethash_light_compute_internal(ethash_light_t light, uint64_t full_size, ethash_h256_t const header_hash, uint64_t nonce)
Calculate the light client data.
uint8_t bytes[NODE_WORDS *4]
uint64_t ethash_get_datasize(uint64_t const block_number)