# CRYPTO_RC4Fast

## Syntax

      #include <nitro/crypto.h>

      void CRYPTO_RC4Fast(const void* key, u32 key_len, void* data, u32 data_len);

## Arguments

key | Pointer to the byte sequence for the encryption/decryption key used with the RC4 algorithm.
key_len | Length of the key specified by `key`. The length of the key must be 16 bytes or less; longer lengths are truncated to 16 bytes.
data | Pointer to the target data to encrypt/decrypt with the RC4 algorithm.
data_len | Specifies the length of the data specified by `data`.

## Return Values

None.

## Description

Performs encryption/decryption using the RC4 shared key encryption algorithm. The same function is used for both encryption and decryption in the RC4 algorithm.
Data stored within the data argument is directly processed and overwritten with the converted results.
This function is defined as an inline function that calls the `CRYPTO_RC4FastInit` and `CRYPTO_RC4FastEncrypt` functions sequentially.

The `CRYPTO_RC4` and `CRYPTO_RC4Fast` functions are the same, except that the `CRYPTO_RC4Fast` function is faster and requires more stack memory.
The `CRYPTO_RC4` function gets the `CRYPTORC4Context` structure from the stack, which requires a minimum of 260 bytes.
The `CRYPTO_RC4Fast` function gets the `CRYPTORC4FastContext` structure, which requires a minimum of 1032 bytes from the stack.
With regard to speed, `CRYPTO_RC4Fast` processes data at approximately 1.5 times the normal speed when the data is sufficiently large in size.

For detailed information on using the RC4 algorithm, see Overview of Encryption Using RC4 Algorithm.

## See Also

`CRYPTO_RC4FastEncrypt, CRYPTO_RC4FastInit`

## Revision History

2008/02/25 Initial version.

CONFIDENTIAL