RetroArch
Functions | Variables
arc4.c File Reference
#include "mbedtls/config.h"
#include "mbedtls/arc4.h"
#include <string.h>
#include "mbedtls/platform.h"
#include "arc4_alt.h"
Include dependency graph for arc4.c:

Functions

void mbedtls_arc4_init (mbedtls_arc4_context *ctx)
 Initialize ARC4 context. More...
 
void mbedtls_arc4_free (mbedtls_arc4_context *ctx)
 Clear ARC4 context. More...
 
void mbedtls_arc4_setup (mbedtls_arc4_context *ctx, const unsigned char *key, unsigned int keylen)
 ARC4 key schedule. More...
 
int mbedtls_arc4_crypt (mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, unsigned char *output)
 ARC4 cipher function. More...
 
int mbedtls_arc4_self_test (int verbose)
 Checkup routine. More...
 

Variables

static const unsigned char arc4_test_key [3][8]
 
static const unsigned char arc4_test_pt [3][8]
 
static const unsigned char arc4_test_ct [3][8]
 

Function Documentation

◆ mbedtls_arc4_crypt()

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

ARC4 cipher function.

Parameters
ctxARC4 context
lengthlength of the input data
inputbuffer holding the input data
outputbuffer for the output data
Returns
0 if successful
Here is the caller graph for this function:

◆ mbedtls_arc4_free()

void mbedtls_arc4_free ( mbedtls_arc4_context ctx)

Clear ARC4 context.

Parameters
ctxARC4 context to be cleared
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_arc4_init()

void mbedtls_arc4_init ( mbedtls_arc4_context ctx)

Initialize ARC4 context.

Parameters
ctxARC4 context to be initialized
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbedtls_arc4_self_test()

int mbedtls_arc4_self_test ( int  verbose)

Checkup routine.

Returns
0 if successful, or 1 if the test failed
Here is the call graph for this function:

◆ mbedtls_arc4_setup()

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

ARC4 key schedule.

Parameters
ctxARC4 context to be setup
keythe secret key
keylenlength of the key, in bytes
Here is the caller graph for this function:

Variable Documentation

◆ arc4_test_ct

const unsigned char arc4_test_ct[3][8]
static
Initial value:
=
{
{ 0x75, 0xB7, 0x87, 0x80, 0x99, 0xE0, 0xC5, 0x96 },
{ 0x74, 0x94, 0xC2, 0xE7, 0x10, 0x4B, 0x08, 0x79 },
{ 0xDE, 0x18, 0x89, 0x41, 0xA3, 0x37, 0x5D, 0x3A }
}

◆ arc4_test_key

const unsigned char arc4_test_key[3][8]
static
Initial value:
=
{
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
}

◆ arc4_test_pt

const unsigned char arc4_test_pt[3][8]
static
Initial value:
=
{
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
}