-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathneoscrypt.h
35 lines (25 loc) · 905 Bytes
/
neoscrypt.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
34
void neoscrypt(const unsigned char *password, unsigned char *output);
typedef unsigned long long ullong;
typedef signed long long llong;
typedef unsigned int uint;
typedef unsigned char uchar;
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? a : b)
#endif
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? a : b)
#endif
#define BLOCK_SIZE 64
#define DIGEST_SIZE 32
typedef uchar hash_digest[DIGEST_SIZE];
#define ROTL32(a,b) (((a) << (b)) | ((a) >> (32 - b)))
#define ROTR32(a,b) (((a) >> (b)) | ((a) << (32 - b)))
#define U8TO32_BE(p) \
(((uint)((p)[0]) << 24) | ((uint)((p)[1]) << 16) | \
((uint)((p)[2]) << 8) | ((uint)((p)[3])))
#define U32TO8_BE(p, v) \
(p)[0] = (uchar)((v) >> 24); (p)[1] = (uchar)((v) >> 16); \
(p)[2] = (uchar)((v) >> 8); (p)[3] = (uchar)((v) );
#define U64TO8_BE(p, v) \
U32TO8_BE((p), (uint)((v) >> 32)); \
U32TO8_BE((p) + 4, (uint)((v) ));