roboot/boot/xtea.h File Reference


Detailed Description

XTEA cipher API for ROBOOT.

License:
ROBOOT ver. 0.1.0 - Copyright (C) 2010 AGH UST
This file is part of the ROBOOT (RObus BOOTloader) project. ROBOOT is developed at the Department of Electronics, AGH University of Science and Technology in Krakow, Poland.

The ROBOOT project uses dual-licensing. You can use it for free for non-commercial, open source projects. See license.txt for details or visit project home page at http://www.wsn.agh.edu.pl/?q=roboot

THIS SOFTWARE IS PROVIDED 'AS IS'. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. AGH UST SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

Author:
Artur Lipowski
Purpose:
ROBOOT
Compiler:
GCC
Hardware:
independent
Documented in:
doxygen
Comments:

Definition in file xtea.h.

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  XteaStateKey_T

Defines

#define XTEA_KEYLEN   16
#define XTEA_BLOCKLEN   8

Functions

void XteaSetup (const uint8_t *key, const uint8_t *iv, XteaStateKey_T *skey)
void XteaRestart (XteaStateKey_T *skey)
void XteaEncrypt (const uint8_t *pt, uint8_t *ct, uint32_t len, XteaStateKey_T *skey)
void XteaDecrypt (const uint8_t *ct, uint8_t *pt, uint32_t len, XteaStateKey_T *skey)


Function Documentation

void XteaSetup ( const uint8_t *  key,
const uint8_t *  iv,
XteaStateKey_T *  skey 
)

Initializes XTEA encryption algorithm API. Because actual data and state needed for encryption/decryption is stored into separate space (skey) then it is possible to perform many operations simultaneously. It is safe to call this function many times for given skey data. Function does not use dynamic memory allocation.

Parameters:
key a key used for encryption and decryption
iv a initialization vector for algorithm (if NULL then it will be not used)
skey a pointer to internally used data

Definition at line 55 of file xtea.c.

References XteaRestart().

void XteaRestart ( XteaStateKey_T *  skey  ) 

Reinitializes XTEA encryption algorithm API. This function can be used for subsequent encryption/decryption of data using the same key.

Parameters:
skey a pointer to internally used data (it have to be initialized previously by XteaSetup function)

Definition at line 96 of file xtea.c.

Referenced by XteaSetup().

void XteaEncrypt ( const uint8_t *  pt,
uint8_t *  ct,
uint32_t  len,
XteaStateKey_T *  skey 
)

Encrypts a block of text with XTEA algo.

Parameters:
pt the input plain text
ct the output cipher text
len the length of data for encryption
skey a pointer to internally used data

Definition at line 113 of file xtea.c.

Referenced by XteaDecrypt().

void XteaDecrypt ( const uint8_t *  ct,
uint8_t *  pt,
uint32_t  len,
XteaStateKey_T *  skey 
)

Decrypts a block of text with XTEA algo.

Parameters:
ct the output cipher text
pt the input plain text
len the length of data for encryption
skey a pointer to internally used data

Definition at line 133 of file xtea.c.

References XteaEncrypt().


Generated on Tue Mar 9 07:57:32 2010 for 'ROBOOT' by  doxygen 1.5.8