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

Go to the source code of this file.

Macros

#define s1   cast5_s1
 
#define s2   cast5_s2
 
#define s3   cast5_s3
 
#define s4   cast5_s4
 
#define F1(D, m, r)
 
#define F2(D, m, r)
 
#define F3(D, m, r)
 
#define xi(i)   ((x[(i)/4] >> (8*(3-((i)%4)))) & 0xff)
 
#define zi(i)   ((z[(i)/4] >> (8*(3-((i)%4)))) & 0xff)
 

Functions

 EXPORT_SYMBOL_GPL (cast5_s1)
 
 EXPORT_SYMBOL_GPL (cast5_s2)
 
 EXPORT_SYMBOL_GPL (cast5_s3)
 
 EXPORT_SYMBOL_GPL (cast5_s4)
 
void __cast5_encrypt (struct cast5_ctx *c, u8 *outbuf, const u8 *inbuf)
 
 EXPORT_SYMBOL_GPL (__cast5_encrypt)
 
void __cast5_decrypt (struct cast5_ctx *c, u8 *outbuf, const u8 *inbuf)
 
 EXPORT_SYMBOL_GPL (__cast5_decrypt)
 
int cast5_setkey (struct crypto_tfm *tfm, const u8 *key, unsigned int key_len)
 
 EXPORT_SYMBOL_GPL (cast5_setkey)
 
 module_init (cast5_mod_init)
 
 module_exit (cast5_mod_fini)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Cast5 Cipher Algorithm")
 
 MODULE_ALIAS ("cast5")
 

Variables

const u32 cast5_s1 [256]
 
const u32 cast5_s2 [256]
 
const u32 cast5_s3 [256]
 
const u32 cast5_s4 [256]
 

Macro Definition Documentation

#define F1 (   D,
  m,
  r 
)
Value:
((I = ((m) + (D))), (I = rol32(I, (r))), \
(((s1[I >> 24] ^ s2[(I>>16)&0xff]) - s3[(I>>8)&0xff]) + s4[I&0xff]))

Definition at line 572 of file cast5_generic.c.

#define F2 (   D,
  m,
  r 
)
Value:
((I = ((m) ^ (D))), (I = rol32(I, (r))), \
(((s1[I >> 24] - s2[(I>>16)&0xff]) + s3[(I>>8)&0xff]) ^ s4[I&0xff]))

Definition at line 574 of file cast5_generic.c.

#define F3 (   D,
  m,
  r 
)
Value:
((I = ((m) - (D))), (I = rol32(I, (r))), \
(((s1[I >> 24] + s2[(I>>16)&0xff]) ^ s3[(I>>8)&0xff]) - s4[I&0xff]))

Definition at line 576 of file cast5_generic.c.

#define s1   cast5_s1

Definition at line 567 of file cast5_generic.c.

#define s2   cast5_s2

Definition at line 568 of file cast5_generic.c.

#define s3   cast5_s3

Definition at line 569 of file cast5_generic.c.

#define s4   cast5_s4

Definition at line 570 of file cast5_generic.c.

#define xi (   i)    ((x[(i)/4] >> (8*(3-((i)%4)))) & 0xff)
#define zi (   i)    ((z[(i)/4] >> (8*(3-((i)%4)))) & 0xff)

Function Documentation

void __cast5_decrypt ( struct cast5_ctx c,
u8 outbuf,
const u8 inbuf 
)

Definition at line 637 of file cast5_generic.c.

void __cast5_encrypt ( struct cast5_ctx c,
u8 outbuf,
const u8 inbuf 
)

Definition at line 580 of file cast5_generic.c.

int cast5_setkey ( struct crypto_tfm tfm,
const u8 key,
unsigned int  key_len 
)

Definition at line 756 of file cast5_generic.c.

EXPORT_SYMBOL_GPL ( cast5_s1  )
EXPORT_SYMBOL_GPL ( cast5_s2  )
EXPORT_SYMBOL_GPL ( cast5_s3  )
EXPORT_SYMBOL_GPL ( cast5_s4  )
EXPORT_SYMBOL_GPL ( __cast5_encrypt  )
EXPORT_SYMBOL_GPL ( __cast5_decrypt  )
EXPORT_SYMBOL_GPL ( cast5_setkey  )
MODULE_ALIAS ( "cast5"  )
MODULE_DESCRIPTION ( "Cast5 Cipher Algorithm"  )
module_exit ( cast5_mod_fini  )
module_init ( cast5_mod_init  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation

const u32 cast5_s1[256]

Definition at line 34 of file cast5_generic.c.

const u32 cast5_s2[256]

Definition at line 101 of file cast5_generic.c.

const u32 cast5_s3[256]

Definition at line 168 of file cast5_generic.c.

const u32 cast5_s4[256]

Definition at line 235 of file cast5_generic.c.