mbed TLS v2.28.2
arc4.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright The Mbed TLS Contributors
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License"); you may
14  * not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  */
26 #ifndef MBEDTLS_ARC4_H
27 #define MBEDTLS_ARC4_H
28 
29 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include "mbedtls/config.h"
31 #else
32 #include MBEDTLS_CONFIG_FILE
33 #endif
34 
35 #include <stddef.h>
36 
37 /* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */
39 #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #if !defined(MBEDTLS_ARC4_ALT)
46 // Regular implementation
47 //
48 
56 typedef struct mbedtls_arc4_context
57 {
58  int x;
59  int y;
60  unsigned char m[256];
61 }
63 
64 #else /* MBEDTLS_ARC4_ALT */
65 #include "arc4_alt.h"
66 #endif /* MBEDTLS_ARC4_ALT */
67 
79 
91 
104 void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
105  unsigned int keylen );
106 
122 int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
123  unsigned char *output );
124 
125 #if defined(MBEDTLS_SELF_TEST)
126 
137 int mbedtls_arc4_self_test( int verbose );
138 
139 #endif /* MBEDTLS_SELF_TEST */
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #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:57
unsigned char m[256]
Definition: arc4.h:60