ReactOS 0.4.15-dev-7958-gcd0bb1a
crypt.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CRC32(c, b)   ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
 
#define zdecode(pkeys, pcrc_32_tab, c)    (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
 
#define zencode(pkeys, pcrc_32_tab, c, t)    (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c))
 

Functions

static int decrypt_byte (unsigned long *pkeys, const z_crc_t *pcrc_32_tab)
 
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)
 

Macro Definition Documentation

◆ CRC32

#define CRC32 (   c,
  b 
)    ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))

Definition at line 30 of file crypt.h.

◆ zdecode

#define zdecode (   pkeys,
  pcrc_32_tab,
  c 
)     (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))

Definition at line 77 of file crypt.h.

◆ zencode

#define zencode (   pkeys,
  pcrc_32_tab,
  c,
  t 
)     (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c))

Definition at line 80 of file crypt.h.

Function Documentation

◆ decrypt_byte()

static int decrypt_byte ( unsigned long pkeys,
const z_crc_t pcrc_32_tab 
)
static

Definition at line 35 of file crypt.h.

36{
37 unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
38 * unpredictable manner on 16-bit systems; not a problem
39 * with any known compiler so far, though */
40
41 (void)pcrc_32_tab;
42 temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
43 return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
44}
static unsigned(__cdecl *hash_bstr)(bstr_t s)
static calc_node_t temp
Definition: rpn_ieee.c:38

◆ init_keys()

static void init_keys ( const char passwd,
unsigned long pkeys,
const z_crc_t pcrc_32_tab 
)
static

Definition at line 66 of file crypt.h.

67{
68 *(pkeys+0) = 305419896L;
69 *(pkeys+1) = 591751049L;
70 *(pkeys+2) = 878082192L;
71 while (*passwd != '\0') {
72 update_keys(pkeys,pcrc_32_tab,(int)*passwd);
73 passwd++;
74 }
75}
static int update_keys(unsigned long *pkeys, const z_crc_t *pcrc_32_tab, int c)
Definition: crypt.h:49

◆ update_keys()

static int update_keys ( unsigned long pkeys,
const z_crc_t pcrc_32_tab,
int  c 
)
static

Definition at line 49 of file crypt.h.

50{
51 (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
52 (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
53 (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
54 {
55 register int keyshift = (int)((*(pkeys+1)) >> 24);
56 (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
57 }
58 return c;
59}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define CRC32(c, b)
Definition: crypt.h:30

Referenced by init_keys().