2010-09-26 21:54:31 -06:00
|
|
|
#ifndef __ARC4_H__
|
|
|
|
#define __ARC4_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2010-09-27 21:03:10 -06:00
|
|
|
struct arc4_ctx {
|
|
|
|
uint8_t S[256];
|
|
|
|
uint8_t i;
|
|
|
|
uint8_t j;
|
|
|
|
};
|
2010-09-26 21:54:31 -06:00
|
|
|
|
2011-01-21 23:01:30 -07:00
|
|
|
void arc4_init(struct arc4_ctx *ctx, const uint8_t *key, size_t keylen);
|
|
|
|
uint8_t arc4_out(struct arc4_ctx *ctx);
|
2010-09-26 21:54:31 -06:00
|
|
|
void arc4_crypt(struct arc4_ctx *ctx,
|
2011-01-21 23:01:30 -07:00
|
|
|
uint8_t *obuf, const uint8_t *ibuf, size_t buflen);
|
|
|
|
void arc4_crypt_buffer(const uint8_t *key, size_t keylen,
|
2010-09-26 21:54:31 -06:00
|
|
|
uint8_t *buf, size_t buflen);
|
|
|
|
#endif
|