Problems with 64-bit long.
[openssl.git] / crypto / bf / bf_ecb.c
index 7840352dc36a5cb6b92cdbdcc9bd7b289aaa86f2..7abe20979d49dd212c8ca7b6e3e69b759d9c0241 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/bf/bf_ecb.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
 
 #include "blowfish.h"
 #include "bf_locl.h"
+#include "opensslv.h"
 
 /* Blowfish as implemented from 'Blowfish: Springer-Verlag paper'
  * (From LECTURE NOTES IN COIMPUTER SCIENCE 809, FAST SOFTWARE ENCRYPTION,
  * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993)
  */
 
-char *BF_version="BlowFish part of SSLeay 0.8.1b 29-Jun-1998";
+const char *BF_version="BlowFish" OPENSSL_VERSION_PTEXT;
 
-char *BF_options()
+const char *BF_options(void)
        {
 #ifdef BF_PTR
        return("blowfish(ptr)");
@@ -77,17 +78,17 @@ char *BF_options()
 #endif
        }
 
-void BF_ecb_encrypt(in, out, ks, encrypt)
-unsigned char *in;
-unsigned char *out;
-BF_KEY *ks;
-int encrypt;
+void BF_ecb_encrypt(unsigned char *in, unsigned char *out, BF_KEY *ks,
+            int encrypt)
        {
        BF_LONG l,d[2];
 
        n2l(in,l); d[0]=l;
        n2l(in,l); d[1]=l;
-       BF_encrypt(d,ks,encrypt);
+       if (encrypt)
+               BF_encrypt(d,ks);
+       else
+               BF_decrypt(d,ks);
        l=d[0]; l2n(l,out);
        l=d[1]; l2n(l,out);
        l=d[0]=d[1]=0;