The required constant definitions are as follows:
#define MODULE_NAME ARC4 /* Name of algorithm */ #define BLOCK_SIZE 1 /* Will always be 1 for a stream cipher */ #define KEY_SIZE 0 /* Size of key in bytes (0 if not fixed size) */
The C structure must be named stream_state:
typedef struct { ... whatever state variables you need ... } stream_state;
There are three functions that need to be written: to initialize the algorithm's state, and to encrypt and decrypt a single block.
Put #include "stream_template.c" at the end of the file to include the actual implementation of the module.