wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
des-internal.c File Reference

DES and 3DES-EDE ciphers. More...

#include "includes.h"
#include "common.h"
#include "crypto.h"
#include "des_i.h"

Macros

#define ROLc(x, y)
 
#define RORc(x, y)
 

Functions

void des_encrypt (const u8 *clear, const u8 *key, u8 *cypher)
 Encrypt one block with DES. More...
 
void des_key_setup (const u8 *key, u32 *ek, u32 *dk)
 
void des_block_encrypt (const u8 *plain, const u32 *ek, u8 *crypt)
 
void des_block_decrypt (const u8 *crypt, const u32 *dk, u8 *plain)
 
void des3_key_setup (const u8 *key, struct des3_key_s *dkey)
 
void des3_encrypt (const u8 *plain, const struct des3_key_s *key, u8 *crypt)
 
void des3_decrypt (const u8 *crypt, const struct des3_key_s *key, u8 *plain)
 

Detailed Description

DES and 3DES-EDE ciphers.

Modifications to LibTomCrypt implementation:

Macro Definition Documentation

#define ROLc (   x,
 
)
Value:
((((unsigned long) (x) << (unsigned long) ((y) & 31)) | \
(((unsigned long) (x) & 0xFFFFFFFFUL) >> \
(unsigned long) (32 - ((y) & 31)))) & 0xFFFFFFFFUL)

DES code submitted by Dobes Vandermeer

#define RORc (   x,
 
)
Value:
(((((unsigned long) (x) & 0xFFFFFFFFUL) >> \
(unsigned long) ((y) & 31)) | \
((unsigned long) (x) << (unsigned long) (32 - ((y) & 31)))) & \
0xFFFFFFFFUL)

Function Documentation

void des_encrypt ( const u8 *  clear,
const u8 *  key,
u8 *  cypher 
)

Encrypt one block with DES.

Parameters
clear8 octets (in)
key7 octets (in) (no parity bits included)
cypher8 octets (out)