Lines Matching refs:ctx
24 u_int8_t t = ctx->state[x]; \
25 ctx->state[x] = ctx->state[y]; \
26 ctx->state[y] = t; \
30 rc4_keysetup(struct rc4_ctx *ctx, u_char *key, u_int32_t klen)
37 ctx->state[i] = i;
39 y = (key[x] + ctx->state[i] + y) & (RC4STATE - 1);
43 ctx->x = ctx->y = 0;
47 rc4_crypt(struct rc4_ctx *ctx, u_char *src, u_char *dst,
53 ctx->x = (ctx->x + 1) & (RC4STATE - 1);
54 ctx->y = (ctx->state[ctx->x] + ctx->y) & (RC4STATE - 1);
55 RC4SWAP(ctx->x, ctx->y);
56 dst[i] = src[i] ^ ctx->state[
57 (ctx->state[ctx->x] + ctx->state[ctx->y]) & (RC4STATE - 1)];
62 rc4_getbytes(struct rc4_ctx *ctx, u_char *dst, u_int32_t len)
67 ctx->x = (ctx->x + 1) & (RC4STATE - 1);
68 ctx->y = (ctx->state[ctx->x] + ctx->y) & (RC4STATE - 1);
69 RC4SWAP(ctx->x, ctx->y);
70 dst[i] = ctx->state[
71 (ctx->state[ctx->x] + ctx->state[ctx->y]) & (RC4STATE - 1)];
76 rc4_skip(struct rc4_ctx *ctx, u_int32_t len)
79 ctx->x = (ctx->x + 1) & (RC4STATE - 1);
80 ctx->y = (ctx->state[ctx->x] + ctx->y) & (RC4STATE - 1);
81 RC4SWAP(ctx->x, ctx->y);