-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdes.h
72 lines (57 loc) · 2.5 KB
/
des.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
DES.H - header file for DESC.C
Copyright (c) J.S.A.Kapp 1994 - 1996.
RSAEURO - RSA Library compatible with RSAREF 2.0.
All functions prototypes are the Same as for RSAREF.
To aid compatiblity the source and the files follow the
same naming comventions that RSAREF uses. This should aid
direct importing to your applications.
This library is legal everywhere outside the US. And should
NOT be imported to the US and used there.
DES Code header file.
Revision 1.00 - JSAK.
*/
#ifndef _DES_H_
#define _DES_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
UINT4 subkeys[32]; /* subkeys */
UINT4 iv[2]; /* initializing vector */
UINT4 originalIV[2]; /* for restarting the context */
int encrypt; /* encrypt flag */
} DES_CBC_CTX;
typedef struct {
UINT4 subkeys[32]; /* subkeys */
UINT4 iv[2]; /* initializing vector */
UINT4 inputWhitener[2]; /* input whitener */
UINT4 outputWhitener[2]; /* output whitener */
UINT4 originalIV[2]; /* for restarting the context */
int encrypt; /* encrypt flag */
} DESX_CBC_CTX;
typedef struct {
UINT4 subkeys[3][32]; /* subkeys for three operations */
UINT4 iv[2]; /* initializing vector */
UINT4 originalIV[2]; /* for restarting the context */
int encrypt; /* encrypt flag */
} DES3_CBC_CTX;
void DES_CBCInit PROTO_LIST
((DES_CBC_CTX *, unsigned char *, unsigned char *, int));
int DES_CBCUpdate PROTO_LIST
((DES_CBC_CTX *, unsigned char *, unsigned char *, unsigned int));
void DES_CBCRestart PROTO_LIST ((DES_CBC_CTX *));
void DESX_CBCInit PROTO_LIST
((DESX_CBC_CTX *, unsigned char *, unsigned char *, int));
int DESX_CBCUpdate PROTO_LIST
((DESX_CBC_CTX *, unsigned char *, unsigned char *, unsigned int));
void DESX_CBCRestart PROTO_LIST ((DESX_CBC_CTX *));
void DES3_CBCInit PROTO_LIST
((DES3_CBC_CTX *, unsigned char *, unsigned char *, int));
int DES3_CBCUpdate PROTO_LIST
((DES3_CBC_CTX *, unsigned char *, unsigned char *, unsigned int));
void DES3_CBCRestart PROTO_LIST ((DES3_CBC_CTX *));
#ifdef __cplusplus
}
#endif
#endif /* _DES_H_ */