openssl_rsa_pss_verify 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +35 -0
- data/README +1 -0
- data/Rakefile +4 -0
- data/ext/openssl_rsa_pss_verify/extconf.rb +15 -0
- data/ext/openssl_rsa_pss_verify/openssl_rsa_pss_verify_ext.c +56 -0
- data/lib/openssl_rsa_pss_verify/version.rb +3 -0
- data/lib/openssl_rsa_pss_verify.rb +2 -0
- data/openssl_rsa_pss_verify.gemspec +26 -0
- data/tasks/compile.rake +12 -0
- data/tasks/rspec.rake +12 -0
- data/vendor/openssl/include/openssl/aes.h +147 -0
- data/vendor/openssl/include/openssl/asn1.h +1404 -0
- data/vendor/openssl/include/openssl/asn1_mac.h +578 -0
- data/vendor/openssl/include/openssl/asn1t.h +960 -0
- data/vendor/openssl/include/openssl/bio.h +847 -0
- data/vendor/openssl/include/openssl/blowfish.h +129 -0
- data/vendor/openssl/include/openssl/bn.h +891 -0
- data/vendor/openssl/include/openssl/buffer.h +119 -0
- data/vendor/openssl/include/openssl/camellia.h +130 -0
- data/vendor/openssl/include/openssl/cast.h +107 -0
- data/vendor/openssl/include/openssl/cmac.h +82 -0
- data/vendor/openssl/include/openssl/cms.h +501 -0
- data/vendor/openssl/include/openssl/comp.h +80 -0
- data/vendor/openssl/include/openssl/conf.h +263 -0
- data/vendor/openssl/include/openssl/conf_api.h +89 -0
- data/vendor/openssl/include/openssl/crypto.h +611 -0
- data/vendor/openssl/include/openssl/des.h +248 -0
- data/vendor/openssl/include/openssl/des_old.h +446 -0
- data/vendor/openssl/include/openssl/dh.h +280 -0
- data/vendor/openssl/include/openssl/dsa.h +327 -0
- data/vendor/openssl/include/openssl/dso.h +409 -0
- data/vendor/openssl/include/openssl/dtls1.h +287 -0
- data/vendor/openssl/include/openssl/e_os2.h +315 -0
- data/vendor/openssl/include/openssl/ebcdic.h +19 -0
- data/vendor/openssl/include/openssl/ec.h +1167 -0
- data/vendor/openssl/include/openssl/ecdh.h +125 -0
- data/vendor/openssl/include/openssl/ecdsa.h +260 -0
- data/vendor/openssl/include/openssl/engine.h +842 -0
- data/vendor/openssl/include/openssl/err.h +386 -0
- data/vendor/openssl/include/openssl/evp.h +1409 -0
- data/vendor/openssl/include/openssl/hmac.h +110 -0
- data/vendor/openssl/include/openssl/idea.h +103 -0
- data/vendor/openssl/include/openssl/krb5_asn.h +256 -0
- data/vendor/openssl/include/openssl/kssl.h +183 -0
- data/vendor/openssl/include/openssl/lhash.h +241 -0
- data/vendor/openssl/include/openssl/md4.h +120 -0
- data/vendor/openssl/include/openssl/md5.h +120 -0
- data/vendor/openssl/include/openssl/mdc2.h +98 -0
- data/vendor/openssl/include/openssl/modes.h +135 -0
- data/vendor/openssl/include/openssl/obj_mac.h +4032 -0
- data/vendor/openssl/include/openssl/objects.h +1138 -0
- data/vendor/openssl/include/openssl/ocsp.h +623 -0
- data/vendor/openssl/include/openssl/opensslconf.h +234 -0
- data/vendor/openssl/include/openssl/opensslv.h +89 -0
- data/vendor/openssl/include/openssl/ossl_typ.h +202 -0
- data/vendor/openssl/include/openssl/pem.h +641 -0
- data/vendor/openssl/include/openssl/pem2.h +70 -0
- data/vendor/openssl/include/openssl/pkcs12.h +331 -0
- data/vendor/openssl/include/openssl/pkcs7.h +499 -0
- data/vendor/openssl/include/openssl/pqueue.h +94 -0
- data/vendor/openssl/include/openssl/rand.h +149 -0
- data/vendor/openssl/include/openssl/rc2.h +103 -0
- data/vendor/openssl/include/openssl/rc4.h +90 -0
- data/vendor/openssl/include/openssl/ripemd.h +107 -0
- data/vendor/openssl/include/openssl/rsa.h +582 -0
- data/vendor/openssl/include/openssl/safestack.h +2663 -0
- data/vendor/openssl/include/openssl/seed.h +139 -0
- data/vendor/openssl/include/openssl/sha.h +214 -0
- data/vendor/openssl/include/openssl/srp.h +172 -0
- data/vendor/openssl/include/openssl/srtp.h +145 -0
- data/vendor/openssl/include/openssl/ssl.h +2579 -0
- data/vendor/openssl/include/openssl/ssl2.h +272 -0
- data/vendor/openssl/include/openssl/ssl23.h +83 -0
- data/vendor/openssl/include/openssl/ssl3.h +684 -0
- data/vendor/openssl/include/openssl/stack.h +108 -0
- data/vendor/openssl/include/openssl/symhacks.h +475 -0
- data/vendor/openssl/include/openssl/tls1.h +735 -0
- data/vendor/openssl/include/openssl/ts.h +858 -0
- data/vendor/openssl/include/openssl/txt_db.h +112 -0
- data/vendor/openssl/include/openssl/ui.h +383 -0
- data/vendor/openssl/include/openssl/ui_compat.h +83 -0
- data/vendor/openssl/include/openssl/whrlpool.h +41 -0
- data/vendor/openssl/include/openssl/x509.h +1297 -0
- data/vendor/openssl/include/openssl/x509_vfy.h +567 -0
- data/vendor/openssl/include/openssl/x509v3.h +1007 -0
- data/vendor/openssl/lib/engines/lib4758cca.so +0 -0
- data/vendor/openssl/lib/engines/libaep.so +0 -0
- data/vendor/openssl/lib/engines/libatalla.so +0 -0
- data/vendor/openssl/lib/engines/libcapi.so +0 -0
- data/vendor/openssl/lib/engines/libchil.so +0 -0
- data/vendor/openssl/lib/engines/libcswift.so +0 -0
- data/vendor/openssl/lib/engines/libgmp.so +0 -0
- data/vendor/openssl/lib/engines/libgost.so +0 -0
- data/vendor/openssl/lib/engines/libnuron.so +0 -0
- data/vendor/openssl/lib/engines/libpadlock.so +0 -0
- data/vendor/openssl/lib/engines/libsureware.so +0 -0
- data/vendor/openssl/lib/engines/libubsec.so +0 -0
- data/vendor/openssl/lib/libcrypto.a +0 -0
- data/vendor/openssl/lib/libcrypto.so +0 -0
- data/vendor/openssl/lib/libcrypto.so.1.0.0 +0 -0
- data/vendor/openssl/lib/libssl.a +0 -0
- data/vendor/openssl/lib/libssl.so +0 -0
- data/vendor/openssl/lib/libssl.so.1.0.0 +0 -0
- data/vendor/openssl/lib/pkgconfig/libcrypto.pc +12 -0
- data/vendor/openssl/lib/pkgconfig/libssl.pc +12 -0
- data/vendor/openssl/lib/pkgconfig/openssl.pc +12 -0
- metadata +208 -0
@@ -0,0 +1,248 @@
|
|
1
|
+
/* crypto/des/des.h */
|
2
|
+
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* This package is an SSL implementation written
|
6
|
+
* by Eric Young (eay@cryptsoft.com).
|
7
|
+
* The implementation was written so as to conform with Netscapes SSL.
|
8
|
+
*
|
9
|
+
* This library is free for commercial and non-commercial use as long as
|
10
|
+
* the following conditions are aheared to. The following conditions
|
11
|
+
* apply to all code found in this distribution, be it the RC4, RSA,
|
12
|
+
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
13
|
+
* included with this distribution is covered by the same copyright terms
|
14
|
+
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
15
|
+
*
|
16
|
+
* Copyright remains Eric Young's, and as such any Copyright notices in
|
17
|
+
* the code are not to be removed.
|
18
|
+
* If this package is used in a product, Eric Young should be given attribution
|
19
|
+
* as the author of the parts of the library used.
|
20
|
+
* This can be in the form of a textual message at program startup or
|
21
|
+
* in documentation (online or textual) provided with the package.
|
22
|
+
*
|
23
|
+
* Redistribution and use in source and binary forms, with or without
|
24
|
+
* modification, are permitted provided that the following conditions
|
25
|
+
* are met:
|
26
|
+
* 1. Redistributions of source code must retain the copyright
|
27
|
+
* notice, this list of conditions and the following disclaimer.
|
28
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
29
|
+
* notice, this list of conditions and the following disclaimer in the
|
30
|
+
* documentation and/or other materials provided with the distribution.
|
31
|
+
* 3. All advertising materials mentioning features or use of this software
|
32
|
+
* must display the following acknowledgement:
|
33
|
+
* "This product includes cryptographic software written by
|
34
|
+
* Eric Young (eay@cryptsoft.com)"
|
35
|
+
* The word 'cryptographic' can be left out if the rouines from the library
|
36
|
+
* being used are not cryptographic related :-).
|
37
|
+
* 4. If you include any Windows specific code (or a derivative thereof) from
|
38
|
+
* the apps directory (application code) you must include an acknowledgement:
|
39
|
+
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
40
|
+
*
|
41
|
+
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
42
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
43
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
44
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
45
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
46
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
47
|
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
48
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
49
|
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
50
|
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
51
|
+
* SUCH DAMAGE.
|
52
|
+
*
|
53
|
+
* The licence and distribution terms for any publically available version or
|
54
|
+
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
55
|
+
* copied and put under another distribution licence
|
56
|
+
* [including the GNU Public Licence.]
|
57
|
+
*/
|
58
|
+
|
59
|
+
#ifndef HEADER_NEW_DES_H
|
60
|
+
#define HEADER_NEW_DES_H
|
61
|
+
|
62
|
+
#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES,
|
63
|
+
DES_LONG (via openssl/opensslconf.h */
|
64
|
+
|
65
|
+
#ifdef OPENSSL_NO_DES
|
66
|
+
#error DES is disabled.
|
67
|
+
#endif
|
68
|
+
|
69
|
+
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
70
|
+
# undef OPENSSL_EXTERN
|
71
|
+
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
72
|
+
#endif
|
73
|
+
|
74
|
+
#ifdef __cplusplus
|
75
|
+
extern "C" {
|
76
|
+
#endif
|
77
|
+
|
78
|
+
typedef unsigned char DES_cblock[8];
|
79
|
+
typedef /* const */ unsigned char const_DES_cblock[8];
|
80
|
+
/* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock *
|
81
|
+
* and const_DES_cblock * are incompatible pointer types. */
|
82
|
+
|
83
|
+
typedef struct DES_ks
|
84
|
+
{
|
85
|
+
union
|
86
|
+
{
|
87
|
+
DES_cblock cblock;
|
88
|
+
/* make sure things are correct size on machines with
|
89
|
+
* 8 byte longs */
|
90
|
+
DES_LONG deslong[2];
|
91
|
+
} ks[16];
|
92
|
+
} DES_key_schedule;
|
93
|
+
|
94
|
+
#ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT
|
95
|
+
# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT
|
96
|
+
# define OPENSSL_ENABLE_OLD_DES_SUPPORT
|
97
|
+
# endif
|
98
|
+
#endif
|
99
|
+
|
100
|
+
#ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT
|
101
|
+
# include <openssl/des_old.h>
|
102
|
+
#endif
|
103
|
+
|
104
|
+
#define DES_KEY_SZ (sizeof(DES_cblock))
|
105
|
+
#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
|
106
|
+
|
107
|
+
#define DES_ENCRYPT 1
|
108
|
+
#define DES_DECRYPT 0
|
109
|
+
|
110
|
+
#define DES_CBC_MODE 0
|
111
|
+
#define DES_PCBC_MODE 1
|
112
|
+
|
113
|
+
#define DES_ecb2_encrypt(i,o,k1,k2,e) \
|
114
|
+
DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
|
115
|
+
|
116
|
+
#define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
|
117
|
+
DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
|
118
|
+
|
119
|
+
#define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
|
120
|
+
DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
|
121
|
+
|
122
|
+
#define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
123
|
+
DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
124
|
+
|
125
|
+
OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */
|
126
|
+
#define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
|
127
|
+
OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */
|
128
|
+
#define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode)
|
129
|
+
|
130
|
+
const char *DES_options(void);
|
131
|
+
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
|
132
|
+
DES_key_schedule *ks1,DES_key_schedule *ks2,
|
133
|
+
DES_key_schedule *ks3, int enc);
|
134
|
+
DES_LONG DES_cbc_cksum(const unsigned char *input,DES_cblock *output,
|
135
|
+
long length,DES_key_schedule *schedule,
|
136
|
+
const_DES_cblock *ivec);
|
137
|
+
/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
|
138
|
+
void DES_cbc_encrypt(const unsigned char *input,unsigned char *output,
|
139
|
+
long length,DES_key_schedule *schedule,DES_cblock *ivec,
|
140
|
+
int enc);
|
141
|
+
void DES_ncbc_encrypt(const unsigned char *input,unsigned char *output,
|
142
|
+
long length,DES_key_schedule *schedule,DES_cblock *ivec,
|
143
|
+
int enc);
|
144
|
+
void DES_xcbc_encrypt(const unsigned char *input,unsigned char *output,
|
145
|
+
long length,DES_key_schedule *schedule,DES_cblock *ivec,
|
146
|
+
const_DES_cblock *inw,const_DES_cblock *outw,int enc);
|
147
|
+
void DES_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
|
148
|
+
long length,DES_key_schedule *schedule,DES_cblock *ivec,
|
149
|
+
int enc);
|
150
|
+
void DES_ecb_encrypt(const_DES_cblock *input,DES_cblock *output,
|
151
|
+
DES_key_schedule *ks,int enc);
|
152
|
+
|
153
|
+
/* This is the DES encryption function that gets called by just about
|
154
|
+
every other DES routine in the library. You should not use this
|
155
|
+
function except to implement 'modes' of DES. I say this because the
|
156
|
+
functions that call this routine do the conversion from 'char *' to
|
157
|
+
long, and this needs to be done to make sure 'non-aligned' memory
|
158
|
+
access do not occur. The characters are loaded 'little endian'.
|
159
|
+
Data is a pointer to 2 unsigned long's and ks is the
|
160
|
+
DES_key_schedule to use. enc, is non zero specifies encryption,
|
161
|
+
zero if decryption. */
|
162
|
+
void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc);
|
163
|
+
|
164
|
+
/* This functions is the same as DES_encrypt1() except that the DES
|
165
|
+
initial permutation (IP) and final permutation (FP) have been left
|
166
|
+
out. As for DES_encrypt1(), you should not use this function.
|
167
|
+
It is used by the routines in the library that implement triple DES.
|
168
|
+
IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same
|
169
|
+
as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */
|
170
|
+
void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc);
|
171
|
+
|
172
|
+
void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
|
173
|
+
DES_key_schedule *ks2, DES_key_schedule *ks3);
|
174
|
+
void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
|
175
|
+
DES_key_schedule *ks2, DES_key_schedule *ks3);
|
176
|
+
void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output,
|
177
|
+
long length,
|
178
|
+
DES_key_schedule *ks1,DES_key_schedule *ks2,
|
179
|
+
DES_key_schedule *ks3,DES_cblock *ivec,int enc);
|
180
|
+
void DES_ede3_cbcm_encrypt(const unsigned char *in,unsigned char *out,
|
181
|
+
long length,
|
182
|
+
DES_key_schedule *ks1,DES_key_schedule *ks2,
|
183
|
+
DES_key_schedule *ks3,
|
184
|
+
DES_cblock *ivec1,DES_cblock *ivec2,
|
185
|
+
int enc);
|
186
|
+
void DES_ede3_cfb64_encrypt(const unsigned char *in,unsigned char *out,
|
187
|
+
long length,DES_key_schedule *ks1,
|
188
|
+
DES_key_schedule *ks2,DES_key_schedule *ks3,
|
189
|
+
DES_cblock *ivec,int *num,int enc);
|
190
|
+
void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out,
|
191
|
+
int numbits,long length,DES_key_schedule *ks1,
|
192
|
+
DES_key_schedule *ks2,DES_key_schedule *ks3,
|
193
|
+
DES_cblock *ivec,int enc);
|
194
|
+
void DES_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out,
|
195
|
+
long length,DES_key_schedule *ks1,
|
196
|
+
DES_key_schedule *ks2,DES_key_schedule *ks3,
|
197
|
+
DES_cblock *ivec,int *num);
|
198
|
+
#if 0
|
199
|
+
void DES_xwhite_in2out(const_DES_cblock *DES_key,const_DES_cblock *in_white,
|
200
|
+
DES_cblock *out_white);
|
201
|
+
#endif
|
202
|
+
|
203
|
+
int DES_enc_read(int fd,void *buf,int len,DES_key_schedule *sched,
|
204
|
+
DES_cblock *iv);
|
205
|
+
int DES_enc_write(int fd,const void *buf,int len,DES_key_schedule *sched,
|
206
|
+
DES_cblock *iv);
|
207
|
+
char *DES_fcrypt(const char *buf,const char *salt, char *ret);
|
208
|
+
char *DES_crypt(const char *buf,const char *salt);
|
209
|
+
void DES_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
|
210
|
+
long length,DES_key_schedule *schedule,DES_cblock *ivec);
|
211
|
+
void DES_pcbc_encrypt(const unsigned char *input,unsigned char *output,
|
212
|
+
long length,DES_key_schedule *schedule,DES_cblock *ivec,
|
213
|
+
int enc);
|
214
|
+
DES_LONG DES_quad_cksum(const unsigned char *input,DES_cblock output[],
|
215
|
+
long length,int out_count,DES_cblock *seed);
|
216
|
+
int DES_random_key(DES_cblock *ret);
|
217
|
+
void DES_set_odd_parity(DES_cblock *key);
|
218
|
+
int DES_check_key_parity(const_DES_cblock *key);
|
219
|
+
int DES_is_weak_key(const_DES_cblock *key);
|
220
|
+
/* DES_set_key (= set_key = DES_key_sched = key_sched) calls
|
221
|
+
* DES_set_key_checked if global variable DES_check_key is set,
|
222
|
+
* DES_set_key_unchecked otherwise. */
|
223
|
+
int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule);
|
224
|
+
int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule);
|
225
|
+
int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule);
|
226
|
+
void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule);
|
227
|
+
#ifdef OPENSSL_FIPS
|
228
|
+
void private_DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule);
|
229
|
+
#endif
|
230
|
+
void DES_string_to_key(const char *str,DES_cblock *key);
|
231
|
+
void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2);
|
232
|
+
void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length,
|
233
|
+
DES_key_schedule *schedule,DES_cblock *ivec,int *num,
|
234
|
+
int enc);
|
235
|
+
void DES_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length,
|
236
|
+
DES_key_schedule *schedule,DES_cblock *ivec,int *num);
|
237
|
+
|
238
|
+
int DES_read_password(DES_cblock *key, const char *prompt, int verify);
|
239
|
+
int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt,
|
240
|
+
int verify);
|
241
|
+
|
242
|
+
#define DES_fixup_key_parity DES_set_odd_parity
|
243
|
+
|
244
|
+
#ifdef __cplusplus
|
245
|
+
}
|
246
|
+
#endif
|
247
|
+
|
248
|
+
#endif
|
@@ -0,0 +1,446 @@
|
|
1
|
+
/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
|
2
|
+
|
3
|
+
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
4
|
+
*
|
5
|
+
* The function names in here are deprecated and are only present to
|
6
|
+
* provide an interface compatible with openssl 0.9.6 and older as
|
7
|
+
* well as libdes. OpenSSL now provides functions where "des_" has
|
8
|
+
* been replaced with "DES_" in the names, to make it possible to
|
9
|
+
* make incompatible changes that are needed for C type security and
|
10
|
+
* other stuff.
|
11
|
+
*
|
12
|
+
* This include files has two compatibility modes:
|
13
|
+
*
|
14
|
+
* - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
|
15
|
+
* that is compatible with libdes and SSLeay.
|
16
|
+
* - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
|
17
|
+
* API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
|
18
|
+
*
|
19
|
+
* Note that these modes break earlier snapshots of OpenSSL, where
|
20
|
+
* libdes compatibility was the only available mode or (later on) the
|
21
|
+
* prefered compatibility mode. However, after much consideration
|
22
|
+
* (and more or less violent discussions with external parties), it
|
23
|
+
* was concluded that OpenSSL should be compatible with earlier versions
|
24
|
+
* of itself before anything else. Also, in all honesty, libdes is
|
25
|
+
* an old beast that shouldn't really be used any more.
|
26
|
+
*
|
27
|
+
* Please consider starting to use the DES_ functions rather than the
|
28
|
+
* des_ ones. The des_ functions will disappear completely before
|
29
|
+
* OpenSSL 1.0!
|
30
|
+
*
|
31
|
+
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
32
|
+
*/
|
33
|
+
|
34
|
+
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
|
35
|
+
* project 2001.
|
36
|
+
*/
|
37
|
+
/* ====================================================================
|
38
|
+
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
39
|
+
*
|
40
|
+
* Redistribution and use in source and binary forms, with or without
|
41
|
+
* modification, are permitted provided that the following conditions
|
42
|
+
* are met:
|
43
|
+
*
|
44
|
+
* 1. Redistributions of source code must retain the above copyright
|
45
|
+
* notice, this list of conditions and the following disclaimer.
|
46
|
+
*
|
47
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
48
|
+
* notice, this list of conditions and the following disclaimer in
|
49
|
+
* the documentation and/or other materials provided with the
|
50
|
+
* distribution.
|
51
|
+
*
|
52
|
+
* 3. All advertising materials mentioning features or use of this
|
53
|
+
* software must display the following acknowledgment:
|
54
|
+
* "This product includes software developed by the OpenSSL Project
|
55
|
+
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
56
|
+
*
|
57
|
+
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
58
|
+
* endorse or promote products derived from this software without
|
59
|
+
* prior written permission. For written permission, please contact
|
60
|
+
* openssl-core@openssl.org.
|
61
|
+
*
|
62
|
+
* 5. Products derived from this software may not be called "OpenSSL"
|
63
|
+
* nor may "OpenSSL" appear in their names without prior written
|
64
|
+
* permission of the OpenSSL Project.
|
65
|
+
*
|
66
|
+
* 6. Redistributions of any form whatsoever must retain the following
|
67
|
+
* acknowledgment:
|
68
|
+
* "This product includes software developed by the OpenSSL Project
|
69
|
+
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
70
|
+
*
|
71
|
+
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
72
|
+
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
73
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
74
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
75
|
+
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
76
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
77
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
78
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
79
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
80
|
+
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
81
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
82
|
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
83
|
+
* ====================================================================
|
84
|
+
*
|
85
|
+
* This product includes cryptographic software written by Eric Young
|
86
|
+
* (eay@cryptsoft.com). This product includes software written by Tim
|
87
|
+
* Hudson (tjh@cryptsoft.com).
|
88
|
+
*
|
89
|
+
*/
|
90
|
+
|
91
|
+
#ifndef HEADER_DES_H
|
92
|
+
#define HEADER_DES_H
|
93
|
+
|
94
|
+
#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
|
95
|
+
|
96
|
+
#ifdef OPENSSL_NO_DES
|
97
|
+
#error DES is disabled.
|
98
|
+
#endif
|
99
|
+
|
100
|
+
#ifndef HEADER_NEW_DES_H
|
101
|
+
#error You must include des.h, not des_old.h directly.
|
102
|
+
#endif
|
103
|
+
|
104
|
+
#ifdef _KERBEROS_DES_H
|
105
|
+
#error <openssl/des_old.h> replaces <kerberos/des.h>.
|
106
|
+
#endif
|
107
|
+
|
108
|
+
#include <openssl/symhacks.h>
|
109
|
+
|
110
|
+
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
111
|
+
# undef OPENSSL_EXTERN
|
112
|
+
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
113
|
+
#endif
|
114
|
+
|
115
|
+
#ifdef __cplusplus
|
116
|
+
extern "C" {
|
117
|
+
#endif
|
118
|
+
|
119
|
+
#ifdef _
|
120
|
+
#undef _
|
121
|
+
#endif
|
122
|
+
|
123
|
+
typedef unsigned char _ossl_old_des_cblock[8];
|
124
|
+
typedef struct _ossl_old_des_ks_struct
|
125
|
+
{
|
126
|
+
union {
|
127
|
+
_ossl_old_des_cblock _;
|
128
|
+
/* make sure things are correct size on machines with
|
129
|
+
* 8 byte longs */
|
130
|
+
DES_LONG pad[2];
|
131
|
+
} ks;
|
132
|
+
} _ossl_old_des_key_schedule[16];
|
133
|
+
|
134
|
+
#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
|
135
|
+
#define des_cblock DES_cblock
|
136
|
+
#define const_des_cblock const_DES_cblock
|
137
|
+
#define des_key_schedule DES_key_schedule
|
138
|
+
#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
|
139
|
+
DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
|
140
|
+
#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
|
141
|
+
DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
|
142
|
+
#define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
|
143
|
+
DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
|
144
|
+
#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
|
145
|
+
DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
|
146
|
+
#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
|
147
|
+
DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
|
148
|
+
#define des_options()\
|
149
|
+
DES_options()
|
150
|
+
#define des_cbc_cksum(i,o,l,k,iv)\
|
151
|
+
DES_cbc_cksum((i),(o),(l),&(k),(iv))
|
152
|
+
#define des_cbc_encrypt(i,o,l,k,iv,e)\
|
153
|
+
DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
|
154
|
+
#define des_ncbc_encrypt(i,o,l,k,iv,e)\
|
155
|
+
DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
|
156
|
+
#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
|
157
|
+
DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
|
158
|
+
#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
|
159
|
+
DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
|
160
|
+
#define des_ecb_encrypt(i,o,k,e)\
|
161
|
+
DES_ecb_encrypt((i),(o),&(k),(e))
|
162
|
+
#define des_encrypt1(d,k,e)\
|
163
|
+
DES_encrypt1((d),&(k),(e))
|
164
|
+
#define des_encrypt2(d,k,e)\
|
165
|
+
DES_encrypt2((d),&(k),(e))
|
166
|
+
#define des_encrypt3(d,k1,k2,k3)\
|
167
|
+
DES_encrypt3((d),&(k1),&(k2),&(k3))
|
168
|
+
#define des_decrypt3(d,k1,k2,k3)\
|
169
|
+
DES_decrypt3((d),&(k1),&(k2),&(k3))
|
170
|
+
#define des_xwhite_in2out(k,i,o)\
|
171
|
+
DES_xwhite_in2out((k),(i),(o))
|
172
|
+
#define des_enc_read(f,b,l,k,iv)\
|
173
|
+
DES_enc_read((f),(b),(l),&(k),(iv))
|
174
|
+
#define des_enc_write(f,b,l,k,iv)\
|
175
|
+
DES_enc_write((f),(b),(l),&(k),(iv))
|
176
|
+
#define des_fcrypt(b,s,r)\
|
177
|
+
DES_fcrypt((b),(s),(r))
|
178
|
+
#if 0
|
179
|
+
#define des_crypt(b,s)\
|
180
|
+
DES_crypt((b),(s))
|
181
|
+
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
|
182
|
+
#define crypt(b,s)\
|
183
|
+
DES_crypt((b),(s))
|
184
|
+
#endif
|
185
|
+
#endif
|
186
|
+
#define des_ofb_encrypt(i,o,n,l,k,iv)\
|
187
|
+
DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
|
188
|
+
#define des_pcbc_encrypt(i,o,l,k,iv,e)\
|
189
|
+
DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
|
190
|
+
#define des_quad_cksum(i,o,l,c,s)\
|
191
|
+
DES_quad_cksum((i),(o),(l),(c),(s))
|
192
|
+
#define des_random_seed(k)\
|
193
|
+
_ossl_096_des_random_seed((k))
|
194
|
+
#define des_random_key(r)\
|
195
|
+
DES_random_key((r))
|
196
|
+
#define des_read_password(k,p,v) \
|
197
|
+
DES_read_password((k),(p),(v))
|
198
|
+
#define des_read_2passwords(k1,k2,p,v) \
|
199
|
+
DES_read_2passwords((k1),(k2),(p),(v))
|
200
|
+
#define des_set_odd_parity(k)\
|
201
|
+
DES_set_odd_parity((k))
|
202
|
+
#define des_check_key_parity(k)\
|
203
|
+
DES_check_key_parity((k))
|
204
|
+
#define des_is_weak_key(k)\
|
205
|
+
DES_is_weak_key((k))
|
206
|
+
#define des_set_key(k,ks)\
|
207
|
+
DES_set_key((k),&(ks))
|
208
|
+
#define des_key_sched(k,ks)\
|
209
|
+
DES_key_sched((k),&(ks))
|
210
|
+
#define des_set_key_checked(k,ks)\
|
211
|
+
DES_set_key_checked((k),&(ks))
|
212
|
+
#define des_set_key_unchecked(k,ks)\
|
213
|
+
DES_set_key_unchecked((k),&(ks))
|
214
|
+
#define des_string_to_key(s,k)\
|
215
|
+
DES_string_to_key((s),(k))
|
216
|
+
#define des_string_to_2keys(s,k1,k2)\
|
217
|
+
DES_string_to_2keys((s),(k1),(k2))
|
218
|
+
#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
|
219
|
+
DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
|
220
|
+
#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
|
221
|
+
DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
|
222
|
+
|
223
|
+
|
224
|
+
#define des_ecb2_encrypt(i,o,k1,k2,e) \
|
225
|
+
des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
|
226
|
+
|
227
|
+
#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
|
228
|
+
des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
|
229
|
+
|
230
|
+
#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
|
231
|
+
des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
|
232
|
+
|
233
|
+
#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
234
|
+
des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
235
|
+
|
236
|
+
#define des_check_key DES_check_key
|
237
|
+
#define des_rw_mode DES_rw_mode
|
238
|
+
#else /* libdes compatibility */
|
239
|
+
/* Map all symbol names to _ossl_old_des_* form, so we avoid all
|
240
|
+
clashes with libdes */
|
241
|
+
#define des_cblock _ossl_old_des_cblock
|
242
|
+
#define des_key_schedule _ossl_old_des_key_schedule
|
243
|
+
#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
|
244
|
+
_ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
|
245
|
+
#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
|
246
|
+
_ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
|
247
|
+
#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
|
248
|
+
_ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
|
249
|
+
#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
|
250
|
+
_ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
|
251
|
+
#define des_options()\
|
252
|
+
_ossl_old_des_options()
|
253
|
+
#define des_cbc_cksum(i,o,l,k,iv)\
|
254
|
+
_ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
|
255
|
+
#define des_cbc_encrypt(i,o,l,k,iv,e)\
|
256
|
+
_ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
|
257
|
+
#define des_ncbc_encrypt(i,o,l,k,iv,e)\
|
258
|
+
_ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
|
259
|
+
#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
|
260
|
+
_ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
|
261
|
+
#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
|
262
|
+
_ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
|
263
|
+
#define des_ecb_encrypt(i,o,k,e)\
|
264
|
+
_ossl_old_des_ecb_encrypt((i),(o),(k),(e))
|
265
|
+
#define des_encrypt(d,k,e)\
|
266
|
+
_ossl_old_des_encrypt((d),(k),(e))
|
267
|
+
#define des_encrypt2(d,k,e)\
|
268
|
+
_ossl_old_des_encrypt2((d),(k),(e))
|
269
|
+
#define des_encrypt3(d,k1,k2,k3)\
|
270
|
+
_ossl_old_des_encrypt3((d),(k1),(k2),(k3))
|
271
|
+
#define des_decrypt3(d,k1,k2,k3)\
|
272
|
+
_ossl_old_des_decrypt3((d),(k1),(k2),(k3))
|
273
|
+
#define des_xwhite_in2out(k,i,o)\
|
274
|
+
_ossl_old_des_xwhite_in2out((k),(i),(o))
|
275
|
+
#define des_enc_read(f,b,l,k,iv)\
|
276
|
+
_ossl_old_des_enc_read((f),(b),(l),(k),(iv))
|
277
|
+
#define des_enc_write(f,b,l,k,iv)\
|
278
|
+
_ossl_old_des_enc_write((f),(b),(l),(k),(iv))
|
279
|
+
#define des_fcrypt(b,s,r)\
|
280
|
+
_ossl_old_des_fcrypt((b),(s),(r))
|
281
|
+
#define des_crypt(b,s)\
|
282
|
+
_ossl_old_des_crypt((b),(s))
|
283
|
+
#if 0
|
284
|
+
#define crypt(b,s)\
|
285
|
+
_ossl_old_crypt((b),(s))
|
286
|
+
#endif
|
287
|
+
#define des_ofb_encrypt(i,o,n,l,k,iv)\
|
288
|
+
_ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
|
289
|
+
#define des_pcbc_encrypt(i,o,l,k,iv,e)\
|
290
|
+
_ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
|
291
|
+
#define des_quad_cksum(i,o,l,c,s)\
|
292
|
+
_ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
|
293
|
+
#define des_random_seed(k)\
|
294
|
+
_ossl_old_des_random_seed((k))
|
295
|
+
#define des_random_key(r)\
|
296
|
+
_ossl_old_des_random_key((r))
|
297
|
+
#define des_read_password(k,p,v) \
|
298
|
+
_ossl_old_des_read_password((k),(p),(v))
|
299
|
+
#define des_read_2passwords(k1,k2,p,v) \
|
300
|
+
_ossl_old_des_read_2passwords((k1),(k2),(p),(v))
|
301
|
+
#define des_set_odd_parity(k)\
|
302
|
+
_ossl_old_des_set_odd_parity((k))
|
303
|
+
#define des_is_weak_key(k)\
|
304
|
+
_ossl_old_des_is_weak_key((k))
|
305
|
+
#define des_set_key(k,ks)\
|
306
|
+
_ossl_old_des_set_key((k),(ks))
|
307
|
+
#define des_key_sched(k,ks)\
|
308
|
+
_ossl_old_des_key_sched((k),(ks))
|
309
|
+
#define des_string_to_key(s,k)\
|
310
|
+
_ossl_old_des_string_to_key((s),(k))
|
311
|
+
#define des_string_to_2keys(s,k1,k2)\
|
312
|
+
_ossl_old_des_string_to_2keys((s),(k1),(k2))
|
313
|
+
#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
|
314
|
+
_ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
|
315
|
+
#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
|
316
|
+
_ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
|
317
|
+
|
318
|
+
|
319
|
+
#define des_ecb2_encrypt(i,o,k1,k2,e) \
|
320
|
+
des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
|
321
|
+
|
322
|
+
#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
|
323
|
+
des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
|
324
|
+
|
325
|
+
#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
|
326
|
+
des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
|
327
|
+
|
328
|
+
#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
329
|
+
des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
330
|
+
|
331
|
+
#define des_check_key DES_check_key
|
332
|
+
#define des_rw_mode DES_rw_mode
|
333
|
+
#endif
|
334
|
+
|
335
|
+
const char *_ossl_old_des_options(void);
|
336
|
+
void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
337
|
+
_ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
|
338
|
+
_ossl_old_des_key_schedule ks3, int enc);
|
339
|
+
DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
340
|
+
long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
|
341
|
+
void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
342
|
+
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
343
|
+
void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
344
|
+
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
345
|
+
void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
346
|
+
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
|
347
|
+
_ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
|
348
|
+
void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
|
349
|
+
long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
350
|
+
void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
351
|
+
_ossl_old_des_key_schedule ks,int enc);
|
352
|
+
void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
|
353
|
+
void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
|
354
|
+
void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
|
355
|
+
_ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
|
356
|
+
void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
|
357
|
+
_ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
|
358
|
+
void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
|
359
|
+
long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
|
360
|
+
_ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
|
361
|
+
void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
|
362
|
+
long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
|
363
|
+
_ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
|
364
|
+
void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
|
365
|
+
long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
|
366
|
+
_ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
|
367
|
+
#if 0
|
368
|
+
void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
|
369
|
+
_ossl_old_des_cblock (*out_white));
|
370
|
+
#endif
|
371
|
+
|
372
|
+
int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
|
373
|
+
_ossl_old_des_cblock *iv);
|
374
|
+
int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
|
375
|
+
_ossl_old_des_cblock *iv);
|
376
|
+
char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
|
377
|
+
char *_ossl_old_des_crypt(const char *buf,const char *salt);
|
378
|
+
#if !defined(PERL5) && !defined(NeXT)
|
379
|
+
char *_ossl_old_crypt(const char *buf,const char *salt);
|
380
|
+
#endif
|
381
|
+
void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
|
382
|
+
int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
|
383
|
+
void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
384
|
+
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
385
|
+
DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
386
|
+
long length,int out_count,_ossl_old_des_cblock *seed);
|
387
|
+
void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
|
388
|
+
void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
|
389
|
+
int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
|
390
|
+
int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
|
391
|
+
const char *prompt,int verify);
|
392
|
+
void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
|
393
|
+
int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
|
394
|
+
int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
|
395
|
+
int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
|
396
|
+
void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
|
397
|
+
void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
|
398
|
+
void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
|
399
|
+
_ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
|
400
|
+
void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
|
401
|
+
_ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
|
402
|
+
|
403
|
+
void _ossl_096_des_random_seed(des_cblock *key);
|
404
|
+
|
405
|
+
/* The following definitions provide compatibility with the MIT Kerberos
|
406
|
+
* library. The _ossl_old_des_key_schedule structure is not binary compatible. */
|
407
|
+
|
408
|
+
#define _KERBEROS_DES_H
|
409
|
+
|
410
|
+
#define KRBDES_ENCRYPT DES_ENCRYPT
|
411
|
+
#define KRBDES_DECRYPT DES_DECRYPT
|
412
|
+
|
413
|
+
#ifdef KERBEROS
|
414
|
+
# define ENCRYPT DES_ENCRYPT
|
415
|
+
# define DECRYPT DES_DECRYPT
|
416
|
+
#endif
|
417
|
+
|
418
|
+
#ifndef NCOMPAT
|
419
|
+
# define C_Block des_cblock
|
420
|
+
# define Key_schedule des_key_schedule
|
421
|
+
# define KEY_SZ DES_KEY_SZ
|
422
|
+
# define string_to_key des_string_to_key
|
423
|
+
# define read_pw_string des_read_pw_string
|
424
|
+
# define random_key des_random_key
|
425
|
+
# define pcbc_encrypt des_pcbc_encrypt
|
426
|
+
# define set_key des_set_key
|
427
|
+
# define key_sched des_key_sched
|
428
|
+
# define ecb_encrypt des_ecb_encrypt
|
429
|
+
# define cbc_encrypt des_cbc_encrypt
|
430
|
+
# define ncbc_encrypt des_ncbc_encrypt
|
431
|
+
# define xcbc_encrypt des_xcbc_encrypt
|
432
|
+
# define cbc_cksum des_cbc_cksum
|
433
|
+
# define quad_cksum des_quad_cksum
|
434
|
+
# define check_parity des_check_key_parity
|
435
|
+
#endif
|
436
|
+
|
437
|
+
#define des_fixup_key_parity DES_fixup_key_parity
|
438
|
+
|
439
|
+
#ifdef __cplusplus
|
440
|
+
}
|
441
|
+
#endif
|
442
|
+
|
443
|
+
/* for DES_read_pw_string et al */
|
444
|
+
#include <openssl/ui_compat.h>
|
445
|
+
|
446
|
+
#endif
|