You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hashcat/src/cpt.c

38 lines
666 B

8 years ago
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#include "common.h"
#include "types.h"
#include "memory.h"
#include "logging.h"
#include "cpt.h"
int cpt_ctx_init (cpt_ctx_t *cpt_ctx)
{
cpt_ctx->cpt_buf = (cpt_t *) mycalloc (CPT_BUF, sizeof (cpt_t));
cpt_ctx->cpt_total = 0;
cpt_ctx->cpt_pos = 0;
cpt_ctx->cpt_start = time (NULL);
return 0;
}
void cpt_ctx_destroy (cpt_ctx_t *cpt_ctx)
{
myfree (cpt_ctx->cpt_buf);
myfree (cpt_ctx);
}
void cpt_ctx_reset (cpt_ctx_t *cpt_ctx)
{
memset (cpt_ctx->cpt_buf, 0, CPT_BUF * sizeof (cpt_t));
cpt_ctx->cpt_total = 0;
cpt_ctx->cpt_pos = 0;
cpt_ctx->cpt_start = time (NULL);
}