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

Method GetHash160

SECP256K1.cpp:346–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344(buff)[15] = 0xB0;
345
346void Secp256K1::GetHash160(int type,bool compressed,
347 Point &k0,Point &k1,Point &k2,Point &k3,
348 uint8_t *h0,uint8_t *h1,uint8_t *h2,uint8_t *h3) {
349
350#ifdef WIN64
351 __declspec(align(16)) unsigned char sh0[64];
352 __declspec(align(16)) unsigned char sh1[64];
353 __declspec(align(16)) unsigned char sh2[64];
354 __declspec(align(16)) unsigned char sh3[64];
355#else
356 unsigned char sh0[64] __attribute__((aligned(16)));
357 unsigned char sh1[64] __attribute__((aligned(16)));
358 unsigned char sh2[64] __attribute__((aligned(16)));
359 unsigned char sh3[64] __attribute__((aligned(16)));
360#endif
361
362 switch (type) {
363
364 case P2PKH:
365 case BECH32:
366 {
367
368 if (!compressed) {
369
370 uint32_t b0[32];
371 uint32_t b1[32];
372 uint32_t b2[32];
373 uint32_t b3[32];
374
375 KEYBUFFUNCOMP(b0, k0);
376 KEYBUFFUNCOMP(b1, k1);
377 KEYBUFFUNCOMP(b2, k2);
378 KEYBUFFUNCOMP(b3, k3);
379
380 sha256sse_2B(b0, b1, b2, b3, sh0, sh1, sh2, sh3);
381 ripemd160sse_32(sh0, sh1, sh2, sh3, h0, h1, h2, h3);
382
383 } else {
384
385 uint32_t b0[16];
386 uint32_t b1[16];
387 uint32_t b2[16];
388 uint32_t b3[16];
389
390 KEYBUFFCOMP(b0, k0);
391 KEYBUFFCOMP(b1, k1);
392 KEYBUFFCOMP(b2, k2);
393 KEYBUFFCOMP(b3, k3);
394
395 sha256sse_1B(b0, b1, b2, b3, sh0, sh1, sh2, sh3);
396 ripemd160sse_32(sh0, sh1, sh2, sh3, h0, h1, h2, h3);
397
398 }
399
400 }
401 break;
402
403 case P2SH:

Callers 2

checkAddressesMethod · 0.80
checkAddressesSSEMethod · 0.80

Calls 9

sha256sse_2BFunction · 0.85
ripemd160sse_32Function · 0.85
sha256sse_1BFunction · 0.85
sha256_65Function · 0.85
sha256_33Function · 0.85
ripemd160_32Function · 0.85
sha256Function · 0.85
Get32BytesMethod · 0.80
IsEvenMethod · 0.80

Tested by

no test coverage detected