#include <openssl/e_os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <openssl/des.h>
Ir al código fuente de este archivo.
'defines' |
#define | ITERATIONS 16 |
#define | HALF_ITERATIONS 8 |
#define | MAXWRITE (1024*16) |
#define | BSIZE (MAXWRITE+4) |
#define | c2l(c, l) |
#define | c2ln(c, l1, l2, n) |
#define | l2c(l, c) |
#define | HDRSIZE 4 |
#define | n2l(c, l) |
#define | l2n(l, c) |
#define | l2cn(l1, l2, c, n) |
#define | ROTATE(a, n) (((a)>>(n))+((a)<<(32-(n)))) |
#define | LOAD_DATA_tmp(a, b, c, d, e, f) LOAD_DATA(a,b,c,d,e,f,g) |
#define | LOAD_DATA(R, S, u, t, E0, E1, tmp) |
#define | D_ENCRYPT(LL, R, S) |
#define | PERM_OP(a, b, t, n, m) |
#define | IP(l, r) |
#define | FP(l, r) |
Funciones |
void | fcrypt_body (DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0, DES_LONG Eswap1) |
Variables |
const DES_LONG | DES_SPtrans [8][64] |
Documentación de los 'defines'
#define BSIZE (MAXWRITE+4) |
Valor:(l =((DES_LONG)(*((c)++))) , \
l|=((DES_LONG)(*((c)++)))<< 8L, \
l|=((DES_LONG)(*((c)++)))<<16L, \
l|=((DES_LONG)(*((c)++)))<<24L)
#define c2ln |
( |
|
c, |
|
|
|
l1, |
|
|
|
l2, |
|
|
|
n |
|
) |
| |
Valor:{ \
c+=n; \
l1=l2=0; \
switch (n) { \
case 8: l2 =((DES_LONG)(*(--(c))))<<24L; \
case 7: l2|=((DES_LONG)(*(--(c))))<<16L; \
case 6: l2|=((DES_LONG)(*(--(c))))<< 8L; \
case 5: l2|=((DES_LONG)(*(--(c)))); \
case 4: l1 =((DES_LONG)(*(--(c))))<<24L; \
case 3: l1|=((DES_LONG)(*(--(c))))<<16L; \
case 2: l1|=((DES_LONG)(*(--(c))))<< 8L; \
case 1: l1|=((DES_LONG)(*(--(c)))); \
} \
}
#define D_ENCRYPT |
( |
|
LL, |
|
|
|
R, |
|
|
|
S |
|
) |
| |
Valor:{ \
register DES_LONG tt; \
PERM_OP(l,r,tt, 1,0x55555555L); \
PERM_OP(r,l,tt, 8,0x00ff00ffL); \
PERM_OP(l,r,tt, 2,0x33333333L); \
PERM_OP(r,l,tt,16,0x0000ffffL); \
PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
}
#define HALF_ITERATIONS 8 |
Valor:{ \
register DES_LONG tt; \
PERM_OP(r,l,tt, 4,0x0f0f0f0fL); \
PERM_OP(l,r,tt,16,0x0000ffffL); \
PERM_OP(r,l,tt, 2,0x33333333L); \
PERM_OP(l,r,tt, 8,0x00ff00ffL); \
PERM_OP(r,l,tt, 1,0x55555555L); \
}
Valor:(*((c)++)=(unsigned char)(((l) )&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
#define l2cn |
( |
|
l1, |
|
|
|
l2, |
|
|
|
c, |
|
|
|
n |
|
) |
| |
Valor:{ \
c+=n; \
switch (n) { \
case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
} \
}
Valor:(*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l) )&0xff))
#define LOAD_DATA |
( |
|
R, |
|
|
|
S, |
|
|
|
u, |
|
|
|
t, |
|
|
|
E0, |
|
|
|
E1, |
|
|
|
tmp |
|
) |
| |
#define LOAD_DATA_tmp |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
f |
|
) |
| LOAD_DATA(a,b,c,d,e,f,g) |
#define MAXWRITE (1024*16) |
Valor:(l =((DES_LONG)(*((c)++)))<<24L, \
l|=((DES_LONG)(*((c)++)))<<16L, \
l|=((DES_LONG)(*((c)++)))<< 8L, \
l|=((DES_LONG)(*((c)++))))
#define PERM_OP |
( |
|
a, |
|
|
|
b, |
|
|
|
t, |
|
|
|
n, |
|
|
|
m |
|
) |
| |
Valor:((t)=((((a)>>(n))^(b))&(m)),\
(b)^=(t),\
(a)^=((t)<<(n)))
#define ROTATE |
( |
|
a, |
|
|
|
n |
|
) |
| (((a)>>(n))+((a)<<(32-(n)))) |
Documentación de las funciones
void fcrypt_body |
( |
DES_LONG * |
out, |
|
|
DES_key_schedule * |
ks, |
|
|
DES_LONG |
Eswap0, |
|
|
DES_LONG |
Eswap1 |
|
) |
| |
Documentación de las variables