00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MBEDTLS_ARC4_H
00029 #define MBEDTLS_ARC4_H
00030
00031 #if !defined(MBEDTLS_CONFIG_FILE)
00032 #include "config.h"
00033 #else
00034 #include MBEDTLS_CONFIG_FILE
00035 #endif
00036
00037 #include <stddef.h>
00038
00039 #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019
00041 #if !defined(MBEDTLS_ARC4_ALT)
00042
00043
00044
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048
00056 typedef struct
00057 {
00058 int x;
00059 int y;
00060 unsigned char m[256];
00061 }
00062 mbedtls_arc4_context;
00063
00074 void mbedtls_arc4_init( mbedtls_arc4_context *ctx );
00075
00086 void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
00087
00100 void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
00101 unsigned int keylen );
00102
00118 int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
00119 unsigned char *output );
00120
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124
00125 #else
00126 #include "arc4_alt.h"
00127 #endif
00128
00129 #ifdef __cplusplus
00130 extern "C" {
00131 #endif
00132
00143 int mbedtls_arc4_self_test( int verbose );
00144
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148
00149 #endif