PolarSSL v1.2.12
xtea.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_XTEA_H
28 #define POLARSSL_XTEA_H
29 
30 #include "config.h"
31 
32 #include <string.h>
33 
34 #ifdef _MSC_VER
35 #include <basetsd.h>
36 typedef UINT32 uint32_t;
37 #else
38 #include <inttypes.h>
39 #endif
40 
41 #define XTEA_ENCRYPT 1
42 #define XTEA_DECRYPT 0
43 
44 #define POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH -0x0028
46 #if !defined(POLARSSL_XTEA_ALT)
47 // Regular implementation
48 //
49 
53 typedef struct
54 {
55  uint32_t k[4];
56 }
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
69 void xtea_setup( xtea_context *ctx, unsigned char key[16] );
70 
82  int mode,
83  unsigned char input[8],
84  unsigned char output[8] );
85 
100  int mode,
101  size_t length,
102  unsigned char iv[8],
103  unsigned char *input,
104  unsigned char *output);
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #else /* POLARSSL_XTEA_ALT */
111 #include "xtea_alt.h"
112 #endif /* POLARSSL_XTEA_ALT */
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
123 int xtea_self_test( int verbose );
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* xtea.h */
void xtea_setup(xtea_context *ctx, unsigned char key[16])
XTEA key schedule.
Configuration options (set of defines)
int xtea_crypt_ecb(xtea_context *ctx, int mode, unsigned char input[8], unsigned char output[8])
XTEA cipher function.
XTEA context structure.
Definition: xtea.h:53
int xtea_self_test(int verbose)
Checkup routine.
int xtea_crypt_cbc(xtea_context *ctx, int mode, size_t length, unsigned char iv[8], unsigned char *input, unsigned char *output)
XTEA CBC cipher function.