#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stddef.h>
#include "compiler.h"
Go to the source code of this file.
- Date
- 2015
Definition in file ethash.h.
#define ETHASH_ACCESSES 64 |
#define ETHASH_CACHE_BYTES_GROWTH 131072U |
#define ETHASH_CACHE_BYTES_INIT 1073741824U |
#define ETHASH_CACHE_ROUNDS 3 |
#define ETHASH_DAG_MAGIC_NUM 0xFEE1DEADBADDCAFE |
#define ETHASH_DAG_MAGIC_NUM_SIZE 8 |
#define ETHASH_DATASET_BYTES_GROWTH 8388608U |
#define ETHASH_DATASET_BYTES_INIT 1073741824U |
#define ETHASH_DATASET_PARENTS 256 |
#define ETHASH_EPOCH_LENGTH 30000U |
#define ethash_h256_static_init |
( |
|
... | ) |
{ {__VA_ARGS__} } |
#define ETHASH_HASH_BYTES 64 |
#define ETHASH_MIX_BYTES 128 |
#define ETHASH_REVISION 23 |
typedef int(* ethash_callback_t) (unsigned) |
Type of a seedhash/blockhash e.t.c.
Calculate the full client data.
- Parameters
-
full | The full client handler |
header_hash | The header hash to pack into the mix |
nonce | The nonce to pack into the mix |
- Returns
- An object of ethash_return_value to hold the return value
Definition at line 575 of file internal.c.
Get a pointer to the full DAG data.
Definition at line 595 of file internal.c.
Get the size of the DAG data.
Definition at line 600 of file internal.c.
Frees a previously allocated ethash_full handler.
- Parameters
-
full | The light handler to free |
Definition at line 565 of file internal.c.
Allocate and initialize a new ethash_full handler.
- Parameters
-
light | The light handler containing the cache. |
callback | A callback function with signature of ethash_callback_t It accepts an unsigned with which a progress of DAG calculation can be displayed. If all goes well the callback should return 0. If a non-zero value is returned then DAG generation will stop. Be advised. A progress value of 100 means that DAG creation is almost complete and that this function will soon return succesfully. It does not mean that the function has already had a succesfull return. |
- Returns
- Newly allocated ethash_full handler or NULL in case of ERRNOMEM or invalid parameters used for ethash_compute_full_data()
Definition at line 554 of file internal.c.
Calculate the seedhash for a given block number.
Definition at line 344 of file internal.c.
Calculate the light client data.
- Parameters
-
light | The light client handler |
header_hash | The header hash to pack into the mix |
nonce | The nonce to pack into the mix |
- Returns
- an object of ethash_return_value_t holding the return values
Definition at line 432 of file internal.c.
Frees a previously allocated ethash_light handler.
- Parameters
-
light | The light handler to free |
Definition at line 409 of file internal.c.
Allocate and initialize a new ethash_light handler.
- Parameters
-
block_number | The block number for which to create the handler |
- Returns
- Newly allocated ethash_light handler or NULL in case of ERRNOMEM or invalid parameters used for ethash_compute_cache_nodes()
Definition at line 400 of file internal.c.