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

Go to the source code of this file.

Macros

#define G1(a)
 
#define G2(b)
 
#define ENCROUND(n, a, b, c, d)
 
#define DECROUND(n, a, b, c, d)
 
#define ENCCYCLE(n)
 
#define DECCYCLE(n)
 
#define INPACK(n, x, m)   x = le32_to_cpu(src[n]) ^ ctx->w[m]
 
#define OUTUNPACK(n, x, m)
 

Functions

 module_init (twofish_mod_init)
 
 module_exit (twofish_mod_fini)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Twofish Cipher Algorithm")
 
 MODULE_ALIAS ("twofish")
 

Macro Definition Documentation

#define DECCYCLE (   n)
Value:
DECROUND (2 * (n) + 1, c, d, a, b); \
DECROUND (2 * (n), a, b, c, d)

Definition at line 89 of file twofish_generic.c.

#define DECROUND (   n,
  a,
  b,
  c,
  d 
)
Value:
x = G1 (a); y = G2 (b); \
x += y; y += x; \
(d) ^= y + ctx->k[2 * (n) + 1]; \
(d) = ror32((d), 1); \
(c) = rol32((c), 1); \
(c) ^= (x + ctx->k[2 * (n)])

Definition at line 74 of file twofish_generic.c.

#define ENCCYCLE (   n)
Value:
ENCROUND (2 * (n), a, b, c, d); \
ENCROUND (2 * (n) + 1, c, d, a, b)

Definition at line 85 of file twofish_generic.c.

#define ENCROUND (   n,
  a,
  b,
  c,
  d 
)
Value:
x = G1 (a); y = G2 (b); \
x += y; y += x + ctx->k[2 * (n) + 1]; \
(c) ^= x + ctx->k[2 * (n)]; \
(c) = ror32((c), 1); \
(d) = rol32((d), 1) ^ y

Definition at line 67 of file twofish_generic.c.

#define G1 (   a)
Value:
(ctx->s[0][(a) & 0xFF]) ^ (ctx->s[1][((a) >> 8) & 0xFF]) \
^ (ctx->s[2][((a) >> 16) & 0xFF]) ^ (ctx->s[3][(a) >> 24])

Definition at line 54 of file twofish_generic.c.

#define G2 (   b)
Value:
(ctx->s[1][(b) & 0xFF]) ^ (ctx->s[2][((b) >> 8) & 0xFF]) \
^ (ctx->s[3][((b) >> 16) & 0xFF]) ^ (ctx->s[0][(b) >> 24])

Definition at line 58 of file twofish_generic.c.

#define INPACK (   n,
  x,
  m 
)    x = le32_to_cpu(src[n]) ^ ctx->w[m]

Definition at line 99 of file twofish_generic.c.

#define OUTUNPACK (   n,
  x,
  m 
)
Value:
x ^= ctx->w[m]; \
dst[n] = cpu_to_le32(x)

Definition at line 102 of file twofish_generic.c.

Function Documentation

MODULE_ALIAS ( "twofish"  )
MODULE_DESCRIPTION ( "Twofish Cipher Algorithm"  )
module_exit ( twofish_mod_fini  )
module_init ( twofish_mod_init  )
MODULE_LICENSE ( "GPL"  )