My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
rc4_algorithm.c File Reference
#include "sw_mem_functions.h"
#include "unused.h"

Macros

#define MODULO_VALUE   256
 
#define BUF_LEN   256
 
#define INITIALIZATION_CONST   0xff
 
#define SWAP(a, b)   (((b) ^= (a) ^= (b), (a) ^= (b)))
 

Functions

int otzone_rc4_algorithm (char *input_buf, int input_len, char *output_buf, int *output_len)
 the function to encode and decode a buffer using rc4 algorithm. The output buffer has to be atleast the same length as the input buffer. Expect segmentation faults if not. More...
 

Macro Definition Documentation

#define BUF_LEN   256
#define INITIALIZATION_CONST   0xff
#define MODULO_VALUE   256
#define SWAP (   a,
 
)    (((b) ^= (a) ^= (b), (a) ^= (b)))

Function Documentation

int otzone_rc4_algorithm ( char *  input_buf,
int  input_len,
char *  output_buf,
int *  output_len 
)

the function to encode and decode a buffer using rc4 algorithm. The output buffer has to be atleast the same length as the input buffer. Expect segmentation faults if not.

Parameters
input_bufthe input buffer that needs to be converted
input_lenthe length of the input buffer
output_bufthe output buffer into which the data needs to be filled. The size has to be atleast the same size as the input buffer.
output_lenthe length of the converted data
Returns
0 if successful. No other return values are expected for now