|
Ruby
1.9.3p551(2014-11-13revision48407)
|
Go to the source code of this file.
Data Structures | |
| union | C_block |
Macros | |
| #define | _PASSWORD_EFMT1 '_' |
| #define | MUST_ALIGN |
| #define | LONG_IS_32_BITS |
| #define | STATIC static |
| #define | TO_SIX_BIT(rslt, src) |
| #define | ZERO(d, d0, d1) ((d0) = 0, (d1) = 0) |
| #define | LOAD(d, d0, d1, bl) ((d0) = (bl).b32.i0, (d1) = (bl).b32.i1) |
| #define | LOADREG(d, d0, d1, s, s0, s1) ((d0) = (s0), (d1) = (s1)) |
| #define | OR(d, d0, d1, bl) ((d0) |= (bl).b32.i0, (d1) |= (bl).b32.i1) |
| #define | STORE(s, s0, s1, bl) ((bl).b32.i0 = (s0), (bl).b32.i1 = (s1)) |
| #define | DCL_BLOCK(d, d0, d1) long d0, d1 |
| #define | LGCHUNKBITS 2 |
| #define | CHUNKBITS (1<<LGCHUNKBITS) |
| #define | PERM6464(d, d0, d1, cpp, p) { C_block tblk; permute((cpp),&tblk,(p),8); LOAD ((d),(d0),(d1),tblk); } |
| #define | PERM3264(d, d0, d1, cpp, p) { C_block tblk; permute((cpp),&tblk,(p),4); LOAD ((d),(d0),(d1),tblk); } |
| #define | KS_SIZE 16 |
| #define | SALT salt |
| #define | SPTAB(t, i) (*(long *)((unsigned char *)(t) + (i)*(sizeof(long)/4))) |
| #define | DOXOR(x, y, i) k=B.b[(i)]; (x)^=SPTAB(SPE[0][(i)],k); (y)^=SPTAB(SPE[1][(i)],k); |
| #define | CRUNCH(p0, p1, q0, q1) |
Functions | |
| int | des_setkey () |
| int | des_cipher () |
| STATIC void | init_des () |
| STATIC void | init_perm () |
| STATIC void | permute () |
| STATIC void | permute (unsigned char *cp, C_block *out, C_block *p, int chars_in) |
| char * | crypt (const char *key, const char *setting) |
| int | des_setkey (const char *key) |
| int | des_cipher (char *in, char *out, long salt, int num_iter) const |
| STATIC void | init_perm (perm, p, int chars_in, int chars_out) |
| int | setkey (const char *key) |
| int | encrypt (char *block, int flag) |
Variables | |
| static unsigned char | IP [] |
| static unsigned char | ExpandTr [] |
| static unsigned char | PC1 [] |
| static unsigned char | Rotates [] |
| static unsigned char | PC2 [] |
| static unsigned char | S [8][64] |
| static unsigned char | P32Tr [] |
| static unsigned char | CIFP [] |
| static unsigned char | itoa64 [] |
| static unsigned char | a64toi [128] |
| static C_block | PC1ROT [64/CHUNKBITS][1<< CHUNKBITS] |
| static C_block | PC2ROT [2][64/CHUNKBITS][1<< CHUNKBITS] |
| static C_block | IE3264 [32/CHUNKBITS][1<< CHUNKBITS] |
| static long | SPE [2][8][64] |
| static C_block | CF6464 [64/CHUNKBITS][1<< CHUNKBITS] |
| static C_block | constdatablock |
| static char | cryptresult [1+4+4+11+1] |
| static C_block | KS [KS_SIZE] |
| #define CHUNKBITS (1<<LGCHUNKBITS) |
Definition at line 299 of file crypt.c.
Referenced by init_perm(), and permute().
| #define CRUNCH | ( | p0, | |
| p1, | |||
| q0, | |||
| q1 | |||
| ) |
Referenced by des_cipher().
Definition at line 276 of file crypt.c.
Referenced by des_setkey(), and permute().
| #define KS_SIZE 16 |
Definition at line 596 of file crypt.c.
Referenced by des_cipher().
| #define LGCHUNKBITS 2 |
Definition at line 298 of file crypt.c.
Referenced by init_perm().
Definition at line 272 of file crypt.c.
Referenced by des_cipher().
Definition at line 273 of file crypt.c.
Referenced by des_cipher().
| #define PERM3264 | ( | d, | |
| d0, | |||
| d1, | |||
| cpp, | |||
| p | |||
| ) | { C_block tblk; permute((cpp),&tblk,(p),4); LOAD ((d),(d0),(d1),tblk); } |
Definition at line 302 of file crypt.c.
Referenced by des_cipher().
| #define PERM6464 | ( | d, | |
| d0, | |||
| d1, | |||
| cpp, | |||
| p | |||
| ) | { C_block tblk; permute((cpp),&tblk,(p),8); LOAD ((d),(d0),(d1),tblk); } |
Definition at line 300 of file crypt.c.
Referenced by des_cipher(), and des_setkey().
| #define SALT salt |
| #define STORE | ( | s, | |
| s0, | |||
| s1, | |||
| bl | |||
| ) | ((bl).b32.i0 = (s0), (bl).b32.i1 = (s1)) |
Definition at line 275 of file crypt.c.
Referenced by des_cipher(), des_setkey(), and permute().
| #define TO_SIX_BIT | ( | rslt, | |
| src | |||
| ) |
Definition at line 259 of file crypt.c.
Referenced by des_cipher(), and init_des().
Definition at line 500 of file crypt.c.
References _PASSWORD_EFMT1, a64toi, C_block::b, constdatablock, cryptresult, des_cipher(), des_setkey(), i, itoa64, key, long, and NULL.
Referenced by rb_str_crypt().
| int des_cipher | ( | char * | in, |
| char * | out, | ||
| long | salt, | ||
| int | num_iter | ||
| ) | const |
| int des_setkey | ( | const char * | key | ) |
| int encrypt | ( | char * | block, |
| int | flag | ||
| ) |
Definition at line 948 of file crypt.c.
References C_block::b, des_cipher(), and i.
| STATIC void init_des | ( | ) |
| STATIC void init_perm | ( | ) |
Referenced by init_des().
| STATIC void permute | ( | ) |
| int setkey | ( | const char * | key | ) |
Definition at line 927 of file crypt.c.
References C_block::b, des_setkey(), i, and key.
|
static |
Definition at line 471 of file crypt.c.
Referenced by crypt(), and init_des().
Definition at line 486 of file crypt.c.
Referenced by des_cipher(), and init_des().
|
static |
Definition at line 452 of file crypt.c.
Referenced by init_des().
|
static |
Definition at line 342 of file crypt.c.
Referenced by init_des().
Definition at line 480 of file crypt.c.
Referenced by des_cipher(), and init_des().
|
static |
Definition at line 329 of file crypt.c.
Referenced by init_des().
|
static |
Definition at line 464 of file crypt.c.
Referenced by crypt(), and init_des().
Definition at line 597 of file crypt.c.
Referenced by des_cipher(), and des_setkey().
|
static |
Definition at line 441 of file crypt.c.
Referenced by init_des().
|
static |
Definition at line 353 of file crypt.c.
Referenced by init_des().
Definition at line 474 of file crypt.c.
Referenced by des_setkey(), and init_des().
|
static |
Definition at line 370 of file crypt.c.
Referenced by init_des().
Definition at line 477 of file crypt.c.
Referenced by des_setkey(), and init_des().
|
static |
Definition at line 365 of file crypt.c.
Referenced by des_setkey(), and init_des().
|
static |
Definition at line 382 of file crypt.c.
Referenced by init_des(), quorem(), and ruby_dtoa().
|
static |
Definition at line 483 of file crypt.c.
Referenced by init_des().
1.8.14