Change functions to ANSI C.
[openssl.git] / crypto / evp / e_ecb_r2.c
index 66d25f6b5c36c62c09b2ecfa98ec55157eac04e4..f052b181d089c53334e0a4f768d6795780639346 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/evp/e_ecb_r2.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
@@ -79,29 +79,28 @@ static EVP_CIPHER r2_ecb_cipher=
        8,EVP_RC2_KEY_SIZE,0,
        rc2_ecb_init_key,
        rc2_ecb_cipher,
+       NULL,
+       sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
+               sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
+       NULL,
+       NULL,
        };
 
-EVP_CIPHER *EVP_rc2_ecb()
+EVP_CIPHER *EVP_rc2_ecb(void)
        {
        return(&r2_ecb_cipher);
        }
        
-static void rc2_ecb_init_key(ctx,key,iv,enc)
-EVP_CIPHER_CTX *ctx;
-unsigned char *key;
-unsigned char *iv;
-int enc;
+static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
+            unsigned char *iv, int enc)
        {
        if (key != NULL)
-               RC2_set_key(&(ctx->c.rc2_ecb.ks),EVP_RC2_KEY_SIZE,key,
-                       EVP_RC2_KEY_SIZE*8);
+               RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
+                       key,EVP_CIPHER_CTX_key_length(ctx)*8);
        }
 
-static void rc2_ecb_cipher(ctx,out,in,inl)
-EVP_CIPHER_CTX *ctx;
-unsigned char *out;
-unsigned char *in;
-unsigned int inl;
+static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+            unsigned char *in, unsigned int inl)
        {
        unsigned int i;
 
@@ -111,7 +110,7 @@ unsigned int inl;
                {
                RC2_ecb_encrypt(
                        &(in[i]),&(out[i]),
-                       &(ctx->c.rc2_ecb.ks),ctx->encrypt);
+                       &(ctx->c.rc2_ks),ctx->encrypt);
                }
        }