OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
des_locl.h File Reference
#include <openssl/e_os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <openssl/des.h>

Go to the source code of this file.

Macros

#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)
 

Functions

void fcrypt_body (DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0, DES_LONG Eswap1)
 

Variables

const DES_LONG DES_SPtrans [8][64]
 

Macro Definition Documentation

#define BSIZE   (MAXWRITE+4)

Definition at line 106 of file des_locl.h.

#define c2l (   c,
 
)
Value:
(l =((DES_LONG)(*((c)++))) , \
l|=((DES_LONG)(*((c)++)))<< 8L, \
l|=((DES_LONG)(*((c)++)))<<16L, \
l|=((DES_LONG)(*((c)++)))<<24L)

Definition at line 108 of file des_locl.h.

#define c2ln (   c,
  l1,
  l2,
 
)
Value:
{ \
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)))); \
} \
}

Definition at line 114 of file des_locl.h.

#define D_ENCRYPT (   LL,
  R,
 
)
Value:
{\
LOAD_DATA_tmp(R,S,u,t,E0,E1); \
t=ROTATE(t,4); \
LL^=\
DES_SPtrans[0][(u>> 2L)&0x3f]^ \
DES_SPtrans[2][(u>>10L)&0x3f]^ \
DES_SPtrans[4][(u>>18L)&0x3f]^ \
DES_SPtrans[6][(u>>26L)&0x3f]^ \
DES_SPtrans[1][(t>> 2L)&0x3f]^ \
DES_SPtrans[3][(t>>10L)&0x3f]^ \
DES_SPtrans[5][(t>>18L)&0x3f]^ \
DES_SPtrans[7][(t>>26L)&0x3f]; }

Definition at line 348 of file des_locl.h.

#define FP (   l,
 
)
Value:
{ \
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); \
}

Definition at line 414 of file des_locl.h.

#define HALF_ITERATIONS   8

Definition at line 102 of file des_locl.h.

#define HDRSIZE   4

Definition at line 136 of file des_locl.h.

#define IP (   l,
 
)
Value:
{ \
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); \
}

Definition at line 404 of file des_locl.h.

#define ITERATIONS   16

Definition at line 101 of file des_locl.h.

#define l2c (   l,
  c 
)
Value:
(*((c)++)=(unsigned char)(((l) )&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))

Definition at line 129 of file des_locl.h.

#define l2cn (   l1,
  l2,
  c,
 
)
Value:
{ \
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); \
} \
}

Definition at line 149 of file des_locl.h.

#define l2n (   l,
  c 
)
Value:
(*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l) )&0xff))

Definition at line 143 of file des_locl.h.

#define LOAD_DATA (   R,
  S,
  u,
  t,
  E0,
  E1,
  tmp 
)
Value:
u=R^s[S ]; \
t=R^s[S+1]

Definition at line 195 of file des_locl.h.

#define LOAD_DATA_tmp (   a,
  b,
  c,
  d,
  e,
  f 
)    LOAD_DATA(a,b,c,d,e,f,g)

Definition at line 194 of file des_locl.h.

#define MAXWRITE   (1024*16)

Definition at line 105 of file des_locl.h.

#define n2l (   c,
 
)
Value:
(l =((DES_LONG)(*((c)++)))<<24L, \
l|=((DES_LONG)(*((c)++)))<<16L, \
l|=((DES_LONG)(*((c)++)))<< 8L, \
l|=((DES_LONG)(*((c)++))))

Definition at line 138 of file des_locl.h.

#define PERM_OP (   a,
  b,
  t,
  n,
 
)
Value:
((t)=((((a)>>(n))^(b))&(m)),\
(b)^=(t),\
(a)^=((t)<<(n)))

Definition at line 400 of file des_locl.h.

#define ROTATE (   a,
 
)    (((a)>>(n))+((a)<<(32-(n))))

Definition at line 177 of file des_locl.h.

Function Documentation

void fcrypt_body ( DES_LONG *  out,
DES_key_schedule ks,
DES_LONG  Eswap0,
DES_LONG  Eswap1 
)

Definition at line 80 of file fcrypt_b.c.

Variable Documentation

const DES_LONG DES_SPtrans[8][64]

Definition at line 59 of file spr.h.