Re: Security for embedded device

From: Joris Dobbelsteen (none.of_at_your.business)
Date: 06/29/04


Date: Tue, 29 Jun 2004 14:04:21 +0200


"Francois Grieu" <fgrieu@francenet.fr> wrote in message
news:fgrieu-79080E.11160929062004@individual.net...
> In article <40e120e0$0$828$a344fe98@news.wanadoo.nl>,
> "Joris Dobbelsteen" <none.of@your.business> wrote:
>
> > Does anyone know a simple cipher for a 8-bit processor with only a few
bytes
> > of available memory, doing its job without about 1K cycles?
>
> TEA
> <http://www.ftp.cl.cam.ac.uk/ftp/papers/djw-rmn/djw-rmn-tea.html>
>
> Be sure you understand the issue of equivalent keys; BTW,
> it can't strike you with a fixed key, only in fancy feedback modes.

I love newsgroups, there are aways people with a lot of very useful
information. Thank you!

I just used the code on the paper and compiled it for a Zilog eZ8 (using
ZDSII 4.8.0).

void main(void)
{
 long v[2];
 long k[4];
 v[0] = 0x55AA;v[1] = 0x55AA;
 k[0] = 0x0; k[1] = 0x1; k[2] = 0x2; k[3] = 0x3;
 code(v, k);
 decode(v, k);
}

Debug build @ ~18MHz:
code routine: 25536 cycles; 0.001277 sec
decode routine: 25597 cycles; 0.001280 sec
about 25600 / 8 = ~3200 cycles/byte

Release built @ ~18MHz
code size: 1234 bytes
code routine: 25113 cycles; 0.001256 sec
decode routine: 25084 cycles; 0.001254 sec
about 25100 / 8 = ~3150 cycles/byte

Obviously the code is open for optimizations, as already suggested in the
paper. Also reducing the number of rounds to ~16 will come very close to my
1K cycles request. Some optimizations will reduce the code size too,
hopefully.

This surely looks excellent and I will use it!

- Joris