Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
des_generic.c File Reference
#include <asm/byteorder.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <linux/types.h>
#include <crypto/des.h>

Go to the source code of this file.

Data Structures

struct  des_ctx
 
struct  des3_ede_ctx
 

Macros

#define ROL(x, r)   ((x) = rol32((x), (r)))
 
#define ROR(x, r)   ((x) = ror32((x), (r)))
 
#define IP(L, R, T)
 
#define FP(L, R, T)
 
#define ROUND(L, R, A, B, K, d)
 
#define T1(x)   pt[2 * (x) + 0]
 
#define T2(x)   pt[2 * (x) + 1]
 
#define T3(x)   pt[2 * (x) + 2]
 
#define T4(x)   pt[2 * (x) + 3]
 
#define DES_PC2(a, b, c, d)   (T4(d) | T3(c) | T2(b) | T1(a))
 

Functions

unsigned long des_ekey (u32 *pe, const u8 *k)
 
 EXPORT_SYMBOL_GPL (des_ekey)
 
 MODULE_ALIAS ("des3_ede")
 
 module_init (des_generic_mod_init)
 
 module_exit (des_generic_mod_fini)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms")
 
 MODULE_AUTHOR ("Dag Arne Osvik <da@osvik.no>")
 
 MODULE_ALIAS ("des")
 

Macro Definition Documentation

#define DES_PC2 (   a,
  b,
  c,
  d 
)    (T4(d) | T3(c) | T2(b) | T1(a))

Definition at line 617 of file des_generic.c.

#define FP (   L,
  R,
  T 
)

Definition at line 557 of file des_generic.c.

#define IP (   L,
  R,
  T 
)

Definition at line 524 of file des_generic.c.

#define ROL (   x,
  r 
)    ((x) = rol32((x), (r)))

Definition at line 25 of file des_generic.c.

#define ROR (   x,
  r 
)    ((x) = ror32((x), (r)))

Definition at line 26 of file des_generic.c.

#define ROUND (   L,
  R,
  A,
  B,
  K,
  d 
)
Value:
B = K[0]; A = K[1]; K += d; \
B ^= R; A ^= R; \
B &= 0x3f3f3f3f; ROR(A, 4); \
L ^= S8[0xff & B]; A &= 0x3f3f3f3f; \
L ^= S6[0xff & (B >> 8)]; B >>= 16; \
L ^= S7[0xff & A]; \
L ^= S5[0xff & (A >> 8)]; A >>= 16; \
L ^= S4[0xff & B]; \
L ^= S2[0xff & (B >> 8)]; \
L ^= S3[0xff & A]; \
L ^= S1[0xff & (A >> 8)];

Definition at line 590 of file des_generic.c.

#define T1 (   x)    pt[2 * (x) + 0]

Definition at line 612 of file des_generic.c.

#define T2 (   x)    pt[2 * (x) + 1]

Definition at line 613 of file des_generic.c.

#define T3 (   x)    pt[2 * (x) + 2]

Definition at line 614 of file des_generic.c.

#define T4 (   x)    pt[2 * (x) + 3]

Definition at line 615 of file des_generic.c.

Function Documentation

unsigned long des_ekey ( u32 pe,
const u8 k 
)

Definition at line 631 of file des_generic.c.

EXPORT_SYMBOL_GPL ( des_ekey  )
MODULE_ALIAS ( "des3_ede"  )
MODULE_ALIAS ( "des"  )
MODULE_AUTHOR ( "Dag Arne Osvik <da@osvik.no>"  )
MODULE_DESCRIPTION ( "DES & Triple DES EDE Cipher Algorithms"  )
module_exit ( des_generic_mod_fini  )
module_init ( des_generic_mod_init  )
MODULE_LICENSE ( "GPL"  )