Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
crypt.h File Reference

Go to the source code of this file.

Macros

#define NOCRYPT
 
#define NOUNCRYPT
 
#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 unsigned long *pcrc_32_tab)
 
static int update_keys (unsigned long *pkeys, const unsigned long *pcrc_32_tab, int c)
 
static void init_keys (const char *passwd, unsigned long *pkeys, const unsigned long *pcrc_32_tab)
 

Macro Definition Documentation

◆ CRC32

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

Definition at line 32 of file crypt.h.

◆ NOCRYPT

#define NOCRYPT

Definition at line 29 of file crypt.h.

◆ NOUNCRYPT

#define NOUNCRYPT

Definition at line 30 of file crypt.h.

◆ zdecode

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

Definition at line 78 of file crypt.h.

◆ zencode

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

Definition at line 81 of file crypt.h.

Function Documentation

◆ decrypt_byte()

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

Definition at line 37 of file crypt.h.

◆ init_keys()

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

Definition at line 67 of file crypt.h.

◆ update_keys()

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

Definition at line 50 of file crypt.h.