|
|
|
@ -3,20 +3,20 @@
@@ -3,20 +3,20 @@
|
|
|
|
|
#include<getopt.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static struct{ |
|
|
|
|
static struct |
|
|
|
|
{ |
|
|
|
|
bool reg=false; |
|
|
|
|
int threads=-1; |
|
|
|
|
i2p::data::SigningKeyType signature; |
|
|
|
|
std::string outputpath=""; |
|
|
|
|
std::regex regex; |
|
|
|
|
|
|
|
|
|
} options; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void inline CalculateW (const uint8_t block[64], uint32_t W[64]) |
|
|
|
|
{ |
|
|
|
|
/*
|
|
|
|
|
implementation of orignal |
|
|
|
|
/**
|
|
|
|
|
* implementation of orignal |
|
|
|
|
*/ |
|
|
|
|
for (int i = 0; i < 16; i++) |
|
|
|
|
#ifdef _WIN32 |
|
|
|
@ -31,8 +31,8 @@ implementation of orignal
@@ -31,8 +31,8 @@ implementation of orignal
|
|
|
|
|
|
|
|
|
|
static void inline TransformBlock (uint32_t state[8], const uint32_t W[64]) |
|
|
|
|
{ |
|
|
|
|
/*
|
|
|
|
|
implementation of orignal |
|
|
|
|
/**
|
|
|
|
|
* implementation of orignal |
|
|
|
|
*/ |
|
|
|
|
uint32_t S[8]; |
|
|
|
|
memcpy(S, state, 32); |
|
|
|
@ -60,8 +60,8 @@ implementation of orignal
@@ -60,8 +60,8 @@ implementation of orignal
|
|
|
|
|
|
|
|
|
|
void inline HashNextBlock (uint32_t state[8], const uint8_t * block) |
|
|
|
|
{ |
|
|
|
|
/*
|
|
|
|
|
implementation of orignal |
|
|
|
|
/**
|
|
|
|
|
* implementation of orignal |
|
|
|
|
*/ |
|
|
|
|
uint32_t W[64]; |
|
|
|
|
CalculateW (block, W); |
|
|
|
@ -126,10 +126,10 @@ static inline bool NotThat(const char * a, const char *b)
@@ -126,10 +126,10 @@ static inline bool NotThat(const char * a, const char *b)
|
|
|
|
|
|
|
|
|
|
static inline bool thread_find(uint8_t * buf, const char * prefix, int id_thread, unsigned long long throughput) |
|
|
|
|
{ |
|
|
|
|
/*
|
|
|
|
|
Thanks to orignal ^-^ |
|
|
|
|
For idea and example ^-^ |
|
|
|
|
Orignal is sensei of crypto ;) |
|
|
|
|
/**
|
|
|
|
|
* Thanks to orignal ^-^ |
|
|
|
|
* For idea and example ^-^ |
|
|
|
|
* Orignal is sensei of crypto ;) |
|
|
|
|
*/ |
|
|
|
|
std::cout << "Thread " << id_thread << " binded" << std::endl; |
|
|
|
|
/*
|
|
|
|
@ -208,10 +208,6 @@ Orignal is sensei of crypto ;)
@@ -208,10 +208,6 @@ Orignal is sensei of crypto ;)
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void usage(void){ |
|
|
|
|
const constexpr char * help="vain [text-pattern|regex-pattern] [options]\n" |
|
|
|
|
"-h --help, help menu\n" |
|
|
|
@ -225,7 +221,6 @@ void usage(void){
@@ -225,7 +221,6 @@ void usage(void){
|
|
|
|
|
puts(help); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void parsing(int argc, char ** args){ |
|
|
|
|
int option_index; |
|
|
|
|
static struct option long_options[]={ |
|
|
|
@ -274,10 +269,6 @@ void parsing(int argc, char ** args){
@@ -274,10 +269,6 @@ void parsing(int argc, char ** args){
|
|
|
|
|
|
|
|
|
|
int main (int argc, char * argv[]) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( argc < 2 ) |
|
|
|
|
{ |
|
|
|
|
usage(); |
|
|
|
@ -320,7 +311,7 @@ int main (int argc, char * argv[])
@@ -320,7 +311,7 @@ int main (int argc, char * argv[])
|
|
|
|
|
case i2p::data::SIGNING_KEY_TYPE_RSA_SHA384_3072: |
|
|
|
|
case i2p::data::SIGNING_KEY_TYPE_RSA_SHA512_4096: |
|
|
|
|
case i2p::data::SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
|
std::cout << "Sorry, i don't can generate adress for this signature type" << std::endl; |
|
|
|
|
std::cout << "Sorry, i don't can generate address for this signature type" << std::endl; |
|
|
|
|
return 0; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -413,6 +404,3 @@ int main (int argc, char * argv[])
@@ -413,6 +404,3 @@ int main (int argc, char * argv[])
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|