]> eyrie.org Git - kerberos/krb5-strength.git/blob - src/packer.h
Import the current krb5-strength code.
[kerberos/krb5-strength.git] / src / packer.h
1 /*
2  * This program is copyright Alec Muffett 1993. The author disclaims all 
3  * responsibility or liability with respect to it's usage or its effect 
4  * upon hardware or computer systems, and maintains copyright as set out 
5  * in the "LICENCE" document which accompanies distributions of Crack v4.0 
6  * and upwards.
7  */
8
9 #include <stdio.h>
10 #include <ctype.h>
11
12 #define STRINGSIZE      1024
13 #define TRUNCSTRINGSIZE (STRINGSIZE/4)
14
15 #ifndef _ALL_SOURCE
16 typedef unsigned char int8;
17 typedef unsigned short int int16;
18 typedef unsigned long int int32;
19 #endif
20
21 #ifndef NUMWORDS
22 #define NUMWORDS        16
23 #endif
24 #define MAXWORDLEN      32
25 #define MAXBLOCKLEN     (MAXWORDLEN * NUMWORDS)
26
27 struct pi_header
28 {
29     int32 pih_magic;
30     int32 pih_numwords;
31     int16 pih_blocklen;
32     int16 pih_pad;
33 };
34
35 typedef struct
36 {
37     FILE *ifp;
38     FILE *dfp;
39     FILE *wfp;
40
41     int32 flags;
42 #define PFOR_WRITE      0x0001
43 #define PFOR_FLUSH      0x0002
44 #define PFOR_USEHWMS    0x0004
45
46     int32 hwms[256];
47
48     struct pi_header header;
49
50     int count;
51     char data[NUMWORDS][MAXWORDLEN];
52 } PWDICT;
53
54 #define PW_WORDS(x) ((x)->header.pih_numwords)
55 #define PIH_MAGIC 0x70775631
56
57 extern PWDICT *PWOpen();
58 extern char *Mangle();
59 extern char *FascistCheck();
60
61 #define CRACK_TOLOWER(a)        (isupper(a)?tolower(a):(a)) 
62 #define CRACK_TOUPPER(a)        (islower(a)?toupper(a):(a)) 
63 #define STRCMP(a,b)             strcmp((a),(b))