Nut/OS  5.0.5
API Reference
xtea.c File Reference
#include <compiler.h>
#include <stdint.h>
#include <string.h>
#include <gorp/xtea.h>
Include dependency graph for xtea.c:

Defines

#define XTDELTA   0x9e3779b9
#define XTSUM   0xC6EF3720
#define ROUNDS   32

Functions

void XTeaCrypt (uint32_t *w, const uint32_t *v, const XTeaKeyBlock_t k)
 Encrypt a 64bit block with XTEA algorythm.
void XTeaDecrypt (uint32_t *w, const uint32_t *v, const XTeaKeyBlock_t k)
 Decrypt a 64bit block with XTEA algorythm.
void XTeaCryptStr (char *dst, const char *src, uint16_t len, const char *pass)
 Encrypt a string with XTEA algorythm.
void XTeaDecryptStr (char *dst, const char *src, uint16_t len, const char *pass)
 Decrypt a string with XTEA algorythm.

Define Documentation

#define XTDELTA   0x9e3779b9

Referenced by XTeaCrypt(), and XTeaDecrypt().

#define XTSUM   0xC6EF3720

Referenced by XTeaDecrypt().

#define ROUNDS   32

Referenced by XTeaCrypt().


Function Documentation

void XTeaCrypt ( uint32_t w,
const uint32_t v,
const XTeaKeyBlock_t  k 
)

Encrypt a 64bit block with XTEA algorythm.

w Destination pointer to 2x32 bit encrypted block. v Source pointer of 2x32 bit plain text block. k Pointer to 128 bit (4*32bit) key block.

References ROUNDS, and XTDELTA.

Referenced by XTeaCryptStr().

void XTeaDecrypt ( uint32_t w,
const uint32_t v,
const XTeaKeyBlock_t  k 
)

Decrypt a 64bit block with XTEA algorythm.

w Destination pointer to 2x32 bit decrypted block. v Source pointer of 2x32 bit encrypted block. k Pointer to 128 bit (4*32bit) key block.

References XTDELTA, and XTSUM.

Referenced by XTeaDecryptStr().

void XTeaCryptStr ( char *  dst,
const char *  src,
uint16_t  len,
const char *  pass 
)

Encrypt a string with XTEA algorythm.

Respect that the strings or buffers of src and dst strings have to have a length of multiple of 8 as it is a 64 bit based algorhythm.

dst Target buffer to place the encrypted string into. src Source buffer to get the clear text string from. len Length of the string to encrypt. pass Buffer of 64 bytes used as passphrase.

References memcpy(), strlen(), and XTeaCrypt().

Here is the call graph for this function:

void XTeaDecryptStr ( char *  dst,
const char *  src,
uint16_t  len,
const char *  pass 
)

Decrypt a string with XTEA algorythm.

Respect that the strings or buffers of src and dst strings have to have a length of multiple of 8 as it is a 64 bit based algorhythm.

dst Target buffer to place the decrypted string into. src Source buffer to get the encrypted string from. len Length of the string to decrypt. pass Buffer of 64 bytes used as passphrase.

References memcpy(), strlen(), and XTeaDecrypt().

Here is the call graph for this function: