/* arcfour.c --- The arcfour stream cipher
- * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 Free Software
+ * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006, 2009, 2010 Free Software
* Foundation, Inc.
*
* This file is free software; you can redistribute it and/or modify
void
arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
- size_t length)
+ size_t length)
{
uint8_t i = context->idx_i;
uint8_t j = context->idx_j;
sbox[i] = sbox[j];
sbox[j] = t;
*outbuf++ = (*inbuf++
- ^ sbox[(0U + sbox[i] + sbox[j]) % ARCFOUR_SBOX_SIZE]);
+ ^ sbox[(0U + sbox[i] + sbox[j]) % ARCFOUR_SBOX_SIZE]);
}
context->idx_i = i;
sbox[i] = sbox[j];
sbox[j] = t;
if (++k == keylen)
- k = 0;
+ k = 0;
}
}