BeRTOS
Defines | Functions
tea.h File Reference

TEA Tiny Encription Algorith functions. More...

#include <cfg/compiler.h>

Go to the source code of this file.

Defines

#define TEA_KEY_LEN   16
 TEA key size.
#define TEA_BLOCK_LEN   8
 TEA block length.
#define DELTA   0x9E3779B9
 Magic value. (Golden number * 2^31)
#define ROUNDS   32
 Number of rounds.

Functions

void tea_enc (void *_v, void *_k)
 TEA encryption function.
void tea_dec (void *_v, void *_k)
 TEA decryption function.

Detailed Description

TEA Tiny Encription Algorith functions.

Documentation for TEA is available at http://www.cl.cam.ac.uk/ftp/users/djw3/tea.ps.

Author:
Francesco Sacchi <batt@develer.com>

Definition in file tea.h.


Function Documentation

void tea_dec ( void *  _v,
void *  _k 
)

TEA decryption function.

This function decrypts v with k and returns the decrypted data in v.

Parameters:
_vArray of two long values containing the data block.
_kArray of four long values containing the key.

Definition at line 110 of file tea.c.

void tea_enc ( void *  _v,
void *  _k 
)

TEA encryption function.

This function encrypts v with k and returns the encrypted data in v.

Parameters:
_vArray of two long values containing the data block.
_kArray of four long values containing the key.

Definition at line 81 of file tea.c.