arc4.h
mbedtls/config.h
stddef.h
arc4.h
mbedtls/check_config.h
mbedtls/config.h
limits.h
stddef.h
mbedtls_arc4_context
MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED
-0x0019

ARC4 hardware accelerator failed.

struct mbedtls_arc4_context typedef struct mbedtls_arc4_context mbedtls_arc4_context mbedtls_arc4_context

ARC4 context structure.

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

void void mbedtls_arc4_init (mbedtls_arc4_context *ctx) mbedtls_arc4_init mbedtls_arc4_context * ctx

Initialize ARC4 context.

ctx

ARC4 context to be initialized

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

void void mbedtls_arc4_free (mbedtls_arc4_context *ctx) mbedtls_arc4_free mbedtls_arc4_context * ctx

Clear ARC4 context.

ctx

ARC4 context to be cleared

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

void void mbedtls_arc4_setup (mbedtls_arc4_context *ctx, const unsigned char *key, unsigned int keylen) mbedtls_arc4_setup mbedtls_arc4_context * ctx const unsigned char * key unsigned int keylen

ARC4 key schedule.

ctx

ARC4 context to be setup

key

the secret key

keylen

length of the key, in bytes

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

int int mbedtls_arc4_crypt (mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, unsigned char *output) mbedtls_arc4_crypt mbedtls_arc4_context * ctx size_t length const unsigned char * input unsigned char * output

ARC4 cipher function.

ctx

ARC4 context

length

length of the input data

input

buffer holding the input data

output

buffer for the output data

0 if successful

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

int int mbedtls_arc4_self_test (int verbose) mbedtls_arc4_self_test int verbose

Checkup routine.

0 if successful, or 1 if the test failed

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

The ARCFOUR stream cipher.

ARC4 is considered a weak cipher and its use constitutes a security risk. We recommend considering stronger ciphers instead.

    /*
    *CopyrightTheMbedTLSContributors
    *SPDX-License-Identifier:Apache-2.0ORGPL-2.0-or-later
    *
    */
    #ifndefMBEDTLS_ARC4_H
    #defineMBEDTLS_ARC4_H

    #if!defined(MBEDTLS_CONFIG_FILE)
    #include"mbedtls/config.h"
    #else
    #includeMBEDTLS_CONFIG_FILE
    #endif

    #include<stddef.h>

    /*MBEDTLS_ERR_ARC4_HW_ACCEL_FAILEDisdeprecatedandshouldnotbeused.*/
    #defineMBEDTLS_ERR_ARC4_HW_ACCEL_FAILED-0x0019

    #ifdef__cplusplus
    extern"C"{
    #endif

    #if!defined(MBEDTLS_ARC4_ALT)
    //Regularimplementation
    //

    typedefstructmbedtls_arc4_context{
    intx;
    inty;
    unsignedcharm[256];
    }
    mbedtls_arc4_context;

    #else/*MBEDTLS_ARC4_ALT*/
    #include"arc4_alt.h"
    #endif/*MBEDTLS_ARC4_ALT*/

    voidmbedtls_arc4_init(mbedtls_arc4_context*ctx);

    voidmbedtls_arc4_free(mbedtls_arc4_context*ctx);

    voidmbedtls_arc4_setup(mbedtls_arc4_context*ctx,constunsignedchar*key,
    unsignedintkeylen);

    intmbedtls_arc4_crypt(mbedtls_arc4_context*ctx,size_tlength,constunsignedchar*input,
    unsignedchar*output);

    #ifdefined(MBEDTLS_SELF_TEST)

    intmbedtls_arc4_self_test(intverbose);

    #endif/*MBEDTLS_SELF_TEST*/

    #ifdef__cplusplus
    }
    #endif

    #endif/*arc4.h*/