Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dsp_blowfish.c File Reference
#include <linux/mISDNif.h>
#include <linux/mISDNdsp.h>
#include "core.h"
#include "dsp.h"

Go to the source code of this file.

Data Structures

struct  bf_ctx
 

Macros

#define GET32_3(x)   (((x) & 0xff))
 
#define GET32_2(x)   (((x) >> (8)) & (0xff))
 
#define GET32_1(x)   (((x) >> (16)) & (0xff))
 
#define GET32_0(x)   (((x) >> (24)) & (0xff))
 
#define bf_F(x)
 
#define EROUND(a, b, n)   do { b ^= P[n]; a ^= bf_F(b); } while (0)
 
#define DROUND(a, b, n)   do { a ^= bf_F(b); b ^= P[n]; } while (0)
 

Functions

void dsp_bf_encrypt (struct dsp *dsp, u8 *data, int len)
 
void dsp_bf_decrypt (struct dsp *dsp, u8 *data, int len)
 
int dsp_bf_init (struct dsp *dsp, const u8 *key, uint keylen)
 
void dsp_bf_cleanup (struct dsp *dsp)
 

Macro Definition Documentation

#define bf_F (   x)
Value:
(((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \
S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])

Definition at line 357 of file dsp_blowfish.c.

#define DROUND (   a,
  b,
  n 
)    do { a ^= bf_F(b); b ^= P[n]; } while (0)

Definition at line 361 of file dsp_blowfish.c.

#define EROUND (   a,
  b,
  n 
)    do { b ^= P[n]; a ^= bf_F(b); } while (0)

Definition at line 360 of file dsp_blowfish.c.

#define GET32_0 (   x)    (((x) >> (24)) & (0xff))

Definition at line 355 of file dsp_blowfish.c.

#define GET32_1 (   x)    (((x) >> (16)) & (0xff))

Definition at line 354 of file dsp_blowfish.c.

#define GET32_2 (   x)    (((x) >> (8)) & (0xff))

Definition at line 353 of file dsp_blowfish.c.

#define GET32_3 (   x)    (((x) & 0xff))

Definition at line 352 of file dsp_blowfish.c.

Function Documentation

void dsp_bf_cleanup ( struct dsp dsp)

Definition at line 669 of file dsp_blowfish.c.

void dsp_bf_decrypt ( struct dsp dsp,
u8 data,
int  len 
)

Definition at line 458 of file dsp_blowfish.c.

void dsp_bf_encrypt ( struct dsp dsp,
u8 data,
int  len 
)

Definition at line 369 of file dsp_blowfish.c.

int dsp_bf_init ( struct dsp dsp,
const u8 key,
uint  keylen 
)

Definition at line 599 of file dsp_blowfish.c.