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

Method checkAddresses

Vanity.cpp:998–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996// ----------------------------------------------------------------------------
997
998void VanitySearch::checkAddresses(bool compressed, Int key, int i, Point p1) {
999
1000 unsigned char h0[20];
1001 Point pte1[1];
1002 Point pte2[1];
1003
1004 // Point
1005 secp->GetHash160(searchType,compressed, p1, h0);
1006 prefix_t pr0 = *(prefix_t *)h0;
1007 if (hasPattern || prefixes[pr0].items)
1008 checkAddr(pr0, h0, key, i, 0, compressed);
1009
1010 // Endomorphism #1
1011 pte1[0].x.ModMulK1(&p1.x, &beta);
1012 pte1[0].y.Set(&p1.y);
1013
1014 secp->GetHash160(searchType, compressed, pte1[0], h0);
1015
1016 pr0 = *(prefix_t *)h0;
1017 if (hasPattern || prefixes[pr0].items)
1018 checkAddr(pr0, h0, key, i, 1, compressed);
1019
1020 // Endomorphism #2
1021 pte2[0].x.ModMulK1(&p1.x, &beta2);
1022 pte2[0].y.Set(&p1.y);
1023
1024 secp->GetHash160(searchType, compressed, pte2[0], h0);
1025
1026 pr0 = *(prefix_t *)h0;
1027 if (hasPattern || prefixes[pr0].items)
1028 checkAddr(pr0, h0, key, i, 2, compressed);
1029
1030 // Curve symetrie
1031 // if (x,y) = k*G, then (x, -y) is -k*G
1032 p1.y.ModNeg();
1033 secp->GetHash160(searchType, compressed, p1, h0);
1034 pr0 = *(prefix_t *)h0;
1035 if (hasPattern || prefixes[pr0].items)
1036 checkAddr(pr0, h0, key, -i, 0, compressed);
1037
1038 // Endomorphism #1
1039 pte1[0].y.ModNeg();
1040
1041 secp->GetHash160(searchType, compressed, pte1[0], h0);
1042
1043 pr0 = *(prefix_t *)h0;
1044 if (hasPattern || prefixes[pr0].items)
1045 checkAddr(pr0, h0, key, -i, 1, compressed);
1046
1047 // Endomorphism #2
1048 pte2[0].y.ModNeg();
1049
1050 secp->GetHash160(searchType, compressed, pte2[0], h0);
1051
1052 pr0 = *(prefix_t *)h0;
1053 if (hasPattern || prefixes[pr0].items)
1054 checkAddr(pr0, h0, key, -i, 2, compressed);
1055

Callers

nothing calls this directly

Calls 4

GetHash160Method · 0.80
ModMulK1Method · 0.80
ModNegMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected