-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrjtiger.h
33 lines (26 loc) · 835 Bytes
/
rjtiger.h
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
/* tiger.h */
#ifndef TIGER_H
#define TIGER_H
#include "ustd.h"
#ifdef __cplusplus
extern "C" {
#endif
#define tiger_block_size 64
#define tiger_hash_length 24
/* algorithm context */
typedef struct tiger_ctx
{
/* the order of the fields slightly influence the algorithm speed */
uint64_t hash[3]; /* algorithm 192-bit state */
unsigned char message[tiger_block_size]; /* 512-bit buffer for leftovers */
uint64_t length; /* processed message length */
int tiger2; /* flag, 1 for Tiger2 algorithm, default is 0 */
} tiger_ctx;
/* hash functions */
void rhash_tiger_init(tiger_ctx *ctx);
void rhash_tiger_update(tiger_ctx *ctx, const unsigned char* msg, size_t size);
void rhash_tiger_final(tiger_ctx *ctx, unsigned char result[24]);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* TIGER_H */