mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-02-02 11:04:00 +01:00
commit
8afe0d8306
|
@ -9,7 +9,9 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
// sha256
|
// sha256
|
||||||
#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
|
#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
|
||||||
#define Maj(x, y, z) ((x & (y | z)) | (y & z))
|
#define Maj(x, y, z) ((x & (y | z)) | (y & z))
|
||||||
|
|
|
@ -279,10 +279,19 @@ if(type != i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519){
|
||||||
|
|
||||||
KeyBuf = new uint8_t[keys.GetFullLen()];
|
KeyBuf = new uint8_t[keys.GetFullLen()];
|
||||||
keys.ToBuffer (KeyBuf, keys.GetFullLen ());
|
keys.ToBuffer (KeyBuf, keys.GetFullLen ());
|
||||||
|
#ifdef __linux__
|
||||||
if(!count_cpu)
|
if(!count_cpu)
|
||||||
count_cpu = sysconf(_SC_NPROCESSORS_ONLN);
|
count_cpu = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
#elif _WIN32
|
||||||
|
if(!count_cpu){
|
||||||
|
SYSTEM_INFO sysinfo;
|
||||||
|
GetSystemInfo(&sysinfo);
|
||||||
|
count_cpu = sysinfo.dwNumberOfProcessors;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if(!count_cpu)
|
||||||
|
count_cpu = 4;
|
||||||
|
#endif
|
||||||
std::cout << "Start vanity generator in " << count_cpu << " threads" << std::endl;
|
std::cout << "Start vanity generator in " << count_cpu << " threads" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue