PolarSSL
|
00001 00025 #ifndef POLARSSL_XTEA_H 00026 #define POLARSSL_XTEA_H 00027 00028 #ifdef _MSC_VER 00029 #include <basetsd.h> 00030 typedef UINT32 uint32_t; 00031 #else 00032 #include <inttypes.h> 00033 #endif 00034 00035 #define XTEA_ENCRYPT 1 00036 #define XTEA_DECRYPT 0 00037 00038 00042 typedef struct 00043 { 00044 uint32_t k[4]; 00045 } 00046 xtea_context; 00047 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00058 void xtea_setup( xtea_context *ctx, unsigned char key[16] ); 00059 00070 int xtea_crypt_ecb( xtea_context *ctx, 00071 int mode, 00072 unsigned char input[8], 00073 unsigned char output[8] ); 00074 00075 /* 00076 * \brief Checkup routine 00077 * 00078 * \return 0 if successful, or 1 if the test failed 00079 */ 00080 int xtea_self_test( int verbose ); 00081 00082 #ifdef __cplusplus 00083 } 00084 #endif 00085 00086 #endif /* xtea.h */