arc4.h
Go to the documentation of this file.
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef MBEDTLS_ARC4_H
#define MBEDTLS_ARC4_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include <stddef.h>
/* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(MBEDTLS_ARC4_ALT)
// Regular implementation
//
typedef struct mbedtls_arc4_context
{
int x;
int y;
unsigned char m[256];
}
mbedtls_arc4_context;
#else /* MBEDTLS_ARC4_ALT */
#include "arc4_alt.h"
#endif /* MBEDTLS_ARC4_ALT */
void mbedtls_arc4_init( mbedtls_arc4_context *ctx );
void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
unsigned int keylen );
int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
unsigned char *output );
#if defined(MBEDTLS_SELF_TEST)
int mbedtls_arc4_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */
#ifdef __cplusplus
}
#endif
#endif /* arc4.h */
mbedtls_arc4_crypt
int mbedtls_arc4_crypt(mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, unsigned char *output)
ARC4 cipher function.
mbedtls_arc4_setup
void mbedtls_arc4_setup(mbedtls_arc4_context *ctx, const unsigned char *key, unsigned int keylen)
ARC4 key schedule.
mbedtls_arc4_init
void mbedtls_arc4_init(mbedtls_arc4_context *ctx)
Initialize ARC4 context.
mbedtls_arc4_free
void mbedtls_arc4_free(mbedtls_arc4_context *ctx)
Clear ARC4 context.
mbedtls_arc4_self_test
int mbedtls_arc4_self_test(int verbose)
Checkup routine.
mbedtls_arc4_context
struct mbedtls_arc4_context mbedtls_arc4_context
ARC4 context structure.
config.h
Configuration options (set of defines)
mbedtls_arc4_context
ARC4 context structure.
Definition: arc4.h:57
mbedtls_arc4_context::m
unsigned char m[256]
Definition: arc4.h:60
mbedtls_arc4_context::x
int x
Definition: arc4.h:58
mbedtls_arc4_context::y
int y
Definition: arc4.h:59