Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
monkins1010 authored Jun 13, 2020
1 parent bad6ba2 commit 09d621f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
21 changes: 12 additions & 9 deletions input.cl
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,11 @@ void case_0c(uint128m *prand, uint128m *prandex, const uint128m *pbuf,
}
else
{
uint128m tempb3 = prandex[0];
uint128m tempb3 = prandex[0];
prandex[0] = tempa2;
prand[0] = tempb3;
uint128m tempb4 = pbuf[0];
acc[0] = _mm_xor_si128_emu(tempb4, acc[0]);
}
}

Expand Down Expand Up @@ -590,10 +592,10 @@ void case_18(uint128m *prand, uint128m *prandex, const uint128m *pbuf,
{
onekey = rc[0]; rc++;
const uint128m temp2 = _mm_load_si128_emu(rounds & 1 ? pbuf : buftmp);
const uint128m add1 = _mm_xor_si128_emu(onekey, temp2);
onekey = _mm_xor_si128_emu(onekey, temp2);

const int32_t divisor = (uint32_t)selector;
const int64_t dividend = ((int64_t*)&add1)[0];
const int64_t dividend = ((int64_t*)&onekey)[0];
uint128m modulo = { 0,0,0,0 }; ((int32_t*)&modulo)[0] = (dividend % divisor);
acc[0] = _mm_xor_si128_emu(modulo , acc[0]);

Expand All @@ -603,17 +605,17 @@ void case_18(uint128m *prand, uint128m *prandex, const uint128m *pbuf,
onekey = rc[0]; rc++;
uint128m temp2 = _mm_load_si128_emu(rounds & 1 ? buftmp : pbuf);
uint128m add1 = _mm_xor_si128_emu(onekey, temp2);
uint128m clprod1 = _mm_clmulepi64_si128_emu(add1, add1, 0x10);
uint128m clprod2 = _mm_mulhrs_epi16_emu(acc[0], clprod1);
onekey = _mm_clmulepi64_si128_emu(add1, add1, 0x10);
uint128m clprod2 = _mm_mulhrs_epi16_emu(acc[0], onekey);
acc[0] = clprod2^ acc[0];
}
}while(rounds--);


const uint128m tempa3 = (prandex[0]);
const uint128m tempa4 = _mm_xor_si128_emu(tempa3, acc[0]);
prandex[0] = tempa4;
prand[0] = onekey;
prandex[0] = onekey;
prand[0] = tempa4;
}

void case_1c(uint128m *prand, uint128m *prandex, const uint128m *pbuf,
Expand All @@ -634,7 +636,8 @@ void case_1c(uint128m *prand, uint128m *prandex, const uint128m *pbuf,
prand[0] = tempa2;

acc[0] = _mm_xor_si128_emu(tempa3, acc[0]);

uint128m temp4 = _mm_load_si128_emu(pbuf - (((selector & 1) << 1) - 1));
acc[0] = _mm_xor_si128_emu(temp4, acc[0]);
uint128m tempb1 = _mm_mulhrs_epi16_emu(acc[0], tempa3);
uint128m tempb2 = _mm_xor_si128_emu(tempb1, tempa3);
prandex[0] = tempb2;
Expand Down Expand Up @@ -834,7 +837,7 @@ __kernel void verus_gpu_hash(__constant uint *startNonce,
sharedMemory1[2][i] = saes_table[2][i];
sharedMemory1[3][i] = saes_table[3][i];
}
barrier(CLK_LOCAL_MEM_FENCE); //sync sharedmem
//mem_fence(CLK_LOCAL_MEM_FENCE); //sync sharedmem
if (startNonce[0] == 0) {
for (int i = 0; i < VERUS_KEY_SIZE128; i++) {

Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ uint32_t verify_nonce(cl_command_queue queue, cl_mem nonces_d,
if (vhash[7] >= Htarg || fulltest(vhash, (uint32_t*)target)) {
((uint32_t*)&buffer)[333] = winning_n & 0xffffffff;
// ((uint32_t*)&buffer)[334] = winning_n >> 32;
buffer[0] = 0xfd; buffer[1] = 0x40; buffer[2] = 0x05; buffer[3] = 0x03;
buffer[0] = 0xfd; buffer[1] = 0x40; buffer[2] = 0x05; buffer[3] = 0x04;
sh = 1;

debug("Hash is under target\n");
Expand Down Expand Up @@ -923,7 +923,7 @@ void mining_mode(cl_device_id dev_id, cl_program program, cl_context ctx, cl_com
uint64_t *nonce_ptr;
uint32_t *nonce_sum;

unsigned char block_41970[] = { 0xfd, 0x40, 0x05, 0x03 };
unsigned char block_41970[] = { 0xfd, 0x40, 0x05, 0x04 };

uint8_t full_data[140 + 3 + 1344] = { 0 };
uint8_t* sol_data = &full_data[140];
Expand Down
Binary file modified sa-solver.exe
Binary file not shown.

0 comments on commit 09d621f

Please sign in to comment.