rc4.c File Reference

RC4 stream cipher. More...

#include "includes.h"
#include "common.h"
#include "crypto.h"
Include dependency graph for rc4.c:

Go to the source code of this file.

Defines

#define S_SWAP(a, b)   do { u8 t = S[a]; S[a] = S[b]; S[b] = t; } while(0)

Functions

int rc4_skip (const u8 *key, size_t keylen, size_t skip, u8 *data, size_t data_len)
 XOR RC4 stream to given data with skip-stream-start.

Detailed Description

RC4 stream cipher.

Copyright
Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

Definition in file rc4.c.


Function Documentation

int rc4_skip ( const u8 *  key,
size_t  keylen,
size_t  skip,
u8 *  data,
size_t  data_len 
)

XOR RC4 stream to given data with skip-stream-start.

Parameters:
key RC4 key
keylen RC4 key length
skip number of bytes to skip from the beginning of the RC4 stream
data data to be XOR'ed with RC4 stream
data_len buf length
Returns:
0 on success, -1 on failure

Generate RC4 pseudo random stream for the given key, skip beginning of the stream, and XOR the end result with the data buffer to perform RC4 encryption/decryption.

Definition at line 23 of file rc4.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:19:41 2009 for hostapd by  doxygen 1.6.1