ReactOS  0.4.12-dev-685-gf36cbf7
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), 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 76 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), t^(c))

Definition at line 79 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  temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
42  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
43 }
static stack_node_t temp
Definition: rpn.c:18

◆ init_keys()

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

Definition at line 65 of file crypt.h.

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

◆ update_keys()

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

Definition at line 48 of file crypt.h.

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

Referenced by init_keys().