Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
camellia_glue.c File Reference
#include <asm/processor.h>
#include <asm/unaligned.h>
#include <linux/crypto.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <crypto/algapi.h>
#include <crypto/lrw.h>
#include <crypto/xts.h>
#include <asm/crypto/glue_helper.h>

Go to the source code of this file.

Data Structures

struct  camellia_ctx
 
struct  camellia_lrw_ctx
 
struct  camellia_xts_ctx
 

Macros

#define CAMELLIA_MIN_KEY_SIZE   16
 
#define CAMELLIA_MAX_KEY_SIZE   32
 
#define CAMELLIA_BLOCK_SIZE   16
 
#define CAMELLIA_TABLE_BYTE_LEN   272
 
#define CAMELLIA_SIGMA1L   (0xA09E667FL)
 
#define CAMELLIA_SIGMA1R   (0x3BCC908BL)
 
#define CAMELLIA_SIGMA2L   (0xB67AE858L)
 
#define CAMELLIA_SIGMA2R   (0x4CAA73B2L)
 
#define CAMELLIA_SIGMA3L   (0xC6EF372FL)
 
#define CAMELLIA_SIGMA3R   (0xE94F82BEL)
 
#define CAMELLIA_SIGMA4L   (0x54FF53A5L)
 
#define CAMELLIA_SIGMA4R   (0xF1D36F1CL)
 
#define CAMELLIA_SIGMA5L   (0x10E527FAL)
 
#define CAMELLIA_SIGMA5R   (0xDE682D1DL)
 
#define CAMELLIA_SIGMA6L   (0xB05688C2L)
 
#define CAMELLIA_SIGMA6R   (0xB3E6C1FDL)
 
#define ROLDQ(l, r, bits)
 
#define CAMELLIA_F(x, kl, kr, y)
 
#define SET_SUBKEY_LR(INDEX, sRL)   (subkey[(INDEX)] = ror64((sRL), 32))
 

Functions

asmlinkage void __camellia_enc_blk (struct camellia_ctx *ctx, u8 *dst, const u8 *src, bool xor)
 
asmlinkage void camellia_dec_blk (struct camellia_ctx *ctx, u8 *dst, const u8 *src)
 
asmlinkage void __camellia_enc_blk_2way (struct camellia_ctx *ctx, u8 *dst, const u8 *src, bool xor)
 
asmlinkage void camellia_dec_blk_2way (struct camellia_ctx *ctx, u8 *dst, const u8 *src)
 
 module_param (force, int, 0)
 
 MODULE_PARM_DESC (force,"Force module load, ignore CPU blacklist")
 
 module_init (init)
 
 module_exit (fini)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Camellia Cipher Algorithm, asm optimized")
 
 MODULE_ALIAS ("camellia")
 
 MODULE_ALIAS ("camellia-asm")
 

Variables

const u64 camellia_sp10011110 [256]
 
const u64 camellia_sp22000222 [256]
 
const u64 camellia_sp03303033 [256]
 
const u64 camellia_sp00444404 [256]
 
const u64 camellia_sp02220222 [256]
 
const u64 camellia_sp30333033 [256]
 
const u64 camellia_sp44044404 [256]
 
const u64 camellia_sp11101110 [256]
 

Macro Definition Documentation

#define CAMELLIA_BLOCK_SIZE   16

Definition at line 39 of file camellia_glue.c.

#define CAMELLIA_F (   x,
  kl,
  kr,
  y 
)
Value:
({ \
u64 ii = x ^ (((u64)kl << 32) | kr); \
y ^= camellia_sp44044404[(uint8_t)(ii >> 8)]; \
ii >>= 16; \
y ^= camellia_sp02220222[(uint8_t)(ii >> 8)]; \
ii >>= 16; \
y ^= camellia_sp03303033[(uint8_t)(ii >> 8)]; \
ii >>= 16; \
y ^= camellia_sp10011110[(uint8_t)(ii >> 8)]; \
y = ror64(y, 32); \
})

Definition at line 827 of file camellia_glue.c.

#define CAMELLIA_MAX_KEY_SIZE   32

Definition at line 38 of file camellia_glue.c.

#define CAMELLIA_MIN_KEY_SIZE   16

Definition at line 37 of file camellia_glue.c.

#define CAMELLIA_SIGMA1L   (0xA09E667FL)

Definition at line 807 of file camellia_glue.c.

#define CAMELLIA_SIGMA1R   (0x3BCC908BL)

Definition at line 808 of file camellia_glue.c.

#define CAMELLIA_SIGMA2L   (0xB67AE858L)

Definition at line 809 of file camellia_glue.c.

#define CAMELLIA_SIGMA2R   (0x4CAA73B2L)

Definition at line 810 of file camellia_glue.c.

#define CAMELLIA_SIGMA3L   (0xC6EF372FL)

Definition at line 811 of file camellia_glue.c.

#define CAMELLIA_SIGMA3R   (0xE94F82BEL)

Definition at line 812 of file camellia_glue.c.

#define CAMELLIA_SIGMA4L   (0x54FF53A5L)

Definition at line 813 of file camellia_glue.c.

#define CAMELLIA_SIGMA4R   (0xF1D36F1CL)

Definition at line 814 of file camellia_glue.c.

#define CAMELLIA_SIGMA5L   (0x10E527FAL)

Definition at line 815 of file camellia_glue.c.

#define CAMELLIA_SIGMA5R   (0xDE682D1DL)

Definition at line 816 of file camellia_glue.c.

#define CAMELLIA_SIGMA6L   (0xB05688C2L)

Definition at line 817 of file camellia_glue.c.

#define CAMELLIA_SIGMA6R   (0xB3E6C1FDL)

Definition at line 818 of file camellia_glue.c.

#define CAMELLIA_TABLE_BYTE_LEN   272

Definition at line 40 of file camellia_glue.c.

#define ROLDQ (   l,
  r,
  bits 
)
Value:
({ \
u64 t = l; \
l = (l << bits) | (r >> (64 - bits)); \
r = (r << bits) | (t >> (64 - bits)); \
})

Definition at line 821 of file camellia_glue.c.

#define SET_SUBKEY_LR (   INDEX,
  sRL 
)    (subkey[(INDEX)] = ror64((sRL), 32))

Definition at line 843 of file camellia_glue.c.

Function Documentation

asmlinkage void __camellia_enc_blk ( struct camellia_ctx ctx,
u8 dst,
const u8 src,
bool  xor 
)
asmlinkage void __camellia_enc_blk_2way ( struct camellia_ctx ctx,
u8 dst,
const u8 src,
bool  xor 
)
asmlinkage void camellia_dec_blk ( struct camellia_ctx ctx,
u8 dst,
const u8 src 
)
asmlinkage void camellia_dec_blk_2way ( struct camellia_ctx ctx,
u8 dst,
const u8 src 
)
MODULE_ALIAS ( "camellia"  )
MODULE_ALIAS ( "camellia-asm )
MODULE_DESCRIPTION ( "Camellia Cipher  Algorithm,
asm optimized"   
)
module_exit ( fini  )
module_init ( init  )
MODULE_LICENSE ( "GPL"  )
module_param ( force  ,
int  ,
 
)
MODULE_PARM_DESC ( force  ,
"Force module  load,
ignore CPU blacklist"   
)

Variable Documentation

const u64 camellia_sp00444404[256]

Definition at line 361 of file camellia_glue.c.

const u64 camellia_sp02220222[256]

Definition at line 450 of file camellia_glue.c.

const u64 camellia_sp03303033[256]

Definition at line 272 of file camellia_glue.c.

const u64 camellia_sp10011110[256]

Definition at line 94 of file camellia_glue.c.

const u64 camellia_sp11101110[256]

Definition at line 717 of file camellia_glue.c.

const u64 camellia_sp22000222[256]

Definition at line 183 of file camellia_glue.c.

const u64 camellia_sp30333033[256]

Definition at line 539 of file camellia_glue.c.

const u64 camellia_sp44044404[256]

Definition at line 628 of file camellia_glue.c.