I looked at the cgminer 3.7.2 (last cgminer that supported BTC GPU mining) and thought that all I had to do was add another sha256 function but it seems its much more involved than that.
I tried this one:
https://github.com/Kalroth/cgminer-3.7.2-kalrothI added another round:
static void regen_hash(struct work *work)
{
uint32_t *data32 = (uint32_t *)(work->data);
unsigned char swap[80];
uint32_t *swap32 = (uint32_t *)swap;
unsigned char hash1[32];
unsigned char hash2[32];
flip80(swap32, data32);
sha256(swap, 80, hash1);
sha256(hash1, 32, hash2);
sha256(hash2, 32, (unsigned char *)(work->hash));
}
static void gen_hash(unsigned char *data, unsigned char *hash, int len)
{
unsigned char hash1[32];
unsigned char hash2[32];
sha256(data, len, hash1);
sha256(hash1, 32, hash2);
sha256(hash2, 32, hash);
}
Getting 600MHs on a RX470, but nothing gets accepted. Maybe the difficulty calculation is not right or something?