33 *
44 * \brief The ARCFOUR stream cipher
55 *
6+ * \warning ARC4 is considered a weak cipher and its use constitutes a
7+ * security risk. We recommend considering stronger ciphers instead.
8+ */
9+ /*
610 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
711 * SPDX-License-Identifier: Apache-2.0
812 *
1923 * limitations under the License.
2024 *
2125 * This file is part of mbed TLS (https://tls.mbed.org)
26+ *
2227 */
2328#ifndef MBEDTLS_ARC4_H
2429#define MBEDTLS_ARC4_H
3136
3237#include <stddef.h>
3338
39+ #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */
40+
3441#if !defined(MBEDTLS_ARC4_ALT )
3542// Regular implementation
3643//
@@ -40,7 +47,11 @@ extern "C" {
4047#endif
4148
4249/**
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+ *
4455 */
4556typedef struct
4657{
@@ -54,13 +65,23 @@ mbedtls_arc4_context;
5465 * \brief Initialize ARC4 context
5566 *
5667 * \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+ *
5773 */
5874void mbedtls_arc4_init ( mbedtls_arc4_context * ctx );
5975
6076/**
6177 * \brief Clear ARC4 context
6278 *
6379 * \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+ *
6485 */
6586void mbedtls_arc4_free ( mbedtls_arc4_context * ctx );
6687
@@ -70,6 +91,11 @@ void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
7091 * \param ctx ARC4 context to be setup
7192 * \param key the secret key
7293 * \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+ *
7399 */
74100void mbedtls_arc4_setup ( mbedtls_arc4_context * ctx , const unsigned char * key ,
75101 unsigned int keylen );
@@ -83,6 +109,11 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
83109 * \param output buffer for the output data
84110 *
85111 * \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+ *
86117 */
87118int mbedtls_arc4_crypt ( mbedtls_arc4_context * ctx , size_t length , const unsigned char * input ,
88119 unsigned char * output );
@@ -103,6 +134,11 @@ extern "C" {
103134 * \brief Checkup routine
104135 *
105136 * \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+ *
106142 */
107143int mbedtls_arc4_self_test ( int verbose );
108144
0 commit comments