blob: f30743b178fa7b7413bf7a37591f1bff4857b6de [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file arc4.h
3 */
4#ifndef XYSSL_ARC4_H
5#define XYSSL_ARC4_H
6
7/**
8 * \brief ARC4 context structure
9 */
10typedef struct
11{
12 int x; /*!< permutation index */
13 int y; /*!< permutation index */
14 unsigned char m[256]; /*!< permutation table */
15}
16arc4_context;
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/**
23 * \brief ARC4 key schedule
24 *
25 * \param ctx ARC4 context to be initialized
26 * \param key the secret key
27 * \param keylen length of the key
28 */
29void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen );
30
31/**
32 * \brief ARC4 cipher function
33 *
34 * \param ctx ARC4 context
35 * \param buf buffer to be processed
36 * \param buflen amount of data in buf
37 */
38void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen );
39
40/*
41 * \brief Checkup routine
42 *
43 * \return 0 if successful, or 1 if the test failed
44 */
45int arc4_self_test( int verbose );
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif /* arc4.h */