3
3
*
4
4
* \brief The ARCFOUR stream cipher
5
5
*
6
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
7
+ * security risk. We recommend considering stronger ciphers instead.
8
+ */
9
+ /*
6
10
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7
11
* SPDX-License-Identifier: Apache-2.0
8
12
*
19
23
* limitations under the License.
20
24
*
21
25
* This file is part of mbed TLS (https://tls.mbed.org)
26
+ *
22
27
*/
23
28
#ifndef MBEDTLS_ARC4_H
24
29
#define MBEDTLS_ARC4_H
31
36
32
37
#include <stddef.h>
33
38
39
+ #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */
40
+
34
41
#if !defined(MBEDTLS_ARC4_ALT )
35
42
// Regular implementation
36
43
//
@@ -40,7 +47,11 @@ extern "C" {
40
47
#endif
41
48
42
49
/**
43
- * \brief ARC4 context structure
50
+ * \brief ARC4 context structure
51
+ *
52
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
53
+ * security risk. We recommend considering stronger ciphers instead.
54
+ *
44
55
*/
45
56
typedef struct
46
57
{
@@ -54,13 +65,23 @@ mbedtls_arc4_context;
54
65
* \brief Initialize ARC4 context
55
66
*
56
67
* \param ctx ARC4 context to be initialized
68
+ *
69
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
70
+ * security risk. We recommend considering stronger ciphers
71
+ * instead.
72
+ *
57
73
*/
58
74
void mbedtls_arc4_init ( mbedtls_arc4_context * ctx );
59
75
60
76
/**
61
77
* \brief Clear ARC4 context
62
78
*
63
79
* \param ctx ARC4 context to be cleared
80
+ *
81
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
82
+ * security risk. We recommend considering stronger ciphers
83
+ * instead.
84
+ *
64
85
*/
65
86
void mbedtls_arc4_free ( mbedtls_arc4_context * ctx );
66
87
@@ -70,6 +91,11 @@ void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
70
91
* \param ctx ARC4 context to be setup
71
92
* \param key the secret key
72
93
* \param keylen length of the key, in bytes
94
+ *
95
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
96
+ * security risk. We recommend considering stronger ciphers
97
+ * instead.
98
+ *
73
99
*/
74
100
void mbedtls_arc4_setup ( mbedtls_arc4_context * ctx , const unsigned char * key ,
75
101
unsigned int keylen );
@@ -83,6 +109,11 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
83
109
* \param output buffer for the output data
84
110
*
85
111
* \return 0 if successful
112
+ *
113
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
114
+ * security risk. We recommend considering stronger ciphers
115
+ * instead.
116
+ *
86
117
*/
87
118
int mbedtls_arc4_crypt ( mbedtls_arc4_context * ctx , size_t length , const unsigned char * input ,
88
119
unsigned char * output );
@@ -103,6 +134,11 @@ extern "C" {
103
134
* \brief Checkup routine
104
135
*
105
136
* \return 0 if successful, or 1 if the test failed
137
+ *
138
+ * \warning ARC4 is considered a weak cipher and its use constitutes a
139
+ * security risk. We recommend considering stronger ciphers
140
+ * instead.
141
+ *
106
142
*/
107
143
int mbedtls_arc4_self_test ( int verbose );
108
144
0 commit comments