[BACK]Return to rc4.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

File: [local] / src / usr.bin / ssh / Attic / rc4.h (download)

Revision 1.1, Sun Sep 26 20:53:37 1999 UTC (24 years, 8 months ago) by deraadt
Branch: MAIN

i bet a lot of people didn't know what ssh 1.2.16 had a nice license.
well, except for the patent issues.  someone in sweden (forget their
name at the moment) cleaned out most of the patented code, and now
this code removes rsa code.  when this is done, it will link against
libssl, but the work isn't completely done yet.  then we need to bring
this up to modern days, featurewise.

/*

Alleged RC4 (based on the Usenet posting in Spring-95)

*/

/* RCSID("$Id: rc4.h,v 1.1 1999/09/26 20:53:37 deraadt Exp $"); */

#ifndef RC4_H
#define RC4_H

typedef struct
{
   unsigned int x;
   unsigned int y;
   unsigned char state[256];
} RC4Context;

/* Initializes the context and sets the key. */
void rc4_init(RC4Context *ctx, const unsigned char *key, unsigned int keylen);

/* Returns the next pseudo-random byte from the RC4 (pseudo-random generator)
   stream. */
unsigned int rc4_byte(RC4Context *ctx);

/* Encrypts data. */
void rc4_encrypt(RC4Context *ctx, unsigned char *dest, 
		 const unsigned char *src, unsigned int len);

/* Decrypts data. */
void rc4_decrypt(RC4Context *ctx, unsigned char *dest, 
		 const unsigned char *src, unsigned int len);

#endif /* RC4_H */