|
@@ -39,9 +39,9 @@
|
|
#include "rc4/rc4.h"
|
|
#include "rc4/rc4.h"
|
|
|
|
|
|
static __inline void
|
|
static __inline void
|
|
-swap_bytes(u_char *a, u_char *b)
|
|
|
|
|
|
+swap_bytes(uint8_t *a, uint8_t *b)
|
|
{
|
|
{
|
|
- u_char temp;
|
|
|
|
|
|
+ uint8_t temp;
|
|
|
|
|
|
temp = *a;
|
|
temp = *a;
|
|
*a = *b;
|
|
*a = *b;
|
|
@@ -53,14 +53,14 @@ swap_bytes(u_char *a, u_char *b)
|
|
* which can have arbitrary length.
|
|
* which can have arbitrary length.
|
|
*/
|
|
*/
|
|
void
|
|
void
|
|
-rc4_init(struct rc4_state *const state, const u_char *key, int keylen)
|
|
|
|
|
|
+rc4_init(struct rc4_state *const state, const uint8_t *key, int keylen)
|
|
{
|
|
{
|
|
- u_char j;
|
|
|
|
|
|
+ uint8_t j;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
/* Initialize state with identity permutation */
|
|
/* Initialize state with identity permutation */
|
|
for (i = 0; i < 256; i++)
|
|
for (i = 0; i < 256; i++)
|
|
- state->perm[i] = (u_char)i;
|
|
|
|
|
|
+ state->perm[i] = (uint8_t)i;
|
|
state->index1 = 0;
|
|
state->index1 = 0;
|
|
state->index2 = 0;
|
|
state->index2 = 0;
|
|
|
|
|
|
@@ -80,10 +80,10 @@ rc4_init(struct rc4_state *const state, const u_char *key, int keylen)
|
|
*/
|
|
*/
|
|
void
|
|
void
|
|
rc4_crypt(struct rc4_state *const state,
|
|
rc4_crypt(struct rc4_state *const state,
|
|
- const u_char *inbuf, u_char *outbuf, int buflen)
|
|
|
|
|
|
+ const uint8_t *inbuf, uint8_t *outbuf, int buflen)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
- u_char j;
|
|
|
|
|
|
+ uint8_t j;
|
|
|
|
|
|
for (i = 0; i < buflen; i++)
|
|
for (i = 0; i < buflen; i++)
|
|
{
|
|
{
|