123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- #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)
- #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
- #ifdef __cplusplus
- }
- #endif
- #else
- #include "xtea_alt.h"
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- int mbedtls_xtea_self_test( int verbose );
- #ifdef __cplusplus
- }
- #endif
- #endif
|