From f63038ac6213d11863c63d331808817a0bdfdd85 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 11 Jan 2014 10:18:50 -0700 Subject: [PATCH] finished pow --- src/main.cpp | 4 ++-- src/scrypt.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 35530589ed..0d9f851dbf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,7 +31,7 @@ CTxMemPool mempool; unsigned int nTransactionsUpdated = 0; map mapBlockIndex; -uint256 hashGenesisBlock("0xe4bda88bbd289f266060f8e3f19167e819278df379a32614cad9acf02dfcdb3c"); +uint256 hashGenesisBlock("0x79183173cf612c431e3726f5c9c893f8670a081b976bac6d00094c74f7e2df3a"); static CBigNum bnProofOfWorkLimit(~uint256(0) >> 20); // Xcoin: starting difficulty is 1 / 2^12 CBlockIndex* pindexGenesisBlock = NULL; int nBestHeight = -1; @@ -2770,7 +2770,7 @@ bool InitBlockIndex() { block.nVersion = 1; block.nTime = 1389401959; block.nBits = 0x1e0ffff0; - block.nNonce = 21029584; + block.nNonce = 24329260; if (fTestNet) { diff --git a/src/scrypt.cpp b/src/scrypt.cpp index ab545f77d4..21cb1a1b6c 100644 --- a/src/scrypt.cpp +++ b/src/scrypt.cpp @@ -257,12 +257,20 @@ void shash(const char *input, char *output) { uint8_t B[128]; uint32_t X[32]; - uint32_t k; + uint32_t i, j, k; + uint32_t *V; PBKDF2_SHA256((const uint8_t *)input, 80, (const uint8_t *)input, 80, 1, B, 128); for (k = 0; k < 32; k++) - X[k] = le32dec(&B[4 * k]); + X[k] = le32dec(&B[4 * k]); + + for (k = 0; k < 16; k++){ + for (i = 0; i < 16; i++){ + xor_salsa8(&X[k+i], &X[k]); + xor_salsa8(&X[k], &X[k+i]); + } + } for (k = 0; k < 32; k++) le32enc(&B[4 * k], X[k]);