/* $MirOS: src/sys/crypto/arc4.c,v 1.3 2010/09/21 21:24:22 tg Exp $ */ /* rewritten; no code left, only the API */ #include #include void rc4_keysetup(struct rc4_ctx *ctx, const u_char *key, u_int32_t klen) { arcfour_init(ctx); arcfour_ksa(ctx, key, klen); } void rc4_crypt(struct rc4_ctx *ctx, const u_char *src, u_char *dst, u_int32_t len) { while (len--) *dst++ = *src++ ^ arcfour_byte(ctx); }