Fix escaping code for string printing. If *any* escaping is enabled we
[oweals/openssl.git] / crypto / des / ecb_enc.c
index fac4b41b198f705f47b6aa43299557932d0f7d0a..75ae6cf8bb6c447a85432f5d8595da52b053da77 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/des/ecb_enc.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 "des_locl.h"
 #include "spr.h"
 
-char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay";
-char *DES_version="DES part of SSLeay 0.8.1b 29-Jun-1998";
-
-char *des_options()
-       {
-       static int init=1;
-       static char buf[32];
-
-       if (init)
-               {
-               char *ptr,*unroll,*risc,*size;
-
-               init=0;
-#ifdef DES_PTR
-               ptr="ptr";
-#else
-               ptr="idx";
-#endif
-#if defined(DES_RISC1) || defined(DES_RISC2)
-#ifdef DES_RISC1
-               risc="risc1";
-#endif
-#ifdef DES_RISC2
-               risc="risc2";
-#endif
-#else
-               risc="cisc";
-#endif
-#ifdef DES_UNROLL
-               unroll="16";
-#else
-               unroll="4";
-#endif
-               if (sizeof(DES_LONG) != sizeof(long))
-                       size="int";
-               else
-                       size="long";
-               sprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size);
-               }
-       return(buf);
-       }
-               
-
-void des_ecb_encrypt(input, output, ks, enc)
-des_cblock (*input);
-des_cblock (*output);
-des_key_schedule ks;
-int enc;
+void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
+                    DES_key_schedule *ks, int enc)
        {
        register DES_LONG l;
-       register unsigned char *in,*out;
        DES_LONG ll[2];
+       const unsigned char *in = &(*input)[0];
+       unsigned char *out = &(*output)[0];
 
-       in=(unsigned char *)input;
-       out=(unsigned char *)output;
        c2l(in,l); ll[0]=l;
        c2l(in,l); ll[1]=l;
-       des_encrypt(ll,ks,enc);
+       DES_encrypt1(ll,ks,enc);
        l=ll[0]; l2c(l,out);
        l=ll[1]; l2c(l,out);
        l=ll[0]=ll[1]=0;
        }
-