Mbed TLS v2.28.8
arc4.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright The Mbed TLS Contributors
11  * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
12  *
13  */
14 #ifndef MBEDTLS_ARC4_H
15 #define MBEDTLS_ARC4_H
16 
17 #if !defined(MBEDTLS_CONFIG_FILE)
18 #include "mbedtls/config.h"
19 #else
20 #include MBEDTLS_CONFIG_FILE
21 #endif
22 
23 #include <stddef.h>
24 
25 /* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */
27 #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #if !defined(MBEDTLS_ARC4_ALT)
34 // Regular implementation
35 //
36 
44 typedef struct mbedtls_arc4_context {
45  int x;
46  int y;
47  unsigned char m[256];
48 }
50 
51 #else /* MBEDTLS_ARC4_ALT */
52 #include "arc4_alt.h"
53 #endif /* MBEDTLS_ARC4_ALT */
54 
66 
78 
91 void mbedtls_arc4_setup(mbedtls_arc4_context *ctx, const unsigned char *key,
92  unsigned int keylen);
93 
109 int mbedtls_arc4_crypt(mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
110  unsigned char *output);
111 
112 #if defined(MBEDTLS_SELF_TEST)
113 
124 int mbedtls_arc4_self_test(int verbose);
125 
126 #endif /* MBEDTLS_SELF_TEST */
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* arc4.h */
int mbedtls_arc4_crypt(mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, unsigned char *output)
ARC4 cipher function.
void mbedtls_arc4_setup(mbedtls_arc4_context *ctx, const unsigned char *key, unsigned int keylen)
ARC4 key schedule.
void mbedtls_arc4_init(mbedtls_arc4_context *ctx)
Initialize ARC4 context.
void mbedtls_arc4_free(mbedtls_arc4_context *ctx)
Clear ARC4 context.
int mbedtls_arc4_self_test(int verbose)
Checkup routine.
struct mbedtls_arc4_context mbedtls_arc4_context
ARC4 context structure.
Configuration options (set of defines)
ARC4 context structure.
Definition: arc4.h:44
unsigned char m[256]
Definition: arc4.h:47