tea.c File Reference
TEA Tiny Encription Algorith functions (implementation). More...
#include "tea.h"
#include <mware/byteorder.h>
Go to the source code of this file.
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 (implementation).
- Version:
- Id
- tea.c 841 2007-10-08 17:35:23Z marco
Placed in the Public Domain by David Wheeler and Roger Needham.
**** ANSI C VERSION ****
Notes:
TEA is a Feistel cipher with XOR and and addition as the non-linear mixing functions.
Takes 64 bits of data in v[0] and v[1]. Returns 64 bits of data in w[0] and w[1]. Takes 128 bits of key in k[0] - k[3].
TEA can be operated in any of the modes of DES. Cipher Block Chaining is, for example, simple to implement.
n is the number of iterations. 32 is ample, 16 is sufficient, as few as eight may be OK. The algorithm achieves good dispersion after six iterations. The iteration count can be made variable if required.
Note this is optimised for 32-bit CPUs with fast shift capabilities. It can very easily be ported to assembly language on most CPUs.
delta is chosen to be the real part of (the golden ratio Sqrt(5/4) - 1/2 ~ 0.618034 multiplied by 2^32).
Definition in file tea.c.
Function Documentation
| void tea_dec | ( | void * | _v, | |
| void * | _k | |||
| ) |
| void tea_enc | ( | void * | _v, | |
| void * | _k | |||
| ) |
