Browse Source

Refactoring names to match spec

cl-refactor
Matthew Wampler-Doty 10 years ago
parent
commit
367527f1ca
  1. 6
      ethash.h
  2. 6
      internal.c

6
ethash.h

@ -27,13 +27,13 @@
#include "compiler.h"
#define REVISION 20
#define DAGSIZE_BYTES_INIT 1073741824U // 2**30
#define DAG_GROWTH 8388608U // 2**23
#define DATASET_BYTES_INIT 1073741824U // 2**30
#define DATASET_BYTES_GROWTH 8388608U // 2**23
#define CACHE_MULTIPLIER 1024
#define EPOCH_LENGTH 30000U
#define MIX_BYTES 128
#define HASH_BYTES 64
#define DAG_PARENTS 256
#define DATASET_PARENTS 256
#define CACHE_ROUNDS 3
#define ACCESSES 64

6
internal.c

@ -114,7 +114,7 @@ void ethash_calculate_dag_item(
__m128i xmm3 = ret->xmm[3];
#endif
for (unsigned i = 0; i != DAG_PARENTS; ++i) {
for (unsigned i = 0; i != DATASET_PARENTS; ++i) {
uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes;
node const *parent = &cache_nodes[parent_index];
@ -274,9 +274,9 @@ void ethash_quick_hash(
}
void ethash_get_seedhash(uint8_t seedhash[32], const uint32_t block_number) {
memset(seedhash,0,32);
memset(seedhash, 0, 32);
const uint32_t epochs = block_number / EPOCH_LENGTH;
for (uint32_t i = 0 ; i < epochs ; ++i)
for (uint32_t i = 0; i < epochs; ++i)
SHA3_256(seedhash, seedhash, 32);
}

Loading…
Cancel
Save