From de8f24ea083384bb66b32ec105dc4743c5663cdf Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 29 Sep 1999 04:37:45 +0000 Subject: OpenSSL 0.9.4 merge --- src/lib/libcrypto/evp/e_ecb_d.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/lib/libcrypto/evp/e_ecb_d.c') diff --git a/src/lib/libcrypto/evp/e_ecb_d.c b/src/lib/libcrypto/evp/e_ecb_d.c index 7a409d6459..5fb4e64b1c 100644 --- a/src/lib/libcrypto/evp/e_ecb_d.c +++ b/src/lib/libcrypto/evp/e_ecb_d.c @@ -56,21 +56,16 @@ * [including the GNU Public Licence.] */ +#ifndef NO_DES #include #include "cryptlib.h" -#include "evp.h" -#include "objects.h" +#include +#include -#ifndef NOPROTO static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); -#else -static void des_ecb_init_key(); -static void des_ecb_cipher(); -#endif - static EVP_CIPHER d_ecb_cipher= { NID_des_ecb, @@ -84,35 +79,40 @@ static EVP_CIPHER d_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_des_ecb() +EVP_CIPHER *EVP_des_ecb(void) { return(&d_ecb_cipher); } -static void des_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { - if (key != NULL) - des_set_key((des_cblock *)key,ctx->c.des_ks); + des_cblock *deskey = (des_cblock *)key; + + if (deskey != NULL) + des_set_key(deskey,ctx->c.des_ks); } -static void des_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; + des_cblock *output /* = (des_cblock *)out */; + des_cblock *input /* = (des_cblock *)in */; if (inl < 8) return; inl-=8; for (i=0; i<=inl; i+=8) { - des_ecb_encrypt( - (des_cblock *)&(in[i]),(des_cblock *)&(out[i]), - ctx->c.des_ks,ctx->encrypt); + /* Either this ... */ + output = (des_cblock *)(out + i); + input = (des_cblock *)(in + i); + + des_ecb_encrypt(input,output,ctx->c.des_ks,ctx->encrypt); + + /* ... or this. */ + /* output++; */ + /* input++; */ } } +#endif -- cgit v1.2.3-55-g6feb