Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Private Member Functions | List of all members
Equihash< N, K > Class Template Reference

#include <equihash.h>

Public Types

enum  : size_t { IndicesPerHashOutput =512/N }
 
enum  : size_t { HashLen =(N+7)/8 }
 
enum  : size_t { HashOutput =IndicesPerHashOutput*HashLen }
 
enum  : size_t { CollisionBitLength =N/(K+1) }
 
enum  : size_t { CollisionByteLength =(CollisionBitLength+7)/8 }
 
enum  : size_t { HashLength =(K+1)*CollisionByteLength }
 
enum  : size_t { FullWidth =2*CollisionByteLength+sizeof(eh_index)*(1 << (K-1)) }
 
enum  : size_t { FinalFullWidth =2*CollisionByteLength+sizeof(eh_index)*(1 << (K)) }
 
enum  : size_t { TruncatedWidth =max(HashLength+sizeof(eh_trunc), 2*CollisionByteLength+sizeof(eh_trunc)*(1 << (K-1))) }
 
enum  : size_t { FinalTruncatedWidth =max(HashLength+sizeof(eh_trunc), 2*CollisionByteLength+sizeof(eh_trunc)*(1 << (K))) }
 
enum  : size_t { SolutionWidth =(1 << K)*(CollisionBitLength+1)/8 }
 

Public Member Functions

 Equihash ()
 
int InitialiseState (eh_HashState &base_state)
 
bool BasicSolve (const eh_HashState &base_state, const std::function< bool(std::vector< unsigned char >)> validBlock, const std::function< bool(EhSolverCancelCheck)> cancelled)
 
bool OptimisedSolve (const eh_HashState &base_state, const std::function< bool(std::vector< unsigned char >)> validBlock, const std::function< bool(EhSolverCancelCheck)> cancelled)
 
bool IsValidSolution (const eh_HashState &base_state, std::vector< unsigned char > soln)
 

Private Member Functions

 BOOST_STATIC_ASSERT (K< N)
 
 BOOST_STATIC_ASSERT ((N/(K+1))+1< 8 *sizeof(eh_index))
 

Detailed Description

template<unsigned int N, unsigned int K>
class Equihash< N, K >

Definition at line 164 of file equihash.h.

Member Enumeration Documentation

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
IndicesPerHashOutput 

Definition at line 172 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
HashLen 

Definition at line 173 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
HashOutput 

Definition at line 174 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
CollisionBitLength 

Definition at line 175 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
CollisionByteLength 

Definition at line 176 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
HashLength 

Definition at line 177 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
FullWidth 

Definition at line 178 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
FinalFullWidth 

Definition at line 179 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
TruncatedWidth 

Definition at line 180 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
FinalTruncatedWidth 

Definition at line 181 of file equihash.h.

template<unsigned int N, unsigned int K>
anonymous enum : size_t
Enumerator
SolutionWidth 

Definition at line 182 of file equihash.h.

Constructor & Destructor Documentation

template<unsigned int N, unsigned int K>
Equihash< N, K >::Equihash ( )
inline

Definition at line 184 of file equihash.h.

Member Function Documentation

template<unsigned int N, unsigned int K>
template bool Equihash< N, K >::BasicSolve ( const eh_HashState base_state,
const std::function< bool(std::vector< unsigned char >)>  validBlock,
const std::function< bool(EhSolverCancelCheck)>  cancelled 
)

Definition at line 335 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<unsigned int N, unsigned int K>
Equihash< N, K >::BOOST_STATIC_ASSERT ( )
private
template<unsigned int N, unsigned int K>
Equihash< N, K >::BOOST_STATIC_ASSERT ( )
private
template<unsigned int N, unsigned int K>
template int Equihash< N, K >::InitialiseState ( eh_HashState base_state)

Definition at line 35 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<unsigned int N, unsigned int K>
template bool Equihash< N, K >::IsValidSolution ( const eh_HashState base_state,
std::vector< unsigned char >  soln 
)

Definition at line 731 of file equihash.cpp.

Here is the call graph for this function:

template<unsigned int N, unsigned int K>
template bool Equihash< N, K >::OptimisedSolve ( const eh_HashState base_state,
const std::function< bool(std::vector< unsigned char >)>  validBlock,
const std::function< bool(EhSolverCancelCheck)>  cancelled 
)

Definition at line 507 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: