new, smaller, faster and untested version of KLISP
[syren.git] / src / xyssl / arc4.h
blobf30743b178fa7b7413bf7a37591f1bff4857b6de
1 /**
2 * \file arc4.h
3 */
4 #ifndef XYSSL_ARC4_H
5 #define XYSSL_ARC4_H
7 /**
8 * \brief ARC4 context structure
9 */
10 typedef struct
12 int x; /*!< permutation index */
13 int y; /*!< permutation index */
14 unsigned char m[256]; /*!< permutation table */
16 arc4_context;
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
22 /**
23 * \brief ARC4 key schedule
25 * \param ctx ARC4 context to be initialized
26 * \param key the secret key
27 * \param keylen length of the key
29 void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen );
31 /**
32 * \brief ARC4 cipher function
34 * \param ctx ARC4 context
35 * \param buf buffer to be processed
36 * \param buflen amount of data in buf
38 void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen );
41 * \brief Checkup routine
43 * \return 0 if successful, or 1 if the test failed
45 int arc4_self_test( int verbose );
47 #ifdef __cplusplus
49 #endif
51 #endif /* arc4.h */