1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 01:44:23 +00:00

misc: add FIXME for scrypt_test() and scanhash_scrypt().

This commit is contained in:
Noel Maersk 2014-02-25 06:32:06 +02:00
parent 2135777cac
commit c4c85ca71c
2 changed files with 5 additions and 4 deletions

View File

@ -420,6 +420,7 @@ void scrypt_regenhash(struct work *work)
static const uint32_t diff1targ = 0x0000ffff; static const uint32_t diff1targ = 0x0000ffff;
/* Used externally as confirmation of correct OCL code */ /* Used externally as confirmation of correct OCL code */
/* FIXME: find reference in git blame and see why it was present, remove if obsolete */
/* /*
int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce) int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce)
{ {
@ -430,7 +431,7 @@ int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t non
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
scratchbuf = (char *)alloca(SCRATCHBUF_SIZE); scratchbuf = (char *)alloca(SCRATCHBUF_SIZE);
scrypt_1024_1_1_256_sp(data, scratchbuf, ohash); scrypt_n_1_1_256_sp(data, scratchbuf, ohash, (1 << opt_nfactor));
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
applog(LOG_DEBUG, "htarget %08lx diff1 %08lx hash %08lx", applog(LOG_DEBUG, "htarget %08lx diff1 %08lx hash %08lx",
@ -469,7 +470,7 @@ bool scanhash_scrypt(struct thr_info *thr, const unsigned char __maybe_unused *p
*nonce = ++n; *nonce = ++n;
data[19] = htobe32(n); data[19] = htobe32(n);
scrypt_1024_1_1_256_sp(data, scratchbuf, ostate); scrypt_n_1_1_256_sp(data, scratchbuf, ostate, (1 << opt_nfactor));
tmp_hash7 = be32toh(ostate[7]); tmp_hash7 = be32toh(ostate[7]);
if (unlikely(tmp_hash7 <= Htarg)) { if (unlikely(tmp_hash7 <= Htarg)) {

View File

@ -3,8 +3,8 @@
#include "miner.h" #include "miner.h"
extern int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, /* extern int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, */
uint32_t nonce); /* uint32_t nonce); */
extern void scrypt_regenhash(struct work *work); extern void scrypt_regenhash(struct work *work);
#endif /* SCRYPT_H */ #endif /* SCRYPT_H */