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
10 * Modified as part of the krb5-strength project as follows:
12 * 2007-03-23 Russ Allbery <eagle@eyrie.org>
13 * - Add ANSI C prototypes and prototype additional functions.
14 * 2009-10-14 Russ Allbery <eagle@eyrie.org>
15 * - Prototype changes for const cleanliness.
16 * 2010-03-14 Russ Allbery <eagle@eyrie.org>
17 * - Fix int8, int16, and int32 definitions.
18 * 2013-10-01 Russ Allbery <eagle@eyrie.org>
19 * - Set hidden visibility on all symbols by default.
20 * 2020-05-16 Russ Allbery <eagle@eyrie.org>
21 * - Cast CRACK_TOLOWER and CRACK_TOUPPER to char.
25 #include <portable/system.h>
29 #define STRINGSIZE 1024
30 #define TRUNCSTRINGSIZE (STRINGSIZE/4)
33 typedef uint16_t int16;
34 typedef uint32_t int32;
39 #define MAXBLOCKLEN (MAXWORDLEN * NUMWORDS)
56 #define PFOR_WRITE 0x0001
57 #define PFOR_FLUSH 0x0002
58 #define PFOR_USEHWMS 0x0004
62 struct pi_header header;
65 char data[NUMWORDS][MAXWORDLEN];
68 #define PW_WORDS(x) ((x)->header.pih_numwords)
69 #define PIH_MAGIC 0x70775631
71 /* Default to a hidden visibility for all CrackLib functions. */
72 #pragma GCC visibility push(hidden)
74 extern PWDICT *PWOpen(const char *, const char *);
75 extern int32 FindPW(PWDICT *, const char *);
76 extern int PutPW(PWDICT *, const char *);
77 extern int PWClose(PWDICT *);
78 extern char *Mangle(const char *, const char *);
79 extern const char *FascistCheck(const char *, const char *);
80 extern char Chop(char *);
81 extern char *Trim(char *);
82 extern int PMatch(const char *, const char *);
83 extern char *Reverse(const char *);
84 extern char *Lowercase(const char *);
86 /* Undo default visibility change. */
87 #pragma GCC visibility pop
89 #define CRACK_TOLOWER(a) ((char)(isupper(a)?tolower(a):(a)))
90 #define CRACK_TOUPPER(a) ((char)(islower(a)?toupper(a):(a)))
91 #define STRCMP(a,b) strcmp((a),(b))