MCPcopy Create free account
hub / github.com/JeanLucPons/VanitySearch / FindKeyCPU

Method FindKeyCPU

Vanity.cpp:1284–1477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282}
1283
1284void VanitySearch::FindKeyCPU(TH_PARAM *ph) {
1285
1286 // Global init
1287 int thId = ph->threadId;
1288 counters[thId] = 0;
1289
1290 // CPU Thread
1291 IntGroup *grp = new IntGroup(CPU_GRP_SIZE/2+1);
1292
1293 // Group Init
1294 Int key;
1295 Point startP;
1296 getCPUStartingKey(thId,key,startP);
1297
1298 Int dx[CPU_GRP_SIZE/2+1];
1299 Point pts[CPU_GRP_SIZE];
1300
1301 Int dy;
1302 Int dyn;
1303 Int _s;
1304 Int _p;
1305 Point pp;
1306 Point pn;
1307 grp->Set(dx);
1308
1309 ph->hasStarted = true;
1310 ph->rekeyRequest = false;
1311
1312 while (!endOfSearch) {
1313
1314 if (ph->rekeyRequest) {
1315 getCPUStartingKey(thId, key, startP);
1316 ph->rekeyRequest = false;
1317 }
1318
1319 // Fill group
1320 int i;
1321 int hLength = (CPU_GRP_SIZE / 2 - 1);
1322
1323 for (i = 0; i < hLength; i++) {
1324 dx[i].ModSub(&Gn[i].x, &startP.x);
1325 }
1326 dx[i].ModSub(&Gn[i].x, &startP.x); // For the first point
1327 dx[i+1].ModSub(&_2Gn.x, &startP.x); // For the next center point
1328
1329 // Grouped ModInv
1330 grp->ModInv();
1331
1332 // We use the fact that P + i*G and P - i*G has the same deltax, so the same inverse
1333 // We compute key in the positive and negative way from the center of the group
1334
1335 // center point
1336 pts[CPU_GRP_SIZE/2] = startP;
1337
1338 for (i = 0; i<hLength && !endOfSearch; i++) {
1339
1340 pp = startP;
1341 pn = startP;

Callers 1

_FindKeyFunction · 0.80

Calls 11

ModSubMethod · 0.80
ModMulK1Method · 0.80
ModSquareK1Method · 0.80
ModNegMethod · 0.80
ModAddMethod · 0.80
ComputePublicKeyMethod · 0.80
equalsMethod · 0.80
NextKeyMethod · 0.80
SetMethod · 0.45
ModInvMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected