File: Hash.h

package info (click to toggle)
hashrat 1.8.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,700 kB
  • ctags: 1,677
  • sloc: ansic: 17,713; sh: 323; makefile: 157
file content (46 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef LIBUSEFUL_HASH_H
#define LIBUSEFUL_HASH_H

#include "file.h"
#include "includes.h"


#ifdef __cplusplus
extern "C" {
#endif

typedef struct t_hash THash;

typedef void (*HASH_UPDATE)(THash *Hash, char *Data, int DataLen);
typedef THash *(*HASH_CLONE)(THash *Hash);
typedef int (*HASH_FINISH)(THash *Hash, char **RetStr);

struct t_hash
{
char *Type;
char *Key1;
unsigned int Key1Len;
char *Key2;
unsigned int Key2Len;
void *Ctx;
HASH_UPDATE Update;
HASH_FINISH Finish;
HASH_CLONE Clone;
};

void HashAvailableTypes(ListNode *Vars);
THash *HashInit(const char *Type);
int HashFinish(THash *Hash, int Encoding, char **Return);
void HMACSetKey(THash *HMAC, char *Key, int Len);
void HashDestroy(THash *Hash);
int HashBytes(char **Return, char *Type, char *text, int len, int Encoding);
int HashFile(char **Return, char *Type, char *Path, int Encoding);
int PBK2DF2(char **Return, char *Type, char *Bytes, int Len, char *Salt, int SaltLen, uint32_t Rounds, int Encoding);

#ifdef __cplusplus
}
#endif



#endif