| 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 |
#ifndef LMTABLE_H |
| 33 |
#define LMTABLE_H |
| 34 |
|
| 35 |
#include "misc.h" |
| 36 |
#include "table.h" |
| 37 |
|
| 38 |
#ifdef __cplusplus |
| 39 |
extern "C" { |
| 40 |
#endif |
| 41 |
|
| 42 |
static const uchar_t alphanum_chars[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
| 43 |
static const uchar_t extended_chars[69] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; |
| 44 |
static const uint32_t alphanum_max[8] = { 0, 0, 2, 71, 2557, 92056, 3314018, 119304647 }; |
| 45 |
static const uint32_t extended_max[8] = { 0, 0, 1, 3, 190, 13076, 902235, 62254232 }; |
| 46 |
static const uchar_t lmmagic[8] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 }; |
| 47 |
|
| 48 |
static const uint64_t lmalphanum10k_sizes[10] = { 4, 6910420, 30819324, 61638648, 30814120, 61628240, 30824574, 61649148, 30811564, 61623128}; |
| 49 |
static const uint64_t lmalphanum5k_sizes[10] = { 4, 6910420, 59026754, 118053508, 59033296, 118066592, 59036744, 118073488, 59032468, 118064936}; |
| 50 |
static const uint64_t lmextended_sizes[10] = { 4, 92001844, 636849574, 1273699148, 636848624, 1273697248, 636859776, 1273719552, 636844860, 1273689720}; |
| 51 |
|
| 52 |
int lmtable_setup(void *tbl_); |
| 53 |
|
| 54 |
void lmtable_find(void *hsh_, void *tbl_, void *el_); |
| 55 |
int lmtable_lookup_idx(void *hsh_, void *tbl_, void *el_); |
| 56 |
int lmtable_lookup_end(void *hsh_, void *tbl_, void *el_); |
| 57 |
int lmtable_lookup_srt(void *hsh_, void *tbl_, void *el_); |
| 58 |
int lmtable_check(void *hsh_, void *tbl_, void *el_); |
| 59 |
int lmtable_isvalid(void *hsh_, void *tbl_); |
| 60 |
|
| 61 |
void lmtable_mkredux(table_t *tbl, uchar_t *hash, uchar_t *pwd, int n_redux); |
| 62 |
void lmtable_mkhash(uchar_t *pwd, uchar_t *hash); |
| 63 |
|
| 64 |
#ifdef __cplusplus |
| 65 |
} |
| 66 |
#endif |
| 67 |
#endif |