2016-09-09 21:17:43 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-09-09 21:17:43 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _POTFILE_H
|
|
|
|
#define _POTFILE_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2016-09-30 20:52:44 +00:00
|
|
|
#include <stddef.h>
|
2016-09-09 21:17:43 +00:00
|
|
|
#include <errno.h>
|
|
|
|
|
2016-09-10 09:32:26 +00:00
|
|
|
#define INCR_POT 1000
|
|
|
|
|
2016-09-30 20:52:44 +00:00
|
|
|
int sort_by_pot (const void *v1, const void *v2, void *v3);
|
|
|
|
int sort_by_salt_buf (const void *v1, const void *v2, void *v3);
|
2016-09-10 10:16:16 +00:00
|
|
|
int sort_by_hash_t_salt (const void *v1, const void *v2);
|
|
|
|
int sort_by_hash_t_salt_hccap (const void *v1, const void *v2);
|
|
|
|
|
2016-09-30 20:52:44 +00:00
|
|
|
void hc_qsort_r (void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg);
|
|
|
|
void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg);
|
|
|
|
|
2016-09-30 10:37:29 +00:00
|
|
|
void potfile_init (potfile_ctx_t *potfile_ctx, const user_options_t *user_options, const folder_config_t *folder_config);
|
2016-10-04 04:35:49 +00:00
|
|
|
void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plain_ptr, const u32 plain_len);
|
2016-09-10 13:17:23 +00:00
|
|
|
int potfile_read_open (potfile_ctx_t *potfile_ctx);
|
|
|
|
void potfile_read_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig);
|
|
|
|
void potfile_read_close (potfile_ctx_t *potfile_ctx);
|
|
|
|
int potfile_write_open (potfile_ctx_t *potfile_ctx);
|
|
|
|
void potfile_write_close (potfile_ctx_t *potfile_ctx);
|
|
|
|
void potfile_write_append (potfile_ctx_t *potfile_ctx, const char *out_buf, u8 *plain_ptr, unsigned int plain_len);
|
2016-10-04 04:35:49 +00:00
|
|
|
void potfile_hash_alloc (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const u32 num);
|
2016-09-10 13:17:23 +00:00
|
|
|
void potfile_hash_free (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig);
|
2016-09-30 20:52:44 +00:00
|
|
|
void potfile_show_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *, void *));
|
|
|
|
void potfile_left_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *, void *));
|
|
|
|
void potfile_show_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *, void *));
|
|
|
|
void potfile_left_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *, void *));
|
2016-09-16 15:01:18 +00:00
|
|
|
int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes);
|
2016-09-10 13:17:23 +00:00
|
|
|
void potfile_destroy (potfile_ctx_t *potfile_ctx);
|
2016-09-09 21:17:43 +00:00
|
|
|
|
|
|
|
#endif // _POTFILE_H
|