source: trunk/third/ssh/arcfour.h @ 12646

Revision 12646, 1.2 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12645, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2
3ARCFOUR cipher (based on a cipher posted on the Usenet in Spring-95).
4This cipher is widely believed and has been tested to be equivalent
5with the RC4 cipher from RSA Data Security, Inc.  (RC4 is a trademark
6of RSA Data Security)
7
8*/
9
10/*
11 * $Id: arcfour.h,v 1.1.1.2 1999-03-08 17:43:34 danw Exp $
12 * $Log: not supported by cvs2svn $
13 * Revision 1.1.1.1  1996/02/18  21:38:11  ylo
14 *      Imported ssh-1.2.13.
15 *
16 * Revision 1.2  1995/07/13  01:30:25  ylo
17 *      Added cvs log.
18 *
19 * $Endlog$
20 */
21
22#ifndef ARCFOUR_H
23#define ARCFOUR_H
24
25typedef struct
26{
27   unsigned int x;
28   unsigned int y;
29   unsigned char state[256];
30} ArcfourContext;
31
32/* Initializes the context and sets the key. */
33void arcfour_init(ArcfourContext *ctx, const unsigned char *key,
34                  unsigned int keylen);
35
36/* Returns the next pseudo-random byte from the arcfour (pseudo-random
37   generator) stream. */
38unsigned int arcfour_byte(ArcfourContext *ctx);
39
40/* Encrypts data. */
41void arcfour_encrypt(ArcfourContext *ctx, unsigned char *dest,
42                     const unsigned char *src, unsigned int len);
43
44/* Decrypts data. */
45void arcfour_decrypt(ArcfourContext *ctx, unsigned char *dest,
46                     const unsigned char *src, unsigned int len);
47
48#endif /* ARCFOUR_H */
Note: See TracBrowser for help on using the repository browser.