summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_rc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_rc4.c')
-rw-r--r--src/lib/libcrypto/evp/e_rc4.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c
index 7e9790a94c..c7e58a75cc 100644
--- a/src/lib/libcrypto/evp/e_rc4.c
+++ b/src/lib/libcrypto/evp/e_rc4.c
@@ -60,19 +60,13 @@
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include "cryptlib.h" 62#include "cryptlib.h"
63#include "evp.h" 63#include <openssl/evp.h>
64#include "objects.h" 64#include <openssl/objects.h>
65 65
66#ifndef NOPROTO
67static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
70 unsigned char *in, unsigned int inl); 69 unsigned char *in, unsigned int inl);
71#else
72static void rc4_init_key();
73static void rc4_cipher();
74#endif
75
76static EVP_CIPHER r4_cipher= 70static EVP_CIPHER r4_cipher=
77 { 71 {
78 NID_rc4, 72 NID_rc4,
@@ -94,21 +88,18 @@ static EVP_CIPHER r4_40_cipher=
94 rc4_cipher, 88 rc4_cipher,
95 }; 89 };
96 90
97EVP_CIPHER *EVP_rc4() 91EVP_CIPHER *EVP_rc4(void)
98 { 92 {
99 return(&r4_cipher); 93 return(&r4_cipher);
100 } 94 }
101 95
102EVP_CIPHER *EVP_rc4_40() 96EVP_CIPHER *EVP_rc4_40(void)
103 { 97 {
104 return(&r4_40_cipher); 98 return(&r4_40_cipher);
105 } 99 }
106 100
107static void rc4_init_key(ctx,key,iv,enc) 101static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
108EVP_CIPHER_CTX *ctx; 102 unsigned char *iv, int enc)
109unsigned char *key;
110unsigned char *iv;
111int enc;
112 { 103 {
113 if (key != NULL) 104 if (key != NULL)
114 memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); 105 memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx));
@@ -116,11 +107,8 @@ int enc;
116 ctx->c.rc4.key); 107 ctx->c.rc4.key);
117 } 108 }
118 109
119static void rc4_cipher(ctx,out,in,inl) 110static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
120EVP_CIPHER_CTX *ctx; 111 unsigned char *in, unsigned int inl)
121unsigned char *out;
122unsigned char *in;
123unsigned int inl;
124 { 112 {
125 RC4(&(ctx->c.rc4.ks),inl,in,out); 113 RC4(&(ctx->c.rc4.ks),inl,in,out);
126 } 114 }