1 /*********************************************************************
3 * Author: Brad Conte (brad AT bradconte.com)
5 * Disclaimer: This code is presented "as is" without any guarantees.
6 * Details: Defines the API for the corresponding ARCFOUR implementation.
7 *********************************************************************/
12 /*************************** HEADER FILES ***************************/
15 /**************************** DATA TYPES ****************************/
16 typedef unsigned char BYTE; // 8-bit byte
18 /*********************** FUNCTION DECLARATIONS **********************/
19 // Input: state - the state used to generate the keystream
20 // key - Key to use to initialize the state
21 // len - length of key in bytes (valid lenth is 1 to 256)
22 void arcfour_key_setup(BYTE state[], const BYTE key[], int len);
24 // Pseudo-Random Generator Algorithm
25 // Input: state - the state used to generate the keystream
26 // out - Must be allocated to be of at least "len" length
27 // len - number of bytes to generate
28 void arcfour_generate_stream(BYTE state[], BYTE out[], size_t len);