mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-12-05 21:27:13 -06:00
compile batch keygen by default
This commit is contained in:
15
main.c
15
main.c
@@ -517,8 +517,6 @@ end:
|
|||||||
}
|
}
|
||||||
#endif // PASSPHRASE
|
#endif // PASSPHRASE
|
||||||
|
|
||||||
#ifdef BATCHKEYGEN
|
|
||||||
|
|
||||||
#ifndef BATCHNUM
|
#ifndef BATCHNUM
|
||||||
#define BATCHNUM 2048
|
#define BATCHNUM 2048
|
||||||
#endif
|
#endif
|
||||||
@@ -640,7 +638,6 @@ end:
|
|||||||
sodium_memzero(seed,sizeof(seed));
|
sodium_memzero(seed,sizeof(seed));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif // BATCHKEYGEN
|
|
||||||
|
|
||||||
static void printhelp(FILE *out,const char *progname)
|
static void printhelp(FILE *out,const char *progname)
|
||||||
{
|
{
|
||||||
@@ -662,11 +659,9 @@ static void printhelp(FILE *out,const char *progname)
|
|||||||
"\t-j numthreads - same as -t\n"
|
"\t-j numthreads - same as -t\n"
|
||||||
"\t-n numkeys - specify number of keys (default - 0 - unlimited)\n"
|
"\t-n numkeys - specify number of keys (default - 0 - unlimited)\n"
|
||||||
"\t-N numwords - specify number of words per key (default - 1)\n"
|
"\t-N numwords - specify number of words per key (default - 1)\n"
|
||||||
"\t-z - use faster key generation method. this is now default\n"
|
"\t-z - use faster key generation method; this is now default\n"
|
||||||
"\t-Z - use slower key generation method\n"
|
"\t-Z - use slower key generation method\n"
|
||||||
#ifdef BATCHKEYGEN
|
"\t-B - use batching key generation method (>10x faster than -z, experimental)\n"
|
||||||
"\t-B - use batching key generation\n"
|
|
||||||
#endif
|
|
||||||
"\t-s - print statistics each 10 seconds\n"
|
"\t-s - print statistics each 10 seconds\n"
|
||||||
"\t-S t - print statistics every specified ammount of seconds\n"
|
"\t-S t - print statistics every specified ammount of seconds\n"
|
||||||
"\t-T - do not reset statistics counters when printing\n"
|
"\t-T - do not reset statistics counters when printing\n"
|
||||||
@@ -733,9 +728,7 @@ int main(int argc,char **argv)
|
|||||||
int dirnameflag = 0;
|
int dirnameflag = 0;
|
||||||
int numthreads = 0;
|
int numthreads = 0;
|
||||||
int fastkeygen = 1;
|
int fastkeygen = 1;
|
||||||
#ifdef BATCHKEYGEN
|
|
||||||
int batchkeygen = 0;
|
int batchkeygen = 0;
|
||||||
#endif
|
|
||||||
int yamlinput = 0;
|
int yamlinput = 0;
|
||||||
#ifdef PASSPHRASE
|
#ifdef PASSPHRASE
|
||||||
int deterministic = 0;
|
int deterministic = 0;
|
||||||
@@ -864,10 +857,8 @@ int main(int argc,char **argv)
|
|||||||
fastkeygen = 0;
|
fastkeygen = 0;
|
||||||
else if (*arg == 'z')
|
else if (*arg == 'z')
|
||||||
fastkeygen = 1;
|
fastkeygen = 1;
|
||||||
#ifdef BATCHKEYGEN
|
|
||||||
else if (*arg == 'B')
|
else if (*arg == 'B')
|
||||||
batchkeygen = 1;
|
batchkeygen = 1;
|
||||||
#endif
|
|
||||||
else if (*arg == 's') {
|
else if (*arg == 's') {
|
||||||
#ifdef STATISTICS
|
#ifdef STATISTICS
|
||||||
reportdelay = 10000000;
|
reportdelay = 10000000;
|
||||||
@@ -1068,9 +1059,7 @@ int main(int argc,char **argv)
|
|||||||
#ifdef PASSPHRASE
|
#ifdef PASSPHRASE
|
||||||
deterministic ? dofastworkdeterministic :
|
deterministic ? dofastworkdeterministic :
|
||||||
#endif
|
#endif
|
||||||
#ifdef BATCHKEYGEN
|
|
||||||
batchkeygen ? dobatchwork :
|
batchkeygen ? dobatchwork :
|
||||||
#endif
|
|
||||||
(fastkeygen ? dofastwork : dowork),tp);
|
(fastkeygen ? dofastwork : dowork),tp);
|
||||||
if (tret) {
|
if (tret) {
|
||||||
fprintf(stderr,"error while making " FSZ "th thread: %s\n",i,strerror(tret));
|
fprintf(stderr,"error while making " FSZ "th thread: %s\n",i,strerror(tret));
|
||||||
|
|||||||
Reference in New Issue
Block a user