Ignore Makefile.save
[openssl.git] / crypto / evp / e_cbc_r2.c
index 9175e53550891d6d0448d3d6251e54039f83bf0d..d6a568f4b332d6ea85455bce54706d52086b63c3 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "evp.h"
-#include "objects.h"
+#include <openssl/evp.h>
+#include <openssl/objects.h>
 
-#ifndef NOPROTO
 static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
        unsigned char *iv,int enc);
 static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
        unsigned char *in, unsigned int inl);
-static int rc2_meth_to_magic(EVP_CIPHER *e);
+static int rc2_meth_to_magic(const EVP_CIPHER *e);
 static EVP_CIPHER *rc2_magic_to_meth(int i);
 static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
 static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
 
-#else
-
-static void rc2_cbc_init_key();
-static void rc2_cbc_cipher();
-static int rc2_meth_to_magic();
-static EVP_CIPHER *rc2_magic_to_meth();
-static int rc2_set_asn1_type_and_iv();
-static int rc2_get_asn1_type_and_iv();
-#endif
-
 #define RC2_40_MAGIC   0xa0
 #define RC2_64_MAGIC   0x78
 #define RC2_128_MAGIC  0x3a
@@ -126,26 +115,23 @@ static EVP_CIPHER r2_40_cbc_cipher=
        rc2_get_asn1_type_and_iv,
        };
 
-EVP_CIPHER *EVP_rc2_cbc()
+EVP_CIPHER *EVP_rc2_cbc(void)
        {
        return(&r2_cbc_cipher);
        }
 
-EVP_CIPHER *EVP_rc2_64_cbc()
+EVP_CIPHER *EVP_rc2_64_cbc(void)
        {
        return(&r2_64_cbc_cipher);
        }
 
-EVP_CIPHER *EVP_rc2_40_cbc()
+EVP_CIPHER *EVP_rc2_40_cbc(void)
        {
        return(&r2_40_cbc_cipher);
        }
        
-static void rc2_cbc_init_key(ctx,key,iv,enc)
-EVP_CIPHER_CTX *ctx;
-unsigned char *key;
-unsigned char *iv;
-int enc;
+static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
+            unsigned char *iv, int enc)
        {
        if (iv != NULL)
                memcpy(&(ctx->oiv[0]),iv,8);
@@ -155,11 +141,8 @@ int enc;
                        key,EVP_CIPHER_CTX_key_length(ctx)*8);
        }
 
-static void rc2_cbc_cipher(ctx,out,in,inl)
-EVP_CIPHER_CTX *ctx;
-unsigned char *out;
-unsigned char *in;
-unsigned int inl;
+static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+            unsigned char *in, unsigned int inl)
        {
        RC2_cbc_encrypt(
                in,out,(long)inl,
@@ -167,8 +150,7 @@ unsigned int inl;
                ctx->encrypt);
        }
 
-static int rc2_meth_to_magic(e)
-EVP_CIPHER *e;
+static int rc2_meth_to_magic(const EVP_CIPHER *e)
        {
        int i;
 
@@ -179,8 +161,7 @@ EVP_CIPHER *e;
        else return(0);
        }
 
-static EVP_CIPHER *rc2_magic_to_meth(i)
-int i;
+static EVP_CIPHER *rc2_magic_to_meth(int i)
        {
        if      (i == RC2_128_MAGIC) return(EVP_rc2_cbc());
        else if (i == RC2_64_MAGIC)  return(EVP_rc2_64_cbc());
@@ -192,9 +173,7 @@ int i;
                }
        }
 
-int rc2_get_asn1_type_and_iv(c,type)
-EVP_CIPHER_CTX *c;
-ASN1_TYPE *type;
+static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
        {
        long num=0;
        int i=0,l;
@@ -220,9 +199,7 @@ ASN1_TYPE *type;
        return(i);
        }
 
-static int rc2_set_asn1_type_and_iv(c,type)
-EVP_CIPHER_CTX *c;
-ASN1_TYPE *type;
+static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
        {
        long num;
        int i=0,j;