arcfour.h 706 Bytes
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * $Id$
 */

#ifndef ARCFOUR_H_INCLUDED
#define ARCFOUR_H_INCLUDED

#include "crypto_types.h"

struct arcfour_ctx {
  UINT8 S[256];
  UINT8 i, j;
};

#if 0
void arcfour_init(struct arcfour_ctx *ctx);
#endif

19
20
/* Encryption functions */
void arcfour_set_key(struct arcfour_ctx *ctx, UINT32 length, const UINT8 *key);
Niels Möller's avatar
Niels Möller committed
21
void arcfour_crypt(struct arcfour_ctx *ctx, UINT8 *dest,
22
23
24
25
26
27
28
29
30
		   UINT32 length, const UINT8 *src);

/* Using arcfour as a randomness generator. */
void arcfour_init(struct arcfour_ctx *ctx);
void arcfour_update_key(struct arcfour_ctx *ctx,
			UINT32 length, const UINT8 *key);
void arcfour_stream(struct arcfour_ctx *ctx,
		    UINT32 length, UINT8 *dest);

Niels Möller's avatar
Niels Möller committed
31
32

#endif /* ARCFOUR_H_INCLUDED */