Fabcoin Core  0.16.2
P2P Digital Currency
Functions | Variables
equihash.cpp File Reference
#include "crypto/equihash.h"
#include "util.h"
#include <algorithm>
#include <iostream>
#include <stdexcept>
#include <boost/optional.hpp>
Include dependency graph for equihash.cpp:

Go to the source code of this file.

Functions

void GenerateHash (const eh_HashState &base_state, eh_index g, unsigned char *hash, size_t hLen)
 
void ExpandArray (const unsigned char *in, size_t in_len, unsigned char *out, size_t out_len, size_t bit_len, size_t byte_pad)
 
void CompressArray (const unsigned char *in, size_t in_len, unsigned char *out, size_t out_len, size_t bit_len, size_t byte_pad)
 
void EhIndexToArray (const eh_index i, unsigned char *array)
 
eh_index ArrayToEhIndex (const unsigned char *array)
 
eh_trunc TruncateIndex (const eh_index i, const unsigned int ilen)
 
eh_index UntruncateIndex (const eh_trunc t, const eh_index r, const unsigned int ilen)
 
std::vector< eh_indexGetIndicesFromMinimal (std::vector< unsigned char > minimal, size_t cBitLen)
 
std::vector< unsigned char > GetMinimalFromIndices (std::vector< eh_index > indices, size_t cBitLen)
 
 assert (len-trim+(2 *lenIndices)<=WIDTH)
 
 for (size_t i=trim;i< len;i++) hash[i-trim] = a.hash[i] ^ b.hash[i]
 
 if (a.IndicesBefore(b, len, lenIndices))
 
template<size_t WIDTH>
bool HasCollision (StepRow< WIDTH > &a, StepRow< WIDTH > &b, size_t l)
 
template<size_t WIDTH>
void CollideBranches (std::vector< FullStepRow< WIDTH >> &X, const size_t hlen, const size_t lenIndices, const unsigned int clen, const unsigned int ilen, const eh_trunc lt, const eh_trunc rt)
 

Variables

EhSolverCancelledException solver_cancelled
 
 else
 

Function Documentation

eh_index ArrayToEhIndex ( const unsigned char *  array)

Definition at line 158 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

assert ( len-trim+(2 *lenIndices)<=  WIDTH)
Initial value:
{
assert(len+lenIndices <= W)
assert(len-trim+(2 *lenIndices)<=WIDTH)
template<size_t WIDTH>
void CollideBranches ( std::vector< FullStepRow< WIDTH >> &  X,
const size_t  hlen,
const size_t  lenIndices,
const unsigned int  clen,
const unsigned int  ilen,
const eh_trunc  lt,
const eh_trunc  rt 
)

Definition at line 455 of file equihash.cpp.

Here is the caller graph for this function:

void CompressArray ( const unsigned char *  in,
size_t  in_len,
unsigned char *  out,
size_t  out_len,
size_t  bit_len,
size_t  byte_pad 
)

Definition at line 108 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void EhIndexToArray ( const eh_index  i,
unsigned char *  array 
)

Definition at line 149 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExpandArray ( const unsigned char *  in,
size_t  in_len,
unsigned char *  out,
size_t  out_len,
size_t  bit_len,
size_t  byte_pad 
)

Definition at line 64 of file equihash.cpp.

Here is the caller graph for this function:

for ( ) = a.hash[i] ^ b.hash[i]

Here is the caller graph for this function:

void GenerateHash ( const eh_HashState base_state,
eh_index  g,
unsigned char *  hash,
size_t  hLen 
)

Definition at line 53 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<eh_index> GetIndicesFromMinimal ( std::vector< unsigned char >  minimal,
size_t  cBitLen 
)

Definition at line 179 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<unsigned char> GetMinimalFromIndices ( std::vector< eh_index indices,
size_t  cBitLen 
)

Definition at line 195 of file equihash.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<size_t WIDTH>
bool HasCollision ( StepRow< WIDTH > &  a,
StepRow< WIDTH > &  b,
size_t  l 
)

Definition at line 283 of file equihash.cpp.

if ( a.  IndicesBeforeb, len, lenIndices)

Definition at line 243 of file equihash.cpp.

Here is the caller graph for this function:

eh_trunc TruncateIndex ( const eh_index  i,
const unsigned int  ilen 
)

Definition at line 166 of file equihash.cpp.

Here is the caller graph for this function:

eh_index UntruncateIndex ( const eh_trunc  t,
const eh_index  r,
const unsigned int  ilen 
)

Definition at line 173 of file equihash.cpp.

Here is the caller graph for this function:

Variable Documentation

else
Initial value:
{
std::copy(b.hash+len, b.hash+len+lenIndices, hash+len-trim)
#define b(i, j)

Definition at line 246 of file equihash.cpp.

EhSolverCancelledException solver_cancelled

Definition at line 32 of file equihash.cpp.