30 #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
42 temp = ((
unsigned)(*(pkeys+2)) & 0xffff) | 2;
43 return (
int)(((temp * (temp ^ 1)) >> 8) & 0xff);
51 (*(pkeys+0)) =
CRC32((*(pkeys+0)),
c);
52 (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
53 (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
55 register int keyshift = (
int)((*(pkeys+1)) >> 24);
56 (*(pkeys+2)) =
CRC32((*(pkeys+2)), keyshift);
66 static void init_keys(
const char* passwd,
unsigned long* pkeys,
const z_crc_t* pcrc_32_tab)
68 *(pkeys+0) = 305419896L;
69 *(pkeys+1) = 591751049L;
70 *(pkeys+2) = 878082192L;
71 while (*passwd !=
'\0') {
77 #define zdecode(pkeys,pcrc_32_tab,c) \
78 (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
80 #define zencode(pkeys,pcrc_32_tab,c,t) \
81 (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c))
83 #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
85 #define RAND_HEAD_LEN 12
88 # define ZCR_SEED2 3141592654L
91 static unsigned crypthead(
const char* passwd,
96 unsigned long crcForCrypting)
101 unsigned char header[RAND_HEAD_LEN-2];
102 static unsigned calls = 0;
104 if (bufSize<RAND_HEAD_LEN)
113 srand((
unsigned)(
time(
NULL) ^ ZCR_SEED2));
116 for (
n = 0;
n < RAND_HEAD_LEN-2;
n++)
118 c = (rand() >> 7) & 0xff;
123 for (
n = 0;
n < RAND_HEAD_LEN-2;
n++)
127 buf[
n++] = (
unsigned char)
zencode(pkeys, pcrc_32_tab, (
int)(crcForCrypting >> 16) & 0xff, t);
128 buf[
n++] = (
unsigned char)
zencode(pkeys, pcrc_32_tab, (
int)(crcForCrypting >> 24) & 0xff, t);
static int update_keys(unsigned long *pkeys, const z_crc_t *pcrc_32_tab, int c)
static void init_keys(const char *passwd, unsigned long *pkeys, const z_crc_t *pcrc_32_tab)
static int decrypt_byte(unsigned long *pkeys, const z_crc_t *pcrc_32_tab)
#define zencode(pkeys, pcrc_32_tab, c, t)
static static fork const void static count static fd const char const char static newpath char char char static envp time
static void struct sockaddr socklen_t static fromlen static backlog static fork char char char static envp int struct rusage static rusage struct utsname static buf struct sembuf unsigned
#define header(is_bt, len_min, ret_op)