xtea.h
Go to the documentation of this file.
#ifndef MBEDTLS_XTEA_H
#define MBEDTLS_XTEA_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_XTEA_ENCRYPT 1
#define MBEDTLS_XTEA_DECRYPT 0
#define MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH -0x0028
#if !defined(MBEDTLS_XTEA_ALT)
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
uint32_t k[4];
}
mbedtls_xtea_context;
void mbedtls_xtea_init( mbedtls_xtea_context *ctx );
void mbedtls_xtea_free( mbedtls_xtea_context *ctx );
void mbedtls_xtea_setup( mbedtls_xtea_context *ctx, const unsigned char key[16] );
int mbedtls_xtea_crypt_ecb( mbedtls_xtea_context *ctx,
int mode,
const unsigned char input[8],
unsigned char output[8] );
#if defined(MBEDTLS_CIPHER_MODE_CBC)
int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx,
int mode,
size_t length,
unsigned char iv[8],
const unsigned char *input,
unsigned char *output);
#endif /* MBEDTLS_CIPHER_MODE_CBC */
#ifdef __cplusplus
}
#endif
#else /* MBEDTLS_XTEA_ALT */
#include "xtea_alt.h"
#endif /* MBEDTLS_XTEA_ALT */
#ifdef __cplusplus
extern "C" {
#endif
int mbedtls_xtea_self_test( int verbose );
#ifdef __cplusplus
}
#endif
#endif /* xtea.h */
config.h
Configuration options (set of defines)
mbedtls_xtea_self_test
int mbedtls_xtea_self_test(int verbose)
Checkup routine.