00001 #ifndef XTEA_H_
00002 #define XTEA_H_
00003
00030
00031 #include <stdint.h>
00032
00033 #define XTEA_KEYLEN 16
00034 #define XTEA_BLOCKLEN 8
00035
00036
00037 typedef struct {
00038 uint32_t A[32];
00039 uint32_t B[32];
00040 uint8_t IV[XTEA_BLOCKLEN];
00041 uint8_t pad[XTEA_BLOCKLEN];
00042 uint32_t padlen;
00043 } XteaStateKey_T;
00044
00056 void XteaSetup(const uint8_t *key, const uint8_t *iv, XteaStateKey_T *skey);
00057
00064 void XteaRestart(XteaStateKey_T *skey);
00065
00074 void XteaEncrypt(const uint8_t *pt, uint8_t *ct, uint32_t len, XteaStateKey_T *skey);
00075
00084 void XteaDecrypt(const uint8_t *ct, uint8_t *pt, uint32_t len, XteaStateKey_T *skey);
00085
00086 #endif