@@ -195,6 +195,8 @@ void CLKeySearchDevice::init(const secp256k1::uint256 &start, int compression, u
195195
196196 _start = start;
197197
198+ _stride = stride;
199+
198200 _compression = compression;
199201
200202 allocateBuffers ();
@@ -415,8 +417,7 @@ void CLKeySearchDevice::getResultsInternal()
415417 KeySearchResult minerResult;
416418
417419 // Calculate the private key based on the number of iterations and the current thread
418- // secp256k1::uint256 offset((uint64_t)_blocks * _threads * _pointsPerThread * _iterations + getPrivateKeyOffset(ptr[i].thread, ptr[i].block, ptr[i].idx));
419- secp256k1::uint256 offset = (secp256k1::uint256 ((uint64_t )_blocks * _threads * _pointsPerThread * _iterations) + secp256k1::uint256 (getPrivateKeyOffset (ptr[i].thread , ptr[i].block , ptr[i].idx ))) * _stride;
420+ secp256k1::uint256 offset = (secp256k1::uint256 ((uint64_t )_blocks * _threads * _pointsPerThread * _iterations) + secp256k1::uint256 (getPrivateKeyOffset (ptr->thread , ptr->block , ptr->idx ))) * _stride;
420421 secp256k1::uint256 privateKey = secp256k1::addModN (_start, offset);
421422
422423 minerResult.privateKey = privateKey;
@@ -588,8 +589,11 @@ void CLKeySearchDevice::generateStartingPoints()
588589 // Generate key pairs for k, k+1, k+2 ... k + <total points in parallel - 1>
589590 secp256k1::uint256 privKey = _start;
590591
591- for (uint64_t i = 0 ; i < totalPoints; i++) {
592- exponents.push_back (privKey.add (i));
592+ exponents.push_back (privKey);
593+
594+ for (uint64_t i = 1 ; i < totalPoints; i++) {
595+ privKey = privKey.add (_stride);
596+ exponents.push_back (privKey);
593597 }
594598
595599 unsigned int *privateKeys = new unsigned int [8 * totalPoints];
0 commit comments