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.
Definition in file xtea.c.
#include "xtea.h"
Go to the source code of this file.
Defines | |
#define | STORE32L(x, y) |
#define | LOAD32L(x, y) |
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) |
#define STORE32L | ( | x, | |||
y | ) |
#define LOAD32L | ( | x, | |||
y | ) |
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.
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.
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.
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.
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().