[23095] | 1 | /* DES.H - header file for DESC.C |
---|
| 2 | */ |
---|
| 3 | |
---|
| 4 | #ifndef _DES_H_ |
---|
| 5 | #define _DES_H_ 1 |
---|
| 6 | |
---|
| 7 | #ifdef __cplusplus |
---|
| 8 | extern "C" { |
---|
| 9 | #endif |
---|
| 10 | |
---|
| 11 | typedef struct { |
---|
| 12 | UINT4 subkeys[32]; /* subkeys */ |
---|
| 13 | UINT4 iv[2]; /* initializing vector */ |
---|
| 14 | UINT4 originalIV[2]; /* for restarting the context */ |
---|
| 15 | int encrypt; /* encrypt flag */ |
---|
| 16 | } DES_CBC_CTX; |
---|
| 17 | |
---|
| 18 | typedef struct { |
---|
| 19 | UINT4 subkeys[32]; /* subkeys */ |
---|
| 20 | UINT4 iv[2]; /* initializing vector */ |
---|
| 21 | UINT4 inputWhitener[2]; /* input whitener */ |
---|
| 22 | UINT4 outputWhitener[2]; /* output whitener */ |
---|
| 23 | UINT4 originalIV[2]; /* for restarting the context */ |
---|
| 24 | int encrypt; /* encrypt flag */ |
---|
| 25 | } DESX_CBC_CTX; |
---|
| 26 | |
---|
| 27 | typedef struct { |
---|
| 28 | UINT4 subkeys[3][32]; /* subkeys for three operations */ |
---|
| 29 | UINT4 iv[2]; /* initializing vector */ |
---|
| 30 | UINT4 originalIV[2]; /* for restarting the context */ |
---|
| 31 | int encrypt; /* encrypt flag */ |
---|
| 32 | } DES3_CBC_CTX; |
---|
| 33 | |
---|
| 34 | void DES_CBCInit PROTO_LIST |
---|
| 35 | ((DES_CBC_CTX *, unsigned char *, unsigned char *, int)); |
---|
| 36 | int DES_CBCUpdate PROTO_LIST |
---|
| 37 | ((DES_CBC_CTX *, unsigned char *, unsigned char *, unsigned int)); |
---|
| 38 | void DES_CBCRestart PROTO_LIST ((DES_CBC_CTX *)); |
---|
| 39 | |
---|
| 40 | void DESX_CBCInit PROTO_LIST |
---|
| 41 | ((DESX_CBC_CTX *, unsigned char *, unsigned char *, int)); |
---|
| 42 | int DESX_CBCUpdate PROTO_LIST |
---|
| 43 | ((DESX_CBC_CTX *, unsigned char *, unsigned char *, unsigned int)); |
---|
| 44 | void DESX_CBCRestart PROTO_LIST ((DESX_CBC_CTX *)); |
---|
| 45 | |
---|
| 46 | void DES3_CBCInit PROTO_LIST |
---|
| 47 | ((DES3_CBC_CTX *, unsigned char *, unsigned char *, int)); |
---|
| 48 | int DES3_CBCUpdate PROTO_LIST |
---|
| 49 | ((DES3_CBC_CTX *, unsigned char *, unsigned char *, unsigned int)); |
---|
| 50 | void DES3_CBCRestart PROTO_LIST ((DES3_CBC_CTX *)); |
---|
| 51 | |
---|
| 52 | #ifdef __cplusplus |
---|
| 53 | } |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | #endif |
---|