-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibex_hash.h
More file actions
executable file
·67 lines (46 loc) · 2.84 KB
/
Copy pathlibex_hash.h
File metadata and controls
executable file
·67 lines (46 loc) · 2.84 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* -------------------------------------------------------------------------- */
/* (c) ali@balarabe.com [libex_hash.h] */
/* -------------------------------------------------------------------------- */
#if (defined __GNUC__ || defined __clang__) && !defined __MINGW32__
#pragma GCC diagnostic ignored "-Wunused-macros"
#endif
#if !defined INCLUDED_LIBEX_HASH_H
#define INCLUDED_LIBEX_HASH_H
#include "libex.h"
/* whirlpool-specific definitions */
#define NESSIE_HASH_DIGEST_BYTES 64
#define NESSIE_HASH_DIGEST_BITS 512 /* 8 * NESSIE_HASH_DIGEST_BYTES */
/* -------------------------------------------------------------------------- */
LX_NAMESPACE(lx_c)
typedef struct lx_hash_t {
uint8_t hash_bytes[NESSIE_HASH_DIGEST_BYTES]; /* lx_hash_t */
}
lx_hash_t;
LX_PUBLIC lx_bool lx_hash_equal( /*F*/
const lx_hash_t* hash_1_, /*-*/
const lx_hash_t* hash_2_ ); /*-*/
LX_PUBLIC lx_new_chars_t lx_hash_hex_of_file( lx_chars_t filename_ ); /*F*/
#if defined UNICODE || defined _UNICODE
#define lx_hash_hex_of_text lx_hash_hex_of_text_A /*F*/
#else
#define lx_hash_hex_of_text lx_hash_hex_of_text_W /*F*/
#endif
LX_PUBLIC lx_new_chars_t lx_hash_hex_of_text_A( const char* text_ ); /*F*/
LX_PUBLIC lx_new_chars_t lx_hash_hex_of_text_W( const wchar_t* text_ ); /*F*/
LX_PUBLIC lx_new_chars_t lx_hash_hex_text( const lx_hash_t* hash_ ); /*F*/
LX_PUBLIC void lx_hash_init( lx_hash_t* hash_ ); /*F*/
LX_PUBLIC lx_hash_t lx_hash_of_bytes( /*F*/
const void* bytes_, /*-*/
const size_t length_in_bytes_ ); /*-*/
LX_PUBLIC lx_hash_t lx_hash_of_file( lx_chars_t filename_ ); /*F*/
LX_PUBLIC lx_hash_t lx_hash_of_hash( lx_hash_t* hash_ ); /*F*/
#if defined UNICODE || defined _UNICODE
#define lx_hash_of_text lx_hash_of_text_A /*F*/
#else /* UNICODE || _UNICODE */
#define lx_hash_of_text lx_hash_of_text_W /*F*/
#endif /* !UNICODE && !_UNICODE */
LX_PUBLIC lx_hash_t lx_hash_of_text_A( const char* text_ ); /*F*/
LX_PUBLIC lx_hash_t lx_hash_of_text_W( const wchar_t* text_ ); /*F*/
void nessie_test_api( void ); /*F*/
LX_END_NAMESPACE /*lx_c*/
#endif /*eof*/