tuweni / org.apache.tuweni.ethash / EthHash

EthHash

open class EthHash (source)

Implementation of EthHash utilities for Ethereum mining algorithms.

Constructors

<init>

Implementation of EthHash utilities for Ethereum mining algorithms.

EthHash()

Properties

ACCESSES

number of accesses in hashimoto loop

static var ACCESSES: Int

CACHE_BYTES_GROWTH

cache growth per epoch

static var CACHE_BYTES_GROWTH: Long

CACHE_BYTES_INIT

bytes in cache at genesis

static var CACHE_BYTES_INIT: Long

CACHE_MULTIPLIER

Size of the DAG relative to the cache

static var CACHE_MULTIPLIER: Int

CACHE_ROUNDS

number of rounds in cache production

static var CACHE_ROUNDS: Int

DATASET_BYTES_GROWTH

dataset growth per epoch

static var DATASET_BYTES_GROWTH: Long

DATASET_BYTES_INIT

bytes in dataset at genesis

static var DATASET_BYTES_INIT: Long

DATASET_PARENTS

number of parents of each dataset element

static var DATASET_PARENTS: Int

EPOCH_LENGTH

blocks per epoch

static var EPOCH_LENGTH: Int

FNV_PRIME

static var FNV_PRIME: Int

HASH_BYTES

hash length in bytes

static var HASH_BYTES: Int

MIX_BYTES

width of mix

static var MIX_BYTES: Int

WORD_BYTES

Bytes in word.

static var WORD_BYTES: Int

Functions

calcDatasetItem

Calculate a data set item based on the previous cache for a given index

open static fun calcDatasetItem(cache: Array<UInt32!>!, index: UInt32!): Bytes!

epoch

Calculates the EthHash Epoch for a given block number.

open static fun epoch(block: Long): Long

getCacheSize

Provides the size of the cache at a given block number

open static fun getCacheSize(block_number: Long): Int

getFullSize

Provides the size of the full dataset at a given block number

open static fun getFullSize(block_number: Long): Long

hashimotoLight

Hashimoto Light Hashing.

open static fun hashimotoLight(size: Long, cache: Array<UInt32!>!, header: Bytes!, nonce: Bytes!): Bytes!

mkCache

Generates the EthHash cache for given parameters.

open static fun mkCache(cacheSize: Int, block: Long): Array<UInt32!>!