1
0
mirror of https://github.com/GOSTSec/ccminer synced 2025-01-08 22:07:56 +00:00

cputest: add other hashes to cpu tests

This commit is contained in:
Tanguy Pruvot 2014-08-14 19:49:31 +02:00
parent 9d3d09103b
commit 8e32e5ea09
6 changed files with 43 additions and 15 deletions

View File

@ -50,7 +50,7 @@ static uint32_t *d_branch2Nonces[8];
static uint32_t *d_branch3Nonces[8];
// Original jackpothash Funktion aus einem miner Quelltext
inline unsigned int jackpothash(void *state, const void *input)
extern "C" unsigned int jackpothash(void *state, const void *input)
{
sph_blake512_context ctx_blake;
sph_groestl512_context ctx_groestl;

View File

@ -40,7 +40,7 @@ void sha256func(unsigned char *hash, const unsigned char *data, int len)
be32enc((uint32_t *)hash + i, T[i]);
}
static void groestlhash(void *state, const void *input)
extern "C" void groestlhash(void *state, const void *input)
{
// Tryout GPU-groestl

10
miner.h
View File

@ -251,10 +251,6 @@ extern int scanhash_x15(int thr_id, uint32_t *pdata,
const uint32_t *ptarget, uint32_t max_nonce,
unsigned long *hashes_done);
extern void fugue256_hash(unsigned char* output, const unsigned char* input, int len);
extern void heavycoin_hash(unsigned char* output, const unsigned char* input, int len);
extern void groestlcoin_hash(unsigned char* output, const unsigned char* input, int len);
struct thr_info {
int id;
pthread_t pth;
@ -351,6 +347,12 @@ extern void tq_freeze(struct thread_q *tq);
extern void tq_thaw(struct thread_q *tq);
void print_hash_tests(void);
unsigned int jackpothash(void *state, const void *input);
void fugue256_hash(unsigned char* output, const unsigned char* input, int len);
void heavycoin_hash(unsigned char* output, const unsigned char* input, int len);
void groestlhash(void *state, const void *input);
void myriadhash(void *state, const void *input);
void quarkhash(void *state, const void *input);
void x11hash(void *output, const void *input);
void x13hash(void *output, const void *input);
void x14hash(void *output, const void *input);

View File

@ -18,7 +18,7 @@ void myriadgroestl_cpu_hash(int thr_id, int threads, uint32_t startNounce, void
((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) | \
(((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu))
static void myriadhash(void *state, const void *input)
extern "C" void myriadhash(void *state, const void *input)
{
sph_groestl512_context ctx_groestl;

View File

@ -59,7 +59,7 @@ extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, int threads,
int order);
// Original Quarkhash Funktion aus einem miner Quelltext
inline void quarkhash(void *state, const void *input)
extern "C" void quarkhash(void *state, const void *input)
{
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;

30
util.c
View File

@ -1321,8 +1321,8 @@ out:
static void print_hash(unsigned char *hash)
{
for (int i=0; i < 32; i++) {
printf("%02x", hash[i]);
for (int i=0; i < 32; i += 4) {
printf("%02x%02x%02x%02x ", hash[i], hash[i+1], hash[i+2], hash[i+3]);
}
}
@ -1332,6 +1332,30 @@ void print_hash_tests(void)
memset(buf, 0, sizeof buf);
printf("CPU HASH ON EMPTY BUFFER RESULTS:\n");
memset(hash, 0, sizeof hash);
fugue256_hash(&hash[0], &buf[0], 32);
printf("\nfugue256:"); print_hash(hash);
memset(hash, 0, sizeof hash);
groestlhash(&hash[0], &buf[0]);
printf("\ngroestl: "); print_hash(hash);
memset(hash, 0, sizeof hash);
heavycoin_hash(&hash[0], &buf[0], 32);
printf("\nheavy: "); print_hash(hash);
memset(hash, 0, sizeof hash);
jackpothash(&hash[0], &buf[0]);
printf("\njackpot: "); print_hash(hash);
memset(hash, 0, sizeof hash);
myriadhash(&hash[0], &buf[0]);
printf("\nmyriad: "); print_hash(hash);
memset(hash, 0, sizeof hash);
quarkhash(&hash[0], &buf[0]);
printf("\nquark: "); print_hash(hash);
memset(hash, 0, sizeof hash);
x11hash(&hash[0], &buf[0]);
printf("\nX11: "); print_hash(hash);
@ -1347,4 +1371,6 @@ void print_hash_tests(void)
memset(hash, 0, sizeof hash);
x15hash(&hash[0], &buf[0]);
printf("\nX15: "); print_hash(hash);
printf("\n");
}