Change type of various DES function arguments from des_cblock
[openssl.git] / crypto / evp / e_ecb_d.c
index 3496ca5180dbeba641aa9449db53eae64479c334..5fb4e64b1cadbc9a7811fdfba7462bf6581e1b55 100644 (file)
@@ -87,20 +87,32 @@ EVP_CIPHER *EVP_des_ecb(void)
 static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
             unsigned char *iv, int enc)
        {
-       if (key != NULL)
-               des_set_key(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(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(&(in[i]),&(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