des.h 1.1 KB
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 *	des - fast & portable DES encryption & decryption.
 *	Copyright (C) 1992  Dana L. How
 *	Please see the file `README' for the complete copyright notice.
 *
 * Slightly edited by Niels Möller, 1997
 */

#ifndef DES_H_INCLUDED
#define DES_H_INCLUDED

#include "crypto_types.h"

#include "RCSID.h"
RCSID2(desCore_hRcs, "$Id$");

#define DES_KEYSIZE 8
#define DES_BLOCKSIZE 8
#define DES_EXPANDED_KEYLEN 32

21
22
23
typedef UINT8 DesData[DES_BLOCKSIZE];
typedef UINT32 DesKeys[DES_EXPANDED_KEYLEN];
typedef void DesFunc(UINT8 *d, UINT32 *r, UINT8 *s);
Niels Möller's avatar
Niels Möller committed
24

25
extern int DesMethod(UINT32 *method, UINT8 *k);
Niels Möller's avatar
Niels Möller committed
26
27
28
29
30
31
32
33
34
35
36
37
extern void DesQuickInit(void);
extern void DesQuickDone(void);
extern DesFunc DesQuickCoreEncrypt;
extern DesFunc DesQuickFipsEncrypt;
extern DesFunc DesQuickCoreDecrypt;
extern DesFunc DesQuickFipsDecrypt;
extern DesFunc DesSmallCoreEncrypt;
extern DesFunc DesSmallFipsEncrypt;
extern DesFunc DesSmallCoreDecrypt;
extern DesFunc DesSmallFipsDecrypt;

extern DesFunc *DesCryptFuncs[2];
38
39
extern int des_key_sched(UINT8 *k, UINT32 *s);
extern int des_ecb_encrypt(UINT8 *s, UINT8 *d, UINT32 *r, int e);
Niels Möller's avatar
Niels Möller committed
40
41

#endif /*  DES_H_INCLUDED */