X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=BOINC%20software%2FBOINC%20client%20apps%2Fdistrrtgen%2Fdistrrtgen.cpp;h=69621d2cecc8d496df5e86ade1a42fe976225b19;hb=42abeb2fa5e334dd1587f489fd7309b5de14fafd;hp=d9367852ab16d89229b855ea1c5eb97a578789f9;hpb=df8d800454d70f0fb39ab0c227ca55f91b581da7;p=freerainbowtables diff --git a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.cpp b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.cpp index d936785..69621d2 100644 --- a/BOINC software/BOINC client apps/distrrtgen/distrrtgen.cpp +++ b/BOINC software/BOINC client apps/distrrtgen/distrrtgen.cpp @@ -127,7 +127,7 @@ int main(int argc, char **argv) { return -1; } string sHashRoutineName, sCharsetName, sSalt, sCheckPoints; - int nRainbowChainCount, nPlainLenMin, nPlainLenMax, nRainbowTableIndex, nRainbowChainLen; + uint32 nRainbowChainCount, nPlainLenMin, nPlainLenMax, nRainbowTableIndex, nRainbowChainLen; uint64 nChainStart; sHashRoutineName = argv[1]; sCharsetName = argv[2]; @@ -144,7 +144,7 @@ int main(int argc, char **argv) { nChainStart = atoll(argv[8]); #endif sCheckPoints = argv[9]; - vector vCPPositions; + vector vCPPositions; char *cp = strtok((char *)sCheckPoints.c_str(), ","); while(cp != NULL) { @@ -223,21 +223,21 @@ int main(int argc, char **argv) { unsigned int nFileLen; // Round to boundary - nDataLen = nDataLen / 18 * 18; - if ((int)nDataLen == nRainbowChainCount * 18) + nDataLen = nDataLen / 10 * 10; + if ((int)nDataLen == nRainbowChainCount * 10) { std::cerr << "precomputation of this rainbow table already finished" << std::endl; fclose(outfile); return 0; } - nChainStart += (nDataLen / 18); + nChainStart += (nDataLen / 10); fseek(outfile, nDataLen, SEEK_SET); size_t nReturn; CChainWalkContext cwc; uint64 nIndex[2]; time_t tStart = time(NULL); // std::cout << "Starting to generate chains" << std::endl; - for(int nCurrentCalculatedChains = nDataLen / 18; nCurrentCalculatedChains < nRainbowChainCount; nCurrentCalculatedChains++) + for(uint32 nCurrentCalculatedChains = nDataLen / 10; nCurrentCalculatedChains < nRainbowChainCount; nCurrentCalculatedChains++) { uint32 cpcheck = 0; unsigned short checkpoint = 0; @@ -246,7 +246,7 @@ int main(int argc, char **argv) { cwc.SetIndex(nChainStart++); // use a given index now! nIndex[0] = cwc.GetIndex(); - for (int nPos = 0; nPos < nRainbowChainLen - 1; nPos++) + for (uint32 nPos = 0; nPos < nRainbowChainLen - 1; nPos++) { // std::cout << "IndexToPlain()" << std::endl; cwc.IndexToPlain(); @@ -265,7 +265,7 @@ int main(int argc, char **argv) { nIndex[1] = cwc.GetIndex(); // Write chain to disk - if ((nReturn = fwrite(nIndex, 1, 16, outfile)) != 16) + if ((nReturn = fwrite(&nIndex[1], 1, 8, outfile)) != 8) { std::cerr << "disk write fail" << std::endl; fclose(outfile); @@ -280,7 +280,7 @@ int main(int argc, char **argv) { // fflush(file); } //std::cout << "Generation completed" << std::endl; - fseek(outfile, 0, SEEK_SET); +/* fseek(outfile, 0, SEEK_SET); nFileLen = GetFileLen(outfile); nRainbowChainCount = nFileLen / 18; @@ -290,7 +290,7 @@ int main(int argc, char **argv) { { // Load file fseek(outfile, 0, SEEK_SET); - for(int i = 0; i < nRainbowChainCount; i++) + for(uint32 i = 0; i < nRainbowChainCount; i++) { if(fread(&pChain[i], 1, 16, outfile) != 16) { @@ -305,18 +305,18 @@ int main(int argc, char **argv) { } // Sort file - QuickSort(pChain, 0, nRainbowChainCount - 1); + //QuickSort(pChain, 0, nRainbowChainCount - 1); // Write file fseek(outfile, 0, SEEK_SET); - for(int i = 0; i < nRainbowChainCount; i++) + for(uint32 i = 0; i < nRainbowChainCount; i++) { - fwrite(&pChain[i], 1, 16, outfile); + fwrite(&pChain[i].nIndexE, 1, 8, outfile); fwrite(&pChain[i].nCheckPoint, 2, 1, outfile); } delete[] pChain; } - +*/ fclose(outfile); // main loop - read characters, convert to UC, write