Files: 271e1130133565a49a6056ea4947369569cb9701 / ext / bcrypt.h
1605 bytesRaw
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | /* This implementation is adaptable to current computing power. |
8 | * You can have up to 2^31 rounds which should be enough for some |
9 | * time to come. |
10 | */ |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | char *bcrypt_gensalt(u_int8_t, u_int8_t *); |
18 | |
19 | static void encode_salt(char *, u_int8_t *, u_int16_t, u_int8_t); |
20 | static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t); |
21 | static void decode_base64(u_int8_t *, u_int16_t, u_int8_t *); |
22 | |
23 | static char encrypted[_PASSWORD_LEN]; |
24 | static char gsalt[7 + (BCRYPT_MAXSALT * 4 + 2) / 3 + 1]; |
25 | static char error[] = ":"; |
26 | |
27 | const static u_int8_t Base64Code[] = |
28 | "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
29 | |
30 | const static u_int8_t index_64[128] = { |
31 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
32 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
33 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
34 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
35 | 255, 255, 255, 255, 255, 255, 0, 1, 54, 55, |
36 | 56, 57, 58, 59, 60, 61, 62, 63, 255, 255, |
37 | 255, 255, 255, 255, 255, 2, 3, 4, 5, 6, |
38 | 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, |
39 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, |
40 | 255, 255, 255, 255, 255, 255, 28, 29, 30, |
41 | 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, |
42 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, |
43 | 51, 52, 53, 255, 255, 255, 255, 255 |
44 | }; |
45 |
Built with git-ssb-web