mbed TLS v2.7.6
arc4.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
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  * This file is part of mbed TLS (https://tls.mbed.org)
26  *
27  */
28 #ifndef MBEDTLS_ARC4_H
29 #define MBEDTLS_ARC4_H
30 
31 #if !defined(MBEDTLS_CONFIG_FILE)
32 #include "config.h"
33 #else
34 #include MBEDTLS_CONFIG_FILE
35 #endif
36 
37 #include <stddef.h>
38 
39 #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019
41 #if !defined(MBEDTLS_ARC4_ALT)
42 // Regular implementation
43 //
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
56 typedef struct
57 {
58  int x;
59  int y;
60  unsigned char m[256];
61 }
63 
75 
87 
100 void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
101  unsigned int keylen );
102 
118 int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
119  unsigned char *output );
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #else /* MBEDTLS_ARC4_ALT */
126 #include "arc4_alt.h"
127 #endif /* MBEDTLS_ARC4_ALT */
128 
129 #ifdef __cplusplus
130 extern "C" {
131 #endif
132 
143 int mbedtls_arc4_self_test( int verbose );
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif /* arc4.h */
int mbedtls_arc4_crypt(mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, unsigned char *output)
ARC4 cipher function.
Configuration options (set of defines)
void mbedtls_arc4_init(mbedtls_arc4_context *ctx)
Initialize ARC4 context.
ARC4 context structure.
Definition: arc4.h:56
void mbedtls_arc4_free(mbedtls_arc4_context *ctx)
Clear ARC4 context.
void mbedtls_arc4_setup(mbedtls_arc4_context *ctx, const unsigned char *key, unsigned int keylen)
ARC4 key schedule.
int mbedtls_arc4_self_test(int verbose)
Checkup routine.