Electroneum
Loading...
Searching...
No Matches
test_check_hash< hash_target_high, hash_target_low, difficulty_high, difficulty_low > Class Template Reference

#include <check_hash.h>

Public Member Functions

bool init ()
bool test ()

Static Public Attributes

static const size_t loop_count = 100000

Detailed Description

template<uint64_t hash_target_high, uint64_t hash_target_low, uint64_t difficulty_high, uint64_t difficulty_low>
class test_check_hash< hash_target_high, hash_target_low, difficulty_high, difficulty_low >

Definition at line 35 of file check_hash.h.

Member Function Documentation

◆ init()

template<uint64_t hash_target_high, uint64_t hash_target_low, uint64_t difficulty_high, uint64_t difficulty_low>
bool test_check_hash< hash_target_high, hash_target_low, difficulty_high, difficulty_low >::init ( )
inline

Definition at line 40 of file check_hash.h.

41 {
44 difficulty = difficulty_high;
45 difficulty = (difficulty << 64) | difficulty_low;
47 ((uint64_t*)&hash)[0] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
48 hash_value >>= 64;
49 ((uint64_t*)&hash)[1] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
50 hash_value >>= 64;
51 ((uint64_t*)&hash)[2] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
52 hash_value >>= 64;
53 ((uint64_t*)&hash)[3] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>();
54 return true;
55 }

◆ test()

template<uint64_t hash_target_high, uint64_t hash_target_low, uint64_t difficulty_high, uint64_t difficulty_low>
bool test_check_hash< hash_target_high, hash_target_low, difficulty_high, difficulty_low >::test ( )
inline

Definition at line 57 of file check_hash.h.

58 {
59 cryptonote::check_hash_128(hash, difficulty);
60 return true;
61 }
bool check_hash_128(const crypto::hash &hash, difficulty_type difficulty)
Here is the call graph for this function:

Member Data Documentation

◆ loop_count

template<uint64_t hash_target_high, uint64_t hash_target_low, uint64_t difficulty_high, uint64_t difficulty_low>
const size_t test_check_hash< hash_target_high, hash_target_low, difficulty_high, difficulty_low >::loop_count = 100000
static

Definition at line 38 of file check_hash.h.


The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/tests/performance_tests/check_hash.h