Post
Topic
Board Mining (Altcoins)
Re: DIY FPGA Mining rig for any algorithm with fast ROI
by
2112
on 18/05/2018, 05:48:33 UTC
I had to watch a really boring "entertainment" program and used that time to edit the above file into a working C++ program. Echo was never used. Due to the peculiar permutation order Blake and Bmw are always fixed at position 0 and 1 respectively, only the remaining 8 positions change. So using the terminology from the whitefire990's post above timetravel10 requires only 9 reconfigurable blocks assuming that only Groestl requires a double block.
Code:
#include     // std::next_permutation
#include
#include

#define HASH_FUNC_BASE_TIMESTAMP 1492973331 // BitCore: Genesis Timestamp
#define HASH_FUNC_COUNT 10 // BitCore: HASH_FUNC_COUNT of 11
#define HASH_FUNC_COUNT_PERMUTATIONS 40320  // BitCore: HASH_FUNC_COUNT!

int main()
{
    // We want to permute algorithms. To get started we
    // initialize an array with a sorted sequence of unique
    // integers where every integer represents its own algorithm.
    uint32_t permutation[HASH_FUNC_COUNT];
    for (uint32_t i=0; i < HASH_FUNC_COUNT; i++) {
        permutation[i]=i;
    }

    // Compute the next permuation
    uint32_t steps = HASH_FUNC_COUNT_PERMUTATIONS;
    for (uint32_t i=0; i < steps; i++) {
        for (uint32_t i=0; i < HASH_FUNC_COUNT; i++) {
    switch(permutation[i]) {
            case 0:
std::cout << "blake ";
            break;
            case 1:
std::cout << "bmw ";
            break;
            case 2:
std::cout << "groestl ";
            break;
            case 3:
std::cout << "skein ";
            break;
            case 4:
std::cout << "jh ";
            break;
            case 5:
std::cout << "keccak ";
            break;
            case 6:
std::cout << "luffa ";
            break;
            case 7:
std::cout << "cubehash ";
            break;
            case 8:
std::cout << "shavite ";
            break;
            case 9:
std::cout << "simd ";
            break;
            case 10:
std::cout << "echo ";
            break;
    }
        }
std::cout << std::endl;
        std::next_permutation(permutation, permutation + HASH_FUNC_COUNT);
    }
    return 0;
}