summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/ecb_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/ecb_enc.c')
-rw-r--r--src/lib/libcrypto/des/ecb_enc.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/lib/libcrypto/des/ecb_enc.c b/src/lib/libcrypto/des/ecb_enc.c
index acf23fdd00..b261a8aad9 100644
--- a/src/lib/libcrypto/des/ecb_enc.c
+++ b/src/lib/libcrypto/des/ecb_enc.c
@@ -58,20 +58,20 @@
58 58
59#include "des_locl.h" 59#include "des_locl.h"
60#include "spr.h" 60#include "spr.h"
61#include <openssl/opensslv.h>
61 62
62char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; 63OPENSSL_GLOBAL const char *libdes_version="libdes" OPENSSL_VERSION_PTEXT;
63char *DES_version="DES part of SSLeay 0.9.0b 29-Jun-1998"; 64OPENSSL_GLOBAL const char *DES_version="DES" OPENSSL_VERSION_PTEXT;
64 65
65char *des_options() 66const char *des_options(void)
66 { 67 {
67 static int init=1; 68 static int init=1;
68 static char buf[32]; 69 static char buf[32];
69 70
70 if (init) 71 if (init)
71 { 72 {
72 char *ptr,*unroll,*risc,*size; 73 const char *ptr,*unroll,*risc,*size;
73 74
74 init=0;
75#ifdef DES_PTR 75#ifdef DES_PTR
76 ptr="ptr"; 76 ptr="ptr";
77#else 77#else
@@ -97,23 +97,21 @@ char *des_options()
97 else 97 else
98 size="long"; 98 size="long";
99 sprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size); 99 sprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size);
100 init=0;
100 } 101 }
101 return(buf); 102 return(buf);
102 } 103 }
103 104
104 105
105void des_ecb_encrypt(input, output, ks, enc) 106void des_ecb_encrypt(const_des_cblock *input, des_cblock *output,
106des_cblock (*input); 107 des_key_schedule ks,
107des_cblock (*output); 108 int enc)
108des_key_schedule ks;
109int enc;
110 { 109 {
111 register DES_LONG l; 110 register DES_LONG l;
112 register unsigned char *in,*out;
113 DES_LONG ll[2]; 111 DES_LONG ll[2];
112 const unsigned char *in = &(*input)[0];
113 unsigned char *out = &(*output)[0];
114 114
115 in=(unsigned char *)input;
116 out=(unsigned char *)output;
117 c2l(in,l); ll[0]=l; 115 c2l(in,l); ll[0]=l;
118 c2l(in,l); ll[1]=l; 116 c2l(in,l); ll[1]=l;
119 des_encrypt(ll,ks,enc); 117 des_encrypt(ll,ks,enc);