|
|
@ -17,19 +17,19 @@ void myriadgroestl_cpu_hash(int thr_id, int threads, uint32_t startNounce, void |
|
|
|
|
|
|
|
|
|
|
|
extern "C" void myriadhash(void *state, const void *input) |
|
|
|
extern "C" void myriadhash(void *state, const void *input) |
|
|
|
{ |
|
|
|
{ |
|
|
|
sph_groestl512_context ctx_groestl; |
|
|
|
uint32_t hashA[16], hashB[16]; |
|
|
|
|
|
|
|
sph_groestl512_context ctx_groestl; |
|
|
|
|
|
|
|
SHA256_CTX sha256; |
|
|
|
|
|
|
|
|
|
|
|
uint32_t hashA[16], hashB[16]; |
|
|
|
sph_groestl512_init(&ctx_groestl); |
|
|
|
|
|
|
|
sph_groestl512 (&ctx_groestl, input, 80); |
|
|
|
|
|
|
|
sph_groestl512_close(&ctx_groestl, hashA); |
|
|
|
|
|
|
|
|
|
|
|
sph_groestl512_init(&ctx_groestl); |
|
|
|
SHA256_Init(&sha256); |
|
|
|
sph_groestl512 (&ctx_groestl, input, 80); |
|
|
|
SHA256_Update(&sha256,(unsigned char *)hashA, 64); |
|
|
|
sph_groestl512_close(&ctx_groestl, hashA); |
|
|
|
SHA256_Final((unsigned char *)hashB, &sha256); |
|
|
|
|
|
|
|
|
|
|
|
SHA256_CTX sha256; |
|
|
|
memcpy(state, hashB, 32); |
|
|
|
SHA256_Init(&sha256); |
|
|
|
|
|
|
|
SHA256_Update(&sha256,(unsigned char *)hashA, 64); |
|
|
|
|
|
|
|
SHA256_Final((unsigned char *)hashB, &sha256); |
|
|
|
|
|
|
|
memcpy(state, hashB, 32); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool init[MAX_GPUS] = { 0 }; |
|
|
|
static bool init[MAX_GPUS] = { 0 }; |
|
|
@ -38,7 +38,7 @@ extern "C" int scanhash_myriad(int thr_id, uint32_t *pdata, const uint32_t *ptar |
|
|
|
uint32_t max_nonce, unsigned long *hashes_done) |
|
|
|
uint32_t max_nonce, unsigned long *hashes_done) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint32_t start_nonce = pdata[19]++; |
|
|
|
uint32_t start_nonce = pdata[19]++; |
|
|
|
uint32_t throughput = device_intensity(thr_id, __func__, 1 << 17); |
|
|
|
uint32_t throughput = device_intensity(thr_id, __func__, 1 << 17); |
|
|
|
throughput = min(throughput, max_nonce - start_nonce); |
|
|
|
throughput = min(throughput, max_nonce - start_nonce); |
|
|
|
|
|
|
|
|
|
|
|
uint32_t *outputHash = (uint32_t*)malloc(throughput * 16 * sizeof(uint32_t)); |
|
|
|
uint32_t *outputHash = (uint32_t*)malloc(throughput * 16 * sizeof(uint32_t)); |
|
|
|