Browse Source

cputest: add other hashes to cpu tests

master
Tanguy Pruvot 10 years ago
parent
commit
8e32e5ea09
  1. 2
      JHA/jackpotcoin.cu
  2. 2
      groestlcoin.cpp
  3. 10
      miner.h
  4. 2
      myriadgroestl.cpp
  5. 2
      quark/quarkcoin.cu
  6. 40
      util.c

2
JHA/jackpotcoin.cu

@ -50,7 +50,7 @@ static uint32_t *d_branch2Nonces[8]; @@ -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;

2
groestlcoin.cpp

@ -40,7 +40,7 @@ void sha256func(unsigned char *hash, const unsigned char *data, int len) @@ -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

@ -251,10 +251,6 @@ extern int scanhash_x15(int thr_id, uint32_t *pdata, @@ -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); @@ -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);

2
myriadgroestl.cpp

@ -18,7 +18,7 @@ void myriadgroestl_cpu_hash(int thr_id, int threads, uint32_t startNounce, void @@ -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;

2
quark/quarkcoin.cu

@ -59,7 +59,7 @@ extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, int threads, @@ -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;

40
util.c

@ -1321,8 +1321,8 @@ out: @@ -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,19 +1332,45 @@ void print_hash_tests(void) @@ -1332,19 +1332,45 @@ 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);
printf("\nX11: "); print_hash(hash);
memset(hash, 0, sizeof hash);
x13hash(&hash[0], &buf[0]);
printf("\nX13: "); print_hash(hash);
printf("\nX13: "); print_hash(hash);
memset(hash, 0, sizeof hash);
x14hash(&hash[0], &buf[0]);
printf("\nX14: "); print_hash(hash);
printf("\nX14: "); print_hash(hash);
memset(hash, 0, sizeof hash);
x15hash(&hash[0], &buf[0]);
printf("\nX15: "); print_hash(hash);
}
printf("\nX15: "); print_hash(hash);
printf("\n");
}

Loading…
Cancel
Save