Skip to content

Commit

Permalink
compile batch keygen by default
Browse files Browse the repository at this point in the history
  • Loading branch information
cathugger committed Jan 27, 2019
1 parent 0ec0f85 commit 0befa41
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,6 @@ static void *dofastworkdeterministic(void *task)
}
#endif // PASSPHRASE

#ifdef BATCHKEYGEN

#ifndef BATCHNUM
#define BATCHNUM 2048
#endif
Expand Down Expand Up @@ -640,7 +638,6 @@ static void *dobatchwork(void *task)
sodium_memzero(seed,sizeof(seed));
return 0;
}
#endif // BATCHKEYGEN

static void printhelp(FILE *out,const char *progname)
{
Expand All @@ -662,11 +659,9 @@ static void printhelp(FILE *out,const char *progname)
"\t-j numthreads - same as -t\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-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"
#ifdef BATCHKEYGEN
"\t-B - use batching key generation\n"
#endif
"\t-B - use batching key generation method (>10x faster than -z, experimental)\n"
"\t-s - print statistics each 10 seconds\n"
"\t-S t - print statistics every specified ammount of seconds\n"
"\t-T - do not reset statistics counters when printing\n"
Expand Down Expand Up @@ -733,9 +728,7 @@ int main(int argc,char **argv)
int dirnameflag = 0;
int numthreads = 0;
int fastkeygen = 1;
#ifdef BATCHKEYGEN
int batchkeygen = 0;
#endif
int yamlinput = 0;
#ifdef PASSPHRASE
int deterministic = 0;
Expand Down Expand Up @@ -864,10 +857,8 @@ int main(int argc,char **argv)
fastkeygen = 0;
else if (*arg == 'z')
fastkeygen = 1;
#ifdef BATCHKEYGEN
else if (*arg == 'B')
batchkeygen = 1;
#endif
else if (*arg == 's') {
#ifdef STATISTICS
reportdelay = 10000000;
Expand Down Expand Up @@ -1068,9 +1059,7 @@ int main(int argc,char **argv)
#ifdef PASSPHRASE
deterministic ? dofastworkdeterministic :
#endif
#ifdef BATCHKEYGEN
batchkeygen ? dobatchwork :
#endif
(fastkeygen ? dofastwork : dowork),tp);
if (tret) {
fprintf(stderr,"error while making " FSZ "th thread: %s\n",i,strerror(tret));
Expand Down

0 comments on commit 0befa41

Please sign in to comment.