Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitchX
GitHub Repository: BitchX/BitchX1.3
Path: blob/master/dll/blowfish/blowfish.h
1074 views
1
#include "irc.h"
2
#include "struct.h"
3
#include "ircaux.h"
4
#include "ctcp.h"
5
#include "status.h"
6
#include "lastlog.h"
7
#include "server.h"
8
#include "screen.h"
9
#include "vars.h"
10
#include "misc.h"
11
#include "output.h"
12
#include "module.h"
13
#include "hash2.h"
14
15
#include <sys/time.h>
16
#include <stdlib.h>
17
#include <stdio.h>
18
19
#ifdef WANT_TCL
20
# include <tcl.h>
21
# include "tcl_bx.h"
22
23
#ifndef STDVAR
24
# define STDVAR (ClientData cd, Tcl_Interp *irp, int argc, char *argv[])
25
#endif
26
27
#ifndef BADARGS
28
#define BADARGS(nl,nh,example) \
29
if ((argc<(nl)) || (argc>(nh))) { \
30
Tcl_AppendResult(intp,"wrong # args: should be \"",argv[0], \
31
(example),"\"",NULL); \
32
return TCL_ERROR; \
33
}
34
#endif /* BADARGS */
35
36
#endif /* WANT_TCL */
37
38
#define INIT_MODULE
39
#include "modval.h"
40
41
#define MAXKEYBYTES 56 /* 448 bits */
42
#define bf_N 16
43
#define noErr 0
44
#define DATAERROR -1
45
#define KEYBYTES 8
46
47
#define UBYTE_08bits unsigned char
48
#define UWORD_16bits unsigned short
49
50
# define UWORD_32bits unsigned int
51
/*
52
#else
53
# if SIZEOF_LONG==4
54
# define UWORD_32bits unsigned long
55
# endif
56
#endif
57
*/
58
/* choose a byte order for your hardware */
59
60
#ifdef WORDS_BIGENDIAN
61
/* ABCD - big endian - motorola */
62
union aword {
63
UWORD_32bits word;
64
UBYTE_08bits byte [4];
65
struct {
66
unsigned int byte0:8;
67
unsigned int byte1:8;
68
unsigned int byte2:8;
69
unsigned int byte3:8;
70
} w;
71
};
72
#endif /* WORDS_BIGENDIAN */
73
74
#ifndef WORDS_BIGENDIAN
75
/* DCBA - little endian - intel */
76
union aword {
77
UWORD_32bits word;
78
UBYTE_08bits byte [4];
79
struct {
80
unsigned int byte3:8;
81
unsigned int byte2:8;
82
unsigned int byte1:8;
83
unsigned int byte0:8;
84
} w;
85
};
86
#endif /* !WORDS_BIGENDIAN */
87
88