embedded IPsec source code documentation

des.h File Reference

Detailed Description

Header of DES and 3DES cipher.

Niklaus Schild <n.schild@gmx.ch>
This document is part of embedded IPsec
Copyright (c) 2003 Niklaus Schild and Christian Scheurer, HTI Biel/Bienne
All rights reserved.
This file contains code from the OpenSSL Project
portions Copyright (c) 1998-2003 OpenSSL (www.openssl.org)

Definition in file des.h.

#include "ipsec/types.h"

Go to the source code of this file.

Data Structures

struct  DES_ks


#define DES_LONG   __u32
#define DES_ENCRYPT   1
#define DES_DECRYPT   0


typedef unsigned char DES_cblock [8]
typedef const unsigned char const_DES_cblock [8]
typedef DES_ks DES_key_schedule


int DES_set_key_checked (const_DES_cblock *key, DES_key_schedule *schedule)
void DES_set_key_unchecked (const_DES_cblock *key, DES_key_schedule *schedule)
void cipher_3des_cbc (unsigned char *, int, unsigned char *, unsigned char *, int, unsigned char *)

Define Documentation

#define DES_DECRYPT   0

defines decryption for the des function

Definition at line 69 of file des.h.

#define DES_ENCRYPT   1

defines encryption for the des function

Definition at line 68 of file des.h.

#define DES_LONG   __u32

Definition at line 54 of file des.h.

Typedef Documentation

typedef const unsigned char const_DES_cblock[8]

Definition at line 57 of file des.h.

typedef unsigned char DES_cblock[8]

Definition at line 56 of file des.h.

typedef struct DES_ks DES_key_schedule

Function Documentation

void cipher_3des_cbc unsigned char *  text,
int  text_len,
unsigned char *  key,
unsigned char *  iv,
int  mode,
unsigned char *  output

3DES-CBC function calculates a digest from a given data buffer and a given key.

text pointer to input data
text_len length of input data
key pointer to encryption key (192 bits)
iv initialization vector
mode defines whether encryption or decryption should be performed
output en- or decrypted input data

Definition at line 1067 of file des.c.

int DES_set_key_checked const_DES_cblock key,
DES_key_schedule schedule

void DES_set_key_unchecked const_DES_cblock key,
DES_key_schedule schedule

Copyright 2003 by Christian Scheurer and Niklaus Schild