1*0Sstevel@tonic-gate /* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
4*0Sstevel@tonic-gate *
5*0Sstevel@tonic-gate * The function names in here are deprecated and are only present to
6*0Sstevel@tonic-gate * provide an interface compatible with libdes. OpenSSL now provides
7*0Sstevel@tonic-gate * functions where "des_" has been replaced with "DES_" in the names,
8*0Sstevel@tonic-gate * to make it possible to make incompatible changes that are needed
9*0Sstevel@tonic-gate * for C type security and other stuff.
10*0Sstevel@tonic-gate *
11*0Sstevel@tonic-gate * Please consider starting to use the DES_ functions rather than the
12*0Sstevel@tonic-gate * des_ ones. The des_ functions will dissapear completely before
13*0Sstevel@tonic-gate * OpenSSL 1.0!
14*0Sstevel@tonic-gate *
15*0Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
16*0Sstevel@tonic-gate */
17*0Sstevel@tonic-gate
18*0Sstevel@tonic-gate /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
19*0Sstevel@tonic-gate * project 2001.
20*0Sstevel@tonic-gate */
21*0Sstevel@tonic-gate /* ====================================================================
22*0Sstevel@tonic-gate * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
23*0Sstevel@tonic-gate *
24*0Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without
25*0Sstevel@tonic-gate * modification, are permitted provided that the following conditions
26*0Sstevel@tonic-gate * are met:
27*0Sstevel@tonic-gate *
28*0Sstevel@tonic-gate * 1. Redistributions of source code must retain the above copyright
29*0Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer.
30*0Sstevel@tonic-gate *
31*0Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright
32*0Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in
33*0Sstevel@tonic-gate * the documentation and/or other materials provided with the
34*0Sstevel@tonic-gate * distribution.
35*0Sstevel@tonic-gate *
36*0Sstevel@tonic-gate * 3. All advertising materials mentioning features or use of this
37*0Sstevel@tonic-gate * software must display the following acknowledgment:
38*0Sstevel@tonic-gate * "This product includes software developed by the OpenSSL Project
39*0Sstevel@tonic-gate * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40*0Sstevel@tonic-gate *
41*0Sstevel@tonic-gate * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42*0Sstevel@tonic-gate * endorse or promote products derived from this software without
43*0Sstevel@tonic-gate * prior written permission. For written permission, please contact
44*0Sstevel@tonic-gate * openssl-core@openssl.org.
45*0Sstevel@tonic-gate *
46*0Sstevel@tonic-gate * 5. Products derived from this software may not be called "OpenSSL"
47*0Sstevel@tonic-gate * nor may "OpenSSL" appear in their names without prior written
48*0Sstevel@tonic-gate * permission of the OpenSSL Project.
49*0Sstevel@tonic-gate *
50*0Sstevel@tonic-gate * 6. Redistributions of any form whatsoever must retain the following
51*0Sstevel@tonic-gate * acknowledgment:
52*0Sstevel@tonic-gate * "This product includes software developed by the OpenSSL Project
53*0Sstevel@tonic-gate * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54*0Sstevel@tonic-gate *
55*0Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56*0Sstevel@tonic-gate * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57*0Sstevel@tonic-gate * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58*0Sstevel@tonic-gate * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59*0Sstevel@tonic-gate * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60*0Sstevel@tonic-gate * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61*0Sstevel@tonic-gate * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62*0Sstevel@tonic-gate * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63*0Sstevel@tonic-gate * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64*0Sstevel@tonic-gate * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65*0Sstevel@tonic-gate * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66*0Sstevel@tonic-gate * OF THE POSSIBILITY OF SUCH DAMAGE.
67*0Sstevel@tonic-gate * ====================================================================
68*0Sstevel@tonic-gate *
69*0Sstevel@tonic-gate * This product includes cryptographic software written by Eric Young
70*0Sstevel@tonic-gate * (eay@cryptsoft.com). This product includes software written by Tim
71*0Sstevel@tonic-gate * Hudson (tjh@cryptsoft.com).
72*0Sstevel@tonic-gate *
73*0Sstevel@tonic-gate */
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gate #define OPENSSL_DES_LIBDES_COMPATIBILITY
76*0Sstevel@tonic-gate #include <openssl/des.h>
77*0Sstevel@tonic-gate #include <openssl/rand.h>
78*0Sstevel@tonic-gate
_ossl_old_des_options(void)79*0Sstevel@tonic-gate const char *_ossl_old_des_options(void)
80*0Sstevel@tonic-gate {
81*0Sstevel@tonic-gate return DES_options();
82*0Sstevel@tonic-gate }
_ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,des_key_schedule ks1,des_key_schedule ks2,des_key_schedule ks3,int enc)83*0Sstevel@tonic-gate void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
84*0Sstevel@tonic-gate des_key_schedule ks1,des_key_schedule ks2,
85*0Sstevel@tonic-gate des_key_schedule ks3, int enc)
86*0Sstevel@tonic-gate {
87*0Sstevel@tonic-gate DES_ecb3_encrypt((const_DES_cblock *)input, output,
88*0Sstevel@tonic-gate (DES_key_schedule *)ks1, (DES_key_schedule *)ks2,
89*0Sstevel@tonic-gate (DES_key_schedule *)ks3, enc);
90*0Sstevel@tonic-gate }
_ossl_old_des_cbc_cksum(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec)91*0Sstevel@tonic-gate DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
92*0Sstevel@tonic-gate long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec)
93*0Sstevel@tonic-gate {
94*0Sstevel@tonic-gate return DES_cbc_cksum((unsigned char *)input, output, length,
95*0Sstevel@tonic-gate (DES_key_schedule *)schedule, ivec);
96*0Sstevel@tonic-gate }
_ossl_old_des_cbc_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,int enc)97*0Sstevel@tonic-gate void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
98*0Sstevel@tonic-gate des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc)
99*0Sstevel@tonic-gate {
100*0Sstevel@tonic-gate DES_cbc_encrypt((unsigned char *)input, (unsigned char *)output,
101*0Sstevel@tonic-gate length, (DES_key_schedule *)schedule, ivec, enc);
102*0Sstevel@tonic-gate }
_ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,int enc)103*0Sstevel@tonic-gate void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
104*0Sstevel@tonic-gate des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc)
105*0Sstevel@tonic-gate {
106*0Sstevel@tonic-gate DES_ncbc_encrypt((unsigned char *)input, (unsigned char *)output,
107*0Sstevel@tonic-gate length, (DES_key_schedule *)schedule, ivec, enc);
108*0Sstevel@tonic-gate }
_ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,_ossl_old_des_cblock * inw,_ossl_old_des_cblock * outw,int enc)109*0Sstevel@tonic-gate void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
110*0Sstevel@tonic-gate des_key_schedule schedule,_ossl_old_des_cblock *ivec,
111*0Sstevel@tonic-gate _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc)
112*0Sstevel@tonic-gate {
113*0Sstevel@tonic-gate DES_xcbc_encrypt((unsigned char *)input, (unsigned char *)output,
114*0Sstevel@tonic-gate length, (DES_key_schedule *)schedule, ivec, inw, outw, enc);
115*0Sstevel@tonic-gate }
_ossl_old_des_cfb_encrypt(unsigned char * in,unsigned char * out,int numbits,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,int enc)116*0Sstevel@tonic-gate void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
117*0Sstevel@tonic-gate long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc)
118*0Sstevel@tonic-gate {
119*0Sstevel@tonic-gate DES_cfb_encrypt(in, out, numbits, length,
120*0Sstevel@tonic-gate (DES_key_schedule *)schedule, ivec, enc);
121*0Sstevel@tonic-gate }
_ossl_old_des_ecb_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,des_key_schedule ks,int enc)122*0Sstevel@tonic-gate void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
123*0Sstevel@tonic-gate des_key_schedule ks,int enc)
124*0Sstevel@tonic-gate {
125*0Sstevel@tonic-gate DES_ecb_encrypt(input, output, (DES_key_schedule *)ks, enc);
126*0Sstevel@tonic-gate }
_ossl_old_des_encrypt(DES_LONG * data,des_key_schedule ks,int enc)127*0Sstevel@tonic-gate void _ossl_old_des_encrypt(DES_LONG *data,des_key_schedule ks, int enc)
128*0Sstevel@tonic-gate {
129*0Sstevel@tonic-gate DES_encrypt1(data, (DES_key_schedule *)ks, enc);
130*0Sstevel@tonic-gate }
_ossl_old_des_encrypt2(DES_LONG * data,des_key_schedule ks,int enc)131*0Sstevel@tonic-gate void _ossl_old_des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc)
132*0Sstevel@tonic-gate {
133*0Sstevel@tonic-gate DES_encrypt2(data, (DES_key_schedule *)ks, enc);
134*0Sstevel@tonic-gate }
_ossl_old_des_encrypt3(DES_LONG * data,des_key_schedule ks1,des_key_schedule ks2,des_key_schedule ks3)135*0Sstevel@tonic-gate void _ossl_old_des_encrypt3(DES_LONG *data, des_key_schedule ks1,
136*0Sstevel@tonic-gate des_key_schedule ks2, des_key_schedule ks3)
137*0Sstevel@tonic-gate {
138*0Sstevel@tonic-gate DES_encrypt3(data, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2,
139*0Sstevel@tonic-gate (DES_key_schedule *)ks3);
140*0Sstevel@tonic-gate }
_ossl_old_des_decrypt3(DES_LONG * data,des_key_schedule ks1,des_key_schedule ks2,des_key_schedule ks3)141*0Sstevel@tonic-gate void _ossl_old_des_decrypt3(DES_LONG *data, des_key_schedule ks1,
142*0Sstevel@tonic-gate des_key_schedule ks2, des_key_schedule ks3)
143*0Sstevel@tonic-gate {
144*0Sstevel@tonic-gate DES_decrypt3(data, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2,
145*0Sstevel@tonic-gate (DES_key_schedule *)ks3);
146*0Sstevel@tonic-gate }
_ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,des_key_schedule ks1,des_key_schedule ks2,des_key_schedule ks3,_ossl_old_des_cblock * ivec,int enc)147*0Sstevel@tonic-gate void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
148*0Sstevel@tonic-gate long length, des_key_schedule ks1, des_key_schedule ks2,
149*0Sstevel@tonic-gate des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc)
150*0Sstevel@tonic-gate {
151*0Sstevel@tonic-gate DES_ede3_cbc_encrypt((unsigned char *)input, (unsigned char *)output,
152*0Sstevel@tonic-gate length, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2,
153*0Sstevel@tonic-gate (DES_key_schedule *)ks3, ivec, enc);
154*0Sstevel@tonic-gate }
_ossl_old_des_ede3_cfb64_encrypt(unsigned char * in,unsigned char * out,long length,des_key_schedule ks1,des_key_schedule ks2,des_key_schedule ks3,_ossl_old_des_cblock * ivec,int * num,int enc)155*0Sstevel@tonic-gate void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
156*0Sstevel@tonic-gate long length, des_key_schedule ks1, des_key_schedule ks2,
157*0Sstevel@tonic-gate des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc)
158*0Sstevel@tonic-gate {
159*0Sstevel@tonic-gate DES_ede3_cfb64_encrypt(in, out, length,
160*0Sstevel@tonic-gate (DES_key_schedule *)ks1, (DES_key_schedule *)ks2,
161*0Sstevel@tonic-gate (DES_key_schedule *)ks3, ivec, num, enc);
162*0Sstevel@tonic-gate }
_ossl_old_des_ede3_ofb64_encrypt(unsigned char * in,unsigned char * out,long length,des_key_schedule ks1,des_key_schedule ks2,des_key_schedule ks3,_ossl_old_des_cblock * ivec,int * num)163*0Sstevel@tonic-gate void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
164*0Sstevel@tonic-gate long length, des_key_schedule ks1, des_key_schedule ks2,
165*0Sstevel@tonic-gate des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num)
166*0Sstevel@tonic-gate {
167*0Sstevel@tonic-gate DES_ede3_ofb64_encrypt(in, out, length,
168*0Sstevel@tonic-gate (DES_key_schedule *)ks1, (DES_key_schedule *)ks2,
169*0Sstevel@tonic-gate (DES_key_schedule *)ks3, ivec, num);
170*0Sstevel@tonic-gate }
171*0Sstevel@tonic-gate
_ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (* des_key),_ossl_old_des_cblock (* in_white),_ossl_old_des_cblock (* out_white))172*0Sstevel@tonic-gate void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
173*0Sstevel@tonic-gate _ossl_old_des_cblock (*out_white))
174*0Sstevel@tonic-gate {
175*0Sstevel@tonic-gate DES_xwhite_in2out(des_key, in_white, out_white);
176*0Sstevel@tonic-gate }
177*0Sstevel@tonic-gate
_ossl_old_des_enc_read(int fd,char * buf,int len,des_key_schedule sched,_ossl_old_des_cblock * iv)178*0Sstevel@tonic-gate int _ossl_old_des_enc_read(int fd,char *buf,int len,des_key_schedule sched,
179*0Sstevel@tonic-gate _ossl_old_des_cblock *iv)
180*0Sstevel@tonic-gate {
181*0Sstevel@tonic-gate return DES_enc_read(fd, buf, len, (DES_key_schedule *)sched, iv);
182*0Sstevel@tonic-gate }
_ossl_old_des_enc_write(int fd,char * buf,int len,des_key_schedule sched,_ossl_old_des_cblock * iv)183*0Sstevel@tonic-gate int _ossl_old_des_enc_write(int fd,char *buf,int len,des_key_schedule sched,
184*0Sstevel@tonic-gate _ossl_old_des_cblock *iv)
185*0Sstevel@tonic-gate {
186*0Sstevel@tonic-gate return DES_enc_write(fd, buf, len, (DES_key_schedule *)sched, iv);
187*0Sstevel@tonic-gate }
_ossl_old_des_fcrypt(const char * buf,const char * salt,char * ret)188*0Sstevel@tonic-gate char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret)
189*0Sstevel@tonic-gate {
190*0Sstevel@tonic-gate return DES_fcrypt(buf, salt, ret);
191*0Sstevel@tonic-gate }
_ossl_old_des_crypt(const char * buf,const char * salt)192*0Sstevel@tonic-gate char *_ossl_old_des_crypt(const char *buf,const char *salt)
193*0Sstevel@tonic-gate {
194*0Sstevel@tonic-gate return DES_crypt(buf, salt);
195*0Sstevel@tonic-gate }
_ossl_old_crypt(const char * buf,const char * salt)196*0Sstevel@tonic-gate char *_ossl_old_crypt(const char *buf,const char *salt)
197*0Sstevel@tonic-gate {
198*0Sstevel@tonic-gate return DES_crypt(buf, salt);
199*0Sstevel@tonic-gate }
_ossl_old_des_ofb_encrypt(unsigned char * in,unsigned char * out,int numbits,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec)200*0Sstevel@tonic-gate void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
201*0Sstevel@tonic-gate int numbits,long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec)
202*0Sstevel@tonic-gate {
203*0Sstevel@tonic-gate DES_ofb_encrypt(in, out, numbits, length, (DES_key_schedule *)schedule,
204*0Sstevel@tonic-gate ivec);
205*0Sstevel@tonic-gate }
_ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,int enc)206*0Sstevel@tonic-gate void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
207*0Sstevel@tonic-gate des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc)
208*0Sstevel@tonic-gate {
209*0Sstevel@tonic-gate DES_pcbc_encrypt((unsigned char *)input, (unsigned char *)output,
210*0Sstevel@tonic-gate length, (DES_key_schedule *)schedule, ivec, enc);
211*0Sstevel@tonic-gate }
_ossl_old_des_quad_cksum(_ossl_old_des_cblock * input,_ossl_old_des_cblock * output,long length,int out_count,_ossl_old_des_cblock * seed)212*0Sstevel@tonic-gate DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
213*0Sstevel@tonic-gate long length,int out_count,_ossl_old_des_cblock *seed)
214*0Sstevel@tonic-gate {
215*0Sstevel@tonic-gate return DES_quad_cksum((unsigned char *)input, output, length,
216*0Sstevel@tonic-gate out_count, seed);
217*0Sstevel@tonic-gate }
_ossl_old_des_random_seed(_ossl_old_des_cblock key)218*0Sstevel@tonic-gate void _ossl_old_des_random_seed(_ossl_old_des_cblock key)
219*0Sstevel@tonic-gate {
220*0Sstevel@tonic-gate RAND_seed(key, sizeof(_ossl_old_des_cblock));
221*0Sstevel@tonic-gate }
_ossl_old_des_random_key(_ossl_old_des_cblock ret)222*0Sstevel@tonic-gate void _ossl_old_des_random_key(_ossl_old_des_cblock ret)
223*0Sstevel@tonic-gate {
224*0Sstevel@tonic-gate DES_random_key((DES_cblock *)ret);
225*0Sstevel@tonic-gate }
_ossl_old_des_read_password(_ossl_old_des_cblock * key,const char * prompt,int verify)226*0Sstevel@tonic-gate int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt,
227*0Sstevel@tonic-gate int verify)
228*0Sstevel@tonic-gate {
229*0Sstevel@tonic-gate return DES_read_password(key, prompt, verify);
230*0Sstevel@tonic-gate }
_ossl_old_des_read_2passwords(_ossl_old_des_cblock * key1,_ossl_old_des_cblock * key2,const char * prompt,int verify)231*0Sstevel@tonic-gate int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1, _ossl_old_des_cblock *key2,
232*0Sstevel@tonic-gate const char *prompt, int verify)
233*0Sstevel@tonic-gate {
234*0Sstevel@tonic-gate return DES_read_2passwords(key1, key2, prompt, verify);
235*0Sstevel@tonic-gate }
_ossl_old_des_set_odd_parity(_ossl_old_des_cblock * key)236*0Sstevel@tonic-gate void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key)
237*0Sstevel@tonic-gate {
238*0Sstevel@tonic-gate DES_set_odd_parity(key);
239*0Sstevel@tonic-gate }
_ossl_old_des_is_weak_key(_ossl_old_des_cblock * key)240*0Sstevel@tonic-gate int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key)
241*0Sstevel@tonic-gate {
242*0Sstevel@tonic-gate return DES_is_weak_key(key);
243*0Sstevel@tonic-gate }
_ossl_old_des_set_key(_ossl_old_des_cblock * key,des_key_schedule schedule)244*0Sstevel@tonic-gate int _ossl_old_des_set_key(_ossl_old_des_cblock *key,des_key_schedule schedule)
245*0Sstevel@tonic-gate {
246*0Sstevel@tonic-gate return DES_set_key(key, (DES_key_schedule *)schedule);
247*0Sstevel@tonic-gate }
_ossl_old_des_key_sched(_ossl_old_des_cblock * key,des_key_schedule schedule)248*0Sstevel@tonic-gate int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,des_key_schedule schedule)
249*0Sstevel@tonic-gate {
250*0Sstevel@tonic-gate return DES_key_sched(key, (DES_key_schedule *)schedule);
251*0Sstevel@tonic-gate }
_ossl_old_des_string_to_key(char * str,_ossl_old_des_cblock * key)252*0Sstevel@tonic-gate void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key)
253*0Sstevel@tonic-gate {
254*0Sstevel@tonic-gate DES_string_to_key(str, key);
255*0Sstevel@tonic-gate }
_ossl_old_des_string_to_2keys(char * str,_ossl_old_des_cblock * key1,_ossl_old_des_cblock * key2)256*0Sstevel@tonic-gate void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2)
257*0Sstevel@tonic-gate {
258*0Sstevel@tonic-gate DES_string_to_2keys(str, key1, key2);
259*0Sstevel@tonic-gate }
_ossl_old_des_cfb64_encrypt(unsigned char * in,unsigned char * out,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,int * num,int enc)260*0Sstevel@tonic-gate void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
261*0Sstevel@tonic-gate des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc)
262*0Sstevel@tonic-gate {
263*0Sstevel@tonic-gate DES_cfb64_encrypt(in, out, length, (DES_key_schedule *)schedule,
264*0Sstevel@tonic-gate ivec, num, enc);
265*0Sstevel@tonic-gate }
_ossl_old_des_ofb64_encrypt(unsigned char * in,unsigned char * out,long length,des_key_schedule schedule,_ossl_old_des_cblock * ivec,int * num)266*0Sstevel@tonic-gate void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
267*0Sstevel@tonic-gate des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num)
268*0Sstevel@tonic-gate {
269*0Sstevel@tonic-gate DES_ofb64_encrypt(in, out, length, (DES_key_schedule *)schedule,
270*0Sstevel@tonic-gate ivec, num);
271*0Sstevel@tonic-gate }
272