#ifndef __DES_H__
#define __DES_H__

//#include "..\CommFiles\DataTypeDefine.h"
#include "stm32f10x.h"
		
#define uint8  uint8_t
#define uint16 uint16_t
#define uint32 uint32_t

#ifndef FALSE
#define FALSE			0
#endif
#ifndef TRUE
#define TRUE			1
#endif

#define False FALSE
#define True  TRUE
    
    typedef struct STRUCT_DES_KEY_STRUCT
    {
        uint8 keyA[8];
        uint8 keyB[8];
        uint8 keyC[8];
    }STRUCT_DES_KEY;
    #define DES_KEY_LEN sizeof(STRUCT_DES_KEY)

    typedef union UNION_DES_KEY_UNION
    {
        STRUCT_DES_KEY sDesKey;
        uint8 unionArray[DES_KEY_LEN];
    }UNION_DES_KEY;

    typedef enum {
        E_DKL_DES=8,            //8×Ö½ÚÃÜÔ¿
        E_DKL_TRIPLE16=16,        //16×Ö½ÚÃÜÔ¿
        E_DKL_TRIPLE24=24        //24×Ö½ÚÃÜÔ¿
    }E_DES_KEY_LEN;

#if 0
    uint32 DesEncrypt(uint8 * _inData,uint8 * _outData,uint8 * _key,uint32 _len);
    uint32 DesDecrypt(uint8 * _inData,uint8 * _outData,uint8 * _key,uint32 _len);
    uint32 TripleDesEncrypt(uint8 * _inData,uint8 * _outData,uint8 * _key, uint32 _len);
    uint32 TripleDesDecrypt(uint8 * _inData,uint8 * _outData, uint8 * _key, uint32 _len);
    uint32 TripleDesEncrypt3Key(uint8 * _inData,uint8 * _outData,uint8 * _key, uint32 _len);
    uint32 TripleDesDecrypt3Key(uint8 * _inData,uint8 * _outData, uint8 * _key, uint32 _len);
#endif
    uint32 DesEncryptFunc(uint8 * _inData,uint8 *_outData,uint8 * _key,uint32 _len,uint32 _keyLen);
    uint32 DesDecryptFunc(uint8 * _inData,uint8 *_outData,uint8 * _key,uint32 _len,uint32 _keyLen);


#endif



