summaryrefslogtreecommitdiff
path: root/arcfour.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2004-02-05 17:02:11 +0100
committerNiels Möller <nisse@lysator.liu.se>2004-02-05 17:02:11 +0100
commitf86be52ec2ba31a11b19ba831db56432c9df2155 (patch)
tree29c50e3e9c51099c3082fd54fbe5e55c47d3d9e1 /arcfour.c
parentd27373b5f0bd958862144495bdc5ef452c432fef (diff)
downloadnettle-f86be52ec2ba31a11b19ba831db56432c9df2155.tar.gz
* configure.ac: Use assembler file arcfour-crypt.asm if available.
* arcfour.c (arcfour_crypt): Moved function too... * arcfour-crypt.c (arcfour_crypt): New file. Rev: src/nettle/Makefile.am:1.69 Rev: src/nettle/arcfour-crypt.c:1.1 Rev: src/nettle/arcfour.c:1.5 Rev: src/nettle/configure.ac:1.29
Diffstat (limited to 'arcfour.c')
-rw-r--r--arcfour.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/arcfour.c b/arcfour.c
index d5424348..da039428 100644
--- a/arcfour.c
+++ b/arcfour.c
@@ -56,27 +56,6 @@ arcfour_set_key(struct arcfour_ctx *ctx,
ctx->i = ctx->j = 0;
}
-
-void
-arcfour_crypt(struct arcfour_ctx *ctx,
- unsigned length, uint8_t *dst,
- const uint8_t *src)
-{
- register uint8_t i, j;
- register int si, sj;
-
- i = ctx->i; j = ctx->j;
- while(length--)
- {
- i++; i &= 0xff;
- si = ctx->S[i];
- j += si; j &= 0xff;
- sj = ctx->S[i] = ctx->S[j];
- *dst++ = *src++ ^ ctx->S[ (si + sj) & 0xff ];
- }
- ctx->i = i; ctx->j = j;
-}
-
void
arcfour_stream(struct arcfour_ctx *ctx,
unsigned length, uint8_t *dst)