This commit is contained in:
Jay D Dee
2020-02-04 01:31:59 -05:00
parent 0681ca996d
commit 1b76cee239
106 changed files with 1695 additions and 4481 deletions

View File

@@ -1,4 +1,7 @@
#include "c11-gate.h"
#if !defined(C11_8WAY) && !defined(C11_4WAY)
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -9,9 +12,6 @@
#include "algo/keccak/sph_keccak.h"
#include "algo/skein/sph_skein.h"
#include "algo/shavite/sph_shavite.h"
#include "algo/luffa/sph_luffa.h"
#include "algo/cubehash/sph_cubehash.h"
#include "algo/simd/sph_simd.h"
#include "algo/luffa/luffa_for_sse2.h"
#include "algo/cubehash/cubehash_sse2.h"
#include "algo/simd/nist.h"
@@ -149,3 +149,4 @@ int scanhash_c11( struct work *work, uint32_t max_nonce,
return 0;
}
#endif

View File

@@ -1,131 +0,0 @@
#include "algo-gate-api.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "algo/shavite/sph_shavite.h"
#include "algo/simd/sph_simd.h"
#include "algo/echo/sph_echo.h"
//#define DEBUG_ALGO
extern void freshhash(void* output, const void* input, uint32_t len)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
#define hashA hash
#define hashB hash+64
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
sph_shavite512_init(&ctx_shavite);
sph_shavite512(&ctx_shavite, input, len);
sph_shavite512_close(&ctx_shavite, hashA);
sph_simd512_init(&ctx_simd);
sph_simd512(&ctx_simd, hashA, 64);
sph_simd512_close(&ctx_simd, hashB);
sph_shavite512_init(&ctx_shavite);
sph_shavite512(&ctx_shavite, hashB, 64);
sph_shavite512_close(&ctx_shavite, hashA);
sph_simd512_init(&ctx_simd);
sph_simd512(&ctx_simd, hashA, 64);
sph_simd512_close(&ctx_simd, hashB);
sph_echo512_init(&ctx_echo);
sph_echo512(&ctx_echo, hashB, 64);
sph_echo512_close(&ctx_echo, hashA);
memcpy(output, hash, 32);
}
int scanhash_fresh( struct work *work,
uint32_t max_nonce, uint64_t *hashes_done, struct thr_info *mythr)
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t len = 80;
int thr_id = mythr->id; // thr_id arg is deprecated
uint32_t n = pdata[19] - 1;
const uint32_t first_nonce = pdata[19];
const uint32_t Htarg = ptarget[7];
#ifdef _MSC_VER
uint32_t __declspec(align(32)) hash64[8];
#else
uint32_t hash64[8] __attribute__((aligned(32)));
#endif
uint32_t endiandata[32];
uint64_t htmax[] = {
0,
0xF,
0xFF,
0xFFF,
0xFFFF,
0x10000000
};
uint32_t masks[] = {
0xFFFFFFFF,
0xFFFFFFF0,
0xFFFFFF00,
0xFFFFF000,
0xFFFF0000,
0
};
// we need bigendian data...
for (int k = 0; k < 19; k++)
be32enc(&endiandata[k], pdata[k]);
#ifdef DEBUG_ALGO
if (Htarg != 0)
printf("[%d] Htarg=%X\n", thr_id, Htarg);
#endif
for (int m=0; m < 6; m++) {
if (Htarg <= htmax[m]) {
uint32_t mask = masks[m];
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
freshhash(hash64, endiandata, len);
#ifndef DEBUG_ALGO
if ((!(hash64[7] & mask)) && fulltest(hash64, ptarget)) {
*hashes_done = n - first_nonce + 1;
return true;
}
#else
if (!(n % 0x1000) && !thr_id) printf(".");
if (!(hash64[7] & mask)) {
printf("[%d]",thr_id);
if (fulltest(hash64, ptarget)) {
*hashes_done = n - first_nonce + 1;
return true;
}
}
#endif
} while (n < max_nonce && !work_restart[thr_id].restart);
// see blake.c if else to understand the loop on htmax => mask
break;
}
}
*hashes_done = n - first_nonce + 1;
pdata[19] = n;
return 0;
}
bool register_fresh_algo( algo_gate_t* gate )
{
algo_not_tested();
gate->scanhash = (void*)&scanhash_fresh;
gate->hash = (void*)&freshhash;
opt_target_factor = 256.0;
return true;
};

View File

@@ -1,5 +1,7 @@
#include "timetravel-gate.h"
#if !defined(TIMETRAVEL_8WAY) && !defined(TIMETRAVEL_4WAY)
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -290,4 +292,4 @@ int scanhash_timetravel( struct work *work, uint32_t max_nonce,
return 0;
}
#endif

View File

@@ -1,4 +1,7 @@
#include "timetravel10-gate.h"
#if !defined(TIMETRAVEL10_8WAY) && !defined(TIMETRAVEL10_4WAY)
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -329,3 +332,4 @@ int scanhash_timetravel10( struct work *work, uint32_t max_nonce,
*hashes_done = pdata[19] - first_nonce + 1;
return 0;
}
#endif

View File

@@ -1,12 +1,13 @@
#include "tribus-gate.h"
#if !defined(TRIBUS_8WAY) && !defined(TRIBUS_4WAY)
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "algo/jh//sph_jh.h"
#include "algo/keccak/sph_keccak.h"
#ifdef __AES__
#include "algo/echo/aes_ni/hash_api.h"
#else
@@ -117,4 +118,4 @@ int scanhash_tribus( struct work *work, uint32_t max_nonce,
return 0;
}
#endif

View File

@@ -1,5 +1,8 @@
#include "cpuminer-config.h"
#include "x11-gate.h"
#if !defined(X11_8WAY) && !defined(X11_4WAY)
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -10,9 +13,6 @@
#include "algo/keccak/sph_keccak.h"
#include "algo/skein/sph_skein.h"
#include "algo/shavite/sph_shavite.h"
#include "algo/luffa/sph_luffa.h"
#include "algo/cubehash/sph_cubehash.h"
#include "algo/simd/sph_simd.h"
#include "algo/luffa/luffa_for_sse2.h"
#include "algo/cubehash/cubehash_sse2.h"
#include "algo/simd/nist.h"
@@ -172,3 +172,4 @@ int scanhash_x11( struct work *work, uint32_t max_nonce,
pdata[19] = n;
return 0;
}
#endif

View File

@@ -1,5 +1,8 @@
#include "cpuminer-config.h"
#include "x11evo-gate.h"
#if !defined(X11EVO_8WAY) && !defined(X11EVO_4WAY)
#include <string.h>
#include <stdint.h>
#include <compat/portable_endian.h>
@@ -8,10 +11,7 @@
#include "algo/jh/sph_jh.h"
#include "algo/keccak/sph_keccak.h"
#include "algo/skein/sph_skein.h"
#include "algo/luffa/sph_luffa.h"
#include "algo/cubehash/sph_cubehash.h"
#include "algo/shavite/sph_shavite.h"
#include "algo/simd/sph_simd.h"
#ifdef __AES__
#include "algo/groestl/aes_ni/hash-groestl.h"
#include "algo/echo/aes_ni/hash_api.h"
@@ -204,3 +204,4 @@ int scanhash_x11evo( struct work* work, uint32_t max_nonce,
pdata[19] = n;
return 0;
}
#endif

View File

@@ -1,4 +1,7 @@
#include "x11gost-gate.h"
#if !defined(X11GOST_8WAY) && !defined(X11GOST_4WAY)
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@@ -10,9 +13,6 @@
#include "algo/keccak/sph_keccak.h"
#include "algo/skein/sph_skein.h"
#include "algo/shavite/sph_shavite.h"
#include "algo/luffa/sph_luffa.h"
#include "algo/cubehash/sph_cubehash.h"
#include "algo/simd/sph_simd.h"
#include "algo/luffa/luffa_for_sse2.h"
#include "algo/cubehash/cubehash_sse2.h"
#include "algo/simd/nist.h"
@@ -160,3 +160,4 @@ int scanhash_x11gost( struct work *work, uint32_t max_nonce,
return 0;
}
#endif