Implemented CN-Heavy algo, Algo tests and fixed n-loop variants (#86)

* Debouncing of connection retry when connecting donation server fails
* When PoW variant is set on proxy, it will overrule local set PoW
* Implementation of cn_heavy algo
* Added self test for cn-heavy
* Fixed n-loop variant of powV2 and cn-heavy
* Fixed n-loop variant of powV2 and added cn-heavy for ARM
* Fixing n-loop for arm
* Limited cn-heavy to max hashfactor 3 on higher seltest fails.
* Removed a lot of casts
* Fixed algo selftest
This commit is contained in:
Ben Gräf 2018-04-07 21:20:24 +02:00 committed by GitHub
parent 06bb082041
commit 1ce9d2bf3c
17 changed files with 2682 additions and 450 deletions

View file

@ -46,7 +46,21 @@ bool Mem::allocate(const Options* options)
m_multiHashThreadMask = Mem::ThreadBitSet(options->multiHashThreadMask());
m_memorySize = 0;
size_t scratchPadSize = m_algo == Options::ALGO_CRYPTONIGHT ? MEMORY : MEMORY_LITE;
size_t scratchPadSize;
switch (m_algo)
{
case Options::ALGO_CRYPTONIGHT_LITE:
scratchPadSize = MEMORY_LITE;
break;
case Options::ALGO_CRYPTONIGHT_HEAVY:
scratchPadSize = MEMORY_HEAVY;
break;
case Options::ALGO_CRYPTONIGHT:
default:
scratchPadSize = MEMORY;
break;
}
for (size_t i=0; i < m_threads; i++) {
m_memorySize += sizeof(cryptonight_ctx);
m_memorySize += scratchPadSize * getThreadHashFactor(i);