OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
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 /* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */
40 #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #if !defined(MBEDTLS_ARC4_ALT)
47 // Regular implementation
48 //
49 
57 typedef struct mbedtls_arc4_context
58 {
59  int x;
60  int y;
61  unsigned char m[256];
62 }
64 
65 #else /* MBEDTLS_ARC4_ALT */
66 #include "arc4_alt.h"
67 #endif /* MBEDTLS_ARC4_ALT */
68 
80 
92 
105 void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
106  unsigned int keylen );
107 
123 int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
124  unsigned char *output );
125 
136 int mbedtls_arc4_self_test( int verbose );
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #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.
unsigned char m[256]
Definition: arc4.h:61
struct mbedtls_arc4_context mbedtls_arc4_context
ARC4 context structure.
int x
Definition: arc4.h:59
ARC4 context structure.
Definition: arc4.h:57
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.
int y
Definition: arc4.h:60