@@ -195,6 +195,8 @@ void CLKeySearchDevice::init(const secp256k1::uint256 &start, int compression, u
195
195
196
196
_start = start;
197
197
198
+ _stride = stride;
199
+
198
200
_compression = compression;
199
201
200
202
allocateBuffers ();
@@ -415,8 +417,7 @@ void CLKeySearchDevice::getResultsInternal()
415
417
KeySearchResult minerResult;
416
418
417
419
// 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;
420
421
secp256k1::uint256 privateKey = secp256k1::addModN (_start, offset);
421
422
422
423
minerResult.privateKey = privateKey;
@@ -588,8 +589,11 @@ void CLKeySearchDevice::generateStartingPoints()
588
589
// Generate key pairs for k, k+1, k+2 ... k + <total points in parallel - 1>
589
590
secp256k1::uint256 privKey = _start;
590
591
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);
593
597
}
594
598
595
599
unsigned int *privateKeys = new unsigned int [8 * totalPoints];
0 commit comments