2016-09-11 09:42:19 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-09-11 09:42:19 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common.h"
|
2017-12-05 10:08:59 +00:00
|
|
|
#include "types.h"
|
|
|
|
#include "interface.h"
|
2018-12-17 09:33:21 +00:00
|
|
|
#include "memory.h"
|
|
|
|
#include "shared.h"
|
2019-03-31 15:39:00 +00:00
|
|
|
#include "benchmark.h"
|
2016-09-12 08:16:42 +00:00
|
|
|
|
2018-02-08 18:13:29 +00:00
|
|
|
static const int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] =
|
2016-09-12 08:16:42 +00:00
|
|
|
{
|
|
|
|
0,
|
|
|
|
100,
|
|
|
|
1400,
|
|
|
|
1700,
|
|
|
|
2500,
|
2017-12-05 10:08:59 +00:00
|
|
|
1000,
|
|
|
|
3000,
|
2016-09-12 08:16:42 +00:00
|
|
|
5500,
|
|
|
|
5600,
|
|
|
|
1500,
|
|
|
|
500,
|
|
|
|
3200,
|
|
|
|
1800,
|
2017-12-05 10:08:59 +00:00
|
|
|
7500,
|
|
|
|
13100,
|
|
|
|
15300,
|
|
|
|
15900,
|
2016-09-12 08:16:42 +00:00
|
|
|
7100,
|
|
|
|
11600,
|
|
|
|
12500,
|
|
|
|
13000,
|
|
|
|
6211,
|
2017-12-05 10:08:59 +00:00
|
|
|
13400,
|
2016-09-12 08:16:42 +00:00
|
|
|
6800,
|
|
|
|
11300,
|
2017-12-05 10:08:59 +00:00
|
|
|
-1,
|
2016-09-12 08:16:42 +00:00
|
|
|
};
|
2017-12-05 10:08:59 +00:00
|
|
|
|
|
|
|
int benchmark_next (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
2018-12-17 09:33:21 +00:00
|
|
|
const folder_config_t *folder_config = hashcat_ctx->folder_config;
|
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
2017-12-05 10:08:59 +00:00
|
|
|
|
|
|
|
static int cur = 0;
|
|
|
|
|
|
|
|
if (user_options->benchmark_all == false)
|
|
|
|
{
|
|
|
|
const int hash_mode = DEFAULT_BENCHMARK_ALGORITHMS_BUF[cur];
|
|
|
|
|
|
|
|
if (hash_mode == -1) return -1;
|
|
|
|
|
|
|
|
cur++;
|
|
|
|
|
|
|
|
return hash_mode;
|
|
|
|
}
|
2019-08-04 02:09:07 +00:00
|
|
|
|
|
|
|
char *modulefile = (char *) hcmalloc (HCBUFSIZ_TINY);
|
|
|
|
|
|
|
|
for (int i = cur; i < MODULE_HASH_MODES_MAXIMUM; i++)
|
2017-12-05 10:08:59 +00:00
|
|
|
{
|
2019-08-04 02:09:07 +00:00
|
|
|
module_filename (folder_config, i, modulefile, HCBUFSIZ_TINY);
|
2018-12-17 09:33:21 +00:00
|
|
|
|
2019-08-04 02:09:07 +00:00
|
|
|
if (hc_path_exist (modulefile) == true)
|
2017-12-05 10:08:59 +00:00
|
|
|
{
|
2019-08-04 02:09:07 +00:00
|
|
|
const int hash_mode = i;
|
2017-12-05 10:08:59 +00:00
|
|
|
|
2019-08-04 02:09:07 +00:00
|
|
|
cur = hash_mode + 1;
|
2017-12-05 10:08:59 +00:00
|
|
|
|
2019-08-04 02:09:07 +00:00
|
|
|
hcfree (modulefile);
|
2019-07-10 15:27:45 +00:00
|
|
|
|
2019-08-04 02:09:07 +00:00
|
|
|
return hash_mode;
|
2017-12-05 10:08:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-04 02:09:07 +00:00
|
|
|
hcfree (modulefile);
|
|
|
|
|
2017-12-05 10:08:59 +00:00
|
|
|
return -1;
|
|
|
|
}
|