Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
cast6_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/cast6.h>

Go to the source code of this file.

Macros

#define s1   cast6_s1
 
#define s2   cast6_s2
 
#define s3   cast6_s3
 
#define s4   cast6_s4
 
#define F1(D, r, m)
 
#define F2(D, r, m)
 
#define F3(D, r, m)
 

Functions

 EXPORT_SYMBOL_GPL (cast6_s1)
 
 EXPORT_SYMBOL_GPL (cast6_s2)
 
 EXPORT_SYMBOL_GPL (cast6_s3)
 
 EXPORT_SYMBOL_GPL (cast6_s4)
 
int __cast6_setkey (struct cast6_ctx *c, const u8 *in_key, unsigned key_len, u32 *flags)
 
 EXPORT_SYMBOL_GPL (__cast6_setkey)
 
int cast6_setkey (struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
 
 EXPORT_SYMBOL_GPL (cast6_setkey)
 
void __cast6_encrypt (struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
 
 EXPORT_SYMBOL_GPL (__cast6_encrypt)
 
void __cast6_decrypt (struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
 
 EXPORT_SYMBOL_GPL (__cast6_decrypt)
 
 module_init (cast6_mod_init)
 
 module_exit (cast6_mod_fini)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Cast6 Cipher Algorithm")
 
 MODULE_ALIAS ("cast6")
 

Variables

const u32 cast6_s1 [256]
 
const u32 cast6_s2 [256]
 
const u32 cast6_s3 [256]
 
const u32 cast6_s4 [256]
 

Macro Definition Documentation

#define F1 (   D,
  r,
  m 
)
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 35 of file cast6_generic.c.

#define F2 (   D,
  r,
  m 
)
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 37 of file cast6_generic.c.

#define F3 (   D,
  r,
  m 
)
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 39 of file cast6_generic.c.

#define s1   cast6_s1

Definition at line 30 of file cast6_generic.c.

#define s2   cast6_s2

Definition at line 31 of file cast6_generic.c.

#define s3   cast6_s3

Definition at line 32 of file cast6_generic.c.

#define s4   cast6_s4

Definition at line 33 of file cast6_generic.c.

Function Documentation

void __cast6_decrypt ( struct cast6_ctx c,
u8 outbuf,
const u8 inbuf 
)

Definition at line 494 of file cast6_generic.c.

void __cast6_encrypt ( struct cast6_ctx c,
u8 outbuf,
const u8 inbuf 
)

Definition at line 456 of file cast6_generic.c.

int __cast6_setkey ( struct cast6_ctx c,
const u8 in_key,
unsigned  key_len,
u32 flags 
)

Definition at line 386 of file cast6_generic.c.

int cast6_setkey ( struct crypto_tfm tfm,
const u8 key,
unsigned int  keylen 
)

Definition at line 429 of file cast6_generic.c.

EXPORT_SYMBOL_GPL ( cast6_s1  )
EXPORT_SYMBOL_GPL ( cast6_s2  )
EXPORT_SYMBOL_GPL ( cast6_s3  )
EXPORT_SYMBOL_GPL ( cast6_s4  )
EXPORT_SYMBOL_GPL ( __cast6_setkey  )
EXPORT_SYMBOL_GPL ( cast6_setkey  )
EXPORT_SYMBOL_GPL ( __cast6_encrypt  )
EXPORT_SYMBOL_GPL ( __cast6_decrypt  )
MODULE_ALIAS ( "cast6"  )
MODULE_DESCRIPTION ( "Cast6 Cipher Algorithm"  )
module_exit ( cast6_mod_fini  )
module_init ( cast6_mod_init  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation

const u32 cast6_s1[256]

Definition at line 42 of file cast6_generic.c.

const u32 cast6_s2[256]

Definition at line 110 of file cast6_generic.c.

const u32 cast6_s3[256]

Definition at line 178 of file cast6_generic.c.

const u32 cast6_s4[256]

Definition at line 246 of file cast6_generic.c.