diff options
Diffstat (limited to 'src/lib/libcrypto')
147 files changed, 1798 insertions, 18188 deletions
diff --git a/src/lib/libcrypto/Attic/Makefile b/src/lib/libcrypto/Attic/Makefile index 24b7f32fdd..b980f54dba 100644 --- a/src/lib/libcrypto/Attic/Makefile +++ b/src/lib/libcrypto/Attic/Makefile | |||
@@ -40,7 +40,7 @@ LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdi | |||
40 | SRC= $(LIBSRC) | 40 | SRC= $(LIBSRC) |
41 | 41 | ||
42 | EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h | 42 | EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h |
43 | HEADER= cryptlib.h buildinf.h $(EXHEADER) | 43 | HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER) |
44 | 44 | ||
45 | ALL= $(GENERAL) $(SRC) $(HEADER) | 45 | ALL= $(GENERAL) $(SRC) $(HEADER) |
46 | 46 | ||
diff --git a/src/lib/libcrypto/Makefile.ssl b/src/lib/libcrypto/Makefile.ssl index cab75d9f80..f9b33586be 100644 --- a/src/lib/libcrypto/Makefile.ssl +++ b/src/lib/libcrypto/Makefile.ssl | |||
@@ -40,7 +40,7 @@ LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdi | |||
40 | SRC= $(LIBSRC) | 40 | SRC= $(LIBSRC) |
41 | 41 | ||
42 | EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h | 42 | EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h |
43 | HEADER= cryptlib.h buildinf.h $(EXHEADER) | 43 | HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER) |
44 | 44 | ||
45 | ALL= $(GENERAL) $(SRC) $(HEADER) | 45 | ALL= $(GENERAL) $(SRC) $(HEADER) |
46 | 46 | ||
diff --git a/src/lib/libcrypto/asn1/asn1_err.c b/src/lib/libcrypto/asn1/asn1_err.c index b183814242..cecd555c88 100644 --- a/src/lib/libcrypto/asn1/asn1_err.c +++ b/src/lib/libcrypto/asn1/asn1_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/asn1/p5_pbe.c b/src/lib/libcrypto/asn1/p5_pbe.c index 64e90237cc..a147ac3295 100644 --- a/src/lib/libcrypto/asn1/p5_pbe.c +++ b/src/lib/libcrypto/asn1/p5_pbe.c | |||
@@ -129,7 +129,7 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, | |||
129 | } | 129 | } |
130 | pbe->salt->length = saltlen; | 130 | pbe->salt->length = saltlen; |
131 | if (salt) memcpy (pbe->salt->data, salt, saltlen); | 131 | if (salt) memcpy (pbe->salt->data, salt, saltlen); |
132 | else if (RAND_bytes (pbe->salt->data, saltlen) <= 0) | 132 | else if (RAND_pseudo_bytes (pbe->salt->data, saltlen) < 0) |
133 | return NULL; | 133 | return NULL; |
134 | 134 | ||
135 | if (!(astype = ASN1_TYPE_new())) { | 135 | if (!(astype = ASN1_TYPE_new())) { |
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c index 4ce06a94ab..1bbdb10c71 100644 --- a/src/lib/libcrypto/asn1/p5_pbev2.c +++ b/src/lib/libcrypto/asn1/p5_pbev2.c | |||
@@ -194,7 +194,8 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | |||
194 | if(!(scheme->parameter = ASN1_TYPE_new())) goto merr; | 194 | if(!(scheme->parameter = ASN1_TYPE_new())) goto merr; |
195 | 195 | ||
196 | /* Create random IV */ | 196 | /* Create random IV */ |
197 | RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)); | 197 | if (RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0) |
198 | goto err; | ||
198 | 199 | ||
199 | /* Dummy cipherinit to just setup the IV */ | 200 | /* Dummy cipherinit to just setup the IV */ |
200 | EVP_CipherInit(&ctx, cipher, NULL, iv, 0); | 201 | EVP_CipherInit(&ctx, cipher, NULL, iv, 0); |
@@ -212,7 +213,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | |||
212 | if (!(osalt->data = Malloc (saltlen))) goto merr; | 213 | if (!(osalt->data = Malloc (saltlen))) goto merr; |
213 | osalt->length = saltlen; | 214 | osalt->length = saltlen; |
214 | if (salt) memcpy (osalt->data, salt, saltlen); | 215 | if (salt) memcpy (osalt->data, salt, saltlen); |
215 | else if (RAND_bytes (osalt->data, saltlen) <= 0) goto merr; | 216 | else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) goto merr; |
216 | 217 | ||
217 | if(iter <= 0) iter = PKCS5_DEFAULT_ITER; | 218 | if(iter <= 0) iter = PKCS5_DEFAULT_ITER; |
218 | if(!ASN1_INTEGER_set(kdf->iter, iter)) goto merr; | 219 | if(!ASN1_INTEGER_set(kdf->iter, iter)) goto merr; |
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c index 81dd6355a8..ea1af092db 100644 --- a/src/lib/libcrypto/asn1/t_req.c +++ b/src/lib/libcrypto/asn1/t_req.c | |||
@@ -119,7 +119,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
119 | 119 | ||
120 | pkey=X509_REQ_get_pubkey(x); | 120 | pkey=X509_REQ_get_pubkey(x); |
121 | #ifndef NO_RSA | 121 | #ifndef NO_RSA |
122 | if (pkey->type == EVP_PKEY_RSA) | 122 | if (pkey != NULL && pkey->type == EVP_PKEY_RSA) |
123 | { | 123 | { |
124 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", | 124 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", |
125 | BN_num_bits(pkey->pkey.rsa->n)); | 125 | BN_num_bits(pkey->pkey.rsa->n)); |
@@ -128,7 +128,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
128 | else | 128 | else |
129 | #endif | 129 | #endif |
130 | #ifndef NO_DSA | 130 | #ifndef NO_DSA |
131 | if (pkey->type == EVP_PKEY_DSA) | 131 | if (pkey != NULL && pkey->type == EVP_PKEY_DSA) |
132 | { | 132 | { |
133 | BIO_printf(bp,"%12sDSA Public Key:\n",""); | 133 | BIO_printf(bp,"%12sDSA Public Key:\n",""); |
134 | DSA_print(bp,pkey->pkey.dsa,16); | 134 | DSA_print(bp,pkey->pkey.dsa,16); |
@@ -137,7 +137,8 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
137 | #endif | 137 | #endif |
138 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); | 138 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); |
139 | 139 | ||
140 | EVP_PKEY_free(pkey); | 140 | if (pkey != NULL) |
141 | EVP_PKEY_free(pkey); | ||
141 | 142 | ||
142 | /* may not be */ | 143 | /* may not be */ |
143 | sprintf(str,"%8sAttributes:\n",""); | 144 | sprintf(str,"%8sAttributes:\n",""); |
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c index 81e9815222..7a05d575c9 100644 --- a/src/lib/libcrypto/asn1/x_pubkey.c +++ b/src/lib/libcrypto/asn1/x_pubkey.c | |||
@@ -183,8 +183,10 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) | |||
183 | 183 | ||
184 | Free(s); | 184 | Free(s); |
185 | 185 | ||
186 | #if 0 | ||
186 | CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); | 187 | CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); |
187 | pk->pkey=pkey; | 188 | pk->pkey=pkey; |
189 | #endif | ||
188 | 190 | ||
189 | if (*x != NULL) | 191 | if (*x != NULL) |
190 | X509_PUBKEY_free(*x); | 192 | X509_PUBKEY_free(*x); |
diff --git a/src/lib/libcrypto/bf/Makefile.ssl b/src/lib/libcrypto/bf/Makefile.ssl index 15f6a63987..cf2f7dd48e 100644 --- a/src/lib/libcrypto/bf/Makefile.ssl +++ b/src/lib/libcrypto/bf/Makefile.ssl | |||
@@ -49,7 +49,7 @@ lib: $(LIBOBJ) | |||
49 | 49 | ||
50 | # elf | 50 | # elf |
51 | asm/bx86-elf.o: asm/bx86unix.cpp | 51 | asm/bx86-elf.o: asm/bx86unix.cpp |
52 | $(CPP) -DELF asm/bx86unix.cpp | as -o asm/bx86-elf.o | 52 | $(CPP) -DELF -x c asm/bx86unix.cpp | as -o asm/bx86-elf.o |
53 | 53 | ||
54 | # solaris | 54 | # solaris |
55 | asm/bx86-sol.o: asm/bx86unix.cpp | 55 | asm/bx86-sol.o: asm/bx86unix.cpp |
@@ -65,7 +65,7 @@ asm/bx86-out.o: asm/bx86unix.cpp | |||
65 | asm/bx86bsdi.o: asm/bx86unix.cpp | 65 | asm/bx86bsdi.o: asm/bx86unix.cpp |
66 | $(CPP) -DBSDI asm/bx86unix.cpp | sed 's/ :/:/' | as -o asm/bx86bsdi.o | 66 | $(CPP) -DBSDI asm/bx86unix.cpp | sed 's/ :/:/' | as -o asm/bx86bsdi.o |
67 | 67 | ||
68 | asm/bx86unix.cpp: | 68 | asm/bx86unix.cpp: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl |
69 | (cd asm; $(PERL) bf-586.pl cpp $(PROCESSOR) >bx86unix.cpp) | 69 | (cd asm; $(PERL) bf-586.pl cpp $(PROCESSOR) >bx86unix.cpp) |
70 | 70 | ||
71 | files: | 71 | files: |
diff --git a/src/lib/libcrypto/bf/Makefile.uni b/src/lib/libcrypto/bf/Makefile.uni index f67e5ca23b..e69de29bb2 100644 --- a/src/lib/libcrypto/bf/Makefile.uni +++ b/src/lib/libcrypto/bf/Makefile.uni | |||
@@ -1,157 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | # make x86-elf - linux-elf etc | ||
6 | # make x86-out - linux-a.out, FreeBSD etc | ||
7 | # make x86-solaris | ||
8 | # make x86-bdsi | ||
9 | |||
10 | DIR= bf | ||
11 | TOP= . | ||
12 | # use BF_PTR2 for intel boxes, | ||
13 | # BF_PTR for sparc and MIPS/SGI | ||
14 | # use nothing for Alpha and HP. | ||
15 | |||
16 | # There are 3 possible performance options, experiment :-) | ||
17 | #OPTS= -DBF_PTR # usr for sparc and MIPS/SGI | ||
18 | #OPTS= -DBF_PTR2 # use for pentium | ||
19 | OPTS= # use for pentium pro, Alpha and HP | ||
20 | |||
21 | MAKE=make -f Makefile | ||
22 | #CC=cc | ||
23 | #CFLAG= -O | ||
24 | |||
25 | CC=gcc | ||
26 | #CFLAG= -O4 -funroll-loops -fomit-frame-pointer | ||
27 | CFLAG= -O3 -fomit-frame-pointer | ||
28 | |||
29 | CFLAGS=$(OPTS) $(CFLAG) | ||
30 | CPP=$(CC) -E | ||
31 | AS=as | ||
32 | RANLIB=ranlib | ||
33 | |||
34 | # Assember version of bf_encrypt(). | ||
35 | BF_ENC=bf_enc.o # normal C version | ||
36 | #BF_ENC=asm/bx86-elf.o # elf format x86 | ||
37 | #BF_ENC=asm/bx86-out.o # a.out format x86 | ||
38 | #BF_ENC=asm/bx86-sol.o # solaris format x86 | ||
39 | #BF_ENC=asm/bx86bsdi.o # bsdi format x86 | ||
40 | |||
41 | LIBDIR=/usr/local/lib | ||
42 | BINDIR=/usr/local/bin | ||
43 | INCDIR=/usr/local/include | ||
44 | MANDIR=/usr/local/man | ||
45 | MAN1=1 | ||
46 | MAN3=3 | ||
47 | SHELL=/bin/sh | ||
48 | LIBOBJ=bf_skey.o bf_ecb.o $(BF_ENC) bf_cfb64.o bf_ofb64.o | ||
49 | LIBSRC=bf_skey.c bf_ecb.c bf_enc.c bf_cfb64.c bf_ofb64.c | ||
50 | |||
51 | GENERAL=Makefile Makefile.ssl Makefile.uni asm bf_locl.org README \ | ||
52 | COPYRIGHT blowfish.doc INSTALL | ||
53 | |||
54 | TESTING= bftest bfspeed bf_opts | ||
55 | TESTING_SRC=bftest.c bfspeed.c bf_opts.c | ||
56 | HEADERS=bf_locl.h blowfish.h bf_pi.h | ||
57 | |||
58 | ALL= $(GENERAL) $(TESTING_SRC) $(LIBSRC) $(HEADERS) | ||
59 | |||
60 | BLIB= libblowfish.a | ||
61 | |||
62 | all: $(BLIB) $(TESTING) | ||
63 | |||
64 | cc: | ||
65 | $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all | ||
66 | |||
67 | gcc: | ||
68 | $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all | ||
69 | |||
70 | x86-elf: | ||
71 | $(MAKE) BF_ENC='asm/bx86-elf.o' CC=$(CC) CFLAGS="-DELF $(OPTS) $(CFLAG)" all | ||
72 | |||
73 | x86-out: | ||
74 | $(MAKE) BF_ENC='asm/bx86-out.o' CC=$(CC) CFLAGS="-DOUT $(OPTS) $(CFLAG)" all | ||
75 | |||
76 | x86-solaris: | ||
77 | $(MAKE) BF_ENC='asm/bx86-sol.o' CC=$(CC) CFLAGS="-DSOL $(OPTS) $(CFLAG)" all | ||
78 | |||
79 | x86-bsdi: | ||
80 | $(MAKE) BF_ENC='asm/bx86bsdi.o' CC=$(CC) CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all | ||
81 | |||
82 | # elf | ||
83 | asm/bx86-elf.o: asm/bx86unix.cpp | ||
84 | $(CPP) -DELF asm/bx86unix.cpp | $(AS) -o asm/bx86-elf.o | ||
85 | |||
86 | # solaris | ||
87 | asm/bx86-sol.o: asm/bx86unix.cpp | ||
88 | $(CC) -E -DSOL asm/bx86unix.cpp | sed 's/^#.*//' > asm/bx86-sol.s | ||
89 | as -o asm/bx86-sol.o asm/bx86-sol.s | ||
90 | rm -f asm/bx86-sol.s | ||
91 | |||
92 | # a.out | ||
93 | asm/bx86-out.o: asm/bx86unix.cpp | ||
94 | $(CPP) -DOUT asm/bx86unix.cpp | $(AS) -o asm/bx86-out.o | ||
95 | |||
96 | # bsdi | ||
97 | asm/bx86bsdi.o: asm/bx86unix.cpp | ||
98 | $(CPP) -DBSDI asm/bx86unix.cpp | $(AS) -o asm/bx86bsdi.o | ||
99 | |||
100 | asm/bx86unix.cpp: | ||
101 | (cd asm; perl bf-586.pl cpp >bx86unix.cpp) | ||
102 | |||
103 | test: all | ||
104 | ./bftest | ||
105 | |||
106 | $(BLIB): $(LIBOBJ) | ||
107 | /bin/rm -f $(BLIB) | ||
108 | ar cr $(BLIB) $(LIBOBJ) | ||
109 | $(RANLIB) $(BLIB) | ||
110 | |||
111 | bftest: bftest.o $(BLIB) | ||
112 | $(CC) $(CFLAGS) -o bftest bftest.o $(BLIB) | ||
113 | |||
114 | bfspeed: bfspeed.o $(BLIB) | ||
115 | $(CC) $(CFLAGS) -o bfspeed bfspeed.o $(BLIB) | ||
116 | |||
117 | bf_opts: bf_opts.o $(BLIB) | ||
118 | $(CC) $(CFLAGS) -o bf_opts bf_opts.o $(BLIB) | ||
119 | |||
120 | tags: | ||
121 | ctags $(TESTING_SRC) $(LIBBF) | ||
122 | |||
123 | tar: | ||
124 | tar chf libbf.tar $(ALL) | ||
125 | |||
126 | shar: | ||
127 | shar $(ALL) >libbf.shar | ||
128 | |||
129 | depend: | ||
130 | makedepend $(LIBBF) $(TESTING_SRC) | ||
131 | |||
132 | clean: | ||
133 | /bin/rm -f *.o tags core $(TESTING) $(BLIB) .nfs* *.old *.bak asm/*.o | ||
134 | |||
135 | dclean: | ||
136 | sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new | ||
137 | mv -f Makefile.new Makefile | ||
138 | |||
139 | # Eric is probably going to choke when he next looks at this --tjh | ||
140 | install: $(BLIB) | ||
141 | if test $(INSTALLTOP); then \ | ||
142 | echo SSL style install; \ | ||
143 | cp $(BLIB) $(INSTALLTOP)/lib; \ | ||
144 | $(RANLIB) $(BLIB); \ | ||
145 | chmod 644 $(INSTALLTOP)/lib/$(BLIB); \ | ||
146 | cp blowfish.h $(INSTALLTOP)/include; \ | ||
147 | chmod 644 $(INSTALLTOP)/include/blowfish.h; \ | ||
148 | else \ | ||
149 | echo Standalone install; \ | ||
150 | cp $(BLIB) $(LIBDIR)/$(BLIB); \ | ||
151 | $(RANLIB) $(BLIB); \ | ||
152 | chmod 644 $(LIBDIR)/$(BLIB); \ | ||
153 | cp blowfish.h $(INCDIR)/blowfish.h; \ | ||
154 | chmod 644 $(INCDIR)/blowfish.h; \ | ||
155 | fi | ||
156 | |||
157 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/bf/asm/b-win32.asm b/src/lib/libcrypto/bf/asm/b-win32.asm index 138c99d0aa..e69de29bb2 100644 --- a/src/lib/libcrypto/bf/asm/b-win32.asm +++ b/src/lib/libcrypto/bf/asm/b-win32.asm | |||
@@ -1,906 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by bf-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE bf-586.asm | ||
8 | .486 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _BF_encrypt | ||
12 | |||
13 | _BF_encrypt PROC NEAR | ||
14 | ; | ||
15 | push ebp | ||
16 | push ebx | ||
17 | mov ebx, DWORD PTR 12[esp] | ||
18 | mov ebp, DWORD PTR 16[esp] | ||
19 | push esi | ||
20 | push edi | ||
21 | ; Load the 2 words | ||
22 | mov edi, DWORD PTR [ebx] | ||
23 | mov esi, DWORD PTR 4[ebx] | ||
24 | xor eax, eax | ||
25 | mov ebx, DWORD PTR [ebp] | ||
26 | xor ecx, ecx | ||
27 | xor edi, ebx | ||
28 | ; | ||
29 | ; Round 0 | ||
30 | mov edx, DWORD PTR 4[ebp] | ||
31 | mov ebx, edi | ||
32 | xor esi, edx | ||
33 | shr ebx, 16 | ||
34 | mov edx, edi | ||
35 | mov al, bh | ||
36 | and ebx, 255 | ||
37 | mov cl, dh | ||
38 | and edx, 255 | ||
39 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
40 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
41 | add ebx, eax | ||
42 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
43 | xor ebx, eax | ||
44 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
45 | add ebx, edx | ||
46 | xor eax, eax | ||
47 | xor esi, ebx | ||
48 | ; | ||
49 | ; Round 1 | ||
50 | mov edx, DWORD PTR 8[ebp] | ||
51 | mov ebx, esi | ||
52 | xor edi, edx | ||
53 | shr ebx, 16 | ||
54 | mov edx, esi | ||
55 | mov al, bh | ||
56 | and ebx, 255 | ||
57 | mov cl, dh | ||
58 | and edx, 255 | ||
59 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
60 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
61 | add ebx, eax | ||
62 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
63 | xor ebx, eax | ||
64 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
65 | add ebx, edx | ||
66 | xor eax, eax | ||
67 | xor edi, ebx | ||
68 | ; | ||
69 | ; Round 2 | ||
70 | mov edx, DWORD PTR 12[ebp] | ||
71 | mov ebx, edi | ||
72 | xor esi, edx | ||
73 | shr ebx, 16 | ||
74 | mov edx, edi | ||
75 | mov al, bh | ||
76 | and ebx, 255 | ||
77 | mov cl, dh | ||
78 | and edx, 255 | ||
79 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
80 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
81 | add ebx, eax | ||
82 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
83 | xor ebx, eax | ||
84 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
85 | add ebx, edx | ||
86 | xor eax, eax | ||
87 | xor esi, ebx | ||
88 | ; | ||
89 | ; Round 3 | ||
90 | mov edx, DWORD PTR 16[ebp] | ||
91 | mov ebx, esi | ||
92 | xor edi, edx | ||
93 | shr ebx, 16 | ||
94 | mov edx, esi | ||
95 | mov al, bh | ||
96 | and ebx, 255 | ||
97 | mov cl, dh | ||
98 | and edx, 255 | ||
99 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
100 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
101 | add ebx, eax | ||
102 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
103 | xor ebx, eax | ||
104 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
105 | add ebx, edx | ||
106 | xor eax, eax | ||
107 | xor edi, ebx | ||
108 | ; | ||
109 | ; Round 4 | ||
110 | mov edx, DWORD PTR 20[ebp] | ||
111 | mov ebx, edi | ||
112 | xor esi, edx | ||
113 | shr ebx, 16 | ||
114 | mov edx, edi | ||
115 | mov al, bh | ||
116 | and ebx, 255 | ||
117 | mov cl, dh | ||
118 | and edx, 255 | ||
119 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
120 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
121 | add ebx, eax | ||
122 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
123 | xor ebx, eax | ||
124 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
125 | add ebx, edx | ||
126 | xor eax, eax | ||
127 | xor esi, ebx | ||
128 | ; | ||
129 | ; Round 5 | ||
130 | mov edx, DWORD PTR 24[ebp] | ||
131 | mov ebx, esi | ||
132 | xor edi, edx | ||
133 | shr ebx, 16 | ||
134 | mov edx, esi | ||
135 | mov al, bh | ||
136 | and ebx, 255 | ||
137 | mov cl, dh | ||
138 | and edx, 255 | ||
139 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
140 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
141 | add ebx, eax | ||
142 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
143 | xor ebx, eax | ||
144 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
145 | add ebx, edx | ||
146 | xor eax, eax | ||
147 | xor edi, ebx | ||
148 | ; | ||
149 | ; Round 6 | ||
150 | mov edx, DWORD PTR 28[ebp] | ||
151 | mov ebx, edi | ||
152 | xor esi, edx | ||
153 | shr ebx, 16 | ||
154 | mov edx, edi | ||
155 | mov al, bh | ||
156 | and ebx, 255 | ||
157 | mov cl, dh | ||
158 | and edx, 255 | ||
159 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
160 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
161 | add ebx, eax | ||
162 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
163 | xor ebx, eax | ||
164 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
165 | add ebx, edx | ||
166 | xor eax, eax | ||
167 | xor esi, ebx | ||
168 | ; | ||
169 | ; Round 7 | ||
170 | mov edx, DWORD PTR 32[ebp] | ||
171 | mov ebx, esi | ||
172 | xor edi, edx | ||
173 | shr ebx, 16 | ||
174 | mov edx, esi | ||
175 | mov al, bh | ||
176 | and ebx, 255 | ||
177 | mov cl, dh | ||
178 | and edx, 255 | ||
179 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
180 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
181 | add ebx, eax | ||
182 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
183 | xor ebx, eax | ||
184 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
185 | add ebx, edx | ||
186 | xor eax, eax | ||
187 | xor edi, ebx | ||
188 | ; | ||
189 | ; Round 8 | ||
190 | mov edx, DWORD PTR 36[ebp] | ||
191 | mov ebx, edi | ||
192 | xor esi, edx | ||
193 | shr ebx, 16 | ||
194 | mov edx, edi | ||
195 | mov al, bh | ||
196 | and ebx, 255 | ||
197 | mov cl, dh | ||
198 | and edx, 255 | ||
199 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
200 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
201 | add ebx, eax | ||
202 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
203 | xor ebx, eax | ||
204 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
205 | add ebx, edx | ||
206 | xor eax, eax | ||
207 | xor esi, ebx | ||
208 | ; | ||
209 | ; Round 9 | ||
210 | mov edx, DWORD PTR 40[ebp] | ||
211 | mov ebx, esi | ||
212 | xor edi, edx | ||
213 | shr ebx, 16 | ||
214 | mov edx, esi | ||
215 | mov al, bh | ||
216 | and ebx, 255 | ||
217 | mov cl, dh | ||
218 | and edx, 255 | ||
219 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
220 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
221 | add ebx, eax | ||
222 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
223 | xor ebx, eax | ||
224 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
225 | add ebx, edx | ||
226 | xor eax, eax | ||
227 | xor edi, ebx | ||
228 | ; | ||
229 | ; Round 10 | ||
230 | mov edx, DWORD PTR 44[ebp] | ||
231 | mov ebx, edi | ||
232 | xor esi, edx | ||
233 | shr ebx, 16 | ||
234 | mov edx, edi | ||
235 | mov al, bh | ||
236 | and ebx, 255 | ||
237 | mov cl, dh | ||
238 | and edx, 255 | ||
239 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
240 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
241 | add ebx, eax | ||
242 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
243 | xor ebx, eax | ||
244 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
245 | add ebx, edx | ||
246 | xor eax, eax | ||
247 | xor esi, ebx | ||
248 | ; | ||
249 | ; Round 11 | ||
250 | mov edx, DWORD PTR 48[ebp] | ||
251 | mov ebx, esi | ||
252 | xor edi, edx | ||
253 | shr ebx, 16 | ||
254 | mov edx, esi | ||
255 | mov al, bh | ||
256 | and ebx, 255 | ||
257 | mov cl, dh | ||
258 | and edx, 255 | ||
259 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
260 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
261 | add ebx, eax | ||
262 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
263 | xor ebx, eax | ||
264 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
265 | add ebx, edx | ||
266 | xor eax, eax | ||
267 | xor edi, ebx | ||
268 | ; | ||
269 | ; Round 12 | ||
270 | mov edx, DWORD PTR 52[ebp] | ||
271 | mov ebx, edi | ||
272 | xor esi, edx | ||
273 | shr ebx, 16 | ||
274 | mov edx, edi | ||
275 | mov al, bh | ||
276 | and ebx, 255 | ||
277 | mov cl, dh | ||
278 | and edx, 255 | ||
279 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
280 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
281 | add ebx, eax | ||
282 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
283 | xor ebx, eax | ||
284 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
285 | add ebx, edx | ||
286 | xor eax, eax | ||
287 | xor esi, ebx | ||
288 | ; | ||
289 | ; Round 13 | ||
290 | mov edx, DWORD PTR 56[ebp] | ||
291 | mov ebx, esi | ||
292 | xor edi, edx | ||
293 | shr ebx, 16 | ||
294 | mov edx, esi | ||
295 | mov al, bh | ||
296 | and ebx, 255 | ||
297 | mov cl, dh | ||
298 | and edx, 255 | ||
299 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
300 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
301 | add ebx, eax | ||
302 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
303 | xor ebx, eax | ||
304 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
305 | add ebx, edx | ||
306 | xor eax, eax | ||
307 | xor edi, ebx | ||
308 | ; | ||
309 | ; Round 14 | ||
310 | mov edx, DWORD PTR 60[ebp] | ||
311 | mov ebx, edi | ||
312 | xor esi, edx | ||
313 | shr ebx, 16 | ||
314 | mov edx, edi | ||
315 | mov al, bh | ||
316 | and ebx, 255 | ||
317 | mov cl, dh | ||
318 | and edx, 255 | ||
319 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
320 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
321 | add ebx, eax | ||
322 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
323 | xor ebx, eax | ||
324 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
325 | add ebx, edx | ||
326 | xor eax, eax | ||
327 | xor esi, ebx | ||
328 | ; | ||
329 | ; Round 15 | ||
330 | mov edx, DWORD PTR 64[ebp] | ||
331 | mov ebx, esi | ||
332 | xor edi, edx | ||
333 | shr ebx, 16 | ||
334 | mov edx, esi | ||
335 | mov al, bh | ||
336 | and ebx, 255 | ||
337 | mov cl, dh | ||
338 | and edx, 255 | ||
339 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
340 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
341 | add ebx, eax | ||
342 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
343 | xor ebx, eax | ||
344 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
345 | add ebx, edx | ||
346 | ; Load parameter 0 (16) enc=1 | ||
347 | mov eax, DWORD PTR 20[esp] | ||
348 | xor edi, ebx | ||
349 | mov edx, DWORD PTR 68[ebp] | ||
350 | xor esi, edx | ||
351 | mov DWORD PTR 4[eax],edi | ||
352 | mov DWORD PTR [eax],esi | ||
353 | pop edi | ||
354 | pop esi | ||
355 | pop ebx | ||
356 | pop ebp | ||
357 | ret | ||
358 | _BF_encrypt ENDP | ||
359 | _TEXT ENDS | ||
360 | _TEXT SEGMENT | ||
361 | PUBLIC _BF_decrypt | ||
362 | |||
363 | _BF_decrypt PROC NEAR | ||
364 | ; | ||
365 | push ebp | ||
366 | push ebx | ||
367 | mov ebx, DWORD PTR 12[esp] | ||
368 | mov ebp, DWORD PTR 16[esp] | ||
369 | push esi | ||
370 | push edi | ||
371 | ; Load the 2 words | ||
372 | mov edi, DWORD PTR [ebx] | ||
373 | mov esi, DWORD PTR 4[ebx] | ||
374 | xor eax, eax | ||
375 | mov ebx, DWORD PTR 68[ebp] | ||
376 | xor ecx, ecx | ||
377 | xor edi, ebx | ||
378 | ; | ||
379 | ; Round 16 | ||
380 | mov edx, DWORD PTR 64[ebp] | ||
381 | mov ebx, edi | ||
382 | xor esi, edx | ||
383 | shr ebx, 16 | ||
384 | mov edx, edi | ||
385 | mov al, bh | ||
386 | and ebx, 255 | ||
387 | mov cl, dh | ||
388 | and edx, 255 | ||
389 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
390 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
391 | add ebx, eax | ||
392 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
393 | xor ebx, eax | ||
394 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
395 | add ebx, edx | ||
396 | xor eax, eax | ||
397 | xor esi, ebx | ||
398 | ; | ||
399 | ; Round 15 | ||
400 | mov edx, DWORD PTR 60[ebp] | ||
401 | mov ebx, esi | ||
402 | xor edi, edx | ||
403 | shr ebx, 16 | ||
404 | mov edx, esi | ||
405 | mov al, bh | ||
406 | and ebx, 255 | ||
407 | mov cl, dh | ||
408 | and edx, 255 | ||
409 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
410 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
411 | add ebx, eax | ||
412 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
413 | xor ebx, eax | ||
414 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
415 | add ebx, edx | ||
416 | xor eax, eax | ||
417 | xor edi, ebx | ||
418 | ; | ||
419 | ; Round 14 | ||
420 | mov edx, DWORD PTR 56[ebp] | ||
421 | mov ebx, edi | ||
422 | xor esi, edx | ||
423 | shr ebx, 16 | ||
424 | mov edx, edi | ||
425 | mov al, bh | ||
426 | and ebx, 255 | ||
427 | mov cl, dh | ||
428 | and edx, 255 | ||
429 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
430 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
431 | add ebx, eax | ||
432 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
433 | xor ebx, eax | ||
434 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
435 | add ebx, edx | ||
436 | xor eax, eax | ||
437 | xor esi, ebx | ||
438 | ; | ||
439 | ; Round 13 | ||
440 | mov edx, DWORD PTR 52[ebp] | ||
441 | mov ebx, esi | ||
442 | xor edi, edx | ||
443 | shr ebx, 16 | ||
444 | mov edx, esi | ||
445 | mov al, bh | ||
446 | and ebx, 255 | ||
447 | mov cl, dh | ||
448 | and edx, 255 | ||
449 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
450 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
451 | add ebx, eax | ||
452 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
453 | xor ebx, eax | ||
454 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
455 | add ebx, edx | ||
456 | xor eax, eax | ||
457 | xor edi, ebx | ||
458 | ; | ||
459 | ; Round 12 | ||
460 | mov edx, DWORD PTR 48[ebp] | ||
461 | mov ebx, edi | ||
462 | xor esi, edx | ||
463 | shr ebx, 16 | ||
464 | mov edx, edi | ||
465 | mov al, bh | ||
466 | and ebx, 255 | ||
467 | mov cl, dh | ||
468 | and edx, 255 | ||
469 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
470 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
471 | add ebx, eax | ||
472 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
473 | xor ebx, eax | ||
474 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
475 | add ebx, edx | ||
476 | xor eax, eax | ||
477 | xor esi, ebx | ||
478 | ; | ||
479 | ; Round 11 | ||
480 | mov edx, DWORD PTR 44[ebp] | ||
481 | mov ebx, esi | ||
482 | xor edi, edx | ||
483 | shr ebx, 16 | ||
484 | mov edx, esi | ||
485 | mov al, bh | ||
486 | and ebx, 255 | ||
487 | mov cl, dh | ||
488 | and edx, 255 | ||
489 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
490 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
491 | add ebx, eax | ||
492 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
493 | xor ebx, eax | ||
494 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
495 | add ebx, edx | ||
496 | xor eax, eax | ||
497 | xor edi, ebx | ||
498 | ; | ||
499 | ; Round 10 | ||
500 | mov edx, DWORD PTR 40[ebp] | ||
501 | mov ebx, edi | ||
502 | xor esi, edx | ||
503 | shr ebx, 16 | ||
504 | mov edx, edi | ||
505 | mov al, bh | ||
506 | and ebx, 255 | ||
507 | mov cl, dh | ||
508 | and edx, 255 | ||
509 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
510 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
511 | add ebx, eax | ||
512 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
513 | xor ebx, eax | ||
514 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
515 | add ebx, edx | ||
516 | xor eax, eax | ||
517 | xor esi, ebx | ||
518 | ; | ||
519 | ; Round 9 | ||
520 | mov edx, DWORD PTR 36[ebp] | ||
521 | mov ebx, esi | ||
522 | xor edi, edx | ||
523 | shr ebx, 16 | ||
524 | mov edx, esi | ||
525 | mov al, bh | ||
526 | and ebx, 255 | ||
527 | mov cl, dh | ||
528 | and edx, 255 | ||
529 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
530 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
531 | add ebx, eax | ||
532 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
533 | xor ebx, eax | ||
534 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
535 | add ebx, edx | ||
536 | xor eax, eax | ||
537 | xor edi, ebx | ||
538 | ; | ||
539 | ; Round 8 | ||
540 | mov edx, DWORD PTR 32[ebp] | ||
541 | mov ebx, edi | ||
542 | xor esi, edx | ||
543 | shr ebx, 16 | ||
544 | mov edx, edi | ||
545 | mov al, bh | ||
546 | and ebx, 255 | ||
547 | mov cl, dh | ||
548 | and edx, 255 | ||
549 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
550 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
551 | add ebx, eax | ||
552 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
553 | xor ebx, eax | ||
554 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
555 | add ebx, edx | ||
556 | xor eax, eax | ||
557 | xor esi, ebx | ||
558 | ; | ||
559 | ; Round 7 | ||
560 | mov edx, DWORD PTR 28[ebp] | ||
561 | mov ebx, esi | ||
562 | xor edi, edx | ||
563 | shr ebx, 16 | ||
564 | mov edx, esi | ||
565 | mov al, bh | ||
566 | and ebx, 255 | ||
567 | mov cl, dh | ||
568 | and edx, 255 | ||
569 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
570 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
571 | add ebx, eax | ||
572 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
573 | xor ebx, eax | ||
574 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
575 | add ebx, edx | ||
576 | xor eax, eax | ||
577 | xor edi, ebx | ||
578 | ; | ||
579 | ; Round 6 | ||
580 | mov edx, DWORD PTR 24[ebp] | ||
581 | mov ebx, edi | ||
582 | xor esi, edx | ||
583 | shr ebx, 16 | ||
584 | mov edx, edi | ||
585 | mov al, bh | ||
586 | and ebx, 255 | ||
587 | mov cl, dh | ||
588 | and edx, 255 | ||
589 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
590 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
591 | add ebx, eax | ||
592 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
593 | xor ebx, eax | ||
594 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
595 | add ebx, edx | ||
596 | xor eax, eax | ||
597 | xor esi, ebx | ||
598 | ; | ||
599 | ; Round 5 | ||
600 | mov edx, DWORD PTR 20[ebp] | ||
601 | mov ebx, esi | ||
602 | xor edi, edx | ||
603 | shr ebx, 16 | ||
604 | mov edx, esi | ||
605 | mov al, bh | ||
606 | and ebx, 255 | ||
607 | mov cl, dh | ||
608 | and edx, 255 | ||
609 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
610 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
611 | add ebx, eax | ||
612 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
613 | xor ebx, eax | ||
614 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
615 | add ebx, edx | ||
616 | xor eax, eax | ||
617 | xor edi, ebx | ||
618 | ; | ||
619 | ; Round 4 | ||
620 | mov edx, DWORD PTR 16[ebp] | ||
621 | mov ebx, edi | ||
622 | xor esi, edx | ||
623 | shr ebx, 16 | ||
624 | mov edx, edi | ||
625 | mov al, bh | ||
626 | and ebx, 255 | ||
627 | mov cl, dh | ||
628 | and edx, 255 | ||
629 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
630 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
631 | add ebx, eax | ||
632 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
633 | xor ebx, eax | ||
634 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
635 | add ebx, edx | ||
636 | xor eax, eax | ||
637 | xor esi, ebx | ||
638 | ; | ||
639 | ; Round 3 | ||
640 | mov edx, DWORD PTR 12[ebp] | ||
641 | mov ebx, esi | ||
642 | xor edi, edx | ||
643 | shr ebx, 16 | ||
644 | mov edx, esi | ||
645 | mov al, bh | ||
646 | and ebx, 255 | ||
647 | mov cl, dh | ||
648 | and edx, 255 | ||
649 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
650 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
651 | add ebx, eax | ||
652 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
653 | xor ebx, eax | ||
654 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
655 | add ebx, edx | ||
656 | xor eax, eax | ||
657 | xor edi, ebx | ||
658 | ; | ||
659 | ; Round 2 | ||
660 | mov edx, DWORD PTR 8[ebp] | ||
661 | mov ebx, edi | ||
662 | xor esi, edx | ||
663 | shr ebx, 16 | ||
664 | mov edx, edi | ||
665 | mov al, bh | ||
666 | and ebx, 255 | ||
667 | mov cl, dh | ||
668 | and edx, 255 | ||
669 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
670 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
671 | add ebx, eax | ||
672 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
673 | xor ebx, eax | ||
674 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
675 | add ebx, edx | ||
676 | xor eax, eax | ||
677 | xor esi, ebx | ||
678 | ; | ||
679 | ; Round 1 | ||
680 | mov edx, DWORD PTR 4[ebp] | ||
681 | mov ebx, esi | ||
682 | xor edi, edx | ||
683 | shr ebx, 16 | ||
684 | mov edx, esi | ||
685 | mov al, bh | ||
686 | and ebx, 255 | ||
687 | mov cl, dh | ||
688 | and edx, 255 | ||
689 | mov eax, DWORD PTR 72[eax*4+ebp] | ||
690 | mov ebx, DWORD PTR 1096[ebx*4+ebp] | ||
691 | add ebx, eax | ||
692 | mov eax, DWORD PTR 2120[ecx*4+ebp] | ||
693 | xor ebx, eax | ||
694 | mov edx, DWORD PTR 3144[edx*4+ebp] | ||
695 | add ebx, edx | ||
696 | ; Load parameter 0 (1) enc=0 | ||
697 | mov eax, DWORD PTR 20[esp] | ||
698 | xor edi, ebx | ||
699 | mov edx, DWORD PTR [ebp] | ||
700 | xor esi, edx | ||
701 | mov DWORD PTR 4[eax],edi | ||
702 | mov DWORD PTR [eax],esi | ||
703 | pop edi | ||
704 | pop esi | ||
705 | pop ebx | ||
706 | pop ebp | ||
707 | ret | ||
708 | _BF_decrypt ENDP | ||
709 | _TEXT ENDS | ||
710 | _TEXT SEGMENT | ||
711 | PUBLIC _BF_cbc_encrypt | ||
712 | |||
713 | _BF_cbc_encrypt PROC NEAR | ||
714 | ; | ||
715 | push ebp | ||
716 | push ebx | ||
717 | push esi | ||
718 | push edi | ||
719 | mov ebp, DWORD PTR 28[esp] | ||
720 | ; getting iv ptr from parameter 4 | ||
721 | mov ebx, DWORD PTR 36[esp] | ||
722 | mov esi, DWORD PTR [ebx] | ||
723 | mov edi, DWORD PTR 4[ebx] | ||
724 | push edi | ||
725 | push esi | ||
726 | push edi | ||
727 | push esi | ||
728 | mov ebx, esp | ||
729 | mov esi, DWORD PTR 36[esp] | ||
730 | mov edi, DWORD PTR 40[esp] | ||
731 | ; getting encrypt flag from parameter 5 | ||
732 | mov ecx, DWORD PTR 56[esp] | ||
733 | ; get and push parameter 3 | ||
734 | mov eax, DWORD PTR 48[esp] | ||
735 | push eax | ||
736 | push ebx | ||
737 | cmp ecx, 0 | ||
738 | jz $L000decrypt | ||
739 | and ebp, 4294967288 | ||
740 | mov eax, DWORD PTR 8[esp] | ||
741 | mov ebx, DWORD PTR 12[esp] | ||
742 | jz $L001encrypt_finish | ||
743 | L002encrypt_loop: | ||
744 | mov ecx, DWORD PTR [esi] | ||
745 | mov edx, DWORD PTR 4[esi] | ||
746 | xor eax, ecx | ||
747 | xor ebx, edx | ||
748 | bswap eax | ||
749 | bswap ebx | ||
750 | mov DWORD PTR 8[esp],eax | ||
751 | mov DWORD PTR 12[esp],ebx | ||
752 | call _BF_encrypt | ||
753 | mov eax, DWORD PTR 8[esp] | ||
754 | mov ebx, DWORD PTR 12[esp] | ||
755 | bswap eax | ||
756 | bswap ebx | ||
757 | mov DWORD PTR [edi],eax | ||
758 | mov DWORD PTR 4[edi],ebx | ||
759 | add esi, 8 | ||
760 | add edi, 8 | ||
761 | sub ebp, 8 | ||
762 | jnz L002encrypt_loop | ||
763 | $L001encrypt_finish: | ||
764 | mov ebp, DWORD PTR 52[esp] | ||
765 | and ebp, 7 | ||
766 | jz $L003finish | ||
767 | xor ecx, ecx | ||
768 | xor edx, edx | ||
769 | mov ebp, DWORD PTR $L004cbc_enc_jmp_table[ebp*4] | ||
770 | jmp ebp | ||
771 | L005ej7: | ||
772 | mov dh, BYTE PTR 6[esi] | ||
773 | shl edx, 8 | ||
774 | L006ej6: | ||
775 | mov dh, BYTE PTR 5[esi] | ||
776 | L007ej5: | ||
777 | mov dl, BYTE PTR 4[esi] | ||
778 | L008ej4: | ||
779 | mov ecx, DWORD PTR [esi] | ||
780 | jmp $L009ejend | ||
781 | L010ej3: | ||
782 | mov ch, BYTE PTR 2[esi] | ||
783 | shl ecx, 8 | ||
784 | L011ej2: | ||
785 | mov ch, BYTE PTR 1[esi] | ||
786 | L012ej1: | ||
787 | mov cl, BYTE PTR [esi] | ||
788 | $L009ejend: | ||
789 | xor eax, ecx | ||
790 | xor ebx, edx | ||
791 | bswap eax | ||
792 | bswap ebx | ||
793 | mov DWORD PTR 8[esp],eax | ||
794 | mov DWORD PTR 12[esp],ebx | ||
795 | call _BF_encrypt | ||
796 | mov eax, DWORD PTR 8[esp] | ||
797 | mov ebx, DWORD PTR 12[esp] | ||
798 | bswap eax | ||
799 | bswap ebx | ||
800 | mov DWORD PTR [edi],eax | ||
801 | mov DWORD PTR 4[edi],ebx | ||
802 | jmp $L003finish | ||
803 | $L000decrypt: | ||
804 | and ebp, 4294967288 | ||
805 | mov eax, DWORD PTR 16[esp] | ||
806 | mov ebx, DWORD PTR 20[esp] | ||
807 | jz $L013decrypt_finish | ||
808 | L014decrypt_loop: | ||
809 | mov eax, DWORD PTR [esi] | ||
810 | mov ebx, DWORD PTR 4[esi] | ||
811 | bswap eax | ||
812 | bswap ebx | ||
813 | mov DWORD PTR 8[esp],eax | ||
814 | mov DWORD PTR 12[esp],ebx | ||
815 | call _BF_decrypt | ||
816 | mov eax, DWORD PTR 8[esp] | ||
817 | mov ebx, DWORD PTR 12[esp] | ||
818 | bswap eax | ||
819 | bswap ebx | ||
820 | mov ecx, DWORD PTR 16[esp] | ||
821 | mov edx, DWORD PTR 20[esp] | ||
822 | xor ecx, eax | ||
823 | xor edx, ebx | ||
824 | mov eax, DWORD PTR [esi] | ||
825 | mov ebx, DWORD PTR 4[esi] | ||
826 | mov DWORD PTR [edi],ecx | ||
827 | mov DWORD PTR 4[edi],edx | ||
828 | mov DWORD PTR 16[esp],eax | ||
829 | mov DWORD PTR 20[esp],ebx | ||
830 | add esi, 8 | ||
831 | add edi, 8 | ||
832 | sub ebp, 8 | ||
833 | jnz L014decrypt_loop | ||
834 | $L013decrypt_finish: | ||
835 | mov ebp, DWORD PTR 52[esp] | ||
836 | and ebp, 7 | ||
837 | jz $L003finish | ||
838 | mov eax, DWORD PTR [esi] | ||
839 | mov ebx, DWORD PTR 4[esi] | ||
840 | bswap eax | ||
841 | bswap ebx | ||
842 | mov DWORD PTR 8[esp],eax | ||
843 | mov DWORD PTR 12[esp],ebx | ||
844 | call _BF_decrypt | ||
845 | mov eax, DWORD PTR 8[esp] | ||
846 | mov ebx, DWORD PTR 12[esp] | ||
847 | bswap eax | ||
848 | bswap ebx | ||
849 | mov ecx, DWORD PTR 16[esp] | ||
850 | mov edx, DWORD PTR 20[esp] | ||
851 | xor ecx, eax | ||
852 | xor edx, ebx | ||
853 | mov eax, DWORD PTR [esi] | ||
854 | mov ebx, DWORD PTR 4[esi] | ||
855 | L015dj7: | ||
856 | ror edx, 16 | ||
857 | mov BYTE PTR 6[edi],dl | ||
858 | shr edx, 16 | ||
859 | L016dj6: | ||
860 | mov BYTE PTR 5[edi],dh | ||
861 | L017dj5: | ||
862 | mov BYTE PTR 4[edi],dl | ||
863 | L018dj4: | ||
864 | mov DWORD PTR [edi],ecx | ||
865 | jmp $L019djend | ||
866 | L020dj3: | ||
867 | ror ecx, 16 | ||
868 | mov BYTE PTR 2[edi],cl | ||
869 | shl ecx, 16 | ||
870 | L021dj2: | ||
871 | mov BYTE PTR 1[esi],ch | ||
872 | L022dj1: | ||
873 | mov BYTE PTR [esi], cl | ||
874 | $L019djend: | ||
875 | jmp $L003finish | ||
876 | $L003finish: | ||
877 | mov ecx, DWORD PTR 60[esp] | ||
878 | add esp, 24 | ||
879 | mov DWORD PTR [ecx],eax | ||
880 | mov DWORD PTR 4[ecx],ebx | ||
881 | pop edi | ||
882 | pop esi | ||
883 | pop ebx | ||
884 | pop ebp | ||
885 | ret | ||
886 | $L004cbc_enc_jmp_table: | ||
887 | DD 0 | ||
888 | DD L012ej1 | ||
889 | DD L011ej2 | ||
890 | DD L010ej3 | ||
891 | DD L008ej4 | ||
892 | DD L007ej5 | ||
893 | DD L006ej6 | ||
894 | DD L005ej7 | ||
895 | L023cbc_dec_jmp_table: | ||
896 | DD 0 | ||
897 | DD L022dj1 | ||
898 | DD L021dj2 | ||
899 | DD L020dj3 | ||
900 | DD L018dj4 | ||
901 | DD L017dj5 | ||
902 | DD L016dj6 | ||
903 | DD L015dj7 | ||
904 | _BF_cbc_encrypt ENDP | ||
905 | _TEXT ENDS | ||
906 | END | ||
diff --git a/src/lib/libcrypto/bio/Makefile.ssl b/src/lib/libcrypto/bio/Makefile.ssl index 2e7480ead9..755f255fe4 100644 --- a/src/lib/libcrypto/bio/Makefile.ssl +++ b/src/lib/libcrypto/bio/Makefile.ssl | |||
@@ -172,8 +172,10 @@ bss_acpt.o: ../../include/openssl/opensslconf.h | |||
172 | bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 172 | bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h |
173 | bss_acpt.o: ../../include/openssl/stack.h ../cryptlib.h | 173 | bss_acpt.o: ../../include/openssl/stack.h ../cryptlib.h |
174 | bss_bio.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | 174 | bss_bio.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h |
175 | bss_bio.o: ../../include/openssl/err.h ../../include/openssl/opensslv.h | 175 | bss_bio.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h |
176 | bss_bio.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 176 | bss_bio.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h |
177 | bss_bio.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
178 | bss_bio.o: ../../include/openssl/stack.h | ||
177 | bss_conn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 179 | bss_conn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
178 | bss_conn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 180 | bss_conn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h |
179 | bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 181 | bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c index 2a5e8b58c9..b11b501512 100644 --- a/src/lib/libcrypto/bio/b_print.c +++ b/src/lib/libcrypto/bio/b_print.c | |||
@@ -64,6 +64,8 @@ | |||
64 | #include <stdarg.h> | 64 | #include <stdarg.h> |
65 | #include <string.h> | 65 | #include <string.h> |
66 | #include <ctype.h> | 66 | #include <ctype.h> |
67 | #include <assert.h> | ||
68 | #include <limits.h> | ||
67 | #include "cryptlib.h" | 69 | #include "cryptlib.h" |
68 | #ifndef NO_SYS_TYPES_H | 70 | #ifndef NO_SYS_TYPES_H |
69 | #include <sys/types.h> | 71 | #include <sys/types.h> |
@@ -72,12 +74,16 @@ | |||
72 | 74 | ||
73 | #ifdef BN_LLONG | 75 | #ifdef BN_LLONG |
74 | # ifndef HAVE_LONG_LONG | 76 | # ifndef HAVE_LONG_LONG |
75 | # define HAVE_LONG_LONG | 77 | # define HAVE_LONG_LONG 1 |
76 | # endif | 78 | # endif |
77 | #endif | 79 | #endif |
78 | 80 | ||
79 | static void dopr (char *buffer, size_t maxlen, size_t *retlen, | 81 | static void dopr (char *buffer, size_t maxlen, size_t *retlen, |
80 | const char *format, va_list args); | 82 | const char *format, va_list args); |
83 | #ifdef USE_ALLOCATING_PRINT | ||
84 | static void doapr (char **buffer, size_t *retlen, | ||
85 | const char *format, va_list args); | ||
86 | #endif | ||
81 | 87 | ||
82 | int BIO_printf (BIO *bio, ...) | 88 | int BIO_printf (BIO *bio, ...) |
83 | { | 89 | { |
@@ -85,15 +91,32 @@ int BIO_printf (BIO *bio, ...) | |||
85 | char *format; | 91 | char *format; |
86 | int ret; | 92 | int ret; |
87 | size_t retlen; | 93 | size_t retlen; |
94 | #ifdef USE_ALLOCATING_PRINT | ||
95 | char *hugebuf; | ||
96 | #else | ||
88 | MS_STATIC char hugebuf[1024*2]; /* 10k in one chunk is the limit */ | 97 | MS_STATIC char hugebuf[1024*2]; /* 10k in one chunk is the limit */ |
98 | #endif | ||
89 | 99 | ||
90 | va_start(args, bio); | 100 | va_start(args, bio); |
91 | format=va_arg(args, char *); | 101 | format=va_arg(args, char *); |
92 | 102 | ||
103 | #ifndef USE_ALLOCATING_PRINT | ||
93 | hugebuf[0]='\0'; | 104 | hugebuf[0]='\0'; |
94 | dopr(hugebuf, sizeof(hugebuf), &retlen, format, args); | 105 | dopr(hugebuf, sizeof(hugebuf), &retlen, format, args); |
95 | ret=BIO_write(bio, hugebuf, (int)retlen); | 106 | #else |
107 | hugebuf = NULL; | ||
108 | CRYPTO_push_info("doapr()"); | ||
109 | doapr(&hugebuf, &retlen, format, args); | ||
110 | if (hugebuf) | ||
111 | { | ||
112 | #endif | ||
113 | ret=BIO_write(bio, hugebuf, (int)retlen); | ||
96 | 114 | ||
115 | #ifdef USE_ALLOCATING_PRINT | ||
116 | Free(hugebuf); | ||
117 | } | ||
118 | CRYPTO_pop_info(); | ||
119 | #endif | ||
97 | va_end(args); | 120 | va_end(args); |
98 | return(ret); | 121 | return(ret); |
99 | } | 122 | } |
@@ -131,10 +154,26 @@ int BIO_printf (BIO *bio, ...) | |||
131 | #define LLONG long | 154 | #define LLONG long |
132 | #endif | 155 | #endif |
133 | 156 | ||
134 | static void fmtstr (char *, size_t *, size_t, char *, int, int, int); | 157 | static void fmtstr (void (*)(char **, size_t *, size_t *, int), |
135 | static void fmtint (char *, size_t *, size_t, LLONG, int, int, int, int); | 158 | char **, size_t *, size_t *, const char *, int, int, |
136 | static void fmtfp (char *, size_t *, size_t, LDOUBLE, int, int, int); | 159 | int); |
137 | static void dopr_outch (char *, size_t *, size_t, int); | 160 | static void fmtint (void (*)(char **, size_t *, size_t *, int), |
161 | char **, size_t *, size_t *, LLONG, int, int, int, int); | ||
162 | static void fmtfp (void (*)(char **, size_t *, size_t *, int), | ||
163 | char **, size_t *, size_t *, LDOUBLE, int, int, int); | ||
164 | #ifndef USE_ALLOCATING_PRINT | ||
165 | static int dopr_isbig (size_t, size_t); | ||
166 | static int dopr_copy (size_t); | ||
167 | static void dopr_outch (char **, size_t *, size_t *, int); | ||
168 | #else | ||
169 | static int doapr_isbig (size_t, size_t); | ||
170 | static int doapr_copy (size_t); | ||
171 | static void doapr_outch (char **, size_t *, size_t *, int); | ||
172 | #endif | ||
173 | static void _dopr(void (*)(char **, size_t *, size_t *, int), | ||
174 | int (*)(size_t, size_t), int (*)(size_t), | ||
175 | char **buffer, size_t *maxlen, size_t *retlen, | ||
176 | const char *format, va_list args); | ||
138 | 177 | ||
139 | /* format read states */ | 178 | /* format read states */ |
140 | #define DP_S_DEFAULT 0 | 179 | #define DP_S_DEFAULT 0 |
@@ -165,6 +204,7 @@ static void dopr_outch (char *, size_t *, size_t, int); | |||
165 | #define char_to_int(p) (p - '0') | 204 | #define char_to_int(p) (p - '0') |
166 | #define MAX(p,q) ((p >= q) ? p : q) | 205 | #define MAX(p,q) ((p >= q) ? p : q) |
167 | 206 | ||
207 | #ifndef USE_ALLOCATING_PRINT | ||
168 | static void | 208 | static void |
169 | dopr( | 209 | dopr( |
170 | char *buffer, | 210 | char *buffer, |
@@ -173,6 +213,35 @@ dopr( | |||
173 | const char *format, | 213 | const char *format, |
174 | va_list args) | 214 | va_list args) |
175 | { | 215 | { |
216 | _dopr(dopr_outch, dopr_isbig, dopr_copy, | ||
217 | &buffer, &maxlen, retlen, format, args); | ||
218 | } | ||
219 | |||
220 | #else | ||
221 | static void | ||
222 | doapr( | ||
223 | char **buffer, | ||
224 | size_t *retlen, | ||
225 | const char *format, | ||
226 | va_list args) | ||
227 | { | ||
228 | size_t dummy_maxlen = 0; | ||
229 | _dopr(doapr_outch, doapr_isbig, doapr_copy, | ||
230 | buffer, &dummy_maxlen, retlen, format, args); | ||
231 | } | ||
232 | #endif | ||
233 | |||
234 | static void | ||
235 | _dopr( | ||
236 | void (*outch_fn)(char **, size_t *, size_t *, int), | ||
237 | int (*isbig_fn)(size_t, size_t), | ||
238 | int (*copy_fn)(size_t), | ||
239 | char **buffer, | ||
240 | size_t *maxlen, | ||
241 | size_t *retlen, | ||
242 | const char *format, | ||
243 | va_list args) | ||
244 | { | ||
176 | char ch; | 245 | char ch; |
177 | LLONG value; | 246 | LLONG value; |
178 | LDOUBLE fvalue; | 247 | LDOUBLE fvalue; |
@@ -190,7 +259,7 @@ dopr( | |||
190 | ch = *format++; | 259 | ch = *format++; |
191 | 260 | ||
192 | while (state != DP_S_DONE) { | 261 | while (state != DP_S_DONE) { |
193 | if ((ch == '\0') || (currlen >= maxlen)) | 262 | if ((ch == '\0') || (*isbig_fn)(currlen, *maxlen)) |
194 | state = DP_S_DONE; | 263 | state = DP_S_DONE; |
195 | 264 | ||
196 | switch (state) { | 265 | switch (state) { |
@@ -198,7 +267,7 @@ dopr( | |||
198 | if (ch == '%') | 267 | if (ch == '%') |
199 | state = DP_S_FLAGS; | 268 | state = DP_S_FLAGS; |
200 | else | 269 | else |
201 | dopr_outch(buffer, &currlen, maxlen, ch); | 270 | (*outch_fn)(buffer, &currlen, maxlen, ch); |
202 | ch = *format++; | 271 | ch = *format++; |
203 | break; | 272 | break; |
204 | case DP_S_FLAGS: | 273 | case DP_S_FLAGS: |
@@ -304,7 +373,8 @@ dopr( | |||
304 | value = va_arg(args, int); | 373 | value = va_arg(args, int); |
305 | break; | 374 | break; |
306 | } | 375 | } |
307 | fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags); | 376 | fmtint(outch_fn, buffer, &currlen, maxlen, |
377 | value, 10, min, max, flags); | ||
308 | break; | 378 | break; |
309 | case 'X': | 379 | case 'X': |
310 | flags |= DP_F_UP; | 380 | flags |= DP_F_UP; |
@@ -329,7 +399,7 @@ dopr( | |||
329 | unsigned int); | 399 | unsigned int); |
330 | break; | 400 | break; |
331 | } | 401 | } |
332 | fmtint(buffer, &currlen, maxlen, value, | 402 | fmtint(outch_fn, buffer, &currlen, maxlen, value, |
333 | ch == 'o' ? 8 : (ch == 'u' ? 10 : 16), | 403 | ch == 'o' ? 8 : (ch == 'u' ? 10 : 16), |
334 | min, max, flags); | 404 | min, max, flags); |
335 | break; | 405 | break; |
@@ -338,7 +408,8 @@ dopr( | |||
338 | fvalue = va_arg(args, LDOUBLE); | 408 | fvalue = va_arg(args, LDOUBLE); |
339 | else | 409 | else |
340 | fvalue = va_arg(args, double); | 410 | fvalue = va_arg(args, double); |
341 | fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags); | 411 | fmtfp(outch_fn, buffer, &currlen, maxlen, |
412 | fvalue, min, max, flags); | ||
342 | break; | 413 | break; |
343 | case 'E': | 414 | case 'E': |
344 | flags |= DP_F_UP; | 415 | flags |= DP_F_UP; |
@@ -357,19 +428,19 @@ dopr( | |||
357 | fvalue = va_arg(args, double); | 428 | fvalue = va_arg(args, double); |
358 | break; | 429 | break; |
359 | case 'c': | 430 | case 'c': |
360 | dopr_outch(buffer, &currlen, maxlen, | 431 | (*outch_fn)(buffer, &currlen, maxlen, |
361 | va_arg(args, int)); | 432 | va_arg(args, int)); |
362 | break; | 433 | break; |
363 | case 's': | 434 | case 's': |
364 | strvalue = va_arg(args, char *); | 435 | strvalue = va_arg(args, char *); |
365 | if (max < 0) | 436 | if (max < 0) |
366 | max = maxlen; | 437 | max = (*copy_fn)(*maxlen); |
367 | fmtstr(buffer, &currlen, maxlen, strvalue, | 438 | fmtstr(outch_fn, buffer, &currlen, maxlen, strvalue, |
368 | flags, min, max); | 439 | flags, min, max); |
369 | break; | 440 | break; |
370 | case 'p': | 441 | case 'p': |
371 | value = (long)va_arg(args, void *); | 442 | value = (long)va_arg(args, void *); |
372 | fmtint(buffer, &currlen, maxlen, | 443 | fmtint(outch_fn, buffer, &currlen, maxlen, |
373 | value, 16, min, max, flags); | 444 | value, 16, min, max, flags); |
374 | break; | 445 | break; |
375 | case 'n': /* XXX */ | 446 | case 'n': /* XXX */ |
@@ -392,7 +463,7 @@ dopr( | |||
392 | } | 463 | } |
393 | break; | 464 | break; |
394 | case '%': | 465 | case '%': |
395 | dopr_outch(buffer, &currlen, maxlen, ch); | 466 | (*outch_fn)(buffer, &currlen, maxlen, ch); |
396 | break; | 467 | break; |
397 | case 'w': | 468 | case 'w': |
398 | /* not supported yet, treat as next char */ | 469 | /* not supported yet, treat as next char */ |
@@ -413,19 +484,20 @@ dopr( | |||
413 | break; | 484 | break; |
414 | } | 485 | } |
415 | } | 486 | } |
416 | if (currlen >= maxlen - 1) | 487 | if (currlen >= *maxlen - 1) |
417 | currlen = maxlen - 1; | 488 | currlen = *maxlen - 1; |
418 | buffer[currlen] = '\0'; | 489 | (*buffer)[currlen] = '\0'; |
419 | *retlen = currlen; | 490 | *retlen = currlen; |
420 | return; | 491 | return; |
421 | } | 492 | } |
422 | 493 | ||
423 | static void | 494 | static void |
424 | fmtstr( | 495 | fmtstr( |
425 | char *buffer, | 496 | void (*outch_fn)(char **, size_t *, size_t *, int), |
497 | char **buffer, | ||
426 | size_t *currlen, | 498 | size_t *currlen, |
427 | size_t maxlen, | 499 | size_t *maxlen, |
428 | char *value, | 500 | const char *value, |
429 | int flags, | 501 | int flags, |
430 | int min, | 502 | int min, |
431 | int max) | 503 | int max) |
@@ -444,16 +516,16 @@ fmtstr( | |||
444 | padlen = -padlen; | 516 | padlen = -padlen; |
445 | 517 | ||
446 | while ((padlen > 0) && (cnt < max)) { | 518 | while ((padlen > 0) && (cnt < max)) { |
447 | dopr_outch(buffer, currlen, maxlen, ' '); | 519 | (*outch_fn)(buffer, currlen, maxlen, ' '); |
448 | --padlen; | 520 | --padlen; |
449 | ++cnt; | 521 | ++cnt; |
450 | } | 522 | } |
451 | while (*value && (cnt < max)) { | 523 | while (*value && (cnt < max)) { |
452 | dopr_outch(buffer, currlen, maxlen, *value++); | 524 | (*outch_fn)(buffer, currlen, maxlen, *value++); |
453 | ++cnt; | 525 | ++cnt; |
454 | } | 526 | } |
455 | while ((padlen < 0) && (cnt < max)) { | 527 | while ((padlen < 0) && (cnt < max)) { |
456 | dopr_outch(buffer, currlen, maxlen, ' '); | 528 | (*outch_fn)(buffer, currlen, maxlen, ' '); |
457 | ++padlen; | 529 | ++padlen; |
458 | ++cnt; | 530 | ++cnt; |
459 | } | 531 | } |
@@ -461,9 +533,10 @@ fmtstr( | |||
461 | 533 | ||
462 | static void | 534 | static void |
463 | fmtint( | 535 | fmtint( |
464 | char *buffer, | 536 | void (*outch_fn)(char **, size_t *, size_t *, int), |
537 | char **buffer, | ||
465 | size_t *currlen, | 538 | size_t *currlen, |
466 | size_t maxlen, | 539 | size_t *maxlen, |
467 | LLONG value, | 540 | LLONG value, |
468 | int base, | 541 | int base, |
469 | int min, | 542 | int min, |
@@ -517,28 +590,28 @@ fmtint( | |||
517 | 590 | ||
518 | /* spaces */ | 591 | /* spaces */ |
519 | while (spadlen > 0) { | 592 | while (spadlen > 0) { |
520 | dopr_outch(buffer, currlen, maxlen, ' '); | 593 | (*outch_fn)(buffer, currlen, maxlen, ' '); |
521 | --spadlen; | 594 | --spadlen; |
522 | } | 595 | } |
523 | 596 | ||
524 | /* sign */ | 597 | /* sign */ |
525 | if (signvalue) | 598 | if (signvalue) |
526 | dopr_outch(buffer, currlen, maxlen, signvalue); | 599 | (*outch_fn)(buffer, currlen, maxlen, signvalue); |
527 | 600 | ||
528 | /* zeros */ | 601 | /* zeros */ |
529 | if (zpadlen > 0) { | 602 | if (zpadlen > 0) { |
530 | while (zpadlen > 0) { | 603 | while (zpadlen > 0) { |
531 | dopr_outch(buffer, currlen, maxlen, '0'); | 604 | (*outch_fn)(buffer, currlen, maxlen, '0'); |
532 | --zpadlen; | 605 | --zpadlen; |
533 | } | 606 | } |
534 | } | 607 | } |
535 | /* digits */ | 608 | /* digits */ |
536 | while (place > 0) | 609 | while (place > 0) |
537 | dopr_outch(buffer, currlen, maxlen, convert[--place]); | 610 | (*outch_fn)(buffer, currlen, maxlen, convert[--place]); |
538 | 611 | ||
539 | /* left justified spaces */ | 612 | /* left justified spaces */ |
540 | while (spadlen < 0) { | 613 | while (spadlen < 0) { |
541 | dopr_outch(buffer, currlen, maxlen, ' '); | 614 | (*outch_fn)(buffer, currlen, maxlen, ' '); |
542 | ++spadlen; | 615 | ++spadlen; |
543 | } | 616 | } |
544 | return; | 617 | return; |
@@ -577,9 +650,10 @@ round(LDOUBLE value) | |||
577 | 650 | ||
578 | static void | 651 | static void |
579 | fmtfp( | 652 | fmtfp( |
580 | char *buffer, | 653 | void (*outch_fn)(char **, size_t *, size_t *, int), |
654 | char **buffer, | ||
581 | size_t *currlen, | 655 | size_t *currlen, |
582 | size_t maxlen, | 656 | size_t *maxlen, |
583 | LDOUBLE fvalue, | 657 | LDOUBLE fvalue, |
584 | int min, | 658 | int min, |
585 | int max, | 659 | int max, |
@@ -657,54 +731,114 @@ fmtfp( | |||
657 | 731 | ||
658 | if ((flags & DP_F_ZERO) && (padlen > 0)) { | 732 | if ((flags & DP_F_ZERO) && (padlen > 0)) { |
659 | if (signvalue) { | 733 | if (signvalue) { |
660 | dopr_outch(buffer, currlen, maxlen, signvalue); | 734 | (*outch_fn)(buffer, currlen, maxlen, signvalue); |
661 | --padlen; | 735 | --padlen; |
662 | signvalue = 0; | 736 | signvalue = 0; |
663 | } | 737 | } |
664 | while (padlen > 0) { | 738 | while (padlen > 0) { |
665 | dopr_outch(buffer, currlen, maxlen, '0'); | 739 | (*outch_fn)(buffer, currlen, maxlen, '0'); |
666 | --padlen; | 740 | --padlen; |
667 | } | 741 | } |
668 | } | 742 | } |
669 | while (padlen > 0) { | 743 | while (padlen > 0) { |
670 | dopr_outch(buffer, currlen, maxlen, ' '); | 744 | (*outch_fn)(buffer, currlen, maxlen, ' '); |
671 | --padlen; | 745 | --padlen; |
672 | } | 746 | } |
673 | if (signvalue) | 747 | if (signvalue) |
674 | dopr_outch(buffer, currlen, maxlen, signvalue); | 748 | (*outch_fn)(buffer, currlen, maxlen, signvalue); |
675 | 749 | ||
676 | while (iplace > 0) | 750 | while (iplace > 0) |
677 | dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]); | 751 | (*outch_fn)(buffer, currlen, maxlen, iconvert[--iplace]); |
678 | 752 | ||
679 | /* | 753 | /* |
680 | * Decimal point. This should probably use locale to find the correct | 754 | * Decimal point. This should probably use locale to find the correct |
681 | * char to print out. | 755 | * char to print out. |
682 | */ | 756 | */ |
683 | if (max > 0) { | 757 | if (max > 0) { |
684 | dopr_outch(buffer, currlen, maxlen, '.'); | 758 | (*outch_fn)(buffer, currlen, maxlen, '.'); |
685 | 759 | ||
686 | while (fplace > 0) | 760 | while (fplace > 0) |
687 | dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]); | 761 | (*outch_fn)(buffer, currlen, maxlen, fconvert[--fplace]); |
688 | } | 762 | } |
689 | while (zpadlen > 0) { | 763 | while (zpadlen > 0) { |
690 | dopr_outch(buffer, currlen, maxlen, '0'); | 764 | (*outch_fn)(buffer, currlen, maxlen, '0'); |
691 | --zpadlen; | 765 | --zpadlen; |
692 | } | 766 | } |
693 | 767 | ||
694 | while (padlen < 0) { | 768 | while (padlen < 0) { |
695 | dopr_outch(buffer, currlen, maxlen, ' '); | 769 | (*outch_fn)(buffer, currlen, maxlen, ' '); |
696 | ++padlen; | 770 | ++padlen; |
697 | } | 771 | } |
698 | } | 772 | } |
699 | 773 | ||
774 | static int | ||
775 | dopr_copy( | ||
776 | size_t len) | ||
777 | { | ||
778 | return len; | ||
779 | } | ||
780 | |||
781 | #ifdef USE_ALLOCATING_PRINT | ||
782 | static int | ||
783 | doapr_copy( | ||
784 | size_t len) | ||
785 | { | ||
786 | /* Return as high an integer as possible */ | ||
787 | return INT_MAX; | ||
788 | } | ||
789 | #endif | ||
790 | |||
791 | static int | ||
792 | dopr_isbig( | ||
793 | size_t currlen, | ||
794 | size_t maxlen) | ||
795 | { | ||
796 | return currlen > maxlen; | ||
797 | } | ||
798 | |||
799 | #ifdef USE_ALLOCATING_PRINT | ||
800 | static int | ||
801 | doapr_isbig( | ||
802 | size_t currlen, | ||
803 | size_t maxlen) | ||
804 | { | ||
805 | return 0; | ||
806 | } | ||
807 | #endif | ||
808 | |||
700 | static void | 809 | static void |
701 | dopr_outch( | 810 | dopr_outch( |
702 | char *buffer, | 811 | char **buffer, |
703 | size_t *currlen, | 812 | size_t *currlen, |
704 | size_t maxlen, | 813 | size_t *maxlen, |
814 | int c) | ||
815 | { | ||
816 | if (*currlen < *maxlen) | ||
817 | (*buffer)[(*currlen)++] = (char)c; | ||
818 | return; | ||
819 | } | ||
820 | |||
821 | #ifdef USE_ALLOCATING_PRINT | ||
822 | static void | ||
823 | doapr_outch( | ||
824 | char **buffer, | ||
825 | size_t *currlen, | ||
826 | size_t *maxlen, | ||
705 | int c) | 827 | int c) |
706 | { | 828 | { |
707 | if (*currlen < maxlen) | 829 | if (*buffer == NULL) { |
708 | buffer[(*currlen)++] = (char)c; | 830 | if (*maxlen == 0) |
831 | *maxlen = 1024; | ||
832 | *buffer = Malloc(*maxlen); | ||
833 | } | ||
834 | while (*currlen >= *maxlen) { | ||
835 | *maxlen += 1024; | ||
836 | *buffer = Realloc(*buffer, *maxlen); | ||
837 | } | ||
838 | /* What to do if *buffer is NULL? */ | ||
839 | assert(*buffer != NULL); | ||
840 | |||
841 | (*buffer)[(*currlen)++] = (char)c; | ||
709 | return; | 842 | return; |
710 | } | 843 | } |
844 | #endif | ||
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h index bc08401eeb..ebdb18170b 100644 --- a/src/lib/libcrypto/bio/bio.h +++ b/src/lib/libcrypto/bio/bio.h | |||
@@ -507,7 +507,7 @@ int BIO_set(BIO *a,BIO_METHOD *type); | |||
507 | int BIO_free(BIO *a); | 507 | int BIO_free(BIO *a); |
508 | int BIO_read(BIO *b, void *data, int len); | 508 | int BIO_read(BIO *b, void *data, int len); |
509 | int BIO_gets(BIO *bp,char *buf, int size); | 509 | int BIO_gets(BIO *bp,char *buf, int size); |
510 | int BIO_write(BIO *b, const char *data, int len); | 510 | int BIO_write(BIO *b, const void *data, int len); |
511 | int BIO_puts(BIO *bp,const char *buf); | 511 | int BIO_puts(BIO *bp,const char *buf); |
512 | long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); | 512 | long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); |
513 | long BIO_callback_ctrl(BIO *bp,int cmd,void (*fp)()); | 513 | long BIO_callback_ctrl(BIO *bp,int cmd,void (*fp)()); |
diff --git a/src/lib/libcrypto/bio/bio_err.c b/src/lib/libcrypto/bio/bio_err.c index b5f07de5a0..f38e7b9178 100644 --- a/src/lib/libcrypto/bio/bio_err.c +++ b/src/lib/libcrypto/bio/bio_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index cf8e6150fd..e88dcc80f3 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
@@ -169,7 +169,7 @@ int BIO_read(BIO *b, void *out, int outl) | |||
169 | return(i); | 169 | return(i); |
170 | } | 170 | } |
171 | 171 | ||
172 | int BIO_write(BIO *b, const char *in, int inl) | 172 | int BIO_write(BIO *b, const void *in, int inl) |
173 | { | 173 | { |
174 | int i; | 174 | int i; |
175 | long (*cb)(); | 175 | long (*cb)(); |
diff --git a/src/lib/libcrypto/bio/bss_bio.c b/src/lib/libcrypto/bio/bss_bio.c index 0d0f9356f7..1e2d7491f2 100644 --- a/src/lib/libcrypto/bio/bss_bio.c +++ b/src/lib/libcrypto/bio/bss_bio.c | |||
@@ -19,8 +19,14 @@ | |||
19 | 19 | ||
20 | #include <openssl/bio.h> | 20 | #include <openssl/bio.h> |
21 | #include <openssl/err.h> | 21 | #include <openssl/err.h> |
22 | #include <openssl/err.h> | ||
22 | #include <openssl/crypto.h> | 23 | #include <openssl/crypto.h> |
23 | 24 | ||
25 | #include "openssl/e_os.h" | ||
26 | #ifndef SSIZE_MAX | ||
27 | # define SSIZE_MAX INT_MAX | ||
28 | #endif | ||
29 | |||
24 | static int bio_new(BIO *bio); | 30 | static int bio_new(BIO *bio); |
25 | static int bio_free(BIO *bio); | 31 | static int bio_free(BIO *bio); |
26 | static int bio_read(BIO *bio, char *buf, int size); | 32 | static int bio_read(BIO *bio, char *buf, int size); |
@@ -205,10 +211,10 @@ static int bio_read(BIO *bio, char *buf, int size_) | |||
205 | */ | 211 | */ |
206 | /* WARNING: The non-copying interface is largely untested as of yet | 212 | /* WARNING: The non-copying interface is largely untested as of yet |
207 | * and may contain bugs. */ | 213 | * and may contain bugs. */ |
208 | static size_t bio_nread0(BIO *bio, char **buf) | 214 | static ssize_t bio_nread0(BIO *bio, char **buf) |
209 | { | 215 | { |
210 | struct bio_bio_st *b, *peer_b; | 216 | struct bio_bio_st *b, *peer_b; |
211 | size_t num; | 217 | ssize_t num; |
212 | 218 | ||
213 | BIO_clear_retry_flags(bio); | 219 | BIO_clear_retry_flags(bio); |
214 | 220 | ||
@@ -243,15 +249,20 @@ static size_t bio_nread0(BIO *bio, char **buf) | |||
243 | return num; | 249 | return num; |
244 | } | 250 | } |
245 | 251 | ||
246 | static size_t bio_nread(BIO *bio, char **buf, size_t num) | 252 | static ssize_t bio_nread(BIO *bio, char **buf, size_t num_) |
247 | { | 253 | { |
248 | struct bio_bio_st *b, *peer_b; | 254 | struct bio_bio_st *b, *peer_b; |
249 | size_t available; | 255 | ssize_t num, available; |
256 | |||
257 | if (num_ > SSIZE_MAX) | ||
258 | num = SSIZE_MAX; | ||
259 | else | ||
260 | num = (ssize_t)num_; | ||
250 | 261 | ||
251 | available = bio_nread0(bio, buf); | 262 | available = bio_nread0(bio, buf); |
252 | if (num > available) | 263 | if (num > available) |
253 | num = available; | 264 | num = available; |
254 | if (num == 0) | 265 | if (num <= 0) |
255 | return num; | 266 | return num; |
256 | 267 | ||
257 | b = bio->ptr; | 268 | b = bio->ptr; |
@@ -351,7 +362,7 @@ static int bio_write(BIO *bio, char *buf, int num_) | |||
351 | * (example usage: bio_nwrite0(), write to buffer, bio_nwrite() | 362 | * (example usage: bio_nwrite0(), write to buffer, bio_nwrite() |
352 | * or just bio_nwrite(), write to buffer) | 363 | * or just bio_nwrite(), write to buffer) |
353 | */ | 364 | */ |
354 | static size_t bio_nwrite0(BIO *bio, char **buf) | 365 | static ssize_t bio_nwrite0(BIO *bio, char **buf) |
355 | { | 366 | { |
356 | struct bio_bio_st *b; | 367 | struct bio_bio_st *b; |
357 | size_t num; | 368 | size_t num; |
@@ -399,15 +410,20 @@ static size_t bio_nwrite0(BIO *bio, char **buf) | |||
399 | return num; | 410 | return num; |
400 | } | 411 | } |
401 | 412 | ||
402 | static size_t bio_nwrite(BIO *bio, char **buf, size_t num) | 413 | static ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_) |
403 | { | 414 | { |
404 | struct bio_bio_st *b; | 415 | struct bio_bio_st *b; |
405 | size_t space; | 416 | ssize_t num, space; |
417 | |||
418 | if (num_ > SSIZE_MAX) | ||
419 | num = SSIZE_MAX; | ||
420 | else | ||
421 | num = (ssize_t)num_; | ||
406 | 422 | ||
407 | space = bio_nwrite0(bio, buf); | 423 | space = bio_nwrite0(bio, buf); |
408 | if (num > space) | 424 | if (num > space) |
409 | num = space; | 425 | num = space; |
410 | if (num == 0) | 426 | if (num <= 0) |
411 | return num; | 427 | return num; |
412 | b = bio->ptr; | 428 | b = bio->ptr; |
413 | assert(b != NULL); | 429 | assert(b != NULL); |
@@ -509,6 +525,11 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) | |||
509 | ret = 1; | 525 | ret = 1; |
510 | break; | 526 | break; |
511 | 527 | ||
528 | case BIO_C_NREAD0: | ||
529 | /* prepare for non-copying read */ | ||
530 | ret = (long) bio_nread0(bio, ptr); | ||
531 | break; | ||
532 | |||
512 | case BIO_C_NREAD: | 533 | case BIO_C_NREAD: |
513 | /* non-copying read */ | 534 | /* non-copying read */ |
514 | ret = (long) bio_nread(bio, ptr, (size_t) num); | 535 | ret = (long) bio_nread(bio, ptr, (size_t) num); |
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c index 4308b19663..497eb1af72 100644 --- a/src/lib/libcrypto/bio/bss_log.c +++ b/src/lib/libcrypto/bio/bss_log.c | |||
@@ -57,8 +57,8 @@ | |||
57 | Why BIO_s_log? | 57 | Why BIO_s_log? |
58 | 58 | ||
59 | BIO_s_log is useful for system daemons (or services under NT). | 59 | BIO_s_log is useful for system daemons (or services under NT). |
60 | It is one-way BIO, it sends all stuff to syslogd (or event log | 60 | It is one-way BIO, it sends all stuff to syslogd (on system that |
61 | under NT). | 61 | commonly use that), or event log (on NT), or OPCOM (on OpenVMS). |
62 | 62 | ||
63 | */ | 63 | */ |
64 | 64 | ||
@@ -66,29 +66,58 @@ | |||
66 | #include <stdio.h> | 66 | #include <stdio.h> |
67 | #include <errno.h> | 67 | #include <errno.h> |
68 | 68 | ||
69 | #ifndef WIN32 | 69 | #if defined(WIN32) |
70 | #ifdef __ultrix | 70 | # include <process.h> |
71 | #include <sys/syslog.h> | 71 | #elif defined(VMS) || defined(__VMS) |
72 | #else | 72 | # include <opcdef.h> |
73 | #include <syslog.h> | 73 | # include <descrip.h> |
74 | #endif | 74 | # include <lib$routines.h> |
75 | #else | 75 | # include <starlet.h> |
76 | #include <process.h> | 76 | #elif defined(__ultrix) |
77 | # include <sys/syslog.h> | ||
78 | #elif !defined(MSDOS) /* Unix */ | ||
79 | # include <syslog.h> | ||
77 | #endif | 80 | #endif |
78 | 81 | ||
79 | #include "cryptlib.h" | 82 | #include "cryptlib.h" |
80 | #include <openssl/buffer.h> | 83 | #include <openssl/buffer.h> |
81 | #include <openssl/err.h> | 84 | #include <openssl/err.h> |
85 | |||
82 | #ifndef NO_SYSLOG | 86 | #ifndef NO_SYSLOG |
83 | 87 | ||
88 | #if defined(WIN32) | ||
89 | #define LOG_EMERG 0 | ||
90 | #define LOG_ALERT 1 | ||
91 | #define LOG_CRIT 2 | ||
92 | #define LOG_ERR 3 | ||
93 | #define LOG_WARNING 4 | ||
94 | #define LOG_NOTICE 5 | ||
95 | #define LOG_INFO 6 | ||
96 | #define LOG_DEBUG 7 | ||
97 | |||
98 | #define LOG_DAEMON (3<<3) | ||
99 | #elif defined(VMS) | ||
100 | /* On VMS, we don't really care about these, but we need them to compile */ | ||
101 | #define LOG_EMERG 0 | ||
102 | #define LOG_ALERT 1 | ||
103 | #define LOG_CRIT 2 | ||
104 | #define LOG_ERR 3 | ||
105 | #define LOG_WARNING 4 | ||
106 | #define LOG_NOTICE 5 | ||
107 | #define LOG_INFO 6 | ||
108 | #define LOG_DEBUG 7 | ||
109 | |||
110 | #define LOG_DAEMON OPC$M_NM_NTWORK | ||
111 | #endif | ||
84 | 112 | ||
85 | static int MS_CALLBACK slg_write(BIO *h,char *buf,int num); | 113 | static int MS_CALLBACK slg_write(BIO *h,char *buf,int num); |
86 | static int MS_CALLBACK slg_puts(BIO *h,char *str); | 114 | static int MS_CALLBACK slg_puts(BIO *h,char *str); |
87 | static long MS_CALLBACK slg_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 115 | static long MS_CALLBACK slg_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
88 | static int MS_CALLBACK slg_new(BIO *h); | 116 | static int MS_CALLBACK slg_new(BIO *h); |
89 | static int MS_CALLBACK slg_free(BIO *data); | 117 | static int MS_CALLBACK slg_free(BIO *data); |
90 | static int xopenlog(BIO* bp, const char* name, int level); | 118 | static void xopenlog(BIO* bp, const char* name, int level); |
91 | static int xcloselog(BIO* bp); | 119 | static void xsyslog(BIO* bp, int priority, const char* string); |
120 | static void xcloselog(BIO* bp); | ||
92 | 121 | ||
93 | static BIO_METHOD methods_slg= | 122 | static BIO_METHOD methods_slg= |
94 | { | 123 | { |
@@ -113,11 +142,7 @@ static int MS_CALLBACK slg_new(BIO *bi) | |||
113 | bi->init=1; | 142 | bi->init=1; |
114 | bi->num=0; | 143 | bi->num=0; |
115 | bi->ptr=NULL; | 144 | bi->ptr=NULL; |
116 | #ifndef WIN32 | ||
117 | xopenlog(bi, "application", LOG_DAEMON); | 145 | xopenlog(bi, "application", LOG_DAEMON); |
118 | #else | ||
119 | xopenlog(bi, "application", 0); | ||
120 | #endif | ||
121 | return(1); | 146 | return(1); |
122 | } | 147 | } |
123 | 148 | ||
@@ -133,43 +158,14 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) | |||
133 | int ret= inl; | 158 | int ret= inl; |
134 | char* buf= in; | 159 | char* buf= in; |
135 | char* pp; | 160 | char* pp; |
136 | #if defined(WIN32) | ||
137 | LPCSTR lpszStrings[2]; | ||
138 | WORD evtype= EVENTLOG_ERROR_TYPE; | ||
139 | int pid = _getpid(); | ||
140 | char pidbuf[20]; | ||
141 | #else | ||
142 | int priority; | 161 | int priority; |
143 | #endif | ||
144 | 162 | ||
145 | if((buf= (char *)Malloc(inl+ 1)) == NULL){ | 163 | if((buf= (char *)Malloc(inl+ 1)) == NULL){ |
146 | return(0); | 164 | return(0); |
147 | } | 165 | } |
148 | strncpy(buf, in, inl); | 166 | strncpy(buf, in, inl); |
149 | buf[inl]= '\0'; | 167 | buf[inl]= '\0'; |
150 | #if defined(WIN32) | ||
151 | if(strncmp(buf, "ERR ", 4) == 0){ | ||
152 | evtype= EVENTLOG_ERROR_TYPE; | ||
153 | pp= buf+ 4; | ||
154 | }else if(strncmp(buf, "WAR ", 4) == 0){ | ||
155 | evtype= EVENTLOG_WARNING_TYPE; | ||
156 | pp= buf+ 4; | ||
157 | }else if(strncmp(buf, "INF ", 4) == 0){ | ||
158 | evtype= EVENTLOG_INFORMATION_TYPE; | ||
159 | pp= buf+ 4; | ||
160 | }else{ | ||
161 | evtype= EVENTLOG_ERROR_TYPE; | ||
162 | pp= buf; | ||
163 | } | ||
164 | 168 | ||
165 | sprintf(pidbuf, "[%d] ", pid); | ||
166 | lpszStrings[0] = pidbuf; | ||
167 | lpszStrings[1] = pp; | ||
168 | |||
169 | if(b->ptr) | ||
170 | ReportEvent(b->ptr, evtype, 0, 1024, NULL, 2, 0, | ||
171 | lpszStrings, NULL); | ||
172 | #else | ||
173 | if(strncmp(buf, "ERR ", 4) == 0){ | 169 | if(strncmp(buf, "ERR ", 4) == 0){ |
174 | priority= LOG_ERR; | 170 | priority= LOG_ERR; |
175 | pp= buf+ 4; | 171 | pp= buf+ 4; |
@@ -184,8 +180,8 @@ static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) | |||
184 | pp= buf; | 180 | pp= buf; |
185 | } | 181 | } |
186 | 182 | ||
187 | syslog(priority, "%s", pp); | 183 | xsyslog(b, priority, pp); |
188 | #endif | 184 | |
189 | Free(buf); | 185 | Free(buf); |
190 | return(ret); | 186 | return(ret); |
191 | } | 187 | } |
@@ -213,28 +209,128 @@ static int MS_CALLBACK slg_puts(BIO *bp, char *str) | |||
213 | return(ret); | 209 | return(ret); |
214 | } | 210 | } |
215 | 211 | ||
216 | static int xopenlog(BIO* bp, const char* name, int level) | ||
217 | { | ||
218 | #if defined(WIN32) | 212 | #if defined(WIN32) |
219 | if((bp->ptr= (char *)RegisterEventSource(NULL, name)) == NULL){ | 213 | |
220 | return(0); | 214 | static void xopenlog(BIO* bp, const char* name, int level) |
221 | } | 215 | { |
222 | #else | 216 | bp->ptr= (char *)RegisterEventSource(NULL, name); |
223 | openlog(name, LOG_PID|LOG_CONS, level); | ||
224 | #endif | ||
225 | return(1); | ||
226 | } | 217 | } |
227 | 218 | ||
228 | static int xcloselog(BIO* bp) | 219 | static void xsyslog(BIO *bp, int priority, const char *string) |
220 | { | ||
221 | LPCSTR lpszStrings[2]; | ||
222 | WORD evtype= EVENTLOG_ERROR_TYPE; | ||
223 | int pid = _getpid(); | ||
224 | char pidbuf[20]; | ||
225 | |||
226 | switch (priority) | ||
227 | { | ||
228 | case LOG_ERR: | ||
229 | evtype = EVENTLOG_ERROR_TYPE; | ||
230 | break; | ||
231 | case LOG_WARNING: | ||
232 | evtype = EVENTLOG_WARNING_TYPE; | ||
233 | break; | ||
234 | case LOG_INFO: | ||
235 | evtype = EVENTLOG_INFORMATION_TYPE; | ||
236 | break; | ||
237 | default: | ||
238 | evtype = EVENTLOG_ERROR_TYPE; | ||
239 | break; | ||
240 | } | ||
241 | |||
242 | sprintf(pidbuf, "[%d] ", pid); | ||
243 | lpszStrings[0] = pidbuf; | ||
244 | lpszStrings[1] = string; | ||
245 | |||
246 | if(bp->ptr) | ||
247 | ReportEvent(bp->ptr, evtype, 0, 1024, NULL, 2, 0, | ||
248 | lpszStrings, NULL); | ||
249 | } | ||
250 | |||
251 | static void xcloselog(BIO* bp) | ||
229 | { | 252 | { |
230 | #if defined(WIN32) | ||
231 | if(bp->ptr) | 253 | if(bp->ptr) |
232 | DeregisterEventSource((HANDLE)(bp->ptr)); | 254 | DeregisterEventSource((HANDLE)(bp->ptr)); |
233 | bp->ptr= NULL; | 255 | bp->ptr= NULL; |
234 | #else | 256 | } |
257 | |||
258 | #elif defined(VMS) | ||
259 | |||
260 | static int VMS_OPC_target = LOG_DAEMON; | ||
261 | |||
262 | static void xopenlog(BIO* bp, const char* name, int level) | ||
263 | { | ||
264 | VMS_OPC_target = level; | ||
265 | } | ||
266 | |||
267 | static void xsyslog(BIO *bp, int priority, const char *string) | ||
268 | { | ||
269 | struct dsc$descriptor_s opc_dsc; | ||
270 | struct opcdef *opcdef_p; | ||
271 | char buf[10240]; | ||
272 | unsigned int len; | ||
273 | struct dsc$descriptor_s buf_dsc; | ||
274 | $DESCRIPTOR(fao_cmd, "!AZ: !AZ"); | ||
275 | char *priority_tag; | ||
276 | |||
277 | switch (priority) | ||
278 | { | ||
279 | case LOG_EMERG: priority_tag = "Emergency"; break; | ||
280 | case LOG_ALERT: priority_tag = "Alert"; break; | ||
281 | case LOG_CRIT: priority_tag = "Critical"; break; | ||
282 | case LOG_ERR: priority_tag = "Error"; break; | ||
283 | case LOG_WARNING: priority_tag = "Warning"; break; | ||
284 | case LOG_NOTICE: priority_tag = "Notice"; break; | ||
285 | case LOG_INFO: priority_tag = "Info"; break; | ||
286 | case LOG_DEBUG: priority_tag = "DEBUG"; break; | ||
287 | } | ||
288 | |||
289 | buf_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
290 | buf_dsc.dsc$b_class = DSC$K_CLASS_S; | ||
291 | buf_dsc.dsc$a_pointer = buf; | ||
292 | buf_dsc.dsc$w_length = sizeof(buf) - 1; | ||
293 | |||
294 | lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); | ||
295 | |||
296 | /* we know there's an 8 byte header. That's documented */ | ||
297 | opcdef_p = (struct opcdef *) Malloc(8 + len); | ||
298 | opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; | ||
299 | memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); | ||
300 | opcdef_p->opc$l_ms_rqstid = 0; | ||
301 | memcpy(&opcdef_p->opc$l_ms_text, buf, len); | ||
302 | |||
303 | opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
304 | opc_dsc.dsc$b_class = DSC$K_CLASS_S; | ||
305 | opc_dsc.dsc$a_pointer = (char *)opcdef_p; | ||
306 | opc_dsc.dsc$w_length = len + 8; | ||
307 | |||
308 | sys$sndopr(opc_dsc, 0); | ||
309 | |||
310 | Free(opcdef_p); | ||
311 | } | ||
312 | |||
313 | static void xcloselog(BIO* bp) | ||
314 | { | ||
315 | } | ||
316 | |||
317 | #else /* Unix */ | ||
318 | |||
319 | static void xopenlog(BIO* bp, const char* name, int level) | ||
320 | { | ||
321 | openlog(name, LOG_PID|LOG_CONS, level); | ||
322 | } | ||
323 | |||
324 | static void xsyslog(BIO *bp, int priority, const char *string) | ||
325 | { | ||
326 | syslog(priority, "%s", string); | ||
327 | } | ||
328 | |||
329 | static void xcloselog(BIO* bp) | ||
330 | { | ||
235 | closelog(); | 331 | closelog(); |
236 | #endif | ||
237 | return(1); | ||
238 | } | 332 | } |
239 | 333 | ||
240 | #endif | 334 | #endif /* Unix */ |
335 | |||
336 | #endif /* NO_SYSLOG */ | ||
diff --git a/src/lib/libcrypto/bn/Makefile.ssl b/src/lib/libcrypto/bn/Makefile.ssl index fa23a43fa0..beb9c1b523 100644 --- a/src/lib/libcrypto/bn/Makefile.ssl +++ b/src/lib/libcrypto/bn/Makefile.ssl | |||
@@ -5,6 +5,7 @@ | |||
5 | DIR= bn | 5 | DIR= bn |
6 | TOP= ../.. | 6 | TOP= ../.. |
7 | CC= cc | 7 | CC= cc |
8 | CPP= $(CC) -E | ||
8 | INCLUDES= -I.. -I../../include | 9 | INCLUDES= -I.. -I../../include |
9 | CFLAG=-g | 10 | CFLAG=-g |
10 | INSTALL_PREFIX= | 11 | INSTALL_PREFIX= |
@@ -72,10 +73,10 @@ lib: $(LIBOBJ) | |||
72 | 73 | ||
73 | # elf | 74 | # elf |
74 | asm/bn86-elf.o: asm/bn86unix.cpp | 75 | asm/bn86-elf.o: asm/bn86unix.cpp |
75 | $(CPP) -DELF asm/bn86unix.cpp | as -o asm/bn86-elf.o | 76 | $(CPP) -DELF -x c asm/bn86unix.cpp | as -o asm/bn86-elf.o |
76 | 77 | ||
77 | asm/co86-elf.o: asm/co86unix.cpp | 78 | asm/co86-elf.o: asm/co86unix.cpp |
78 | $(CPP) -DELF asm/co86unix.cpp | as -o asm/co86-elf.o | 79 | $(CPP) -DELF -x c asm/co86unix.cpp | as -o asm/co86-elf.o |
79 | 80 | ||
80 | # solaris | 81 | # solaris |
81 | asm/bn86-sol.o: asm/bn86unix.cpp | 82 | asm/bn86-sol.o: asm/bn86unix.cpp |
@@ -102,10 +103,10 @@ asm/bn86bsdi.o: asm/bn86unix.cpp | |||
102 | asm/co86bsdi.o: asm/co86unix.cpp | 103 | asm/co86bsdi.o: asm/co86unix.cpp |
103 | $(CPP) -DBSDI asm/co86unix.cpp | sed 's/ :/:/' | as -o asm/co86bsdi.o | 104 | $(CPP) -DBSDI asm/co86unix.cpp | sed 's/ :/:/' | as -o asm/co86bsdi.o |
104 | 105 | ||
105 | asm/bn86unix.cpp: asm/bn-586.pl | 106 | asm/bn86unix.cpp: asm/bn-586.pl ../perlasm/x86asm.pl |
106 | (cd asm; $(PERL) bn-586.pl cpp >bn86unix.cpp ) | 107 | (cd asm; $(PERL) bn-586.pl cpp >bn86unix.cpp ) |
107 | 108 | ||
108 | asm/co86unix.cpp: asm/co-586.pl | 109 | asm/co86unix.cpp: asm/co-586.pl ../perlasm/x86asm.pl |
109 | (cd asm; $(PERL) co-586.pl cpp >co86unix.cpp ) | 110 | (cd asm; $(PERL) co-586.pl cpp >co86unix.cpp ) |
110 | 111 | ||
111 | asm/sparcv8.o: asm/sparcv8.S | 112 | asm/sparcv8.o: asm/sparcv8.S |
diff --git a/src/lib/libcrypto/bn/asm/bn-win32.asm b/src/lib/libcrypto/bn/asm/bn-win32.asm index 871bd88d77..e69de29bb2 100644 --- a/src/lib/libcrypto/bn/asm/bn-win32.asm +++ b/src/lib/libcrypto/bn/asm/bn-win32.asm | |||
@@ -1,2122 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by bn-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE bn-586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _bn_mul_add_words | ||
12 | |||
13 | _bn_mul_add_words PROC NEAR | ||
14 | push ebp | ||
15 | push ebx | ||
16 | push esi | ||
17 | push edi | ||
18 | ; | ||
19 | xor esi, esi | ||
20 | mov edi, DWORD PTR 20[esp] | ||
21 | mov ecx, DWORD PTR 28[esp] | ||
22 | mov ebx, DWORD PTR 24[esp] | ||
23 | and ecx, 4294967288 | ||
24 | mov ebp, DWORD PTR 32[esp] | ||
25 | push ecx | ||
26 | jz $L000maw_finish | ||
27 | L001maw_loop: | ||
28 | mov DWORD PTR [esp],ecx | ||
29 | ; Round 0 | ||
30 | mov eax, DWORD PTR [ebx] | ||
31 | mul ebp | ||
32 | add eax, esi | ||
33 | mov esi, DWORD PTR [edi] | ||
34 | adc edx, 0 | ||
35 | add eax, esi | ||
36 | adc edx, 0 | ||
37 | mov DWORD PTR [edi],eax | ||
38 | mov esi, edx | ||
39 | ; Round 4 | ||
40 | mov eax, DWORD PTR 4[ebx] | ||
41 | mul ebp | ||
42 | add eax, esi | ||
43 | mov esi, DWORD PTR 4[edi] | ||
44 | adc edx, 0 | ||
45 | add eax, esi | ||
46 | adc edx, 0 | ||
47 | mov DWORD PTR 4[edi],eax | ||
48 | mov esi, edx | ||
49 | ; Round 8 | ||
50 | mov eax, DWORD PTR 8[ebx] | ||
51 | mul ebp | ||
52 | add eax, esi | ||
53 | mov esi, DWORD PTR 8[edi] | ||
54 | adc edx, 0 | ||
55 | add eax, esi | ||
56 | adc edx, 0 | ||
57 | mov DWORD PTR 8[edi],eax | ||
58 | mov esi, edx | ||
59 | ; Round 12 | ||
60 | mov eax, DWORD PTR 12[ebx] | ||
61 | mul ebp | ||
62 | add eax, esi | ||
63 | mov esi, DWORD PTR 12[edi] | ||
64 | adc edx, 0 | ||
65 | add eax, esi | ||
66 | adc edx, 0 | ||
67 | mov DWORD PTR 12[edi],eax | ||
68 | mov esi, edx | ||
69 | ; Round 16 | ||
70 | mov eax, DWORD PTR 16[ebx] | ||
71 | mul ebp | ||
72 | add eax, esi | ||
73 | mov esi, DWORD PTR 16[edi] | ||
74 | adc edx, 0 | ||
75 | add eax, esi | ||
76 | adc edx, 0 | ||
77 | mov DWORD PTR 16[edi],eax | ||
78 | mov esi, edx | ||
79 | ; Round 20 | ||
80 | mov eax, DWORD PTR 20[ebx] | ||
81 | mul ebp | ||
82 | add eax, esi | ||
83 | mov esi, DWORD PTR 20[edi] | ||
84 | adc edx, 0 | ||
85 | add eax, esi | ||
86 | adc edx, 0 | ||
87 | mov DWORD PTR 20[edi],eax | ||
88 | mov esi, edx | ||
89 | ; Round 24 | ||
90 | mov eax, DWORD PTR 24[ebx] | ||
91 | mul ebp | ||
92 | add eax, esi | ||
93 | mov esi, DWORD PTR 24[edi] | ||
94 | adc edx, 0 | ||
95 | add eax, esi | ||
96 | adc edx, 0 | ||
97 | mov DWORD PTR 24[edi],eax | ||
98 | mov esi, edx | ||
99 | ; Round 28 | ||
100 | mov eax, DWORD PTR 28[ebx] | ||
101 | mul ebp | ||
102 | add eax, esi | ||
103 | mov esi, DWORD PTR 28[edi] | ||
104 | adc edx, 0 | ||
105 | add eax, esi | ||
106 | adc edx, 0 | ||
107 | mov DWORD PTR 28[edi],eax | ||
108 | mov esi, edx | ||
109 | ; | ||
110 | mov ecx, DWORD PTR [esp] | ||
111 | add ebx, 32 | ||
112 | add edi, 32 | ||
113 | sub ecx, 8 | ||
114 | jnz L001maw_loop | ||
115 | $L000maw_finish: | ||
116 | mov ecx, DWORD PTR 32[esp] | ||
117 | and ecx, 7 | ||
118 | jnz $L002maw_finish2 | ||
119 | jmp $L003maw_end | ||
120 | $L002maw_finish2: | ||
121 | ; Tail Round 0 | ||
122 | mov eax, DWORD PTR [ebx] | ||
123 | mul ebp | ||
124 | add eax, esi | ||
125 | mov esi, DWORD PTR [edi] | ||
126 | adc edx, 0 | ||
127 | add eax, esi | ||
128 | adc edx, 0 | ||
129 | dec ecx | ||
130 | mov DWORD PTR [edi],eax | ||
131 | mov esi, edx | ||
132 | jz $L003maw_end | ||
133 | ; Tail Round 1 | ||
134 | mov eax, DWORD PTR 4[ebx] | ||
135 | mul ebp | ||
136 | add eax, esi | ||
137 | mov esi, DWORD PTR 4[edi] | ||
138 | adc edx, 0 | ||
139 | add eax, esi | ||
140 | adc edx, 0 | ||
141 | dec ecx | ||
142 | mov DWORD PTR 4[edi],eax | ||
143 | mov esi, edx | ||
144 | jz $L003maw_end | ||
145 | ; Tail Round 2 | ||
146 | mov eax, DWORD PTR 8[ebx] | ||
147 | mul ebp | ||
148 | add eax, esi | ||
149 | mov esi, DWORD PTR 8[edi] | ||
150 | adc edx, 0 | ||
151 | add eax, esi | ||
152 | adc edx, 0 | ||
153 | dec ecx | ||
154 | mov DWORD PTR 8[edi],eax | ||
155 | mov esi, edx | ||
156 | jz $L003maw_end | ||
157 | ; Tail Round 3 | ||
158 | mov eax, DWORD PTR 12[ebx] | ||
159 | mul ebp | ||
160 | add eax, esi | ||
161 | mov esi, DWORD PTR 12[edi] | ||
162 | adc edx, 0 | ||
163 | add eax, esi | ||
164 | adc edx, 0 | ||
165 | dec ecx | ||
166 | mov DWORD PTR 12[edi],eax | ||
167 | mov esi, edx | ||
168 | jz $L003maw_end | ||
169 | ; Tail Round 4 | ||
170 | mov eax, DWORD PTR 16[ebx] | ||
171 | mul ebp | ||
172 | add eax, esi | ||
173 | mov esi, DWORD PTR 16[edi] | ||
174 | adc edx, 0 | ||
175 | add eax, esi | ||
176 | adc edx, 0 | ||
177 | dec ecx | ||
178 | mov DWORD PTR 16[edi],eax | ||
179 | mov esi, edx | ||
180 | jz $L003maw_end | ||
181 | ; Tail Round 5 | ||
182 | mov eax, DWORD PTR 20[ebx] | ||
183 | mul ebp | ||
184 | add eax, esi | ||
185 | mov esi, DWORD PTR 20[edi] | ||
186 | adc edx, 0 | ||
187 | add eax, esi | ||
188 | adc edx, 0 | ||
189 | dec ecx | ||
190 | mov DWORD PTR 20[edi],eax | ||
191 | mov esi, edx | ||
192 | jz $L003maw_end | ||
193 | ; Tail Round 6 | ||
194 | mov eax, DWORD PTR 24[ebx] | ||
195 | mul ebp | ||
196 | add eax, esi | ||
197 | mov esi, DWORD PTR 24[edi] | ||
198 | adc edx, 0 | ||
199 | add eax, esi | ||
200 | adc edx, 0 | ||
201 | mov DWORD PTR 24[edi],eax | ||
202 | mov esi, edx | ||
203 | $L003maw_end: | ||
204 | mov eax, esi | ||
205 | pop ecx | ||
206 | pop edi | ||
207 | pop esi | ||
208 | pop ebx | ||
209 | pop ebp | ||
210 | ret | ||
211 | _bn_mul_add_words ENDP | ||
212 | _TEXT ENDS | ||
213 | _TEXT SEGMENT | ||
214 | PUBLIC _bn_mul_words | ||
215 | |||
216 | _bn_mul_words PROC NEAR | ||
217 | push ebp | ||
218 | push ebx | ||
219 | push esi | ||
220 | push edi | ||
221 | ; | ||
222 | xor esi, esi | ||
223 | mov edi, DWORD PTR 20[esp] | ||
224 | mov ebx, DWORD PTR 24[esp] | ||
225 | mov ebp, DWORD PTR 28[esp] | ||
226 | mov ecx, DWORD PTR 32[esp] | ||
227 | and ebp, 4294967288 | ||
228 | jz $L004mw_finish | ||
229 | L005mw_loop: | ||
230 | ; Round 0 | ||
231 | mov eax, DWORD PTR [ebx] | ||
232 | mul ecx | ||
233 | add eax, esi | ||
234 | adc edx, 0 | ||
235 | mov DWORD PTR [edi],eax | ||
236 | mov esi, edx | ||
237 | ; Round 4 | ||
238 | mov eax, DWORD PTR 4[ebx] | ||
239 | mul ecx | ||
240 | add eax, esi | ||
241 | adc edx, 0 | ||
242 | mov DWORD PTR 4[edi],eax | ||
243 | mov esi, edx | ||
244 | ; Round 8 | ||
245 | mov eax, DWORD PTR 8[ebx] | ||
246 | mul ecx | ||
247 | add eax, esi | ||
248 | adc edx, 0 | ||
249 | mov DWORD PTR 8[edi],eax | ||
250 | mov esi, edx | ||
251 | ; Round 12 | ||
252 | mov eax, DWORD PTR 12[ebx] | ||
253 | mul ecx | ||
254 | add eax, esi | ||
255 | adc edx, 0 | ||
256 | mov DWORD PTR 12[edi],eax | ||
257 | mov esi, edx | ||
258 | ; Round 16 | ||
259 | mov eax, DWORD PTR 16[ebx] | ||
260 | mul ecx | ||
261 | add eax, esi | ||
262 | adc edx, 0 | ||
263 | mov DWORD PTR 16[edi],eax | ||
264 | mov esi, edx | ||
265 | ; Round 20 | ||
266 | mov eax, DWORD PTR 20[ebx] | ||
267 | mul ecx | ||
268 | add eax, esi | ||
269 | adc edx, 0 | ||
270 | mov DWORD PTR 20[edi],eax | ||
271 | mov esi, edx | ||
272 | ; Round 24 | ||
273 | mov eax, DWORD PTR 24[ebx] | ||
274 | mul ecx | ||
275 | add eax, esi | ||
276 | adc edx, 0 | ||
277 | mov DWORD PTR 24[edi],eax | ||
278 | mov esi, edx | ||
279 | ; Round 28 | ||
280 | mov eax, DWORD PTR 28[ebx] | ||
281 | mul ecx | ||
282 | add eax, esi | ||
283 | adc edx, 0 | ||
284 | mov DWORD PTR 28[edi],eax | ||
285 | mov esi, edx | ||
286 | ; | ||
287 | add ebx, 32 | ||
288 | add edi, 32 | ||
289 | sub ebp, 8 | ||
290 | jz $L004mw_finish | ||
291 | jmp L005mw_loop | ||
292 | $L004mw_finish: | ||
293 | mov ebp, DWORD PTR 28[esp] | ||
294 | and ebp, 7 | ||
295 | jnz $L006mw_finish2 | ||
296 | jmp $L007mw_end | ||
297 | $L006mw_finish2: | ||
298 | ; Tail Round 0 | ||
299 | mov eax, DWORD PTR [ebx] | ||
300 | mul ecx | ||
301 | add eax, esi | ||
302 | adc edx, 0 | ||
303 | mov DWORD PTR [edi],eax | ||
304 | mov esi, edx | ||
305 | dec ebp | ||
306 | jz $L007mw_end | ||
307 | ; Tail Round 1 | ||
308 | mov eax, DWORD PTR 4[ebx] | ||
309 | mul ecx | ||
310 | add eax, esi | ||
311 | adc edx, 0 | ||
312 | mov DWORD PTR 4[edi],eax | ||
313 | mov esi, edx | ||
314 | dec ebp | ||
315 | jz $L007mw_end | ||
316 | ; Tail Round 2 | ||
317 | mov eax, DWORD PTR 8[ebx] | ||
318 | mul ecx | ||
319 | add eax, esi | ||
320 | adc edx, 0 | ||
321 | mov DWORD PTR 8[edi],eax | ||
322 | mov esi, edx | ||
323 | dec ebp | ||
324 | jz $L007mw_end | ||
325 | ; Tail Round 3 | ||
326 | mov eax, DWORD PTR 12[ebx] | ||
327 | mul ecx | ||
328 | add eax, esi | ||
329 | adc edx, 0 | ||
330 | mov DWORD PTR 12[edi],eax | ||
331 | mov esi, edx | ||
332 | dec ebp | ||
333 | jz $L007mw_end | ||
334 | ; Tail Round 4 | ||
335 | mov eax, DWORD PTR 16[ebx] | ||
336 | mul ecx | ||
337 | add eax, esi | ||
338 | adc edx, 0 | ||
339 | mov DWORD PTR 16[edi],eax | ||
340 | mov esi, edx | ||
341 | dec ebp | ||
342 | jz $L007mw_end | ||
343 | ; Tail Round 5 | ||
344 | mov eax, DWORD PTR 20[ebx] | ||
345 | mul ecx | ||
346 | add eax, esi | ||
347 | adc edx, 0 | ||
348 | mov DWORD PTR 20[edi],eax | ||
349 | mov esi, edx | ||
350 | dec ebp | ||
351 | jz $L007mw_end | ||
352 | ; Tail Round 6 | ||
353 | mov eax, DWORD PTR 24[ebx] | ||
354 | mul ecx | ||
355 | add eax, esi | ||
356 | adc edx, 0 | ||
357 | mov DWORD PTR 24[edi],eax | ||
358 | mov esi, edx | ||
359 | $L007mw_end: | ||
360 | mov eax, esi | ||
361 | pop edi | ||
362 | pop esi | ||
363 | pop ebx | ||
364 | pop ebp | ||
365 | ret | ||
366 | _bn_mul_words ENDP | ||
367 | _TEXT ENDS | ||
368 | _TEXT SEGMENT | ||
369 | PUBLIC _bn_sqr_words | ||
370 | |||
371 | _bn_sqr_words PROC NEAR | ||
372 | push ebp | ||
373 | push ebx | ||
374 | push esi | ||
375 | push edi | ||
376 | ; | ||
377 | mov esi, DWORD PTR 20[esp] | ||
378 | mov edi, DWORD PTR 24[esp] | ||
379 | mov ebx, DWORD PTR 28[esp] | ||
380 | and ebx, 4294967288 | ||
381 | jz $L008sw_finish | ||
382 | L009sw_loop: | ||
383 | ; Round 0 | ||
384 | mov eax, DWORD PTR [edi] | ||
385 | mul eax | ||
386 | mov DWORD PTR [esi],eax | ||
387 | mov DWORD PTR 4[esi],edx | ||
388 | ; Round 4 | ||
389 | mov eax, DWORD PTR 4[edi] | ||
390 | mul eax | ||
391 | mov DWORD PTR 8[esi],eax | ||
392 | mov DWORD PTR 12[esi],edx | ||
393 | ; Round 8 | ||
394 | mov eax, DWORD PTR 8[edi] | ||
395 | mul eax | ||
396 | mov DWORD PTR 16[esi],eax | ||
397 | mov DWORD PTR 20[esi],edx | ||
398 | ; Round 12 | ||
399 | mov eax, DWORD PTR 12[edi] | ||
400 | mul eax | ||
401 | mov DWORD PTR 24[esi],eax | ||
402 | mov DWORD PTR 28[esi],edx | ||
403 | ; Round 16 | ||
404 | mov eax, DWORD PTR 16[edi] | ||
405 | mul eax | ||
406 | mov DWORD PTR 32[esi],eax | ||
407 | mov DWORD PTR 36[esi],edx | ||
408 | ; Round 20 | ||
409 | mov eax, DWORD PTR 20[edi] | ||
410 | mul eax | ||
411 | mov DWORD PTR 40[esi],eax | ||
412 | mov DWORD PTR 44[esi],edx | ||
413 | ; Round 24 | ||
414 | mov eax, DWORD PTR 24[edi] | ||
415 | mul eax | ||
416 | mov DWORD PTR 48[esi],eax | ||
417 | mov DWORD PTR 52[esi],edx | ||
418 | ; Round 28 | ||
419 | mov eax, DWORD PTR 28[edi] | ||
420 | mul eax | ||
421 | mov DWORD PTR 56[esi],eax | ||
422 | mov DWORD PTR 60[esi],edx | ||
423 | ; | ||
424 | add edi, 32 | ||
425 | add esi, 64 | ||
426 | sub ebx, 8 | ||
427 | jnz L009sw_loop | ||
428 | $L008sw_finish: | ||
429 | mov ebx, DWORD PTR 28[esp] | ||
430 | and ebx, 7 | ||
431 | jz $L010sw_end | ||
432 | ; Tail Round 0 | ||
433 | mov eax, DWORD PTR [edi] | ||
434 | mul eax | ||
435 | mov DWORD PTR [esi],eax | ||
436 | dec ebx | ||
437 | mov DWORD PTR 4[esi],edx | ||
438 | jz $L010sw_end | ||
439 | ; Tail Round 1 | ||
440 | mov eax, DWORD PTR 4[edi] | ||
441 | mul eax | ||
442 | mov DWORD PTR 8[esi],eax | ||
443 | dec ebx | ||
444 | mov DWORD PTR 12[esi],edx | ||
445 | jz $L010sw_end | ||
446 | ; Tail Round 2 | ||
447 | mov eax, DWORD PTR 8[edi] | ||
448 | mul eax | ||
449 | mov DWORD PTR 16[esi],eax | ||
450 | dec ebx | ||
451 | mov DWORD PTR 20[esi],edx | ||
452 | jz $L010sw_end | ||
453 | ; Tail Round 3 | ||
454 | mov eax, DWORD PTR 12[edi] | ||
455 | mul eax | ||
456 | mov DWORD PTR 24[esi],eax | ||
457 | dec ebx | ||
458 | mov DWORD PTR 28[esi],edx | ||
459 | jz $L010sw_end | ||
460 | ; Tail Round 4 | ||
461 | mov eax, DWORD PTR 16[edi] | ||
462 | mul eax | ||
463 | mov DWORD PTR 32[esi],eax | ||
464 | dec ebx | ||
465 | mov DWORD PTR 36[esi],edx | ||
466 | jz $L010sw_end | ||
467 | ; Tail Round 5 | ||
468 | mov eax, DWORD PTR 20[edi] | ||
469 | mul eax | ||
470 | mov DWORD PTR 40[esi],eax | ||
471 | dec ebx | ||
472 | mov DWORD PTR 44[esi],edx | ||
473 | jz $L010sw_end | ||
474 | ; Tail Round 6 | ||
475 | mov eax, DWORD PTR 24[edi] | ||
476 | mul eax | ||
477 | mov DWORD PTR 48[esi],eax | ||
478 | mov DWORD PTR 52[esi],edx | ||
479 | $L010sw_end: | ||
480 | pop edi | ||
481 | pop esi | ||
482 | pop ebx | ||
483 | pop ebp | ||
484 | ret | ||
485 | _bn_sqr_words ENDP | ||
486 | _TEXT ENDS | ||
487 | _TEXT SEGMENT | ||
488 | PUBLIC _bn_div_words | ||
489 | |||
490 | _bn_div_words PROC NEAR | ||
491 | push ebp | ||
492 | push ebx | ||
493 | push esi | ||
494 | push edi | ||
495 | mov edx, DWORD PTR 20[esp] | ||
496 | mov eax, DWORD PTR 24[esp] | ||
497 | mov ebx, DWORD PTR 28[esp] | ||
498 | div ebx | ||
499 | pop edi | ||
500 | pop esi | ||
501 | pop ebx | ||
502 | pop ebp | ||
503 | ret | ||
504 | _bn_div_words ENDP | ||
505 | _TEXT ENDS | ||
506 | _TEXT SEGMENT | ||
507 | PUBLIC _bn_add_words | ||
508 | |||
509 | _bn_add_words PROC NEAR | ||
510 | push ebp | ||
511 | push ebx | ||
512 | push esi | ||
513 | push edi | ||
514 | ; | ||
515 | mov ebx, DWORD PTR 20[esp] | ||
516 | mov esi, DWORD PTR 24[esp] | ||
517 | mov edi, DWORD PTR 28[esp] | ||
518 | mov ebp, DWORD PTR 32[esp] | ||
519 | xor eax, eax | ||
520 | and ebp, 4294967288 | ||
521 | jz $L011aw_finish | ||
522 | L012aw_loop: | ||
523 | ; Round 0 | ||
524 | mov ecx, DWORD PTR [esi] | ||
525 | mov edx, DWORD PTR [edi] | ||
526 | add ecx, eax | ||
527 | mov eax, 0 | ||
528 | adc eax, eax | ||
529 | add ecx, edx | ||
530 | adc eax, 0 | ||
531 | mov DWORD PTR [ebx],ecx | ||
532 | ; Round 1 | ||
533 | mov ecx, DWORD PTR 4[esi] | ||
534 | mov edx, DWORD PTR 4[edi] | ||
535 | add ecx, eax | ||
536 | mov eax, 0 | ||
537 | adc eax, eax | ||
538 | add ecx, edx | ||
539 | adc eax, 0 | ||
540 | mov DWORD PTR 4[ebx],ecx | ||
541 | ; Round 2 | ||
542 | mov ecx, DWORD PTR 8[esi] | ||
543 | mov edx, DWORD PTR 8[edi] | ||
544 | add ecx, eax | ||
545 | mov eax, 0 | ||
546 | adc eax, eax | ||
547 | add ecx, edx | ||
548 | adc eax, 0 | ||
549 | mov DWORD PTR 8[ebx],ecx | ||
550 | ; Round 3 | ||
551 | mov ecx, DWORD PTR 12[esi] | ||
552 | mov edx, DWORD PTR 12[edi] | ||
553 | add ecx, eax | ||
554 | mov eax, 0 | ||
555 | adc eax, eax | ||
556 | add ecx, edx | ||
557 | adc eax, 0 | ||
558 | mov DWORD PTR 12[ebx],ecx | ||
559 | ; Round 4 | ||
560 | mov ecx, DWORD PTR 16[esi] | ||
561 | mov edx, DWORD PTR 16[edi] | ||
562 | add ecx, eax | ||
563 | mov eax, 0 | ||
564 | adc eax, eax | ||
565 | add ecx, edx | ||
566 | adc eax, 0 | ||
567 | mov DWORD PTR 16[ebx],ecx | ||
568 | ; Round 5 | ||
569 | mov ecx, DWORD PTR 20[esi] | ||
570 | mov edx, DWORD PTR 20[edi] | ||
571 | add ecx, eax | ||
572 | mov eax, 0 | ||
573 | adc eax, eax | ||
574 | add ecx, edx | ||
575 | adc eax, 0 | ||
576 | mov DWORD PTR 20[ebx],ecx | ||
577 | ; Round 6 | ||
578 | mov ecx, DWORD PTR 24[esi] | ||
579 | mov edx, DWORD PTR 24[edi] | ||
580 | add ecx, eax | ||
581 | mov eax, 0 | ||
582 | adc eax, eax | ||
583 | add ecx, edx | ||
584 | adc eax, 0 | ||
585 | mov DWORD PTR 24[ebx],ecx | ||
586 | ; Round 7 | ||
587 | mov ecx, DWORD PTR 28[esi] | ||
588 | mov edx, DWORD PTR 28[edi] | ||
589 | add ecx, eax | ||
590 | mov eax, 0 | ||
591 | adc eax, eax | ||
592 | add ecx, edx | ||
593 | adc eax, 0 | ||
594 | mov DWORD PTR 28[ebx],ecx | ||
595 | ; | ||
596 | add esi, 32 | ||
597 | add edi, 32 | ||
598 | add ebx, 32 | ||
599 | sub ebp, 8 | ||
600 | jnz L012aw_loop | ||
601 | $L011aw_finish: | ||
602 | mov ebp, DWORD PTR 32[esp] | ||
603 | and ebp, 7 | ||
604 | jz $L013aw_end | ||
605 | ; Tail Round 0 | ||
606 | mov ecx, DWORD PTR [esi] | ||
607 | mov edx, DWORD PTR [edi] | ||
608 | add ecx, eax | ||
609 | mov eax, 0 | ||
610 | adc eax, eax | ||
611 | add ecx, edx | ||
612 | adc eax, 0 | ||
613 | dec ebp | ||
614 | mov DWORD PTR [ebx],ecx | ||
615 | jz $L013aw_end | ||
616 | ; Tail Round 1 | ||
617 | mov ecx, DWORD PTR 4[esi] | ||
618 | mov edx, DWORD PTR 4[edi] | ||
619 | add ecx, eax | ||
620 | mov eax, 0 | ||
621 | adc eax, eax | ||
622 | add ecx, edx | ||
623 | adc eax, 0 | ||
624 | dec ebp | ||
625 | mov DWORD PTR 4[ebx],ecx | ||
626 | jz $L013aw_end | ||
627 | ; Tail Round 2 | ||
628 | mov ecx, DWORD PTR 8[esi] | ||
629 | mov edx, DWORD PTR 8[edi] | ||
630 | add ecx, eax | ||
631 | mov eax, 0 | ||
632 | adc eax, eax | ||
633 | add ecx, edx | ||
634 | adc eax, 0 | ||
635 | dec ebp | ||
636 | mov DWORD PTR 8[ebx],ecx | ||
637 | jz $L013aw_end | ||
638 | ; Tail Round 3 | ||
639 | mov ecx, DWORD PTR 12[esi] | ||
640 | mov edx, DWORD PTR 12[edi] | ||
641 | add ecx, eax | ||
642 | mov eax, 0 | ||
643 | adc eax, eax | ||
644 | add ecx, edx | ||
645 | adc eax, 0 | ||
646 | dec ebp | ||
647 | mov DWORD PTR 12[ebx],ecx | ||
648 | jz $L013aw_end | ||
649 | ; Tail Round 4 | ||
650 | mov ecx, DWORD PTR 16[esi] | ||
651 | mov edx, DWORD PTR 16[edi] | ||
652 | add ecx, eax | ||
653 | mov eax, 0 | ||
654 | adc eax, eax | ||
655 | add ecx, edx | ||
656 | adc eax, 0 | ||
657 | dec ebp | ||
658 | mov DWORD PTR 16[ebx],ecx | ||
659 | jz $L013aw_end | ||
660 | ; Tail Round 5 | ||
661 | mov ecx, DWORD PTR 20[esi] | ||
662 | mov edx, DWORD PTR 20[edi] | ||
663 | add ecx, eax | ||
664 | mov eax, 0 | ||
665 | adc eax, eax | ||
666 | add ecx, edx | ||
667 | adc eax, 0 | ||
668 | dec ebp | ||
669 | mov DWORD PTR 20[ebx],ecx | ||
670 | jz $L013aw_end | ||
671 | ; Tail Round 6 | ||
672 | mov ecx, DWORD PTR 24[esi] | ||
673 | mov edx, DWORD PTR 24[edi] | ||
674 | add ecx, eax | ||
675 | mov eax, 0 | ||
676 | adc eax, eax | ||
677 | add ecx, edx | ||
678 | adc eax, 0 | ||
679 | mov DWORD PTR 24[ebx],ecx | ||
680 | $L013aw_end: | ||
681 | pop edi | ||
682 | pop esi | ||
683 | pop ebx | ||
684 | pop ebp | ||
685 | ret | ||
686 | _bn_add_words ENDP | ||
687 | _TEXT ENDS | ||
688 | _TEXT SEGMENT | ||
689 | PUBLIC _bn_sub_words | ||
690 | |||
691 | _bn_sub_words PROC NEAR | ||
692 | push ebp | ||
693 | push ebx | ||
694 | push esi | ||
695 | push edi | ||
696 | ; | ||
697 | mov ebx, DWORD PTR 20[esp] | ||
698 | mov esi, DWORD PTR 24[esp] | ||
699 | mov edi, DWORD PTR 28[esp] | ||
700 | mov ebp, DWORD PTR 32[esp] | ||
701 | xor eax, eax | ||
702 | and ebp, 4294967288 | ||
703 | jz $L014aw_finish | ||
704 | L015aw_loop: | ||
705 | ; Round 0 | ||
706 | mov ecx, DWORD PTR [esi] | ||
707 | mov edx, DWORD PTR [edi] | ||
708 | sub ecx, eax | ||
709 | mov eax, 0 | ||
710 | adc eax, eax | ||
711 | sub ecx, edx | ||
712 | adc eax, 0 | ||
713 | mov DWORD PTR [ebx],ecx | ||
714 | ; Round 1 | ||
715 | mov ecx, DWORD PTR 4[esi] | ||
716 | mov edx, DWORD PTR 4[edi] | ||
717 | sub ecx, eax | ||
718 | mov eax, 0 | ||
719 | adc eax, eax | ||
720 | sub ecx, edx | ||
721 | adc eax, 0 | ||
722 | mov DWORD PTR 4[ebx],ecx | ||
723 | ; Round 2 | ||
724 | mov ecx, DWORD PTR 8[esi] | ||
725 | mov edx, DWORD PTR 8[edi] | ||
726 | sub ecx, eax | ||
727 | mov eax, 0 | ||
728 | adc eax, eax | ||
729 | sub ecx, edx | ||
730 | adc eax, 0 | ||
731 | mov DWORD PTR 8[ebx],ecx | ||
732 | ; Round 3 | ||
733 | mov ecx, DWORD PTR 12[esi] | ||
734 | mov edx, DWORD PTR 12[edi] | ||
735 | sub ecx, eax | ||
736 | mov eax, 0 | ||
737 | adc eax, eax | ||
738 | sub ecx, edx | ||
739 | adc eax, 0 | ||
740 | mov DWORD PTR 12[ebx],ecx | ||
741 | ; Round 4 | ||
742 | mov ecx, DWORD PTR 16[esi] | ||
743 | mov edx, DWORD PTR 16[edi] | ||
744 | sub ecx, eax | ||
745 | mov eax, 0 | ||
746 | adc eax, eax | ||
747 | sub ecx, edx | ||
748 | adc eax, 0 | ||
749 | mov DWORD PTR 16[ebx],ecx | ||
750 | ; Round 5 | ||
751 | mov ecx, DWORD PTR 20[esi] | ||
752 | mov edx, DWORD PTR 20[edi] | ||
753 | sub ecx, eax | ||
754 | mov eax, 0 | ||
755 | adc eax, eax | ||
756 | sub ecx, edx | ||
757 | adc eax, 0 | ||
758 | mov DWORD PTR 20[ebx],ecx | ||
759 | ; Round 6 | ||
760 | mov ecx, DWORD PTR 24[esi] | ||
761 | mov edx, DWORD PTR 24[edi] | ||
762 | sub ecx, eax | ||
763 | mov eax, 0 | ||
764 | adc eax, eax | ||
765 | sub ecx, edx | ||
766 | adc eax, 0 | ||
767 | mov DWORD PTR 24[ebx],ecx | ||
768 | ; Round 7 | ||
769 | mov ecx, DWORD PTR 28[esi] | ||
770 | mov edx, DWORD PTR 28[edi] | ||
771 | sub ecx, eax | ||
772 | mov eax, 0 | ||
773 | adc eax, eax | ||
774 | sub ecx, edx | ||
775 | adc eax, 0 | ||
776 | mov DWORD PTR 28[ebx],ecx | ||
777 | ; | ||
778 | add esi, 32 | ||
779 | add edi, 32 | ||
780 | add ebx, 32 | ||
781 | sub ebp, 8 | ||
782 | jnz L015aw_loop | ||
783 | $L014aw_finish: | ||
784 | mov ebp, DWORD PTR 32[esp] | ||
785 | and ebp, 7 | ||
786 | jz $L016aw_end | ||
787 | ; Tail Round 0 | ||
788 | mov ecx, DWORD PTR [esi] | ||
789 | mov edx, DWORD PTR [edi] | ||
790 | sub ecx, eax | ||
791 | mov eax, 0 | ||
792 | adc eax, eax | ||
793 | sub ecx, edx | ||
794 | adc eax, 0 | ||
795 | dec ebp | ||
796 | mov DWORD PTR [ebx],ecx | ||
797 | jz $L016aw_end | ||
798 | ; Tail Round 1 | ||
799 | mov ecx, DWORD PTR 4[esi] | ||
800 | mov edx, DWORD PTR 4[edi] | ||
801 | sub ecx, eax | ||
802 | mov eax, 0 | ||
803 | adc eax, eax | ||
804 | sub ecx, edx | ||
805 | adc eax, 0 | ||
806 | dec ebp | ||
807 | mov DWORD PTR 4[ebx],ecx | ||
808 | jz $L016aw_end | ||
809 | ; Tail Round 2 | ||
810 | mov ecx, DWORD PTR 8[esi] | ||
811 | mov edx, DWORD PTR 8[edi] | ||
812 | sub ecx, eax | ||
813 | mov eax, 0 | ||
814 | adc eax, eax | ||
815 | sub ecx, edx | ||
816 | adc eax, 0 | ||
817 | dec ebp | ||
818 | mov DWORD PTR 8[ebx],ecx | ||
819 | jz $L016aw_end | ||
820 | ; Tail Round 3 | ||
821 | mov ecx, DWORD PTR 12[esi] | ||
822 | mov edx, DWORD PTR 12[edi] | ||
823 | sub ecx, eax | ||
824 | mov eax, 0 | ||
825 | adc eax, eax | ||
826 | sub ecx, edx | ||
827 | adc eax, 0 | ||
828 | dec ebp | ||
829 | mov DWORD PTR 12[ebx],ecx | ||
830 | jz $L016aw_end | ||
831 | ; Tail Round 4 | ||
832 | mov ecx, DWORD PTR 16[esi] | ||
833 | mov edx, DWORD PTR 16[edi] | ||
834 | sub ecx, eax | ||
835 | mov eax, 0 | ||
836 | adc eax, eax | ||
837 | sub ecx, edx | ||
838 | adc eax, 0 | ||
839 | dec ebp | ||
840 | mov DWORD PTR 16[ebx],ecx | ||
841 | jz $L016aw_end | ||
842 | ; Tail Round 5 | ||
843 | mov ecx, DWORD PTR 20[esi] | ||
844 | mov edx, DWORD PTR 20[edi] | ||
845 | sub ecx, eax | ||
846 | mov eax, 0 | ||
847 | adc eax, eax | ||
848 | sub ecx, edx | ||
849 | adc eax, 0 | ||
850 | dec ebp | ||
851 | mov DWORD PTR 20[ebx],ecx | ||
852 | jz $L016aw_end | ||
853 | ; Tail Round 6 | ||
854 | mov ecx, DWORD PTR 24[esi] | ||
855 | mov edx, DWORD PTR 24[edi] | ||
856 | sub ecx, eax | ||
857 | mov eax, 0 | ||
858 | adc eax, eax | ||
859 | sub ecx, edx | ||
860 | adc eax, 0 | ||
861 | mov DWORD PTR 24[ebx],ecx | ||
862 | $L016aw_end: | ||
863 | pop edi | ||
864 | pop esi | ||
865 | pop ebx | ||
866 | pop ebp | ||
867 | ret | ||
868 | _bn_sub_words ENDP | ||
869 | _TEXT ENDS | ||
870 | _TEXT SEGMENT | ||
871 | PUBLIC _bn_mul_comba8 | ||
872 | |||
873 | _bn_mul_comba8 PROC NEAR | ||
874 | push esi | ||
875 | mov esi, DWORD PTR 12[esp] | ||
876 | push edi | ||
877 | mov edi, DWORD PTR 20[esp] | ||
878 | push ebp | ||
879 | push ebx | ||
880 | xor ebx, ebx | ||
881 | mov eax, DWORD PTR [esi] | ||
882 | xor ecx, ecx | ||
883 | mov edx, DWORD PTR [edi] | ||
884 | ; ################## Calculate word 0 | ||
885 | xor ebp, ebp | ||
886 | ; mul a[0]*b[0] | ||
887 | mul edx | ||
888 | add ebx, eax | ||
889 | mov eax, DWORD PTR 20[esp] | ||
890 | adc ecx, edx | ||
891 | mov edx, DWORD PTR [edi] | ||
892 | adc ebp, 0 | ||
893 | mov DWORD PTR [eax],ebx | ||
894 | mov eax, DWORD PTR 4[esi] | ||
895 | ; saved r[0] | ||
896 | ; ################## Calculate word 1 | ||
897 | xor ebx, ebx | ||
898 | ; mul a[1]*b[0] | ||
899 | mul edx | ||
900 | add ecx, eax | ||
901 | mov eax, DWORD PTR [esi] | ||
902 | adc ebp, edx | ||
903 | mov edx, DWORD PTR 4[edi] | ||
904 | adc ebx, 0 | ||
905 | ; mul a[0]*b[1] | ||
906 | mul edx | ||
907 | add ecx, eax | ||
908 | mov eax, DWORD PTR 20[esp] | ||
909 | adc ebp, edx | ||
910 | mov edx, DWORD PTR [edi] | ||
911 | adc ebx, 0 | ||
912 | mov DWORD PTR 4[eax],ecx | ||
913 | mov eax, DWORD PTR 8[esi] | ||
914 | ; saved r[1] | ||
915 | ; ################## Calculate word 2 | ||
916 | xor ecx, ecx | ||
917 | ; mul a[2]*b[0] | ||
918 | mul edx | ||
919 | add ebp, eax | ||
920 | mov eax, DWORD PTR 4[esi] | ||
921 | adc ebx, edx | ||
922 | mov edx, DWORD PTR 4[edi] | ||
923 | adc ecx, 0 | ||
924 | ; mul a[1]*b[1] | ||
925 | mul edx | ||
926 | add ebp, eax | ||
927 | mov eax, DWORD PTR [esi] | ||
928 | adc ebx, edx | ||
929 | mov edx, DWORD PTR 8[edi] | ||
930 | adc ecx, 0 | ||
931 | ; mul a[0]*b[2] | ||
932 | mul edx | ||
933 | add ebp, eax | ||
934 | mov eax, DWORD PTR 20[esp] | ||
935 | adc ebx, edx | ||
936 | mov edx, DWORD PTR [edi] | ||
937 | adc ecx, 0 | ||
938 | mov DWORD PTR 8[eax],ebp | ||
939 | mov eax, DWORD PTR 12[esi] | ||
940 | ; saved r[2] | ||
941 | ; ################## Calculate word 3 | ||
942 | xor ebp, ebp | ||
943 | ; mul a[3]*b[0] | ||
944 | mul edx | ||
945 | add ebx, eax | ||
946 | mov eax, DWORD PTR 8[esi] | ||
947 | adc ecx, edx | ||
948 | mov edx, DWORD PTR 4[edi] | ||
949 | adc ebp, 0 | ||
950 | ; mul a[2]*b[1] | ||
951 | mul edx | ||
952 | add ebx, eax | ||
953 | mov eax, DWORD PTR 4[esi] | ||
954 | adc ecx, edx | ||
955 | mov edx, DWORD PTR 8[edi] | ||
956 | adc ebp, 0 | ||
957 | ; mul a[1]*b[2] | ||
958 | mul edx | ||
959 | add ebx, eax | ||
960 | mov eax, DWORD PTR [esi] | ||
961 | adc ecx, edx | ||
962 | mov edx, DWORD PTR 12[edi] | ||
963 | adc ebp, 0 | ||
964 | ; mul a[0]*b[3] | ||
965 | mul edx | ||
966 | add ebx, eax | ||
967 | mov eax, DWORD PTR 20[esp] | ||
968 | adc ecx, edx | ||
969 | mov edx, DWORD PTR [edi] | ||
970 | adc ebp, 0 | ||
971 | mov DWORD PTR 12[eax],ebx | ||
972 | mov eax, DWORD PTR 16[esi] | ||
973 | ; saved r[3] | ||
974 | ; ################## Calculate word 4 | ||
975 | xor ebx, ebx | ||
976 | ; mul a[4]*b[0] | ||
977 | mul edx | ||
978 | add ecx, eax | ||
979 | mov eax, DWORD PTR 12[esi] | ||
980 | adc ebp, edx | ||
981 | mov edx, DWORD PTR 4[edi] | ||
982 | adc ebx, 0 | ||
983 | ; mul a[3]*b[1] | ||
984 | mul edx | ||
985 | add ecx, eax | ||
986 | mov eax, DWORD PTR 8[esi] | ||
987 | adc ebp, edx | ||
988 | mov edx, DWORD PTR 8[edi] | ||
989 | adc ebx, 0 | ||
990 | ; mul a[2]*b[2] | ||
991 | mul edx | ||
992 | add ecx, eax | ||
993 | mov eax, DWORD PTR 4[esi] | ||
994 | adc ebp, edx | ||
995 | mov edx, DWORD PTR 12[edi] | ||
996 | adc ebx, 0 | ||
997 | ; mul a[1]*b[3] | ||
998 | mul edx | ||
999 | add ecx, eax | ||
1000 | mov eax, DWORD PTR [esi] | ||
1001 | adc ebp, edx | ||
1002 | mov edx, DWORD PTR 16[edi] | ||
1003 | adc ebx, 0 | ||
1004 | ; mul a[0]*b[4] | ||
1005 | mul edx | ||
1006 | add ecx, eax | ||
1007 | mov eax, DWORD PTR 20[esp] | ||
1008 | adc ebp, edx | ||
1009 | mov edx, DWORD PTR [edi] | ||
1010 | adc ebx, 0 | ||
1011 | mov DWORD PTR 16[eax],ecx | ||
1012 | mov eax, DWORD PTR 20[esi] | ||
1013 | ; saved r[4] | ||
1014 | ; ################## Calculate word 5 | ||
1015 | xor ecx, ecx | ||
1016 | ; mul a[5]*b[0] | ||
1017 | mul edx | ||
1018 | add ebp, eax | ||
1019 | mov eax, DWORD PTR 16[esi] | ||
1020 | adc ebx, edx | ||
1021 | mov edx, DWORD PTR 4[edi] | ||
1022 | adc ecx, 0 | ||
1023 | ; mul a[4]*b[1] | ||
1024 | mul edx | ||
1025 | add ebp, eax | ||
1026 | mov eax, DWORD PTR 12[esi] | ||
1027 | adc ebx, edx | ||
1028 | mov edx, DWORD PTR 8[edi] | ||
1029 | adc ecx, 0 | ||
1030 | ; mul a[3]*b[2] | ||
1031 | mul edx | ||
1032 | add ebp, eax | ||
1033 | mov eax, DWORD PTR 8[esi] | ||
1034 | adc ebx, edx | ||
1035 | mov edx, DWORD PTR 12[edi] | ||
1036 | adc ecx, 0 | ||
1037 | ; mul a[2]*b[3] | ||
1038 | mul edx | ||
1039 | add ebp, eax | ||
1040 | mov eax, DWORD PTR 4[esi] | ||
1041 | adc ebx, edx | ||
1042 | mov edx, DWORD PTR 16[edi] | ||
1043 | adc ecx, 0 | ||
1044 | ; mul a[1]*b[4] | ||
1045 | mul edx | ||
1046 | add ebp, eax | ||
1047 | mov eax, DWORD PTR [esi] | ||
1048 | adc ebx, edx | ||
1049 | mov edx, DWORD PTR 20[edi] | ||
1050 | adc ecx, 0 | ||
1051 | ; mul a[0]*b[5] | ||
1052 | mul edx | ||
1053 | add ebp, eax | ||
1054 | mov eax, DWORD PTR 20[esp] | ||
1055 | adc ebx, edx | ||
1056 | mov edx, DWORD PTR [edi] | ||
1057 | adc ecx, 0 | ||
1058 | mov DWORD PTR 20[eax],ebp | ||
1059 | mov eax, DWORD PTR 24[esi] | ||
1060 | ; saved r[5] | ||
1061 | ; ################## Calculate word 6 | ||
1062 | xor ebp, ebp | ||
1063 | ; mul a[6]*b[0] | ||
1064 | mul edx | ||
1065 | add ebx, eax | ||
1066 | mov eax, DWORD PTR 20[esi] | ||
1067 | adc ecx, edx | ||
1068 | mov edx, DWORD PTR 4[edi] | ||
1069 | adc ebp, 0 | ||
1070 | ; mul a[5]*b[1] | ||
1071 | mul edx | ||
1072 | add ebx, eax | ||
1073 | mov eax, DWORD PTR 16[esi] | ||
1074 | adc ecx, edx | ||
1075 | mov edx, DWORD PTR 8[edi] | ||
1076 | adc ebp, 0 | ||
1077 | ; mul a[4]*b[2] | ||
1078 | mul edx | ||
1079 | add ebx, eax | ||
1080 | mov eax, DWORD PTR 12[esi] | ||
1081 | adc ecx, edx | ||
1082 | mov edx, DWORD PTR 12[edi] | ||
1083 | adc ebp, 0 | ||
1084 | ; mul a[3]*b[3] | ||
1085 | mul edx | ||
1086 | add ebx, eax | ||
1087 | mov eax, DWORD PTR 8[esi] | ||
1088 | adc ecx, edx | ||
1089 | mov edx, DWORD PTR 16[edi] | ||
1090 | adc ebp, 0 | ||
1091 | ; mul a[2]*b[4] | ||
1092 | mul edx | ||
1093 | add ebx, eax | ||
1094 | mov eax, DWORD PTR 4[esi] | ||
1095 | adc ecx, edx | ||
1096 | mov edx, DWORD PTR 20[edi] | ||
1097 | adc ebp, 0 | ||
1098 | ; mul a[1]*b[5] | ||
1099 | mul edx | ||
1100 | add ebx, eax | ||
1101 | mov eax, DWORD PTR [esi] | ||
1102 | adc ecx, edx | ||
1103 | mov edx, DWORD PTR 24[edi] | ||
1104 | adc ebp, 0 | ||
1105 | ; mul a[0]*b[6] | ||
1106 | mul edx | ||
1107 | add ebx, eax | ||
1108 | mov eax, DWORD PTR 20[esp] | ||
1109 | adc ecx, edx | ||
1110 | mov edx, DWORD PTR [edi] | ||
1111 | adc ebp, 0 | ||
1112 | mov DWORD PTR 24[eax],ebx | ||
1113 | mov eax, DWORD PTR 28[esi] | ||
1114 | ; saved r[6] | ||
1115 | ; ################## Calculate word 7 | ||
1116 | xor ebx, ebx | ||
1117 | ; mul a[7]*b[0] | ||
1118 | mul edx | ||
1119 | add ecx, eax | ||
1120 | mov eax, DWORD PTR 24[esi] | ||
1121 | adc ebp, edx | ||
1122 | mov edx, DWORD PTR 4[edi] | ||
1123 | adc ebx, 0 | ||
1124 | ; mul a[6]*b[1] | ||
1125 | mul edx | ||
1126 | add ecx, eax | ||
1127 | mov eax, DWORD PTR 20[esi] | ||
1128 | adc ebp, edx | ||
1129 | mov edx, DWORD PTR 8[edi] | ||
1130 | adc ebx, 0 | ||
1131 | ; mul a[5]*b[2] | ||
1132 | mul edx | ||
1133 | add ecx, eax | ||
1134 | mov eax, DWORD PTR 16[esi] | ||
1135 | adc ebp, edx | ||
1136 | mov edx, DWORD PTR 12[edi] | ||
1137 | adc ebx, 0 | ||
1138 | ; mul a[4]*b[3] | ||
1139 | mul edx | ||
1140 | add ecx, eax | ||
1141 | mov eax, DWORD PTR 12[esi] | ||
1142 | adc ebp, edx | ||
1143 | mov edx, DWORD PTR 16[edi] | ||
1144 | adc ebx, 0 | ||
1145 | ; mul a[3]*b[4] | ||
1146 | mul edx | ||
1147 | add ecx, eax | ||
1148 | mov eax, DWORD PTR 8[esi] | ||
1149 | adc ebp, edx | ||
1150 | mov edx, DWORD PTR 20[edi] | ||
1151 | adc ebx, 0 | ||
1152 | ; mul a[2]*b[5] | ||
1153 | mul edx | ||
1154 | add ecx, eax | ||
1155 | mov eax, DWORD PTR 4[esi] | ||
1156 | adc ebp, edx | ||
1157 | mov edx, DWORD PTR 24[edi] | ||
1158 | adc ebx, 0 | ||
1159 | ; mul a[1]*b[6] | ||
1160 | mul edx | ||
1161 | add ecx, eax | ||
1162 | mov eax, DWORD PTR [esi] | ||
1163 | adc ebp, edx | ||
1164 | mov edx, DWORD PTR 28[edi] | ||
1165 | adc ebx, 0 | ||
1166 | ; mul a[0]*b[7] | ||
1167 | mul edx | ||
1168 | add ecx, eax | ||
1169 | mov eax, DWORD PTR 20[esp] | ||
1170 | adc ebp, edx | ||
1171 | mov edx, DWORD PTR 4[edi] | ||
1172 | adc ebx, 0 | ||
1173 | mov DWORD PTR 28[eax],ecx | ||
1174 | mov eax, DWORD PTR 28[esi] | ||
1175 | ; saved r[7] | ||
1176 | ; ################## Calculate word 8 | ||
1177 | xor ecx, ecx | ||
1178 | ; mul a[7]*b[1] | ||
1179 | mul edx | ||
1180 | add ebp, eax | ||
1181 | mov eax, DWORD PTR 24[esi] | ||
1182 | adc ebx, edx | ||
1183 | mov edx, DWORD PTR 8[edi] | ||
1184 | adc ecx, 0 | ||
1185 | ; mul a[6]*b[2] | ||
1186 | mul edx | ||
1187 | add ebp, eax | ||
1188 | mov eax, DWORD PTR 20[esi] | ||
1189 | adc ebx, edx | ||
1190 | mov edx, DWORD PTR 12[edi] | ||
1191 | adc ecx, 0 | ||
1192 | ; mul a[5]*b[3] | ||
1193 | mul edx | ||
1194 | add ebp, eax | ||
1195 | mov eax, DWORD PTR 16[esi] | ||
1196 | adc ebx, edx | ||
1197 | mov edx, DWORD PTR 16[edi] | ||
1198 | adc ecx, 0 | ||
1199 | ; mul a[4]*b[4] | ||
1200 | mul edx | ||
1201 | add ebp, eax | ||
1202 | mov eax, DWORD PTR 12[esi] | ||
1203 | adc ebx, edx | ||
1204 | mov edx, DWORD PTR 20[edi] | ||
1205 | adc ecx, 0 | ||
1206 | ; mul a[3]*b[5] | ||
1207 | mul edx | ||
1208 | add ebp, eax | ||
1209 | mov eax, DWORD PTR 8[esi] | ||
1210 | adc ebx, edx | ||
1211 | mov edx, DWORD PTR 24[edi] | ||
1212 | adc ecx, 0 | ||
1213 | ; mul a[2]*b[6] | ||
1214 | mul edx | ||
1215 | add ebp, eax | ||
1216 | mov eax, DWORD PTR 4[esi] | ||
1217 | adc ebx, edx | ||
1218 | mov edx, DWORD PTR 28[edi] | ||
1219 | adc ecx, 0 | ||
1220 | ; mul a[1]*b[7] | ||
1221 | mul edx | ||
1222 | add ebp, eax | ||
1223 | mov eax, DWORD PTR 20[esp] | ||
1224 | adc ebx, edx | ||
1225 | mov edx, DWORD PTR 8[edi] | ||
1226 | adc ecx, 0 | ||
1227 | mov DWORD PTR 32[eax],ebp | ||
1228 | mov eax, DWORD PTR 28[esi] | ||
1229 | ; saved r[8] | ||
1230 | ; ################## Calculate word 9 | ||
1231 | xor ebp, ebp | ||
1232 | ; mul a[7]*b[2] | ||
1233 | mul edx | ||
1234 | add ebx, eax | ||
1235 | mov eax, DWORD PTR 24[esi] | ||
1236 | adc ecx, edx | ||
1237 | mov edx, DWORD PTR 12[edi] | ||
1238 | adc ebp, 0 | ||
1239 | ; mul a[6]*b[3] | ||
1240 | mul edx | ||
1241 | add ebx, eax | ||
1242 | mov eax, DWORD PTR 20[esi] | ||
1243 | adc ecx, edx | ||
1244 | mov edx, DWORD PTR 16[edi] | ||
1245 | adc ebp, 0 | ||
1246 | ; mul a[5]*b[4] | ||
1247 | mul edx | ||
1248 | add ebx, eax | ||
1249 | mov eax, DWORD PTR 16[esi] | ||
1250 | adc ecx, edx | ||
1251 | mov edx, DWORD PTR 20[edi] | ||
1252 | adc ebp, 0 | ||
1253 | ; mul a[4]*b[5] | ||
1254 | mul edx | ||
1255 | add ebx, eax | ||
1256 | mov eax, DWORD PTR 12[esi] | ||
1257 | adc ecx, edx | ||
1258 | mov edx, DWORD PTR 24[edi] | ||
1259 | adc ebp, 0 | ||
1260 | ; mul a[3]*b[6] | ||
1261 | mul edx | ||
1262 | add ebx, eax | ||
1263 | mov eax, DWORD PTR 8[esi] | ||
1264 | adc ecx, edx | ||
1265 | mov edx, DWORD PTR 28[edi] | ||
1266 | adc ebp, 0 | ||
1267 | ; mul a[2]*b[7] | ||
1268 | mul edx | ||
1269 | add ebx, eax | ||
1270 | mov eax, DWORD PTR 20[esp] | ||
1271 | adc ecx, edx | ||
1272 | mov edx, DWORD PTR 12[edi] | ||
1273 | adc ebp, 0 | ||
1274 | mov DWORD PTR 36[eax],ebx | ||
1275 | mov eax, DWORD PTR 28[esi] | ||
1276 | ; saved r[9] | ||
1277 | ; ################## Calculate word 10 | ||
1278 | xor ebx, ebx | ||
1279 | ; mul a[7]*b[3] | ||
1280 | mul edx | ||
1281 | add ecx, eax | ||
1282 | mov eax, DWORD PTR 24[esi] | ||
1283 | adc ebp, edx | ||
1284 | mov edx, DWORD PTR 16[edi] | ||
1285 | adc ebx, 0 | ||
1286 | ; mul a[6]*b[4] | ||
1287 | mul edx | ||
1288 | add ecx, eax | ||
1289 | mov eax, DWORD PTR 20[esi] | ||
1290 | adc ebp, edx | ||
1291 | mov edx, DWORD PTR 20[edi] | ||
1292 | adc ebx, 0 | ||
1293 | ; mul a[5]*b[5] | ||
1294 | mul edx | ||
1295 | add ecx, eax | ||
1296 | mov eax, DWORD PTR 16[esi] | ||
1297 | adc ebp, edx | ||
1298 | mov edx, DWORD PTR 24[edi] | ||
1299 | adc ebx, 0 | ||
1300 | ; mul a[4]*b[6] | ||
1301 | mul edx | ||
1302 | add ecx, eax | ||
1303 | mov eax, DWORD PTR 12[esi] | ||
1304 | adc ebp, edx | ||
1305 | mov edx, DWORD PTR 28[edi] | ||
1306 | adc ebx, 0 | ||
1307 | ; mul a[3]*b[7] | ||
1308 | mul edx | ||
1309 | add ecx, eax | ||
1310 | mov eax, DWORD PTR 20[esp] | ||
1311 | adc ebp, edx | ||
1312 | mov edx, DWORD PTR 16[edi] | ||
1313 | adc ebx, 0 | ||
1314 | mov DWORD PTR 40[eax],ecx | ||
1315 | mov eax, DWORD PTR 28[esi] | ||
1316 | ; saved r[10] | ||
1317 | ; ################## Calculate word 11 | ||
1318 | xor ecx, ecx | ||
1319 | ; mul a[7]*b[4] | ||
1320 | mul edx | ||
1321 | add ebp, eax | ||
1322 | mov eax, DWORD PTR 24[esi] | ||
1323 | adc ebx, edx | ||
1324 | mov edx, DWORD PTR 20[edi] | ||
1325 | adc ecx, 0 | ||
1326 | ; mul a[6]*b[5] | ||
1327 | mul edx | ||
1328 | add ebp, eax | ||
1329 | mov eax, DWORD PTR 20[esi] | ||
1330 | adc ebx, edx | ||
1331 | mov edx, DWORD PTR 24[edi] | ||
1332 | adc ecx, 0 | ||
1333 | ; mul a[5]*b[6] | ||
1334 | mul edx | ||
1335 | add ebp, eax | ||
1336 | mov eax, DWORD PTR 16[esi] | ||
1337 | adc ebx, edx | ||
1338 | mov edx, DWORD PTR 28[edi] | ||
1339 | adc ecx, 0 | ||
1340 | ; mul a[4]*b[7] | ||
1341 | mul edx | ||
1342 | add ebp, eax | ||
1343 | mov eax, DWORD PTR 20[esp] | ||
1344 | adc ebx, edx | ||
1345 | mov edx, DWORD PTR 20[edi] | ||
1346 | adc ecx, 0 | ||
1347 | mov DWORD PTR 44[eax],ebp | ||
1348 | mov eax, DWORD PTR 28[esi] | ||
1349 | ; saved r[11] | ||
1350 | ; ################## Calculate word 12 | ||
1351 | xor ebp, ebp | ||
1352 | ; mul a[7]*b[5] | ||
1353 | mul edx | ||
1354 | add ebx, eax | ||
1355 | mov eax, DWORD PTR 24[esi] | ||
1356 | adc ecx, edx | ||
1357 | mov edx, DWORD PTR 24[edi] | ||
1358 | adc ebp, 0 | ||
1359 | ; mul a[6]*b[6] | ||
1360 | mul edx | ||
1361 | add ebx, eax | ||
1362 | mov eax, DWORD PTR 20[esi] | ||
1363 | adc ecx, edx | ||
1364 | mov edx, DWORD PTR 28[edi] | ||
1365 | adc ebp, 0 | ||
1366 | ; mul a[5]*b[7] | ||
1367 | mul edx | ||
1368 | add ebx, eax | ||
1369 | mov eax, DWORD PTR 20[esp] | ||
1370 | adc ecx, edx | ||
1371 | mov edx, DWORD PTR 24[edi] | ||
1372 | adc ebp, 0 | ||
1373 | mov DWORD PTR 48[eax],ebx | ||
1374 | mov eax, DWORD PTR 28[esi] | ||
1375 | ; saved r[12] | ||
1376 | ; ################## Calculate word 13 | ||
1377 | xor ebx, ebx | ||
1378 | ; mul a[7]*b[6] | ||
1379 | mul edx | ||
1380 | add ecx, eax | ||
1381 | mov eax, DWORD PTR 24[esi] | ||
1382 | adc ebp, edx | ||
1383 | mov edx, DWORD PTR 28[edi] | ||
1384 | adc ebx, 0 | ||
1385 | ; mul a[6]*b[7] | ||
1386 | mul edx | ||
1387 | add ecx, eax | ||
1388 | mov eax, DWORD PTR 20[esp] | ||
1389 | adc ebp, edx | ||
1390 | mov edx, DWORD PTR 28[edi] | ||
1391 | adc ebx, 0 | ||
1392 | mov DWORD PTR 52[eax],ecx | ||
1393 | mov eax, DWORD PTR 28[esi] | ||
1394 | ; saved r[13] | ||
1395 | ; ################## Calculate word 14 | ||
1396 | xor ecx, ecx | ||
1397 | ; mul a[7]*b[7] | ||
1398 | mul edx | ||
1399 | add ebp, eax | ||
1400 | mov eax, DWORD PTR 20[esp] | ||
1401 | adc ebx, edx | ||
1402 | adc ecx, 0 | ||
1403 | mov DWORD PTR 56[eax],ebp | ||
1404 | ; saved r[14] | ||
1405 | ; save r[15] | ||
1406 | mov DWORD PTR 60[eax],ebx | ||
1407 | pop ebx | ||
1408 | pop ebp | ||
1409 | pop edi | ||
1410 | pop esi | ||
1411 | ret | ||
1412 | _bn_mul_comba8 ENDP | ||
1413 | _TEXT ENDS | ||
1414 | _TEXT SEGMENT | ||
1415 | PUBLIC _bn_mul_comba4 | ||
1416 | |||
1417 | _bn_mul_comba4 PROC NEAR | ||
1418 | push esi | ||
1419 | mov esi, DWORD PTR 12[esp] | ||
1420 | push edi | ||
1421 | mov edi, DWORD PTR 20[esp] | ||
1422 | push ebp | ||
1423 | push ebx | ||
1424 | xor ebx, ebx | ||
1425 | mov eax, DWORD PTR [esi] | ||
1426 | xor ecx, ecx | ||
1427 | mov edx, DWORD PTR [edi] | ||
1428 | ; ################## Calculate word 0 | ||
1429 | xor ebp, ebp | ||
1430 | ; mul a[0]*b[0] | ||
1431 | mul edx | ||
1432 | add ebx, eax | ||
1433 | mov eax, DWORD PTR 20[esp] | ||
1434 | adc ecx, edx | ||
1435 | mov edx, DWORD PTR [edi] | ||
1436 | adc ebp, 0 | ||
1437 | mov DWORD PTR [eax],ebx | ||
1438 | mov eax, DWORD PTR 4[esi] | ||
1439 | ; saved r[0] | ||
1440 | ; ################## Calculate word 1 | ||
1441 | xor ebx, ebx | ||
1442 | ; mul a[1]*b[0] | ||
1443 | mul edx | ||
1444 | add ecx, eax | ||
1445 | mov eax, DWORD PTR [esi] | ||
1446 | adc ebp, edx | ||
1447 | mov edx, DWORD PTR 4[edi] | ||
1448 | adc ebx, 0 | ||
1449 | ; mul a[0]*b[1] | ||
1450 | mul edx | ||
1451 | add ecx, eax | ||
1452 | mov eax, DWORD PTR 20[esp] | ||
1453 | adc ebp, edx | ||
1454 | mov edx, DWORD PTR [edi] | ||
1455 | adc ebx, 0 | ||
1456 | mov DWORD PTR 4[eax],ecx | ||
1457 | mov eax, DWORD PTR 8[esi] | ||
1458 | ; saved r[1] | ||
1459 | ; ################## Calculate word 2 | ||
1460 | xor ecx, ecx | ||
1461 | ; mul a[2]*b[0] | ||
1462 | mul edx | ||
1463 | add ebp, eax | ||
1464 | mov eax, DWORD PTR 4[esi] | ||
1465 | adc ebx, edx | ||
1466 | mov edx, DWORD PTR 4[edi] | ||
1467 | adc ecx, 0 | ||
1468 | ; mul a[1]*b[1] | ||
1469 | mul edx | ||
1470 | add ebp, eax | ||
1471 | mov eax, DWORD PTR [esi] | ||
1472 | adc ebx, edx | ||
1473 | mov edx, DWORD PTR 8[edi] | ||
1474 | adc ecx, 0 | ||
1475 | ; mul a[0]*b[2] | ||
1476 | mul edx | ||
1477 | add ebp, eax | ||
1478 | mov eax, DWORD PTR 20[esp] | ||
1479 | adc ebx, edx | ||
1480 | mov edx, DWORD PTR [edi] | ||
1481 | adc ecx, 0 | ||
1482 | mov DWORD PTR 8[eax],ebp | ||
1483 | mov eax, DWORD PTR 12[esi] | ||
1484 | ; saved r[2] | ||
1485 | ; ################## Calculate word 3 | ||
1486 | xor ebp, ebp | ||
1487 | ; mul a[3]*b[0] | ||
1488 | mul edx | ||
1489 | add ebx, eax | ||
1490 | mov eax, DWORD PTR 8[esi] | ||
1491 | adc ecx, edx | ||
1492 | mov edx, DWORD PTR 4[edi] | ||
1493 | adc ebp, 0 | ||
1494 | ; mul a[2]*b[1] | ||
1495 | mul edx | ||
1496 | add ebx, eax | ||
1497 | mov eax, DWORD PTR 4[esi] | ||
1498 | adc ecx, edx | ||
1499 | mov edx, DWORD PTR 8[edi] | ||
1500 | adc ebp, 0 | ||
1501 | ; mul a[1]*b[2] | ||
1502 | mul edx | ||
1503 | add ebx, eax | ||
1504 | mov eax, DWORD PTR [esi] | ||
1505 | adc ecx, edx | ||
1506 | mov edx, DWORD PTR 12[edi] | ||
1507 | adc ebp, 0 | ||
1508 | ; mul a[0]*b[3] | ||
1509 | mul edx | ||
1510 | add ebx, eax | ||
1511 | mov eax, DWORD PTR 20[esp] | ||
1512 | adc ecx, edx | ||
1513 | mov edx, DWORD PTR 4[edi] | ||
1514 | adc ebp, 0 | ||
1515 | mov DWORD PTR 12[eax],ebx | ||
1516 | mov eax, DWORD PTR 12[esi] | ||
1517 | ; saved r[3] | ||
1518 | ; ################## Calculate word 4 | ||
1519 | xor ebx, ebx | ||
1520 | ; mul a[3]*b[1] | ||
1521 | mul edx | ||
1522 | add ecx, eax | ||
1523 | mov eax, DWORD PTR 8[esi] | ||
1524 | adc ebp, edx | ||
1525 | mov edx, DWORD PTR 8[edi] | ||
1526 | adc ebx, 0 | ||
1527 | ; mul a[2]*b[2] | ||
1528 | mul edx | ||
1529 | add ecx, eax | ||
1530 | mov eax, DWORD PTR 4[esi] | ||
1531 | adc ebp, edx | ||
1532 | mov edx, DWORD PTR 12[edi] | ||
1533 | adc ebx, 0 | ||
1534 | ; mul a[1]*b[3] | ||
1535 | mul edx | ||
1536 | add ecx, eax | ||
1537 | mov eax, DWORD PTR 20[esp] | ||
1538 | adc ebp, edx | ||
1539 | mov edx, DWORD PTR 8[edi] | ||
1540 | adc ebx, 0 | ||
1541 | mov DWORD PTR 16[eax],ecx | ||
1542 | mov eax, DWORD PTR 12[esi] | ||
1543 | ; saved r[4] | ||
1544 | ; ################## Calculate word 5 | ||
1545 | xor ecx, ecx | ||
1546 | ; mul a[3]*b[2] | ||
1547 | mul edx | ||
1548 | add ebp, eax | ||
1549 | mov eax, DWORD PTR 8[esi] | ||
1550 | adc ebx, edx | ||
1551 | mov edx, DWORD PTR 12[edi] | ||
1552 | adc ecx, 0 | ||
1553 | ; mul a[2]*b[3] | ||
1554 | mul edx | ||
1555 | add ebp, eax | ||
1556 | mov eax, DWORD PTR 20[esp] | ||
1557 | adc ebx, edx | ||
1558 | mov edx, DWORD PTR 12[edi] | ||
1559 | adc ecx, 0 | ||
1560 | mov DWORD PTR 20[eax],ebp | ||
1561 | mov eax, DWORD PTR 12[esi] | ||
1562 | ; saved r[5] | ||
1563 | ; ################## Calculate word 6 | ||
1564 | xor ebp, ebp | ||
1565 | ; mul a[3]*b[3] | ||
1566 | mul edx | ||
1567 | add ebx, eax | ||
1568 | mov eax, DWORD PTR 20[esp] | ||
1569 | adc ecx, edx | ||
1570 | adc ebp, 0 | ||
1571 | mov DWORD PTR 24[eax],ebx | ||
1572 | ; saved r[6] | ||
1573 | ; save r[7] | ||
1574 | mov DWORD PTR 28[eax],ecx | ||
1575 | pop ebx | ||
1576 | pop ebp | ||
1577 | pop edi | ||
1578 | pop esi | ||
1579 | ret | ||
1580 | _bn_mul_comba4 ENDP | ||
1581 | _TEXT ENDS | ||
1582 | _TEXT SEGMENT | ||
1583 | PUBLIC _bn_sqr_comba8 | ||
1584 | |||
1585 | _bn_sqr_comba8 PROC NEAR | ||
1586 | push esi | ||
1587 | push edi | ||
1588 | push ebp | ||
1589 | push ebx | ||
1590 | mov edi, DWORD PTR 20[esp] | ||
1591 | mov esi, DWORD PTR 24[esp] | ||
1592 | xor ebx, ebx | ||
1593 | xor ecx, ecx | ||
1594 | mov eax, DWORD PTR [esi] | ||
1595 | ; ############### Calculate word 0 | ||
1596 | xor ebp, ebp | ||
1597 | ; sqr a[0]*a[0] | ||
1598 | mul eax | ||
1599 | add ebx, eax | ||
1600 | adc ecx, edx | ||
1601 | mov edx, DWORD PTR [esi] | ||
1602 | adc ebp, 0 | ||
1603 | mov DWORD PTR [edi],ebx | ||
1604 | mov eax, DWORD PTR 4[esi] | ||
1605 | ; saved r[0] | ||
1606 | ; ############### Calculate word 1 | ||
1607 | xor ebx, ebx | ||
1608 | ; sqr a[1]*a[0] | ||
1609 | mul edx | ||
1610 | add eax, eax | ||
1611 | adc edx, edx | ||
1612 | adc ebx, 0 | ||
1613 | add ecx, eax | ||
1614 | adc ebp, edx | ||
1615 | mov eax, DWORD PTR 8[esi] | ||
1616 | adc ebx, 0 | ||
1617 | mov DWORD PTR 4[edi],ecx | ||
1618 | mov edx, DWORD PTR [esi] | ||
1619 | ; saved r[1] | ||
1620 | ; ############### Calculate word 2 | ||
1621 | xor ecx, ecx | ||
1622 | ; sqr a[2]*a[0] | ||
1623 | mul edx | ||
1624 | add eax, eax | ||
1625 | adc edx, edx | ||
1626 | adc ecx, 0 | ||
1627 | add ebp, eax | ||
1628 | adc ebx, edx | ||
1629 | mov eax, DWORD PTR 4[esi] | ||
1630 | adc ecx, 0 | ||
1631 | ; sqr a[1]*a[1] | ||
1632 | mul eax | ||
1633 | add ebp, eax | ||
1634 | adc ebx, edx | ||
1635 | mov edx, DWORD PTR [esi] | ||
1636 | adc ecx, 0 | ||
1637 | mov DWORD PTR 8[edi],ebp | ||
1638 | mov eax, DWORD PTR 12[esi] | ||
1639 | ; saved r[2] | ||
1640 | ; ############### Calculate word 3 | ||
1641 | xor ebp, ebp | ||
1642 | ; sqr a[3]*a[0] | ||
1643 | mul edx | ||
1644 | add eax, eax | ||
1645 | adc edx, edx | ||
1646 | adc ebp, 0 | ||
1647 | add ebx, eax | ||
1648 | adc ecx, edx | ||
1649 | mov eax, DWORD PTR 8[esi] | ||
1650 | adc ebp, 0 | ||
1651 | mov edx, DWORD PTR 4[esi] | ||
1652 | ; sqr a[2]*a[1] | ||
1653 | mul edx | ||
1654 | add eax, eax | ||
1655 | adc edx, edx | ||
1656 | adc ebp, 0 | ||
1657 | add ebx, eax | ||
1658 | adc ecx, edx | ||
1659 | mov eax, DWORD PTR 16[esi] | ||
1660 | adc ebp, 0 | ||
1661 | mov DWORD PTR 12[edi],ebx | ||
1662 | mov edx, DWORD PTR [esi] | ||
1663 | ; saved r[3] | ||
1664 | ; ############### Calculate word 4 | ||
1665 | xor ebx, ebx | ||
1666 | ; sqr a[4]*a[0] | ||
1667 | mul edx | ||
1668 | add eax, eax | ||
1669 | adc edx, edx | ||
1670 | adc ebx, 0 | ||
1671 | add ecx, eax | ||
1672 | adc ebp, edx | ||
1673 | mov eax, DWORD PTR 12[esi] | ||
1674 | adc ebx, 0 | ||
1675 | mov edx, DWORD PTR 4[esi] | ||
1676 | ; sqr a[3]*a[1] | ||
1677 | mul edx | ||
1678 | add eax, eax | ||
1679 | adc edx, edx | ||
1680 | adc ebx, 0 | ||
1681 | add ecx, eax | ||
1682 | adc ebp, edx | ||
1683 | mov eax, DWORD PTR 8[esi] | ||
1684 | adc ebx, 0 | ||
1685 | ; sqr a[2]*a[2] | ||
1686 | mul eax | ||
1687 | add ecx, eax | ||
1688 | adc ebp, edx | ||
1689 | mov edx, DWORD PTR [esi] | ||
1690 | adc ebx, 0 | ||
1691 | mov DWORD PTR 16[edi],ecx | ||
1692 | mov eax, DWORD PTR 20[esi] | ||
1693 | ; saved r[4] | ||
1694 | ; ############### Calculate word 5 | ||
1695 | xor ecx, ecx | ||
1696 | ; sqr a[5]*a[0] | ||
1697 | mul edx | ||
1698 | add eax, eax | ||
1699 | adc edx, edx | ||
1700 | adc ecx, 0 | ||
1701 | add ebp, eax | ||
1702 | adc ebx, edx | ||
1703 | mov eax, DWORD PTR 16[esi] | ||
1704 | adc ecx, 0 | ||
1705 | mov edx, DWORD PTR 4[esi] | ||
1706 | ; sqr a[4]*a[1] | ||
1707 | mul edx | ||
1708 | add eax, eax | ||
1709 | adc edx, edx | ||
1710 | adc ecx, 0 | ||
1711 | add ebp, eax | ||
1712 | adc ebx, edx | ||
1713 | mov eax, DWORD PTR 12[esi] | ||
1714 | adc ecx, 0 | ||
1715 | mov edx, DWORD PTR 8[esi] | ||
1716 | ; sqr a[3]*a[2] | ||
1717 | mul edx | ||
1718 | add eax, eax | ||
1719 | adc edx, edx | ||
1720 | adc ecx, 0 | ||
1721 | add ebp, eax | ||
1722 | adc ebx, edx | ||
1723 | mov eax, DWORD PTR 24[esi] | ||
1724 | adc ecx, 0 | ||
1725 | mov DWORD PTR 20[edi],ebp | ||
1726 | mov edx, DWORD PTR [esi] | ||
1727 | ; saved r[5] | ||
1728 | ; ############### Calculate word 6 | ||
1729 | xor ebp, ebp | ||
1730 | ; sqr a[6]*a[0] | ||
1731 | mul edx | ||
1732 | add eax, eax | ||
1733 | adc edx, edx | ||
1734 | adc ebp, 0 | ||
1735 | add ebx, eax | ||
1736 | adc ecx, edx | ||
1737 | mov eax, DWORD PTR 20[esi] | ||
1738 | adc ebp, 0 | ||
1739 | mov edx, DWORD PTR 4[esi] | ||
1740 | ; sqr a[5]*a[1] | ||
1741 | mul edx | ||
1742 | add eax, eax | ||
1743 | adc edx, edx | ||
1744 | adc ebp, 0 | ||
1745 | add ebx, eax | ||
1746 | adc ecx, edx | ||
1747 | mov eax, DWORD PTR 16[esi] | ||
1748 | adc ebp, 0 | ||
1749 | mov edx, DWORD PTR 8[esi] | ||
1750 | ; sqr a[4]*a[2] | ||
1751 | mul edx | ||
1752 | add eax, eax | ||
1753 | adc edx, edx | ||
1754 | adc ebp, 0 | ||
1755 | add ebx, eax | ||
1756 | adc ecx, edx | ||
1757 | mov eax, DWORD PTR 12[esi] | ||
1758 | adc ebp, 0 | ||
1759 | ; sqr a[3]*a[3] | ||
1760 | mul eax | ||
1761 | add ebx, eax | ||
1762 | adc ecx, edx | ||
1763 | mov edx, DWORD PTR [esi] | ||
1764 | adc ebp, 0 | ||
1765 | mov DWORD PTR 24[edi],ebx | ||
1766 | mov eax, DWORD PTR 28[esi] | ||
1767 | ; saved r[6] | ||
1768 | ; ############### Calculate word 7 | ||
1769 | xor ebx, ebx | ||
1770 | ; sqr a[7]*a[0] | ||
1771 | mul edx | ||
1772 | add eax, eax | ||
1773 | adc edx, edx | ||
1774 | adc ebx, 0 | ||
1775 | add ecx, eax | ||
1776 | adc ebp, edx | ||
1777 | mov eax, DWORD PTR 24[esi] | ||
1778 | adc ebx, 0 | ||
1779 | mov edx, DWORD PTR 4[esi] | ||
1780 | ; sqr a[6]*a[1] | ||
1781 | mul edx | ||
1782 | add eax, eax | ||
1783 | adc edx, edx | ||
1784 | adc ebx, 0 | ||
1785 | add ecx, eax | ||
1786 | adc ebp, edx | ||
1787 | mov eax, DWORD PTR 20[esi] | ||
1788 | adc ebx, 0 | ||
1789 | mov edx, DWORD PTR 8[esi] | ||
1790 | ; sqr a[5]*a[2] | ||
1791 | mul edx | ||
1792 | add eax, eax | ||
1793 | adc edx, edx | ||
1794 | adc ebx, 0 | ||
1795 | add ecx, eax | ||
1796 | adc ebp, edx | ||
1797 | mov eax, DWORD PTR 16[esi] | ||
1798 | adc ebx, 0 | ||
1799 | mov edx, DWORD PTR 12[esi] | ||
1800 | ; sqr a[4]*a[3] | ||
1801 | mul edx | ||
1802 | add eax, eax | ||
1803 | adc edx, edx | ||
1804 | adc ebx, 0 | ||
1805 | add ecx, eax | ||
1806 | adc ebp, edx | ||
1807 | mov eax, DWORD PTR 28[esi] | ||
1808 | adc ebx, 0 | ||
1809 | mov DWORD PTR 28[edi],ecx | ||
1810 | mov edx, DWORD PTR 4[esi] | ||
1811 | ; saved r[7] | ||
1812 | ; ############### Calculate word 8 | ||
1813 | xor ecx, ecx | ||
1814 | ; sqr a[7]*a[1] | ||
1815 | mul edx | ||
1816 | add eax, eax | ||
1817 | adc edx, edx | ||
1818 | adc ecx, 0 | ||
1819 | add ebp, eax | ||
1820 | adc ebx, edx | ||
1821 | mov eax, DWORD PTR 24[esi] | ||
1822 | adc ecx, 0 | ||
1823 | mov edx, DWORD PTR 8[esi] | ||
1824 | ; sqr a[6]*a[2] | ||
1825 | mul edx | ||
1826 | add eax, eax | ||
1827 | adc edx, edx | ||
1828 | adc ecx, 0 | ||
1829 | add ebp, eax | ||
1830 | adc ebx, edx | ||
1831 | mov eax, DWORD PTR 20[esi] | ||
1832 | adc ecx, 0 | ||
1833 | mov edx, DWORD PTR 12[esi] | ||
1834 | ; sqr a[5]*a[3] | ||
1835 | mul edx | ||
1836 | add eax, eax | ||
1837 | adc edx, edx | ||
1838 | adc ecx, 0 | ||
1839 | add ebp, eax | ||
1840 | adc ebx, edx | ||
1841 | mov eax, DWORD PTR 16[esi] | ||
1842 | adc ecx, 0 | ||
1843 | ; sqr a[4]*a[4] | ||
1844 | mul eax | ||
1845 | add ebp, eax | ||
1846 | adc ebx, edx | ||
1847 | mov edx, DWORD PTR 8[esi] | ||
1848 | adc ecx, 0 | ||
1849 | mov DWORD PTR 32[edi],ebp | ||
1850 | mov eax, DWORD PTR 28[esi] | ||
1851 | ; saved r[8] | ||
1852 | ; ############### Calculate word 9 | ||
1853 | xor ebp, ebp | ||
1854 | ; sqr a[7]*a[2] | ||
1855 | mul edx | ||
1856 | add eax, eax | ||
1857 | adc edx, edx | ||
1858 | adc ebp, 0 | ||
1859 | add ebx, eax | ||
1860 | adc ecx, edx | ||
1861 | mov eax, DWORD PTR 24[esi] | ||
1862 | adc ebp, 0 | ||
1863 | mov edx, DWORD PTR 12[esi] | ||
1864 | ; sqr a[6]*a[3] | ||
1865 | mul edx | ||
1866 | add eax, eax | ||
1867 | adc edx, edx | ||
1868 | adc ebp, 0 | ||
1869 | add ebx, eax | ||
1870 | adc ecx, edx | ||
1871 | mov eax, DWORD PTR 20[esi] | ||
1872 | adc ebp, 0 | ||
1873 | mov edx, DWORD PTR 16[esi] | ||
1874 | ; sqr a[5]*a[4] | ||
1875 | mul edx | ||
1876 | add eax, eax | ||
1877 | adc edx, edx | ||
1878 | adc ebp, 0 | ||
1879 | add ebx, eax | ||
1880 | adc ecx, edx | ||
1881 | mov eax, DWORD PTR 28[esi] | ||
1882 | adc ebp, 0 | ||
1883 | mov DWORD PTR 36[edi],ebx | ||
1884 | mov edx, DWORD PTR 12[esi] | ||
1885 | ; saved r[9] | ||
1886 | ; ############### Calculate word 10 | ||
1887 | xor ebx, ebx | ||
1888 | ; sqr a[7]*a[3] | ||
1889 | mul edx | ||
1890 | add eax, eax | ||
1891 | adc edx, edx | ||
1892 | adc ebx, 0 | ||
1893 | add ecx, eax | ||
1894 | adc ebp, edx | ||
1895 | mov eax, DWORD PTR 24[esi] | ||
1896 | adc ebx, 0 | ||
1897 | mov edx, DWORD PTR 16[esi] | ||
1898 | ; sqr a[6]*a[4] | ||
1899 | mul edx | ||
1900 | add eax, eax | ||
1901 | adc edx, edx | ||
1902 | adc ebx, 0 | ||
1903 | add ecx, eax | ||
1904 | adc ebp, edx | ||
1905 | mov eax, DWORD PTR 20[esi] | ||
1906 | adc ebx, 0 | ||
1907 | ; sqr a[5]*a[5] | ||
1908 | mul eax | ||
1909 | add ecx, eax | ||
1910 | adc ebp, edx | ||
1911 | mov edx, DWORD PTR 16[esi] | ||
1912 | adc ebx, 0 | ||
1913 | mov DWORD PTR 40[edi],ecx | ||
1914 | mov eax, DWORD PTR 28[esi] | ||
1915 | ; saved r[10] | ||
1916 | ; ############### Calculate word 11 | ||
1917 | xor ecx, ecx | ||
1918 | ; sqr a[7]*a[4] | ||
1919 | mul edx | ||
1920 | add eax, eax | ||
1921 | adc edx, edx | ||
1922 | adc ecx, 0 | ||
1923 | add ebp, eax | ||
1924 | adc ebx, edx | ||
1925 | mov eax, DWORD PTR 24[esi] | ||
1926 | adc ecx, 0 | ||
1927 | mov edx, DWORD PTR 20[esi] | ||
1928 | ; sqr a[6]*a[5] | ||
1929 | mul edx | ||
1930 | add eax, eax | ||
1931 | adc edx, edx | ||
1932 | adc ecx, 0 | ||
1933 | add ebp, eax | ||
1934 | adc ebx, edx | ||
1935 | mov eax, DWORD PTR 28[esi] | ||
1936 | adc ecx, 0 | ||
1937 | mov DWORD PTR 44[edi],ebp | ||
1938 | mov edx, DWORD PTR 20[esi] | ||
1939 | ; saved r[11] | ||
1940 | ; ############### Calculate word 12 | ||
1941 | xor ebp, ebp | ||
1942 | ; sqr a[7]*a[5] | ||
1943 | mul edx | ||
1944 | add eax, eax | ||
1945 | adc edx, edx | ||
1946 | adc ebp, 0 | ||
1947 | add ebx, eax | ||
1948 | adc ecx, edx | ||
1949 | mov eax, DWORD PTR 24[esi] | ||
1950 | adc ebp, 0 | ||
1951 | ; sqr a[6]*a[6] | ||
1952 | mul eax | ||
1953 | add ebx, eax | ||
1954 | adc ecx, edx | ||
1955 | mov edx, DWORD PTR 24[esi] | ||
1956 | adc ebp, 0 | ||
1957 | mov DWORD PTR 48[edi],ebx | ||
1958 | mov eax, DWORD PTR 28[esi] | ||
1959 | ; saved r[12] | ||
1960 | ; ############### Calculate word 13 | ||
1961 | xor ebx, ebx | ||
1962 | ; sqr a[7]*a[6] | ||
1963 | mul edx | ||
1964 | add eax, eax | ||
1965 | adc edx, edx | ||
1966 | adc ebx, 0 | ||
1967 | add ecx, eax | ||
1968 | adc ebp, edx | ||
1969 | mov eax, DWORD PTR 28[esi] | ||
1970 | adc ebx, 0 | ||
1971 | mov DWORD PTR 52[edi],ecx | ||
1972 | ; saved r[13] | ||
1973 | ; ############### Calculate word 14 | ||
1974 | xor ecx, ecx | ||
1975 | ; sqr a[7]*a[7] | ||
1976 | mul eax | ||
1977 | add ebp, eax | ||
1978 | adc ebx, edx | ||
1979 | adc ecx, 0 | ||
1980 | mov DWORD PTR 56[edi],ebp | ||
1981 | ; saved r[14] | ||
1982 | mov DWORD PTR 60[edi],ebx | ||
1983 | pop ebx | ||
1984 | pop ebp | ||
1985 | pop edi | ||
1986 | pop esi | ||
1987 | ret | ||
1988 | _bn_sqr_comba8 ENDP | ||
1989 | _TEXT ENDS | ||
1990 | _TEXT SEGMENT | ||
1991 | PUBLIC _bn_sqr_comba4 | ||
1992 | |||
1993 | _bn_sqr_comba4 PROC NEAR | ||
1994 | push esi | ||
1995 | push edi | ||
1996 | push ebp | ||
1997 | push ebx | ||
1998 | mov edi, DWORD PTR 20[esp] | ||
1999 | mov esi, DWORD PTR 24[esp] | ||
2000 | xor ebx, ebx | ||
2001 | xor ecx, ecx | ||
2002 | mov eax, DWORD PTR [esi] | ||
2003 | ; ############### Calculate word 0 | ||
2004 | xor ebp, ebp | ||
2005 | ; sqr a[0]*a[0] | ||
2006 | mul eax | ||
2007 | add ebx, eax | ||
2008 | adc ecx, edx | ||
2009 | mov edx, DWORD PTR [esi] | ||
2010 | adc ebp, 0 | ||
2011 | mov DWORD PTR [edi],ebx | ||
2012 | mov eax, DWORD PTR 4[esi] | ||
2013 | ; saved r[0] | ||
2014 | ; ############### Calculate word 1 | ||
2015 | xor ebx, ebx | ||
2016 | ; sqr a[1]*a[0] | ||
2017 | mul edx | ||
2018 | add eax, eax | ||
2019 | adc edx, edx | ||
2020 | adc ebx, 0 | ||
2021 | add ecx, eax | ||
2022 | adc ebp, edx | ||
2023 | mov eax, DWORD PTR 8[esi] | ||
2024 | adc ebx, 0 | ||
2025 | mov DWORD PTR 4[edi],ecx | ||
2026 | mov edx, DWORD PTR [esi] | ||
2027 | ; saved r[1] | ||
2028 | ; ############### Calculate word 2 | ||
2029 | xor ecx, ecx | ||
2030 | ; sqr a[2]*a[0] | ||
2031 | mul edx | ||
2032 | add eax, eax | ||
2033 | adc edx, edx | ||
2034 | adc ecx, 0 | ||
2035 | add ebp, eax | ||
2036 | adc ebx, edx | ||
2037 | mov eax, DWORD PTR 4[esi] | ||
2038 | adc ecx, 0 | ||
2039 | ; sqr a[1]*a[1] | ||
2040 | mul eax | ||
2041 | add ebp, eax | ||
2042 | adc ebx, edx | ||
2043 | mov edx, DWORD PTR [esi] | ||
2044 | adc ecx, 0 | ||
2045 | mov DWORD PTR 8[edi],ebp | ||
2046 | mov eax, DWORD PTR 12[esi] | ||
2047 | ; saved r[2] | ||
2048 | ; ############### Calculate word 3 | ||
2049 | xor ebp, ebp | ||
2050 | ; sqr a[3]*a[0] | ||
2051 | mul edx | ||
2052 | add eax, eax | ||
2053 | adc edx, edx | ||
2054 | adc ebp, 0 | ||
2055 | add ebx, eax | ||
2056 | adc ecx, edx | ||
2057 | mov eax, DWORD PTR 8[esi] | ||
2058 | adc ebp, 0 | ||
2059 | mov edx, DWORD PTR 4[esi] | ||
2060 | ; sqr a[2]*a[1] | ||
2061 | mul edx | ||
2062 | add eax, eax | ||
2063 | adc edx, edx | ||
2064 | adc ebp, 0 | ||
2065 | add ebx, eax | ||
2066 | adc ecx, edx | ||
2067 | mov eax, DWORD PTR 12[esi] | ||
2068 | adc ebp, 0 | ||
2069 | mov DWORD PTR 12[edi],ebx | ||
2070 | mov edx, DWORD PTR 4[esi] | ||
2071 | ; saved r[3] | ||
2072 | ; ############### Calculate word 4 | ||
2073 | xor ebx, ebx | ||
2074 | ; sqr a[3]*a[1] | ||
2075 | mul edx | ||
2076 | add eax, eax | ||
2077 | adc edx, edx | ||
2078 | adc ebx, 0 | ||
2079 | add ecx, eax | ||
2080 | adc ebp, edx | ||
2081 | mov eax, DWORD PTR 8[esi] | ||
2082 | adc ebx, 0 | ||
2083 | ; sqr a[2]*a[2] | ||
2084 | mul eax | ||
2085 | add ecx, eax | ||
2086 | adc ebp, edx | ||
2087 | mov edx, DWORD PTR 8[esi] | ||
2088 | adc ebx, 0 | ||
2089 | mov DWORD PTR 16[edi],ecx | ||
2090 | mov eax, DWORD PTR 12[esi] | ||
2091 | ; saved r[4] | ||
2092 | ; ############### Calculate word 5 | ||
2093 | xor ecx, ecx | ||
2094 | ; sqr a[3]*a[2] | ||
2095 | mul edx | ||
2096 | add eax, eax | ||
2097 | adc edx, edx | ||
2098 | adc ecx, 0 | ||
2099 | add ebp, eax | ||
2100 | adc ebx, edx | ||
2101 | mov eax, DWORD PTR 12[esi] | ||
2102 | adc ecx, 0 | ||
2103 | mov DWORD PTR 20[edi],ebp | ||
2104 | ; saved r[5] | ||
2105 | ; ############### Calculate word 6 | ||
2106 | xor ebp, ebp | ||
2107 | ; sqr a[3]*a[3] | ||
2108 | mul eax | ||
2109 | add ebx, eax | ||
2110 | adc ecx, edx | ||
2111 | adc ebp, 0 | ||
2112 | mov DWORD PTR 24[edi],ebx | ||
2113 | ; saved r[6] | ||
2114 | mov DWORD PTR 28[edi],ecx | ||
2115 | pop ebx | ||
2116 | pop ebp | ||
2117 | pop edi | ||
2118 | pop esi | ||
2119 | ret | ||
2120 | _bn_sqr_comba4 ENDP | ||
2121 | _TEXT ENDS | ||
2122 | END | ||
diff --git a/src/lib/libcrypto/bn/asm/x86w16.asm b/src/lib/libcrypto/bn/asm/x86w16.asm index 80a9ed6eef..e69de29bb2 100644 --- a/src/lib/libcrypto/bn/asm/x86w16.asm +++ b/src/lib/libcrypto/bn/asm/x86w16.asm | |||
@@ -1,297 +0,0 @@ | |||
1 | ; Static Name Aliases | ||
2 | ; | ||
3 | TITLE bn_mulw.c | ||
4 | .8087 | ||
5 | F_TEXT SEGMENT WORD PUBLIC 'CODE' | ||
6 | F_TEXT ENDS | ||
7 | _DATA SEGMENT WORD PUBLIC 'DATA' | ||
8 | _DATA ENDS | ||
9 | _CONST SEGMENT WORD PUBLIC 'CONST' | ||
10 | _CONST ENDS | ||
11 | _BSS SEGMENT WORD PUBLIC 'BSS' | ||
12 | _BSS ENDS | ||
13 | DGROUP GROUP _CONST, _BSS, _DATA | ||
14 | ASSUME DS: DGROUP, SS: DGROUP | ||
15 | F_TEXT SEGMENT | ||
16 | ASSUME CS: F_TEXT | ||
17 | PUBLIC _bn_mul_add_words | ||
18 | _bn_mul_add_words PROC FAR | ||
19 | ; Line 58 | ||
20 | push bp | ||
21 | push bx | ||
22 | push si | ||
23 | push di | ||
24 | push ds | ||
25 | push es | ||
26 | mov bp,sp | ||
27 | ; w = 26 | ||
28 | ; num = 24 | ||
29 | ; ap = 20 | ||
30 | ; rp = 16 | ||
31 | xor si,si ;c=0; | ||
32 | mov di,WORD PTR [bp+16] ; load r | ||
33 | mov ds,WORD PTR [bp+18] ; load r | ||
34 | mov bx,WORD PTR [bp+20] ; load a | ||
35 | mov es,WORD PTR [bp+22] ; load a | ||
36 | mov cx,WORD PTR [bp+26] ; load w | ||
37 | mov bp,WORD PTR [bp+24] ; load num | ||
38 | |||
39 | shr bp,1 ; div count by 4 and do groups of 4 | ||
40 | shr bp,1 | ||
41 | je $L555 | ||
42 | |||
43 | $L546: | ||
44 | mov ax,cx | ||
45 | mul WORD PTR es:[bx] ; w* *a | ||
46 | add ax,WORD PTR ds:[di] ; + *r | ||
47 | adc dx,0 | ||
48 | adc ax,si | ||
49 | adc dx,0 | ||
50 | mov WORD PTR ds:[di],ax | ||
51 | mov si,dx | ||
52 | ; | ||
53 | mov ax,cx | ||
54 | mul WORD PTR es:[bx+2] ; w* *a | ||
55 | add ax,WORD PTR ds:[di+2] ; + *r | ||
56 | adc dx,0 | ||
57 | adc ax,si | ||
58 | adc dx,0 | ||
59 | mov WORD PTR ds:[di+2],ax | ||
60 | mov si,dx | ||
61 | ; | ||
62 | mov ax,cx | ||
63 | mul WORD PTR es:[bx+4] ; w* *a | ||
64 | add ax,WORD PTR ds:[di+4] ; + *r | ||
65 | adc dx,0 | ||
66 | adc ax,si | ||
67 | adc dx,0 | ||
68 | mov WORD PTR ds:[di+4],ax | ||
69 | mov si,dx | ||
70 | ; | ||
71 | mov ax,cx | ||
72 | mul WORD PTR es:[bx+6] ; w* *a | ||
73 | add ax,WORD PTR ds:[di+6] ; + *r | ||
74 | adc dx,0 | ||
75 | adc ax,si | ||
76 | adc dx,0 | ||
77 | mov WORD PTR ds:[di+6],ax | ||
78 | mov si,dx | ||
79 | ; | ||
80 | add bx,8 | ||
81 | add di,8 | ||
82 | ; | ||
83 | dec bp | ||
84 | je $L555 | ||
85 | jmp $L546 | ||
86 | ; | ||
87 | ; | ||
88 | $L555: | ||
89 | mov bp,sp | ||
90 | mov bp,WORD PTR [bp+24] ; load num | ||
91 | and bp,3 | ||
92 | dec bp | ||
93 | js $L547 | ||
94 | |||
95 | mov ax,cx | ||
96 | mul WORD PTR es:[bx] ; w* *a | ||
97 | add ax,WORD PTR ds:[di] ; + *r | ||
98 | adc dx,0 | ||
99 | adc ax,si | ||
100 | adc dx,0 | ||
101 | mov WORD PTR ds:[di],ax | ||
102 | mov si,dx | ||
103 | dec bp | ||
104 | js $L547 ; Note that we are now testing for -1 | ||
105 | ; | ||
106 | mov ax,cx | ||
107 | mul WORD PTR es:[bx+2] ; w* *a | ||
108 | add ax,WORD PTR ds:[di+2] ; + *r | ||
109 | adc dx,0 | ||
110 | adc ax,si | ||
111 | adc dx,0 | ||
112 | mov WORD PTR ds:[di+2],ax | ||
113 | mov si,dx | ||
114 | dec bp | ||
115 | js $L547 | ||
116 | ; | ||
117 | mov ax,cx | ||
118 | mul WORD PTR es:[bx+4] ; w* *a | ||
119 | add ax,WORD PTR ds:[di+4] ; + *r | ||
120 | adc dx,0 | ||
121 | adc ax,si | ||
122 | adc dx,0 | ||
123 | mov WORD PTR ds:[di+4],ax | ||
124 | mov si,dx | ||
125 | $L547: | ||
126 | mov ax,si | ||
127 | pop es | ||
128 | pop ds | ||
129 | pop di | ||
130 | pop si | ||
131 | pop bx | ||
132 | pop bp | ||
133 | ret | ||
134 | nop | ||
135 | |||
136 | _bn_mul_add_words ENDP | ||
137 | PUBLIC _bn_mul_words | ||
138 | _bn_mul_words PROC FAR | ||
139 | ; Line 76 | ||
140 | push bp | ||
141 | push bx | ||
142 | push si | ||
143 | push di | ||
144 | push ds | ||
145 | push es | ||
146 | xor si,si | ||
147 | mov bp,sp | ||
148 | mov di,WORD PTR [bp+16] ; r | ||
149 | mov ds,WORD PTR [bp+18] | ||
150 | mov bx,WORD PTR [bp+20] ; a | ||
151 | mov es,WORD PTR [bp+22] | ||
152 | mov cx,WORD PTR [bp+26] ; w | ||
153 | mov bp,WORD PTR [bp+24] ; num | ||
154 | $FC743: | ||
155 | mov ax,cx | ||
156 | mul WORD PTR es:[bx] | ||
157 | add ax,si | ||
158 | adc dx,0 | ||
159 | mov WORD PTR ds:[di],ax | ||
160 | mov si,dx | ||
161 | dec bp | ||
162 | je $L764 | ||
163 | ; | ||
164 | mov ax,cx | ||
165 | mul WORD PTR es:[bx+2] | ||
166 | add ax,si | ||
167 | adc dx,0 | ||
168 | mov WORD PTR ds:[di+2],ax | ||
169 | mov si,dx | ||
170 | dec bp | ||
171 | je $L764 | ||
172 | ; | ||
173 | mov ax,cx | ||
174 | mul WORD PTR es:[bx+4] | ||
175 | add ax,si | ||
176 | adc dx,0 | ||
177 | mov WORD PTR ds:[di+4],ax | ||
178 | mov si,dx | ||
179 | dec bp | ||
180 | je $L764 | ||
181 | ; | ||
182 | mov ax,cx | ||
183 | mul WORD PTR es:[bx+6] | ||
184 | add ax,si | ||
185 | adc dx,0 | ||
186 | mov WORD PTR ds:[di+6],ax | ||
187 | mov si,dx | ||
188 | dec bp | ||
189 | je $L764 | ||
190 | ; | ||
191 | add bx,8 | ||
192 | add di,8 | ||
193 | jmp $FC743 | ||
194 | nop | ||
195 | $L764: | ||
196 | mov ax,si | ||
197 | pop es | ||
198 | pop ds | ||
199 | pop di | ||
200 | pop si | ||
201 | pop bx | ||
202 | pop bp | ||
203 | ret | ||
204 | nop | ||
205 | _bn_mul_words ENDP | ||
206 | PUBLIC _bn_sqr_words | ||
207 | _bn_sqr_words PROC FAR | ||
208 | ; Line 92 | ||
209 | push bp | ||
210 | push bx | ||
211 | push si | ||
212 | push di | ||
213 | push ds | ||
214 | push es | ||
215 | mov bp,sp | ||
216 | mov si,WORD PTR [bp+16] | ||
217 | mov ds,WORD PTR [bp+18] | ||
218 | mov di,WORD PTR [bp+20] | ||
219 | mov es,WORD PTR [bp+22] | ||
220 | mov bx,WORD PTR [bp+24] | ||
221 | |||
222 | mov bp,bx ; save a memory lookup later | ||
223 | shr bx,1 ; div count by 4 and do groups of 4 | ||
224 | shr bx,1 | ||
225 | je $L666 | ||
226 | |||
227 | $L765: | ||
228 | mov ax,WORD PTR es:[di] | ||
229 | mul ax | ||
230 | mov WORD PTR ds:[si],ax | ||
231 | mov WORD PTR ds:[si+2],dx | ||
232 | ; | ||
233 | mov ax,WORD PTR es:[di+2] | ||
234 | mul ax | ||
235 | mov WORD PTR ds:[si+4],ax | ||
236 | mov WORD PTR ds:[si+6],dx | ||
237 | ; | ||
238 | mov ax,WORD PTR es:[di+4] | ||
239 | mul ax | ||
240 | mov WORD PTR ds:[si+8],ax | ||
241 | mov WORD PTR ds:[si+10],dx | ||
242 | ; | ||
243 | mov ax,WORD PTR es:[di+6] | ||
244 | mul ax | ||
245 | mov WORD PTR ds:[si+12],ax | ||
246 | mov WORD PTR ds:[si+14],dx | ||
247 | ; | ||
248 | add di,8 | ||
249 | add si,16 | ||
250 | dec bx | ||
251 | je $L666 | ||
252 | jmp $L765 | ||
253 | $L666: | ||
254 | and bp,3 | ||
255 | dec bp ; The copied value of bx (num) | ||
256 | js $L645 | ||
257 | ; | ||
258 | mov ax,WORD PTR es:[di] | ||
259 | mul ax | ||
260 | mov WORD PTR ds:[si],ax | ||
261 | mov WORD PTR ds:[si+2],dx | ||
262 | dec bp | ||
263 | js $L645 | ||
264 | ; | ||
265 | mov ax,WORD PTR es:[di+2] | ||
266 | mul ax | ||
267 | mov WORD PTR ds:[si+4],ax | ||
268 | mov WORD PTR ds:[si+6],dx | ||
269 | dec bp | ||
270 | js $L645 | ||
271 | ; | ||
272 | mov ax,WORD PTR es:[di+4] | ||
273 | mul ax | ||
274 | mov WORD PTR ds:[si+8],ax | ||
275 | mov WORD PTR ds:[si+10],dx | ||
276 | $L645: | ||
277 | pop es | ||
278 | pop ds | ||
279 | pop di | ||
280 | pop si | ||
281 | pop bx | ||
282 | pop bp | ||
283 | ret | ||
284 | |||
285 | _bn_sqr_words ENDP | ||
286 | PUBLIC _bn_div64 | ||
287 | _bn_div64 PROC FAR | ||
288 | push bp | ||
289 | mov bp,sp | ||
290 | mov dx, WORD PTR [bp+6] | ||
291 | mov ax, WORD PTR [bp+8] | ||
292 | div WORD PTR [bp+10] | ||
293 | pop bp | ||
294 | ret | ||
295 | _bn_div64 ENDP | ||
296 | F_TEXT ENDS | ||
297 | END | ||
diff --git a/src/lib/libcrypto/bn/asm/x86w32.asm b/src/lib/libcrypto/bn/asm/x86w32.asm index 957d71e3b1..e69de29bb2 100644 --- a/src/lib/libcrypto/bn/asm/x86w32.asm +++ b/src/lib/libcrypto/bn/asm/x86w32.asm | |||
@@ -1,360 +0,0 @@ | |||
1 | ; Static Name Aliases | ||
2 | ; | ||
3 | TITLE bn_mulw.c | ||
4 | .386 | ||
5 | F_TEXT SEGMENT WORD USE16 PUBLIC 'CODE' | ||
6 | F_TEXT ENDS | ||
7 | _DATA SEGMENT WORD USE16 PUBLIC 'DATA' | ||
8 | _DATA ENDS | ||
9 | _CONST SEGMENT WORD USE16 PUBLIC 'CONST' | ||
10 | _CONST ENDS | ||
11 | _BSS SEGMENT WORD USE16 PUBLIC 'BSS' | ||
12 | _BSS ENDS | ||
13 | DGROUP GROUP _CONST, _BSS, _DATA | ||
14 | ASSUME DS: DGROUP, SS: DGROUP | ||
15 | F_TEXT SEGMENT | ||
16 | ASSUME CS: F_TEXT | ||
17 | PUBLIC _bn_mul_add_words | ||
18 | _bn_mul_add_words PROC FAR | ||
19 | ; Line 58 | ||
20 | push bp | ||
21 | push bx | ||
22 | push esi | ||
23 | push di | ||
24 | push ds | ||
25 | push es | ||
26 | mov bp,sp | ||
27 | ; w = 28 | ||
28 | ; num = 26 | ||
29 | ; ap = 22 | ||
30 | ; rp = 18 | ||
31 | xor esi,esi ;c=0; | ||
32 | mov di,WORD PTR [bp+18] ; load r | ||
33 | mov ds,WORD PTR [bp+20] ; load r | ||
34 | mov bx,WORD PTR [bp+22] ; load a | ||
35 | mov es,WORD PTR [bp+24] ; load a | ||
36 | mov ecx,DWORD PTR [bp+28] ; load w | ||
37 | mov bp,WORD PTR [bp+26] ; load num | ||
38 | shr bp,1 ; div count by 4 and do groups of 4 | ||
39 | shr bp,1 | ||
40 | je $L555 | ||
41 | |||
42 | $L546: | ||
43 | mov eax,ecx | ||
44 | mul DWORD PTR es:[bx] ; w* *a | ||
45 | add eax,DWORD PTR ds:[di] ; + *r | ||
46 | adc edx,0 | ||
47 | adc eax,esi | ||
48 | adc edx,0 | ||
49 | mov DWORD PTR ds:[di],eax | ||
50 | mov esi,edx | ||
51 | ; | ||
52 | mov eax,ecx | ||
53 | mul DWORD PTR es:[bx+4] ; w* *a | ||
54 | add eax,DWORD PTR ds:[di+4] ; + *r | ||
55 | adc edx,0 | ||
56 | adc eax,esi | ||
57 | adc edx,0 | ||
58 | mov DWORD PTR ds:[di+4],eax | ||
59 | mov esi,edx | ||
60 | ; | ||
61 | mov eax,ecx | ||
62 | mul DWORD PTR es:[bx+8] ; w* *a | ||
63 | add eax,DWORD PTR ds:[di+8] ; + *r | ||
64 | adc edx,0 | ||
65 | adc eax,esi | ||
66 | adc edx,0 | ||
67 | mov DWORD PTR ds:[di+8],eax | ||
68 | mov esi,edx | ||
69 | ; | ||
70 | mov eax,ecx | ||
71 | mul DWORD PTR es:[bx+12] ; w* *a | ||
72 | add eax,DWORD PTR ds:[di+12] ; + *r | ||
73 | adc edx,0 | ||
74 | adc eax,esi | ||
75 | adc edx,0 | ||
76 | mov DWORD PTR ds:[di+12],eax | ||
77 | mov esi,edx | ||
78 | ; | ||
79 | add bx,16 | ||
80 | add di,16 | ||
81 | ; | ||
82 | dec bp | ||
83 | je $L555 | ||
84 | jmp $L546 | ||
85 | ; | ||
86 | ; | ||
87 | $L555: | ||
88 | mov bp,sp | ||
89 | mov bp,WORD PTR [bp+26] ; load num | ||
90 | and bp,3 | ||
91 | dec bp | ||
92 | js $L547m | ||
93 | |||
94 | mov eax,ecx | ||
95 | mul DWORD PTR es:[bx] ; w* *a | ||
96 | add eax,DWORD PTR ds:[di] ; + *r | ||
97 | adc edx,0 | ||
98 | adc eax,esi | ||
99 | adc edx,0 | ||
100 | mov DWORD PTR ds:[di],eax | ||
101 | mov esi,edx | ||
102 | dec bp | ||
103 | js $L547m ; Note that we are now testing for -1 | ||
104 | ; | ||
105 | mov eax,ecx | ||
106 | mul DWORD PTR es:[bx+4] ; w* *a | ||
107 | add eax,DWORD PTR ds:[di+4] ; + *r | ||
108 | adc edx,0 | ||
109 | adc eax,esi | ||
110 | adc edx,0 | ||
111 | mov DWORD PTR ds:[di+4],eax | ||
112 | mov esi,edx | ||
113 | dec bp | ||
114 | js $L547m | ||
115 | ; | ||
116 | mov eax,ecx | ||
117 | mul DWORD PTR es:[bx+8] ; w* *a | ||
118 | add eax,DWORD PTR ds:[di+8] ; + *r | ||
119 | adc edx,0 | ||
120 | adc eax,esi | ||
121 | adc edx,0 | ||
122 | mov DWORD PTR ds:[di+8],eax | ||
123 | mov esi,edx | ||
124 | $L547m: | ||
125 | mov eax,esi | ||
126 | mov edx,esi | ||
127 | shr edx,16 | ||
128 | pop es | ||
129 | pop ds | ||
130 | pop di | ||
131 | pop esi | ||
132 | pop bx | ||
133 | pop bp | ||
134 | ret | ||
135 | nop | ||
136 | _bn_mul_add_words ENDP | ||
137 | |||
138 | PUBLIC _bn_mul_words | ||
139 | _bn_mul_words PROC FAR | ||
140 | ; Line 76 | ||
141 | push bp | ||
142 | push bx | ||
143 | push esi | ||
144 | push di | ||
145 | push ds | ||
146 | push es | ||
147 | xor esi,esi | ||
148 | mov bp,sp | ||
149 | mov di,WORD PTR [bp+18] ; r | ||
150 | mov ds,WORD PTR [bp+20] | ||
151 | mov bx,WORD PTR [bp+22] ; a | ||
152 | mov es,WORD PTR [bp+24] | ||
153 | mov ecx,DWORD PTR [bp+28] ; w | ||
154 | mov bp,WORD PTR [bp+26] ; num | ||
155 | |||
156 | $FC743: | ||
157 | mov eax,ecx | ||
158 | mul DWORD PTR es:[bx] | ||
159 | add eax,esi | ||
160 | adc edx,0 | ||
161 | mov DWORD PTR ds:[di],eax | ||
162 | mov esi,edx | ||
163 | dec bp | ||
164 | je $L764 | ||
165 | ; | ||
166 | mov eax,ecx | ||
167 | mul DWORD PTR es:[bx+4] | ||
168 | add eax,esi | ||
169 | adc edx,0 | ||
170 | mov DWORD PTR ds:[di+4],eax | ||
171 | mov esi,edx | ||
172 | dec bp | ||
173 | je $L764 | ||
174 | ; | ||
175 | mov eax,ecx | ||
176 | mul DWORD PTR es:[bx+8] | ||
177 | add eax,esi | ||
178 | adc edx,0 | ||
179 | mov DWORD PTR ds:[di+8],eax | ||
180 | mov esi,edx | ||
181 | dec bp | ||
182 | je $L764 | ||
183 | ; | ||
184 | mov eax,ecx | ||
185 | mul DWORD PTR es:[bx+12] | ||
186 | add eax,esi | ||
187 | adc edx,0 | ||
188 | mov DWORD PTR ds:[di+12],eax | ||
189 | mov esi,edx | ||
190 | dec bp | ||
191 | je $L764 | ||
192 | ; | ||
193 | add bx,16 | ||
194 | add di,16 | ||
195 | jmp $FC743 | ||
196 | nop | ||
197 | $L764: | ||
198 | mov eax,esi | ||
199 | mov edx,esi | ||
200 | shr edx,16 | ||
201 | pop es | ||
202 | pop ds | ||
203 | pop di | ||
204 | pop esi | ||
205 | pop bx | ||
206 | pop bp | ||
207 | ret | ||
208 | nop | ||
209 | _bn_mul_words ENDP | ||
210 | PUBLIC _bn_sqr_words | ||
211 | _bn_sqr_words PROC FAR | ||
212 | ; Line 92 | ||
213 | push bp | ||
214 | push bx | ||
215 | push si | ||
216 | push di | ||
217 | push ds | ||
218 | push es | ||
219 | mov bp,sp | ||
220 | mov si,WORD PTR [bp+16] | ||
221 | mov ds,WORD PTR [bp+18] | ||
222 | mov di,WORD PTR [bp+20] | ||
223 | mov es,WORD PTR [bp+22] | ||
224 | mov bx,WORD PTR [bp+24] | ||
225 | |||
226 | mov bp,bx ; save a memory lookup later | ||
227 | shr bx,1 ; div count by 4 and do groups of 4 | ||
228 | shr bx,1 | ||
229 | je $L666 | ||
230 | |||
231 | $L765: | ||
232 | mov eax,DWORD PTR es:[di] | ||
233 | mul eax | ||
234 | mov DWORD PTR ds:[si],eax | ||
235 | mov DWORD PTR ds:[si+4],edx | ||
236 | ; | ||
237 | mov eax,DWORD PTR es:[di+4] | ||
238 | mul eax | ||
239 | mov DWORD PTR ds:[si+8],eax | ||
240 | mov DWORD PTR ds:[si+12],edx | ||
241 | ; | ||
242 | mov eax,DWORD PTR es:[di+8] | ||
243 | mul eax | ||
244 | mov DWORD PTR ds:[si+16],eax | ||
245 | mov DWORD PTR ds:[si+20],edx | ||
246 | ; | ||
247 | mov eax,DWORD PTR es:[di+12] | ||
248 | mul eax | ||
249 | mov DWORD PTR ds:[si+24],eax | ||
250 | mov DWORD PTR ds:[si+28],edx | ||
251 | ; | ||
252 | add di,16 | ||
253 | add si,32 | ||
254 | dec bx | ||
255 | je $L666 | ||
256 | jmp $L765 | ||
257 | $L666: | ||
258 | and bp,3 | ||
259 | dec bp ; The copied value of bx (num) | ||
260 | js $L645 | ||
261 | ; | ||
262 | mov eax,DWORD PTR es:[di] | ||
263 | mul eax | ||
264 | mov DWORD PTR ds:[si],eax | ||
265 | mov DWORD PTR ds:[si+4],edx | ||
266 | dec bp | ||
267 | js $L645 | ||
268 | ; | ||
269 | mov eax,DWORD PTR es:[di+4] | ||
270 | mul eax | ||
271 | mov DWORD PTR ds:[si+8],eax | ||
272 | mov DWORD PTR ds:[si+12],edx | ||
273 | dec bp | ||
274 | js $L645 | ||
275 | ; | ||
276 | mov eax,DWORD PTR es:[di+8] | ||
277 | mul eax | ||
278 | mov DWORD PTR ds:[si+16],eax | ||
279 | mov DWORD PTR ds:[si+20],edx | ||
280 | $L645: | ||
281 | pop es | ||
282 | pop ds | ||
283 | pop di | ||
284 | pop si | ||
285 | pop bx | ||
286 | pop bp | ||
287 | ret | ||
288 | _bn_sqr_words ENDP | ||
289 | |||
290 | PUBLIC _bn_div64 | ||
291 | _bn_div64 PROC FAR | ||
292 | push bp | ||
293 | mov bp,sp | ||
294 | mov edx, DWORD PTR [bp+6] | ||
295 | mov eax, DWORD PTR [bp+10] | ||
296 | div DWORD PTR [bp+14] | ||
297 | mov edx,eax | ||
298 | shr edx,16 | ||
299 | pop bp | ||
300 | ret | ||
301 | _bn_div64 ENDP | ||
302 | |||
303 | PUBLIC _bn_add_words | ||
304 | _bn_add_words PROC FAR | ||
305 | ; Line 58 | ||
306 | push bp | ||
307 | push bx | ||
308 | push esi | ||
309 | push di | ||
310 | push ds | ||
311 | push es | ||
312 | mov bp,sp | ||
313 | ; w = 28 | ||
314 | ; num = 26 | ||
315 | ; ap = 22 | ||
316 | ; rp = 18 | ||
317 | xor esi,esi ;c=0; | ||
318 | mov bx,WORD PTR [bp+18] ; load low r | ||
319 | mov si,WORD PTR [bp+22] ; load a | ||
320 | mov es,WORD PTR [bp+24] ; load a | ||
321 | mov di,WORD PTR [bp+26] ; load b | ||
322 | mov ds,WORD PTR [bp+28] ; load b | ||
323 | |||
324 | mov dx,WORD PTR [bp+30] ; load num | ||
325 | xor ecx,ecx | ||
326 | dec dx | ||
327 | js $L547a | ||
328 | |||
329 | $L5477: | ||
330 | mov eax,DWORD PTR es:[si] ; *a | ||
331 | add eax,ecx | ||
332 | mov ecx,0 | ||
333 | adc ecx,0 | ||
334 | add si,4 ; a++ | ||
335 | add eax,DWORD PTR ds:[di] ; + *b | ||
336 | adc ecx,0 | ||
337 | mov ds,WORD PTR [bp+20] | ||
338 | add di,4 | ||
339 | mov DWORD PTR ds:[bx],eax | ||
340 | mov ds,WORD PTR [bp+28] | ||
341 | add bx,4 | ||
342 | dec dx | ||
343 | js $L547a ; Note that we are now testing for -1 | ||
344 | jmp $L5477 | ||
345 | ; | ||
346 | $L547a: | ||
347 | mov eax,ecx | ||
348 | mov edx,ecx | ||
349 | shr edx,16 | ||
350 | pop es | ||
351 | pop ds | ||
352 | pop di | ||
353 | pop esi | ||
354 | pop bx | ||
355 | pop bp | ||
356 | ret | ||
357 | nop | ||
358 | _bn_add_words ENDP | ||
359 | F_TEXT ENDS | ||
360 | END | ||
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index d8822610df..009b0eb685 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
@@ -89,7 +89,7 @@ extern "C" { | |||
89 | * For machines with only one compiler (or shared libraries), this should | 89 | * For machines with only one compiler (or shared libraries), this should |
90 | * be on. Again this in only really a problem on machines | 90 | * be on. Again this in only really a problem on machines |
91 | * using "long long's", are 32bit, and are not using my assembler code. */ | 91 | * using "long long's", are 32bit, and are not using my assembler code. */ |
92 | #if defined(MSDOS) || defined(WINDOWS) || defined(linux) | 92 | #if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux) |
93 | #define BN_DIV2W | 93 | #define BN_DIV2W |
94 | #endif | 94 | #endif |
95 | 95 | ||
diff --git a/src/lib/libcrypto/bn/bn_err.c b/src/lib/libcrypto/bn/bn_err.c index f3b9497dca..988270bcf4 100644 --- a/src/lib/libcrypto/bn/bn_err.c +++ b/src/lib/libcrypto/bn/bn_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index 7bb0b91223..598fecbf0c 100644 --- a/src/lib/libcrypto/bn/bn_mont.c +++ b/src/lib/libcrypto/bn/bn_mont.c | |||
@@ -73,6 +73,7 @@ int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, | |||
73 | BN_MONT_CTX *mont, BN_CTX *ctx) | 73 | BN_MONT_CTX *mont, BN_CTX *ctx) |
74 | { | 74 | { |
75 | BIGNUM *tmp,*tmp2; | 75 | BIGNUM *tmp,*tmp2; |
76 | int ret=0; | ||
76 | 77 | ||
77 | BN_CTX_start(ctx); | 78 | BN_CTX_start(ctx); |
78 | tmp = BN_CTX_get(ctx); | 79 | tmp = BN_CTX_get(ctx); |
@@ -101,10 +102,10 @@ int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, | |||
101 | } | 102 | } |
102 | /* reduce from aRR to aR */ | 103 | /* reduce from aRR to aR */ |
103 | if (!BN_from_montgomery(r,tmp,mont,ctx)) goto err; | 104 | if (!BN_from_montgomery(r,tmp,mont,ctx)) goto err; |
104 | BN_CTX_end(ctx); | 105 | ret=1; |
105 | return(1); | ||
106 | err: | 106 | err: |
107 | return(0); | 107 | BN_CTX_end(ctx); |
108 | return(ret); | ||
108 | } | 109 | } |
109 | 110 | ||
110 | int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont, | 111 | int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont, |
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c index eb007e19e9..3e8baaad9a 100644 --- a/src/lib/libcrypto/bn/bn_mul.c +++ b/src/lib/libcrypto/bn/bn_mul.c | |||
@@ -61,6 +61,9 @@ | |||
61 | #include "bn_lcl.h" | 61 | #include "bn_lcl.h" |
62 | 62 | ||
63 | #ifdef BN_RECURSION | 63 | #ifdef BN_RECURSION |
64 | /* Karatsuba recursive multiplication algorithm | ||
65 | * (cf. Knuth, The Art of Computer Programming, Vol. 2) */ | ||
66 | |||
64 | /* r is 2*n2 words in size, | 67 | /* r is 2*n2 words in size, |
65 | * a and b are both n2 words in size. | 68 | * a and b are both n2 words in size. |
66 | * n2 must be a power of 2. | 69 | * n2 must be a power of 2. |
diff --git a/src/lib/libcrypto/bn/bntest.c b/src/lib/libcrypto/bn/bntest.c index 41c22f5954..0a97af69c5 100644 --- a/src/lib/libcrypto/bn/bntest.c +++ b/src/lib/libcrypto/bn/bntest.c | |||
@@ -234,7 +234,8 @@ int main(int argc, char *argv[]) | |||
234 | /**/ | 234 | /**/ |
235 | exit(0); | 235 | exit(0); |
236 | err: | 236 | err: |
237 | BIO_puts(out,"1\n"); /* make sure bc fails if we are piping to it */ | 237 | BIO_puts(out,"1\n"); /* make sure the Perl script fed by bc notices |
238 | * the failure, see test_bn in test/Makefile.ssl*/ | ||
238 | BIO_flush(out); | 239 | BIO_flush(out); |
239 | ERR_load_crypto_strings(); | 240 | ERR_load_crypto_strings(); |
240 | ERR_print_errors_fp(stderr); | 241 | ERR_print_errors_fp(stderr); |
diff --git a/src/lib/libcrypto/buffer/buf_err.c b/src/lib/libcrypto/buffer/buf_err.c index 7f9fd1f6c3..2f971a5f38 100644 --- a/src/lib/libcrypto/buffer/buf_err.c +++ b/src/lib/libcrypto/buffer/buf_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/cast/Makefile.ssl b/src/lib/libcrypto/cast/Makefile.ssl index 763148e314..4c70d1e3e8 100644 --- a/src/lib/libcrypto/cast/Makefile.ssl +++ b/src/lib/libcrypto/cast/Makefile.ssl | |||
@@ -52,7 +52,7 @@ lib: $(LIBOBJ) | |||
52 | 52 | ||
53 | # elf | 53 | # elf |
54 | asm/cx86-elf.o: asm/cx86unix.cpp | 54 | asm/cx86-elf.o: asm/cx86unix.cpp |
55 | $(CPP) -DELF asm/cx86unix.cpp | as -o asm/cx86-elf.o | 55 | $(CPP) -DELF -x c asm/cx86unix.cpp | as -o asm/cx86-elf.o |
56 | 56 | ||
57 | # solaris | 57 | # solaris |
58 | asm/cx86-sol.o: asm/cx86unix.cpp | 58 | asm/cx86-sol.o: asm/cx86unix.cpp |
@@ -68,7 +68,7 @@ asm/cx86-out.o: asm/cx86unix.cpp | |||
68 | asm/cx86bsdi.o: asm/cx86unix.cpp | 68 | asm/cx86bsdi.o: asm/cx86unix.cpp |
69 | $(CPP) -DBSDI asm/cx86unix.cpp | sed 's/ :/:/' | as -o asm/cx86bsdi.o | 69 | $(CPP) -DBSDI asm/cx86unix.cpp | sed 's/ :/:/' | as -o asm/cx86bsdi.o |
70 | 70 | ||
71 | asm/cx86unix.cpp: asm/cast-586.pl | 71 | asm/cx86unix.cpp: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl |
72 | (cd asm; $(PERL) cast-586.pl cpp $(PROCESSOR) >cx86unix.cpp) | 72 | (cd asm; $(PERL) cast-586.pl cpp $(PROCESSOR) >cx86unix.cpp) |
73 | 73 | ||
74 | files: | 74 | files: |
diff --git a/src/lib/libcrypto/cast/Makefile.uni b/src/lib/libcrypto/cast/Makefile.uni index a5870897cf..e69de29bb2 100644 --- a/src/lib/libcrypto/cast/Makefile.uni +++ b/src/lib/libcrypto/cast/Makefile.uni | |||
@@ -1,124 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | # make x86-elf - linux-elf etc | ||
6 | # make x86-out - linux-a.out, FreeBSD etc | ||
7 | # make x86-solaris | ||
8 | # make x86-bdsi | ||
9 | |||
10 | # There are 3 possible performance options, experiment :-) | ||
11 | #OPTS= -DBF_PTR | ||
12 | #OPTS= -DBF_PTR2 | ||
13 | OPTS= | ||
14 | |||
15 | DIR= cast | ||
16 | TOP= . | ||
17 | CC= gcc | ||
18 | CFLAG= -O3 -fomit-frame-pointer | ||
19 | |||
20 | CPP= $(CC) -E | ||
21 | INCLUDES= | ||
22 | INSTALLTOP=/usr/local/lib | ||
23 | MAKE= make | ||
24 | MAKEDEPEND= makedepend | ||
25 | MAKEFILE= Makefile.uni | ||
26 | AR= ar r | ||
27 | RANLIB= ranlib | ||
28 | |||
29 | CAST_ENC=c_enc.o | ||
30 | # or use | ||
31 | #CAST_ENC=asm/cx86-elf.o | ||
32 | #CAST_ENC=asm/cx86-out.o | ||
33 | #CAST_ENC=asm/cx86-sol.o | ||
34 | #CAST_ENC=asm/cx86bdsi.o | ||
35 | |||
36 | CFLAGS= $(OPTS) $(INCLUDES) $(CFLAG) -DFULL_TEST | ||
37 | |||
38 | GENERAL=Makefile | ||
39 | TEST=casttest | ||
40 | APP1=cast_spd | ||
41 | APP2=castopts | ||
42 | APPS=$(APP1) $(APP2) | ||
43 | |||
44 | LIB=libcast.a | ||
45 | LIBSRC=c_skey.c c_ecb.c c_enc.c c_cfb64.c c_ofb64.c | ||
46 | LIBOBJ=c_skey.o c_ecb.o $(CAST_ENC) c_cfb64.o c_ofb64.o | ||
47 | |||
48 | SRC= $(LIBSRC) | ||
49 | |||
50 | EXHEADER= cast.h | ||
51 | HEADER= cast_lcl.h $(EXHEADER) | ||
52 | |||
53 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
54 | |||
55 | all: $(LIB) $(TEST) $(APPS) | ||
56 | |||
57 | $(LIB): $(LIBOBJ) | ||
58 | $(AR) $(LIB) $(LIBOBJ) | ||
59 | $(RANLIB) $(LIB) | ||
60 | # elf | ||
61 | asm/cx86-elf.o: asm/cx86unix.cpp | ||
62 | $(CPP) -DELF asm/cx86unix.cpp | as -o asm/cx86-elf.o | ||
63 | |||
64 | # solaris | ||
65 | asm/cx86-sol.o: asm/cx86unix.cpp | ||
66 | $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s | ||
67 | as -o asm/cx86-sol.o asm/cx86-sol.s | ||
68 | rm -f asm/cx86-sol.s | ||
69 | |||
70 | # a.out | ||
71 | asm/cx86-out.o: asm/cx86unix.cpp | ||
72 | $(CPP) -DOUT asm/cx86unix.cpp | as -o asm/cx86-out.o | ||
73 | |||
74 | # bsdi | ||
75 | asm/cx86bsdi.o: asm/cx86unix.cpp | ||
76 | $(CPP) -DBSDI asm/cx86unix.cpp | as -o asm/cx86bsdi.o | ||
77 | |||
78 | asm/cx86unix.cpp: | ||
79 | (cd asm; perl cast-586.pl cpp >cx86unix.cpp) | ||
80 | |||
81 | test: $(TEST) | ||
82 | ./$(TEST) | ||
83 | |||
84 | $(TEST): $(TEST).c $(LIB) | ||
85 | $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB) | ||
86 | |||
87 | $(APP1): $(APP1).c $(LIB) | ||
88 | $(CC) -o $(APP1) $(CFLAGS) $(APP1).c $(LIB) | ||
89 | |||
90 | $(APP2): $(APP2).c $(LIB) | ||
91 | $(CC) -o $(APP2) $(CFLAGS) $(APP2).c $(LIB) | ||
92 | |||
93 | lint: | ||
94 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
95 | |||
96 | depend: | ||
97 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
98 | |||
99 | dclean: | ||
100 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
101 | mv -f Makefile.new $(MAKEFILE) | ||
102 | |||
103 | clean: | ||
104 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
105 | |||
106 | cc: | ||
107 | $(MAKE) CC="cc" CFLAG="-O" all | ||
108 | |||
109 | gcc: | ||
110 | $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
111 | |||
112 | x86-elf: | ||
113 | $(MAKE) CAST_ENC="asm/cx86-elf.o" CFLAG="-DELF $(CFLAGS)" all | ||
114 | |||
115 | x86-out: | ||
116 | $(MAKE) CAST_ENC="asm/cx86-out.o" CFLAG="-DOUT $(CFLAGS)" all | ||
117 | |||
118 | x86-solaris: | ||
119 | $(MAKE) CAST_ENC="asm/cx86-sol.o" CFLAG="-DSOL $(CFLAGS)" all | ||
120 | |||
121 | x86-bdsi: | ||
122 | $(MAKE) CAST_ENC="asm/cx86-bdsi.o" CFLAG="-DBDSI $(CFLAGS)" all | ||
123 | |||
124 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/cast/asm/c-win32.asm b/src/lib/libcrypto/cast/asm/c-win32.asm index ba78a3c69c..e69de29bb2 100644 --- a/src/lib/libcrypto/cast/asm/c-win32.asm +++ b/src/lib/libcrypto/cast/asm/c-win32.asm | |||
@@ -1,953 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by cast-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE cast-586.asm | ||
8 | .486 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _CAST_encrypt | ||
12 | EXTERN _CAST_S_table0:DWORD | ||
13 | EXTERN _CAST_S_table1:DWORD | ||
14 | EXTERN _CAST_S_table2:DWORD | ||
15 | EXTERN _CAST_S_table3:DWORD | ||
16 | |||
17 | _CAST_encrypt PROC NEAR | ||
18 | ; | ||
19 | push ebp | ||
20 | push ebx | ||
21 | mov ebx, DWORD PTR 12[esp] | ||
22 | mov ebp, DWORD PTR 16[esp] | ||
23 | push esi | ||
24 | push edi | ||
25 | ; Load the 2 words | ||
26 | mov edi, DWORD PTR [ebx] | ||
27 | mov esi, DWORD PTR 4[ebx] | ||
28 | ; Get short key flag | ||
29 | mov eax, DWORD PTR 128[ebp] | ||
30 | push eax | ||
31 | xor eax, eax | ||
32 | ; round 0 | ||
33 | mov edx, DWORD PTR [ebp] | ||
34 | mov ecx, DWORD PTR 4[ebp] | ||
35 | add edx, esi | ||
36 | rol edx, cl | ||
37 | mov ebx, edx | ||
38 | xor ecx, ecx | ||
39 | mov cl, dh | ||
40 | and ebx, 255 | ||
41 | shr edx, 16 | ||
42 | xor eax, eax | ||
43 | mov al, dh | ||
44 | and edx, 255 | ||
45 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
46 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
47 | xor ecx, ebx | ||
48 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
49 | sub ecx, ebx | ||
50 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
51 | add ecx, ebx | ||
52 | xor edi, ecx | ||
53 | ; round 1 | ||
54 | mov edx, DWORD PTR 8[ebp] | ||
55 | mov ecx, DWORD PTR 12[ebp] | ||
56 | xor edx, edi | ||
57 | rol edx, cl | ||
58 | mov ebx, edx | ||
59 | xor ecx, ecx | ||
60 | mov cl, dh | ||
61 | and ebx, 255 | ||
62 | shr edx, 16 | ||
63 | xor eax, eax | ||
64 | mov al, dh | ||
65 | and edx, 255 | ||
66 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
67 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
68 | sub ecx, ebx | ||
69 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
70 | add ecx, ebx | ||
71 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
72 | xor ecx, ebx | ||
73 | xor esi, ecx | ||
74 | ; round 2 | ||
75 | mov edx, DWORD PTR 16[ebp] | ||
76 | mov ecx, DWORD PTR 20[ebp] | ||
77 | sub edx, esi | ||
78 | rol edx, cl | ||
79 | mov ebx, edx | ||
80 | xor ecx, ecx | ||
81 | mov cl, dh | ||
82 | and ebx, 255 | ||
83 | shr edx, 16 | ||
84 | xor eax, eax | ||
85 | mov al, dh | ||
86 | and edx, 255 | ||
87 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
88 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
89 | add ecx, ebx | ||
90 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
91 | xor ecx, ebx | ||
92 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
93 | sub ecx, ebx | ||
94 | xor edi, ecx | ||
95 | ; round 3 | ||
96 | mov edx, DWORD PTR 24[ebp] | ||
97 | mov ecx, DWORD PTR 28[ebp] | ||
98 | add edx, edi | ||
99 | rol edx, cl | ||
100 | mov ebx, edx | ||
101 | xor ecx, ecx | ||
102 | mov cl, dh | ||
103 | and ebx, 255 | ||
104 | shr edx, 16 | ||
105 | xor eax, eax | ||
106 | mov al, dh | ||
107 | and edx, 255 | ||
108 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
109 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
110 | xor ecx, ebx | ||
111 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
112 | sub ecx, ebx | ||
113 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
114 | add ecx, ebx | ||
115 | xor esi, ecx | ||
116 | ; round 4 | ||
117 | mov edx, DWORD PTR 32[ebp] | ||
118 | mov ecx, DWORD PTR 36[ebp] | ||
119 | xor edx, esi | ||
120 | rol edx, cl | ||
121 | mov ebx, edx | ||
122 | xor ecx, ecx | ||
123 | mov cl, dh | ||
124 | and ebx, 255 | ||
125 | shr edx, 16 | ||
126 | xor eax, eax | ||
127 | mov al, dh | ||
128 | and edx, 255 | ||
129 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
130 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
131 | sub ecx, ebx | ||
132 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
133 | add ecx, ebx | ||
134 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
135 | xor ecx, ebx | ||
136 | xor edi, ecx | ||
137 | ; round 5 | ||
138 | mov edx, DWORD PTR 40[ebp] | ||
139 | mov ecx, DWORD PTR 44[ebp] | ||
140 | sub edx, edi | ||
141 | rol edx, cl | ||
142 | mov ebx, edx | ||
143 | xor ecx, ecx | ||
144 | mov cl, dh | ||
145 | and ebx, 255 | ||
146 | shr edx, 16 | ||
147 | xor eax, eax | ||
148 | mov al, dh | ||
149 | and edx, 255 | ||
150 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
151 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
152 | add ecx, ebx | ||
153 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
154 | xor ecx, ebx | ||
155 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
156 | sub ecx, ebx | ||
157 | xor esi, ecx | ||
158 | ; round 6 | ||
159 | mov edx, DWORD PTR 48[ebp] | ||
160 | mov ecx, DWORD PTR 52[ebp] | ||
161 | add edx, esi | ||
162 | rol edx, cl | ||
163 | mov ebx, edx | ||
164 | xor ecx, ecx | ||
165 | mov cl, dh | ||
166 | and ebx, 255 | ||
167 | shr edx, 16 | ||
168 | xor eax, eax | ||
169 | mov al, dh | ||
170 | and edx, 255 | ||
171 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
172 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
173 | xor ecx, ebx | ||
174 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
175 | sub ecx, ebx | ||
176 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
177 | add ecx, ebx | ||
178 | xor edi, ecx | ||
179 | ; round 7 | ||
180 | mov edx, DWORD PTR 56[ebp] | ||
181 | mov ecx, DWORD PTR 60[ebp] | ||
182 | xor edx, edi | ||
183 | rol edx, cl | ||
184 | mov ebx, edx | ||
185 | xor ecx, ecx | ||
186 | mov cl, dh | ||
187 | and ebx, 255 | ||
188 | shr edx, 16 | ||
189 | xor eax, eax | ||
190 | mov al, dh | ||
191 | and edx, 255 | ||
192 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
193 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
194 | sub ecx, ebx | ||
195 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
196 | add ecx, ebx | ||
197 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
198 | xor ecx, ebx | ||
199 | xor esi, ecx | ||
200 | ; round 8 | ||
201 | mov edx, DWORD PTR 64[ebp] | ||
202 | mov ecx, DWORD PTR 68[ebp] | ||
203 | sub edx, esi | ||
204 | rol edx, cl | ||
205 | mov ebx, edx | ||
206 | xor ecx, ecx | ||
207 | mov cl, dh | ||
208 | and ebx, 255 | ||
209 | shr edx, 16 | ||
210 | xor eax, eax | ||
211 | mov al, dh | ||
212 | and edx, 255 | ||
213 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
214 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
215 | add ecx, ebx | ||
216 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
217 | xor ecx, ebx | ||
218 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
219 | sub ecx, ebx | ||
220 | xor edi, ecx | ||
221 | ; round 9 | ||
222 | mov edx, DWORD PTR 72[ebp] | ||
223 | mov ecx, DWORD PTR 76[ebp] | ||
224 | add edx, edi | ||
225 | rol edx, cl | ||
226 | mov ebx, edx | ||
227 | xor ecx, ecx | ||
228 | mov cl, dh | ||
229 | and ebx, 255 | ||
230 | shr edx, 16 | ||
231 | xor eax, eax | ||
232 | mov al, dh | ||
233 | and edx, 255 | ||
234 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
235 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
236 | xor ecx, ebx | ||
237 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
238 | sub ecx, ebx | ||
239 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
240 | add ecx, ebx | ||
241 | xor esi, ecx | ||
242 | ; round 10 | ||
243 | mov edx, DWORD PTR 80[ebp] | ||
244 | mov ecx, DWORD PTR 84[ebp] | ||
245 | xor edx, esi | ||
246 | rol edx, cl | ||
247 | mov ebx, edx | ||
248 | xor ecx, ecx | ||
249 | mov cl, dh | ||
250 | and ebx, 255 | ||
251 | shr edx, 16 | ||
252 | xor eax, eax | ||
253 | mov al, dh | ||
254 | and edx, 255 | ||
255 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
256 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
257 | sub ecx, ebx | ||
258 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
259 | add ecx, ebx | ||
260 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
261 | xor ecx, ebx | ||
262 | xor edi, ecx | ||
263 | ; round 11 | ||
264 | mov edx, DWORD PTR 88[ebp] | ||
265 | mov ecx, DWORD PTR 92[ebp] | ||
266 | sub edx, edi | ||
267 | rol edx, cl | ||
268 | mov ebx, edx | ||
269 | xor ecx, ecx | ||
270 | mov cl, dh | ||
271 | and ebx, 255 | ||
272 | shr edx, 16 | ||
273 | xor eax, eax | ||
274 | mov al, dh | ||
275 | and edx, 255 | ||
276 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
277 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
278 | add ecx, ebx | ||
279 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
280 | xor ecx, ebx | ||
281 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
282 | sub ecx, ebx | ||
283 | xor esi, ecx | ||
284 | ; test short key flag | ||
285 | pop edx | ||
286 | or edx, edx | ||
287 | jnz $L000cast_enc_done | ||
288 | ; round 12 | ||
289 | mov edx, DWORD PTR 96[ebp] | ||
290 | mov ecx, DWORD PTR 100[ebp] | ||
291 | add edx, esi | ||
292 | rol edx, cl | ||
293 | mov ebx, edx | ||
294 | xor ecx, ecx | ||
295 | mov cl, dh | ||
296 | and ebx, 255 | ||
297 | shr edx, 16 | ||
298 | xor eax, eax | ||
299 | mov al, dh | ||
300 | and edx, 255 | ||
301 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
302 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
303 | xor ecx, ebx | ||
304 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
305 | sub ecx, ebx | ||
306 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
307 | add ecx, ebx | ||
308 | xor edi, ecx | ||
309 | ; round 13 | ||
310 | mov edx, DWORD PTR 104[ebp] | ||
311 | mov ecx, DWORD PTR 108[ebp] | ||
312 | xor edx, edi | ||
313 | rol edx, cl | ||
314 | mov ebx, edx | ||
315 | xor ecx, ecx | ||
316 | mov cl, dh | ||
317 | and ebx, 255 | ||
318 | shr edx, 16 | ||
319 | xor eax, eax | ||
320 | mov al, dh | ||
321 | and edx, 255 | ||
322 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
323 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
324 | sub ecx, ebx | ||
325 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
326 | add ecx, ebx | ||
327 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
328 | xor ecx, ebx | ||
329 | xor esi, ecx | ||
330 | ; round 14 | ||
331 | mov edx, DWORD PTR 112[ebp] | ||
332 | mov ecx, DWORD PTR 116[ebp] | ||
333 | sub edx, esi | ||
334 | rol edx, cl | ||
335 | mov ebx, edx | ||
336 | xor ecx, ecx | ||
337 | mov cl, dh | ||
338 | and ebx, 255 | ||
339 | shr edx, 16 | ||
340 | xor eax, eax | ||
341 | mov al, dh | ||
342 | and edx, 255 | ||
343 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
344 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
345 | add ecx, ebx | ||
346 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
347 | xor ecx, ebx | ||
348 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
349 | sub ecx, ebx | ||
350 | xor edi, ecx | ||
351 | ; round 15 | ||
352 | mov edx, DWORD PTR 120[ebp] | ||
353 | mov ecx, DWORD PTR 124[ebp] | ||
354 | add edx, edi | ||
355 | rol edx, cl | ||
356 | mov ebx, edx | ||
357 | xor ecx, ecx | ||
358 | mov cl, dh | ||
359 | and ebx, 255 | ||
360 | shr edx, 16 | ||
361 | xor eax, eax | ||
362 | mov al, dh | ||
363 | and edx, 255 | ||
364 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
365 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
366 | xor ecx, ebx | ||
367 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
368 | sub ecx, ebx | ||
369 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
370 | add ecx, ebx | ||
371 | xor esi, ecx | ||
372 | $L000cast_enc_done: | ||
373 | nop | ||
374 | mov eax, DWORD PTR 20[esp] | ||
375 | mov DWORD PTR 4[eax],edi | ||
376 | mov DWORD PTR [eax],esi | ||
377 | pop edi | ||
378 | pop esi | ||
379 | pop ebx | ||
380 | pop ebp | ||
381 | ret | ||
382 | _CAST_encrypt ENDP | ||
383 | _TEXT ENDS | ||
384 | _TEXT SEGMENT | ||
385 | PUBLIC _CAST_decrypt | ||
386 | EXTERN _CAST_S_table0:DWORD | ||
387 | EXTERN _CAST_S_table1:DWORD | ||
388 | EXTERN _CAST_S_table2:DWORD | ||
389 | EXTERN _CAST_S_table3:DWORD | ||
390 | |||
391 | _CAST_decrypt PROC NEAR | ||
392 | ; | ||
393 | push ebp | ||
394 | push ebx | ||
395 | mov ebx, DWORD PTR 12[esp] | ||
396 | mov ebp, DWORD PTR 16[esp] | ||
397 | push esi | ||
398 | push edi | ||
399 | ; Load the 2 words | ||
400 | mov edi, DWORD PTR [ebx] | ||
401 | mov esi, DWORD PTR 4[ebx] | ||
402 | ; Get short key flag | ||
403 | mov eax, DWORD PTR 128[ebp] | ||
404 | or eax, eax | ||
405 | jnz $L001cast_dec_skip | ||
406 | xor eax, eax | ||
407 | ; round 15 | ||
408 | mov edx, DWORD PTR 120[ebp] | ||
409 | mov ecx, DWORD PTR 124[ebp] | ||
410 | add edx, esi | ||
411 | rol edx, cl | ||
412 | mov ebx, edx | ||
413 | xor ecx, ecx | ||
414 | mov cl, dh | ||
415 | and ebx, 255 | ||
416 | shr edx, 16 | ||
417 | xor eax, eax | ||
418 | mov al, dh | ||
419 | and edx, 255 | ||
420 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
421 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
422 | xor ecx, ebx | ||
423 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
424 | sub ecx, ebx | ||
425 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
426 | add ecx, ebx | ||
427 | xor edi, ecx | ||
428 | ; round 14 | ||
429 | mov edx, DWORD PTR 112[ebp] | ||
430 | mov ecx, DWORD PTR 116[ebp] | ||
431 | sub edx, edi | ||
432 | rol edx, cl | ||
433 | mov ebx, edx | ||
434 | xor ecx, ecx | ||
435 | mov cl, dh | ||
436 | and ebx, 255 | ||
437 | shr edx, 16 | ||
438 | xor eax, eax | ||
439 | mov al, dh | ||
440 | and edx, 255 | ||
441 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
442 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
443 | add ecx, ebx | ||
444 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
445 | xor ecx, ebx | ||
446 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
447 | sub ecx, ebx | ||
448 | xor esi, ecx | ||
449 | ; round 13 | ||
450 | mov edx, DWORD PTR 104[ebp] | ||
451 | mov ecx, DWORD PTR 108[ebp] | ||
452 | xor edx, esi | ||
453 | rol edx, cl | ||
454 | mov ebx, edx | ||
455 | xor ecx, ecx | ||
456 | mov cl, dh | ||
457 | and ebx, 255 | ||
458 | shr edx, 16 | ||
459 | xor eax, eax | ||
460 | mov al, dh | ||
461 | and edx, 255 | ||
462 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
463 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
464 | sub ecx, ebx | ||
465 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
466 | add ecx, ebx | ||
467 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
468 | xor ecx, ebx | ||
469 | xor edi, ecx | ||
470 | ; round 12 | ||
471 | mov edx, DWORD PTR 96[ebp] | ||
472 | mov ecx, DWORD PTR 100[ebp] | ||
473 | add edx, edi | ||
474 | rol edx, cl | ||
475 | mov ebx, edx | ||
476 | xor ecx, ecx | ||
477 | mov cl, dh | ||
478 | and ebx, 255 | ||
479 | shr edx, 16 | ||
480 | xor eax, eax | ||
481 | mov al, dh | ||
482 | and edx, 255 | ||
483 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
484 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
485 | xor ecx, ebx | ||
486 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
487 | sub ecx, ebx | ||
488 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
489 | add ecx, ebx | ||
490 | xor esi, ecx | ||
491 | $L001cast_dec_skip: | ||
492 | ; round 11 | ||
493 | mov edx, DWORD PTR 88[ebp] | ||
494 | mov ecx, DWORD PTR 92[ebp] | ||
495 | sub edx, esi | ||
496 | rol edx, cl | ||
497 | mov ebx, edx | ||
498 | xor ecx, ecx | ||
499 | mov cl, dh | ||
500 | and ebx, 255 | ||
501 | shr edx, 16 | ||
502 | xor eax, eax | ||
503 | mov al, dh | ||
504 | and edx, 255 | ||
505 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
506 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
507 | add ecx, ebx | ||
508 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
509 | xor ecx, ebx | ||
510 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
511 | sub ecx, ebx | ||
512 | xor edi, ecx | ||
513 | ; round 10 | ||
514 | mov edx, DWORD PTR 80[ebp] | ||
515 | mov ecx, DWORD PTR 84[ebp] | ||
516 | xor edx, edi | ||
517 | rol edx, cl | ||
518 | mov ebx, edx | ||
519 | xor ecx, ecx | ||
520 | mov cl, dh | ||
521 | and ebx, 255 | ||
522 | shr edx, 16 | ||
523 | xor eax, eax | ||
524 | mov al, dh | ||
525 | and edx, 255 | ||
526 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
527 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
528 | sub ecx, ebx | ||
529 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
530 | add ecx, ebx | ||
531 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
532 | xor ecx, ebx | ||
533 | xor esi, ecx | ||
534 | ; round 9 | ||
535 | mov edx, DWORD PTR 72[ebp] | ||
536 | mov ecx, DWORD PTR 76[ebp] | ||
537 | add edx, esi | ||
538 | rol edx, cl | ||
539 | mov ebx, edx | ||
540 | xor ecx, ecx | ||
541 | mov cl, dh | ||
542 | and ebx, 255 | ||
543 | shr edx, 16 | ||
544 | xor eax, eax | ||
545 | mov al, dh | ||
546 | and edx, 255 | ||
547 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
548 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
549 | xor ecx, ebx | ||
550 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
551 | sub ecx, ebx | ||
552 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
553 | add ecx, ebx | ||
554 | xor edi, ecx | ||
555 | ; round 8 | ||
556 | mov edx, DWORD PTR 64[ebp] | ||
557 | mov ecx, DWORD PTR 68[ebp] | ||
558 | sub edx, edi | ||
559 | rol edx, cl | ||
560 | mov ebx, edx | ||
561 | xor ecx, ecx | ||
562 | mov cl, dh | ||
563 | and ebx, 255 | ||
564 | shr edx, 16 | ||
565 | xor eax, eax | ||
566 | mov al, dh | ||
567 | and edx, 255 | ||
568 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
569 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
570 | add ecx, ebx | ||
571 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
572 | xor ecx, ebx | ||
573 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
574 | sub ecx, ebx | ||
575 | xor esi, ecx | ||
576 | ; round 7 | ||
577 | mov edx, DWORD PTR 56[ebp] | ||
578 | mov ecx, DWORD PTR 60[ebp] | ||
579 | xor edx, esi | ||
580 | rol edx, cl | ||
581 | mov ebx, edx | ||
582 | xor ecx, ecx | ||
583 | mov cl, dh | ||
584 | and ebx, 255 | ||
585 | shr edx, 16 | ||
586 | xor eax, eax | ||
587 | mov al, dh | ||
588 | and edx, 255 | ||
589 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
590 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
591 | sub ecx, ebx | ||
592 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
593 | add ecx, ebx | ||
594 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
595 | xor ecx, ebx | ||
596 | xor edi, ecx | ||
597 | ; round 6 | ||
598 | mov edx, DWORD PTR 48[ebp] | ||
599 | mov ecx, DWORD PTR 52[ebp] | ||
600 | add edx, edi | ||
601 | rol edx, cl | ||
602 | mov ebx, edx | ||
603 | xor ecx, ecx | ||
604 | mov cl, dh | ||
605 | and ebx, 255 | ||
606 | shr edx, 16 | ||
607 | xor eax, eax | ||
608 | mov al, dh | ||
609 | and edx, 255 | ||
610 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
611 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
612 | xor ecx, ebx | ||
613 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
614 | sub ecx, ebx | ||
615 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
616 | add ecx, ebx | ||
617 | xor esi, ecx | ||
618 | ; round 5 | ||
619 | mov edx, DWORD PTR 40[ebp] | ||
620 | mov ecx, DWORD PTR 44[ebp] | ||
621 | sub edx, esi | ||
622 | rol edx, cl | ||
623 | mov ebx, edx | ||
624 | xor ecx, ecx | ||
625 | mov cl, dh | ||
626 | and ebx, 255 | ||
627 | shr edx, 16 | ||
628 | xor eax, eax | ||
629 | mov al, dh | ||
630 | and edx, 255 | ||
631 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
632 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
633 | add ecx, ebx | ||
634 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
635 | xor ecx, ebx | ||
636 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
637 | sub ecx, ebx | ||
638 | xor edi, ecx | ||
639 | ; round 4 | ||
640 | mov edx, DWORD PTR 32[ebp] | ||
641 | mov ecx, DWORD PTR 36[ebp] | ||
642 | xor edx, edi | ||
643 | rol edx, cl | ||
644 | mov ebx, edx | ||
645 | xor ecx, ecx | ||
646 | mov cl, dh | ||
647 | and ebx, 255 | ||
648 | shr edx, 16 | ||
649 | xor eax, eax | ||
650 | mov al, dh | ||
651 | and edx, 255 | ||
652 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
653 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
654 | sub ecx, ebx | ||
655 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
656 | add ecx, ebx | ||
657 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
658 | xor ecx, ebx | ||
659 | xor esi, ecx | ||
660 | ; round 3 | ||
661 | mov edx, DWORD PTR 24[ebp] | ||
662 | mov ecx, DWORD PTR 28[ebp] | ||
663 | add edx, esi | ||
664 | rol edx, cl | ||
665 | mov ebx, edx | ||
666 | xor ecx, ecx | ||
667 | mov cl, dh | ||
668 | and ebx, 255 | ||
669 | shr edx, 16 | ||
670 | xor eax, eax | ||
671 | mov al, dh | ||
672 | and edx, 255 | ||
673 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
674 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
675 | xor ecx, ebx | ||
676 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
677 | sub ecx, ebx | ||
678 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
679 | add ecx, ebx | ||
680 | xor edi, ecx | ||
681 | ; round 2 | ||
682 | mov edx, DWORD PTR 16[ebp] | ||
683 | mov ecx, DWORD PTR 20[ebp] | ||
684 | sub edx, edi | ||
685 | rol edx, cl | ||
686 | mov ebx, edx | ||
687 | xor ecx, ecx | ||
688 | mov cl, dh | ||
689 | and ebx, 255 | ||
690 | shr edx, 16 | ||
691 | xor eax, eax | ||
692 | mov al, dh | ||
693 | and edx, 255 | ||
694 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
695 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
696 | add ecx, ebx | ||
697 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
698 | xor ecx, ebx | ||
699 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
700 | sub ecx, ebx | ||
701 | xor esi, ecx | ||
702 | ; round 1 | ||
703 | mov edx, DWORD PTR 8[ebp] | ||
704 | mov ecx, DWORD PTR 12[ebp] | ||
705 | xor edx, esi | ||
706 | rol edx, cl | ||
707 | mov ebx, edx | ||
708 | xor ecx, ecx | ||
709 | mov cl, dh | ||
710 | and ebx, 255 | ||
711 | shr edx, 16 | ||
712 | xor eax, eax | ||
713 | mov al, dh | ||
714 | and edx, 255 | ||
715 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
716 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
717 | sub ecx, ebx | ||
718 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
719 | add ecx, ebx | ||
720 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
721 | xor ecx, ebx | ||
722 | xor edi, ecx | ||
723 | ; round 0 | ||
724 | mov edx, DWORD PTR [ebp] | ||
725 | mov ecx, DWORD PTR 4[ebp] | ||
726 | add edx, edi | ||
727 | rol edx, cl | ||
728 | mov ebx, edx | ||
729 | xor ecx, ecx | ||
730 | mov cl, dh | ||
731 | and ebx, 255 | ||
732 | shr edx, 16 | ||
733 | xor eax, eax | ||
734 | mov al, dh | ||
735 | and edx, 255 | ||
736 | mov ecx, DWORD PTR _CAST_S_table0[ecx*4] | ||
737 | mov ebx, DWORD PTR _CAST_S_table1[ebx*4] | ||
738 | xor ecx, ebx | ||
739 | mov ebx, DWORD PTR _CAST_S_table2[eax*4] | ||
740 | sub ecx, ebx | ||
741 | mov ebx, DWORD PTR _CAST_S_table3[edx*4] | ||
742 | add ecx, ebx | ||
743 | xor esi, ecx | ||
744 | nop | ||
745 | mov eax, DWORD PTR 20[esp] | ||
746 | mov DWORD PTR 4[eax],edi | ||
747 | mov DWORD PTR [eax],esi | ||
748 | pop edi | ||
749 | pop esi | ||
750 | pop ebx | ||
751 | pop ebp | ||
752 | ret | ||
753 | _CAST_decrypt ENDP | ||
754 | _TEXT ENDS | ||
755 | _TEXT SEGMENT | ||
756 | PUBLIC _CAST_cbc_encrypt | ||
757 | |||
758 | _CAST_cbc_encrypt PROC NEAR | ||
759 | ; | ||
760 | push ebp | ||
761 | push ebx | ||
762 | push esi | ||
763 | push edi | ||
764 | mov ebp, DWORD PTR 28[esp] | ||
765 | ; getting iv ptr from parameter 4 | ||
766 | mov ebx, DWORD PTR 36[esp] | ||
767 | mov esi, DWORD PTR [ebx] | ||
768 | mov edi, DWORD PTR 4[ebx] | ||
769 | push edi | ||
770 | push esi | ||
771 | push edi | ||
772 | push esi | ||
773 | mov ebx, esp | ||
774 | mov esi, DWORD PTR 36[esp] | ||
775 | mov edi, DWORD PTR 40[esp] | ||
776 | ; getting encrypt flag from parameter 5 | ||
777 | mov ecx, DWORD PTR 56[esp] | ||
778 | ; get and push parameter 3 | ||
779 | mov eax, DWORD PTR 48[esp] | ||
780 | push eax | ||
781 | push ebx | ||
782 | cmp ecx, 0 | ||
783 | jz $L002decrypt | ||
784 | and ebp, 4294967288 | ||
785 | mov eax, DWORD PTR 8[esp] | ||
786 | mov ebx, DWORD PTR 12[esp] | ||
787 | jz $L003encrypt_finish | ||
788 | L004encrypt_loop: | ||
789 | mov ecx, DWORD PTR [esi] | ||
790 | mov edx, DWORD PTR 4[esi] | ||
791 | xor eax, ecx | ||
792 | xor ebx, edx | ||
793 | bswap eax | ||
794 | bswap ebx | ||
795 | mov DWORD PTR 8[esp],eax | ||
796 | mov DWORD PTR 12[esp],ebx | ||
797 | call _CAST_encrypt | ||
798 | mov eax, DWORD PTR 8[esp] | ||
799 | mov ebx, DWORD PTR 12[esp] | ||
800 | bswap eax | ||
801 | bswap ebx | ||
802 | mov DWORD PTR [edi],eax | ||
803 | mov DWORD PTR 4[edi],ebx | ||
804 | add esi, 8 | ||
805 | add edi, 8 | ||
806 | sub ebp, 8 | ||
807 | jnz L004encrypt_loop | ||
808 | $L003encrypt_finish: | ||
809 | mov ebp, DWORD PTR 52[esp] | ||
810 | and ebp, 7 | ||
811 | jz $L005finish | ||
812 | xor ecx, ecx | ||
813 | xor edx, edx | ||
814 | mov ebp, DWORD PTR $L006cbc_enc_jmp_table[ebp*4] | ||
815 | jmp ebp | ||
816 | L007ej7: | ||
817 | xor edx, edx | ||
818 | mov dh, BYTE PTR 6[esi] | ||
819 | shl edx, 8 | ||
820 | L008ej6: | ||
821 | mov dh, BYTE PTR 5[esi] | ||
822 | L009ej5: | ||
823 | mov dl, BYTE PTR 4[esi] | ||
824 | L010ej4: | ||
825 | mov ecx, DWORD PTR [esi] | ||
826 | jmp $L011ejend | ||
827 | L012ej3: | ||
828 | mov ch, BYTE PTR 2[esi] | ||
829 | xor ecx, ecx | ||
830 | shl ecx, 8 | ||
831 | L013ej2: | ||
832 | mov ch, BYTE PTR 1[esi] | ||
833 | L014ej1: | ||
834 | mov cl, BYTE PTR [esi] | ||
835 | $L011ejend: | ||
836 | xor eax, ecx | ||
837 | xor ebx, edx | ||
838 | bswap eax | ||
839 | bswap ebx | ||
840 | mov DWORD PTR 8[esp],eax | ||
841 | mov DWORD PTR 12[esp],ebx | ||
842 | call _CAST_encrypt | ||
843 | mov eax, DWORD PTR 8[esp] | ||
844 | mov ebx, DWORD PTR 12[esp] | ||
845 | bswap eax | ||
846 | bswap ebx | ||
847 | mov DWORD PTR [edi],eax | ||
848 | mov DWORD PTR 4[edi],ebx | ||
849 | jmp $L005finish | ||
850 | $L002decrypt: | ||
851 | and ebp, 4294967288 | ||
852 | mov eax, DWORD PTR 16[esp] | ||
853 | mov ebx, DWORD PTR 20[esp] | ||
854 | jz $L015decrypt_finish | ||
855 | L016decrypt_loop: | ||
856 | mov eax, DWORD PTR [esi] | ||
857 | mov ebx, DWORD PTR 4[esi] | ||
858 | bswap eax | ||
859 | bswap ebx | ||
860 | mov DWORD PTR 8[esp],eax | ||
861 | mov DWORD PTR 12[esp],ebx | ||
862 | call _CAST_decrypt | ||
863 | mov eax, DWORD PTR 8[esp] | ||
864 | mov ebx, DWORD PTR 12[esp] | ||
865 | bswap eax | ||
866 | bswap ebx | ||
867 | mov ecx, DWORD PTR 16[esp] | ||
868 | mov edx, DWORD PTR 20[esp] | ||
869 | xor ecx, eax | ||
870 | xor edx, ebx | ||
871 | mov eax, DWORD PTR [esi] | ||
872 | mov ebx, DWORD PTR 4[esi] | ||
873 | mov DWORD PTR [edi],ecx | ||
874 | mov DWORD PTR 4[edi],edx | ||
875 | mov DWORD PTR 16[esp],eax | ||
876 | mov DWORD PTR 20[esp],ebx | ||
877 | add esi, 8 | ||
878 | add edi, 8 | ||
879 | sub ebp, 8 | ||
880 | jnz L016decrypt_loop | ||
881 | $L015decrypt_finish: | ||
882 | mov ebp, DWORD PTR 52[esp] | ||
883 | and ebp, 7 | ||
884 | jz $L005finish | ||
885 | mov eax, DWORD PTR [esi] | ||
886 | mov ebx, DWORD PTR 4[esi] | ||
887 | bswap eax | ||
888 | bswap ebx | ||
889 | mov DWORD PTR 8[esp],eax | ||
890 | mov DWORD PTR 12[esp],ebx | ||
891 | call _CAST_decrypt | ||
892 | mov eax, DWORD PTR 8[esp] | ||
893 | mov ebx, DWORD PTR 12[esp] | ||
894 | bswap eax | ||
895 | bswap ebx | ||
896 | mov ecx, DWORD PTR 16[esp] | ||
897 | mov edx, DWORD PTR 20[esp] | ||
898 | xor ecx, eax | ||
899 | xor edx, ebx | ||
900 | mov eax, DWORD PTR [esi] | ||
901 | mov ebx, DWORD PTR 4[esi] | ||
902 | L017dj7: | ||
903 | ror edx, 16 | ||
904 | mov BYTE PTR 6[edi],dl | ||
905 | shr edx, 16 | ||
906 | L018dj6: | ||
907 | mov BYTE PTR 5[edi],dh | ||
908 | L019dj5: | ||
909 | mov BYTE PTR 4[edi],dl | ||
910 | L020dj4: | ||
911 | mov DWORD PTR [edi],ecx | ||
912 | jmp $L021djend | ||
913 | L022dj3: | ||
914 | ror ecx, 16 | ||
915 | mov BYTE PTR 2[edi],cl | ||
916 | shl ecx, 16 | ||
917 | L023dj2: | ||
918 | mov BYTE PTR 1[esi],ch | ||
919 | L024dj1: | ||
920 | mov BYTE PTR [esi], cl | ||
921 | $L021djend: | ||
922 | jmp $L005finish | ||
923 | $L005finish: | ||
924 | mov ecx, DWORD PTR 60[esp] | ||
925 | add esp, 24 | ||
926 | mov DWORD PTR [ecx],eax | ||
927 | mov DWORD PTR 4[ecx],ebx | ||
928 | pop edi | ||
929 | pop esi | ||
930 | pop ebx | ||
931 | pop ebp | ||
932 | ret | ||
933 | $L006cbc_enc_jmp_table: | ||
934 | DD 0 | ||
935 | DD L014ej1 | ||
936 | DD L013ej2 | ||
937 | DD L012ej3 | ||
938 | DD L010ej4 | ||
939 | DD L009ej5 | ||
940 | DD L008ej6 | ||
941 | DD L007ej7 | ||
942 | L025cbc_dec_jmp_table: | ||
943 | DD 0 | ||
944 | DD L024dj1 | ||
945 | DD L023dj2 | ||
946 | DD L022dj3 | ||
947 | DD L020dj4 | ||
948 | DD L019dj5 | ||
949 | DD L018dj6 | ||
950 | DD L017dj7 | ||
951 | _CAST_cbc_encrypt ENDP | ||
952 | _TEXT ENDS | ||
953 | END | ||
diff --git a/src/lib/libcrypto/cast/cast_lcl.h b/src/lib/libcrypto/cast/cast_lcl.h index cfe3842e91..5fab8a43f6 100644 --- a/src/lib/libcrypto/cast/cast_lcl.h +++ b/src/lib/libcrypto/cast/cast_lcl.h | |||
@@ -151,7 +151,7 @@ | |||
151 | *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ | 151 | *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ |
152 | *((c)++)=(unsigned char)(((l) )&0xff)) | 152 | *((c)++)=(unsigned char)(((l) )&0xff)) |
153 | 153 | ||
154 | #if defined(WIN32) | 154 | #if defined(WIN32) && defined(_MSC_VER) |
155 | #define ROTL(a,n) (_lrotl(a,n)) | 155 | #define ROTL(a,n) (_lrotl(a,n)) |
156 | #else | 156 | #else |
157 | #define ROTL(a,n) ((((a)<<(n))&0xffffffffL)|((a)>>(32-(n)))) | 157 | #define ROTL(a,n) ((((a)<<(n))&0xffffffffL)|((a)>>(32-(n)))) |
diff --git a/src/lib/libcrypto/comp/comp_err.c b/src/lib/libcrypto/comp/comp_err.c index 77a3f7070c..c10282a73c 100644 --- a/src/lib/libcrypto/comp/comp_err.c +++ b/src/lib/libcrypto/comp/comp_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c index eb4b3cfc70..5c1ca59090 100644 --- a/src/lib/libcrypto/conf/conf_err.c +++ b/src/lib/libcrypto/conf/conf_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/cpt_err.c b/src/lib/libcrypto/cpt_err.c index c2a2dd4af6..dadd8d8d92 100644 --- a/src/lib/libcrypto/cpt_err.c +++ b/src/lib/libcrypto/cpt_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/crypto-lib.com b/src/lib/libcrypto/crypto-lib.com index 79d86771e8..8ddeafbc06 100644 --- a/src/lib/libcrypto/crypto-lib.com +++ b/src/lib/libcrypto/crypto-lib.com | |||
@@ -186,7 +186,7 @@ $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ - | |||
186 | "enc_read,enc_writ,ofb64enc,"+ - | 186 | "enc_read,enc_writ,ofb64enc,"+ - |
187 | "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ - | 187 | "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ - |
188 | "des_enc,fcrypt_b,read2pwd,"+ - | 188 | "des_enc,fcrypt_b,read2pwd,"+ - |
189 | "fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,supp,ede_cbcm_enc" | 189 | "fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,ede_cbcm_enc" |
190 | $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" | 190 | $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" |
191 | $ LIB_RC4 = "rc4_skey,rc4_enc" | 191 | $ LIB_RC4 = "rc4_skey,rc4_enc" |
192 | $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" | 192 | $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" |
@@ -208,7 +208,7 @@ $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - | |||
208 | "bss_mem,bss_null,bss_fd,"+ - | 208 | "bss_mem,bss_null,bss_fd,"+ - |
209 | "bss_file,bss_sock,bss_conn,"+ - | 209 | "bss_file,bss_sock,bss_conn,"+ - |
210 | "bf_null,bf_buff,b_print,b_dump,"+ - | 210 | "bf_null,bf_buff,b_print,b_dump,"+ - |
211 | "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio" ! + ",bss_log" for syslog | 211 | "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log" |
212 | $ LIB_STACK = "stack" | 212 | $ LIB_STACK = "stack" |
213 | $ LIB_LHASH = "lhash,lh_stats" | 213 | $ LIB_LHASH = "lhash,lh_stats" |
214 | $ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd" | 214 | $ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd" |
@@ -266,7 +266,7 @@ $! | |||
266 | $! Setup exceptional compilations | 266 | $! Setup exceptional compilations |
267 | $! | 267 | $! |
268 | $ COMPILEWITH_CC3 = ",bss_rtcp," | 268 | $ COMPILEWITH_CC3 = ",bss_rtcp," |
269 | $ COMPILEWITH_CC4 = ",a_utctm," | 269 | $ COMPILEWITH_CC4 = ",a_utctm,bss_log," |
270 | $ COMPILEWITH_CC5 = ",md2_dgst,md5_dgst,mdc2dgst,sha_dgst,sha1dgst," + - | 270 | $ COMPILEWITH_CC5 = ",md2_dgst,md5_dgst,mdc2dgst,sha_dgst,sha1dgst," + - |
271 | "rmd_dgst,bf_enc," | 271 | "rmd_dgst,bf_enc," |
272 | $! | 272 | $! |
@@ -1441,6 +1441,7 @@ $! | |||
1441 | $ IF P7 .NES. "" | 1441 | $ IF P7 .NES. "" |
1442 | $ THEN | 1442 | $ THEN |
1443 | $ ENCRYPT_TYPES = P7 | 1443 | $ ENCRYPT_TYPES = P7 |
1444 | $! NYI: ENCRYPT_PROGRAMS = P7 | ||
1444 | $ ENDIF | 1445 | $ ENDIF |
1445 | $! | 1446 | $! |
1446 | $! Time To RETURN... | 1447 | $! Time To RETURN... |
diff --git a/src/lib/libcrypto/des/DES.pod b/src/lib/libcrypto/des/DES.pod index 8a739e7ca0..e69de29bb2 100644 --- a/src/lib/libcrypto/des/DES.pod +++ b/src/lib/libcrypto/des/DES.pod | |||
@@ -1,16 +0,0 @@ | |||
1 | crypt <= crypt(buf,salt) | ||
2 | key <= set_odd_parity(key) | ||
3 | int <= is_weak_key(key) | ||
4 | keysched<= set_key(key) | ||
5 | key <= ecb_encrypt(string8,ks,enc) | ||
6 | key <= ecb3_encrypt(input,ks1,ks2,enc) | ||
7 | string <= cbc_encrypt(input,ks,ivec,enc) => ivec | ||
8 | string <= cbc3_encrypt(input,ks1,ks2,ivec1,ivec2,enc) => ivec1&ivec2 | ||
9 | ck1,ck2 <= cbc_cksum(input,ks,ivec) => ivec | ||
10 | string <= pcbc_encrypt(input,ks,ivec,enc) => ivec | ||
11 | string <= ofb_encrypt(input,numbits,ks,ivec) => ivec | ||
12 | string <= cfb_encrypt(input,numbits,ks,ivec,enc) => ivec | ||
13 | key <= random_key() | ||
14 | key <= string_to_key(string) | ||
15 | key1,key2<= string_to_2keys(string) | ||
16 | |||
diff --git a/src/lib/libcrypto/des/MODES.DES b/src/lib/libcrypto/des/MODES.DES index 0cbc44f51d..e69de29bb2 100644 --- a/src/lib/libcrypto/des/MODES.DES +++ b/src/lib/libcrypto/des/MODES.DES | |||
@@ -1,84 +0,0 @@ | |||
1 | Modes of DES | ||
2 | Quite a bit of the following information has been taken from | ||
3 | AS 2805.5.2 | ||
4 | Australian Standard | ||
5 | Electronic funds transfer - Requirements for interfaces, | ||
6 | Part 5.2: Modes of operation for an n-bit block cipher algorithm | ||
7 | Appendix A | ||
8 | |||
9 | There are several different modes in which DES can be used, they are | ||
10 | as follows. | ||
11 | |||
12 | Electronic Codebook Mode (ECB) (des_ecb_encrypt()) | ||
13 | - 64 bits are enciphered at a time. | ||
14 | - The order of the blocks can be rearranged without detection. | ||
15 | - The same plaintext block always produces the same ciphertext block | ||
16 | (for the same key) making it vulnerable to a 'dictionary attack'. | ||
17 | - An error will only affect one ciphertext block. | ||
18 | |||
19 | Cipher Block Chaining Mode (CBC) (des_cbc_encrypt()) | ||
20 | - a multiple of 64 bits are enciphered at a time. | ||
21 | - The CBC mode produces the same ciphertext whenever the same | ||
22 | plaintext is encrypted using the same key and starting variable. | ||
23 | - The chaining operation makes the ciphertext blocks dependent on the | ||
24 | current and all preceding plaintext blocks and therefore blocks can not | ||
25 | be rearranged. | ||
26 | - The use of different starting variables prevents the same plaintext | ||
27 | enciphering to the same ciphertext. | ||
28 | - An error will affect the current and the following ciphertext blocks. | ||
29 | |||
30 | Cipher Feedback Mode (CFB) (des_cfb_encrypt()) | ||
31 | - a number of bits (j) <= 64 are enciphered at a time. | ||
32 | - The CFB mode produces the same ciphertext whenever the same | ||
33 | plaintext is encrypted using the same key and starting variable. | ||
34 | - The chaining operation makes the ciphertext variables dependent on the | ||
35 | current and all preceding variables and therefore j-bit variables are | ||
36 | chained together and con not be rearranged. | ||
37 | - The use of different starting variables prevents the same plaintext | ||
38 | enciphering to the same ciphertext. | ||
39 | - The strength of the CFB mode depends on the size of k (maximal if | ||
40 | j == k). In my implementation this is always the case. | ||
41 | - Selection of a small value for j will require more cycles through | ||
42 | the encipherment algorithm per unit of plaintext and thus cause | ||
43 | greater processing overheads. | ||
44 | - Only multiples of j bits can be enciphered. | ||
45 | - An error will affect the current and the following ciphertext variables. | ||
46 | |||
47 | Output Feedback Mode (OFB) (des_ofb_encrypt()) | ||
48 | - a number of bits (j) <= 64 are enciphered at a time. | ||
49 | - The OFB mode produces the same ciphertext whenever the same | ||
50 | plaintext enciphered using the same key and starting variable. More | ||
51 | over, in the OFB mode the same key stream is produced when the same | ||
52 | key and start variable are used. Consequently, for security reasons | ||
53 | a specific start variable should be used only once for a given key. | ||
54 | - The absence of chaining makes the OFB more vulnerable to specific attacks. | ||
55 | - The use of different start variables values prevents the same | ||
56 | plaintext enciphering to the same ciphertext, by producing different | ||
57 | key streams. | ||
58 | - Selection of a small value for j will require more cycles through | ||
59 | the encipherment algorithm per unit of plaintext and thus cause | ||
60 | greater processing overheads. | ||
61 | - Only multiples of j bits can be enciphered. | ||
62 | - OFB mode of operation does not extend ciphertext errors in the | ||
63 | resultant plaintext output. Every bit error in the ciphertext causes | ||
64 | only one bit to be in error in the deciphered plaintext. | ||
65 | - OFB mode is not self-synchronising. If the two operation of | ||
66 | encipherment and decipherment get out of synchronism, the system needs | ||
67 | to be re-initialised. | ||
68 | - Each re-initialisation should use a value of the start variable | ||
69 | different from the start variable values used before with the same | ||
70 | key. The reason for this is that an identical bit stream would be | ||
71 | produced each time from the same parameters. This would be | ||
72 | susceptible to a 'known plaintext' attack. | ||
73 | |||
74 | Triple ECB Mode (des_ecb3_encrypt()) | ||
75 | - Encrypt with key1, decrypt with key2 and encrypt with key1 again. | ||
76 | - As for ECB encryption but increases the effective key length to 112 bits. | ||
77 | - If both keys are the same it is equivalent to encrypting once with | ||
78 | just one key. | ||
79 | |||
80 | Triple CBC Mode (des_3cbc_encrypt()) | ||
81 | - Encrypt with key1, decrypt with key2 and encrypt with key1 again. | ||
82 | - As for CBC encryption but increases the effective key length to 112 bits. | ||
83 | - If both keys are the same it is equivalent to encrypting once with | ||
84 | just one key. | ||
diff --git a/src/lib/libcrypto/des/Makefile.PL b/src/lib/libcrypto/des/Makefile.PL index b54a24387c..e69de29bb2 100644 --- a/src/lib/libcrypto/des/Makefile.PL +++ b/src/lib/libcrypto/des/Makefile.PL | |||
@@ -1,14 +0,0 @@ | |||
1 | use ExtUtils::MakeMaker; | ||
2 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence | ||
3 | # the contents of the Makefile being created. | ||
4 | &writeMakefile( | ||
5 | 'potential_libs' => '', # e.g., '-lm' | ||
6 | 'INC' => '', # e.g., '-I/usr/include/other' | ||
7 | 'DISTNAME' => 'DES', | ||
8 | 'VERSION' => '0.1', | ||
9 | 'DEFINE' => '-DPERL5', | ||
10 | 'OBJECT' => 'DES.o cbc_cksm.o cbc_enc.o ecb_enc.o pcbc_enc.o \ | ||
11 | rand_key.o set_key.o str2key.o \ | ||
12 | enc_read.o enc_writ.o fcrypt.o cfb_enc.o \ | ||
13 | ecb3_enc.o ofb_enc.o cbc3_enc.o des_enc.o', | ||
14 | ); | ||
diff --git a/src/lib/libcrypto/des/Makefile.lit b/src/lib/libcrypto/des/Makefile.lit index c09f6969da..e69de29bb2 100644 --- a/src/lib/libcrypto/des/Makefile.lit +++ b/src/lib/libcrypto/des/Makefile.lit | |||
@@ -1,250 +0,0 @@ | |||
1 | # You must select the correct terminal control system to be used to | ||
2 | # turn character echo off when reading passwords. There a 5 systems | ||
3 | # SGTTY - the old BSD system | ||
4 | # TERMIO - most system V boxes | ||
5 | # TERMIOS - SGI (ala IRIX). | ||
6 | # VMS - the DEC operating system | ||
7 | # MSDOS - we all know what it is :-) | ||
8 | # read_pwd.c makes a reasonable guess at what is correct. | ||
9 | |||
10 | # Targets | ||
11 | # make - twidle the options yourself :-) | ||
12 | # make cc - standard cc options | ||
13 | # make gcc - standard gcc options | ||
14 | # make x86-elf - linux-elf etc | ||
15 | # make x86-out - linux-a.out, FreeBSD etc | ||
16 | # make x86-solaris | ||
17 | # make x86-bdsi | ||
18 | |||
19 | # If you are on a DEC Alpha, edit des.h and change the DES_LONG | ||
20 | # define to 'unsigned int'. I have seen this give a %20 speedup. | ||
21 | |||
22 | OPTS0= -DLIBDES_LIT -DRAND -DTERMIO #-DNOCONST | ||
23 | |||
24 | # Version 1.94 has changed the strings_to_key function so that it is | ||
25 | # now compatible with MITs when the string is longer than 8 characters. | ||
26 | # If you wish to keep the old version, uncomment the following line. | ||
27 | # This will affect the -E/-D options on des(1). | ||
28 | #OPTS1= -DOLD_STR_TO_KEY | ||
29 | |||
30 | # There are 4 possible performance options | ||
31 | # -DDES_PTR | ||
32 | # -DDES_RISC1 | ||
33 | # -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2) | ||
34 | # -DDES_UNROLL | ||
35 | # after the initial build, run 'des_opts' to see which options are best | ||
36 | # for your platform. There are some listed in options.txt | ||
37 | #OPTS2= -DDES_PTR | ||
38 | #OPTS3= -DDES_RISC1 # or DES_RISC2 | ||
39 | #OPTS4= -DDES_UNROLL | ||
40 | |||
41 | OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4) | ||
42 | |||
43 | MAKE=make -f Makefile | ||
44 | #CC=cc | ||
45 | #CFLAG= -O | ||
46 | |||
47 | CC=gcc | ||
48 | #CFLAG= -O4 -funroll-loops -fomit-frame-pointer | ||
49 | CFLAG= -O3 -fomit-frame-pointer | ||
50 | |||
51 | CFLAGS=$(OPTS) $(CFLAG) | ||
52 | CPP=$(CC) -E | ||
53 | AS=as | ||
54 | |||
55 | # Assember version of des_encrypt*(). | ||
56 | DES_ENC=des_enc.o fcrypt_b.o # normal C version | ||
57 | #DES_ENC=asm/dx86-elf.o asm/yx86-elf.o # elf format x86 | ||
58 | #DES_ENC=asm/dx86-out.o asm/yx86-out.o # a.out format x86 | ||
59 | #DES_ENC=asm/dx86-sol.o asm/yx86-sol.o # solaris format x86 | ||
60 | #DES_ENC=asm/dx86bsdi.o asm/yx86basi.o # bsdi format x86 | ||
61 | |||
62 | LIBDIR=/usr/local/lib | ||
63 | BINDIR=/usr/local/bin | ||
64 | INCDIR=/usr/local/include | ||
65 | MANDIR=/usr/local/man | ||
66 | MAN1=1 | ||
67 | MAN3=3 | ||
68 | SHELL=/bin/sh | ||
69 | OBJ_LIT=cbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o | ||
70 | OBJ_FULL=cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \ | ||
71 | xcbc_enc.o qud_cksm.o \ | ||
72 | cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o \ | ||
73 | enc_read.o enc_writ.o ofb64ede.o ofb64enc.o ofb_enc.o \ | ||
74 | rand_key.o read_pwd.o read2pwd.o rpc_enc.o str2key.o supp.o | ||
75 | |||
76 | GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \ | ||
77 | des.doc options.txt asm | ||
78 | GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \ | ||
79 | des.man DES.pm DES.pod DES.xs Makefile.PL dess.cpp des3s.cpp \ | ||
80 | Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \ | ||
81 | des.org des_locl.org | ||
82 | TESTING_LIT= destest speed des_opts | ||
83 | TESTING_FULL= rpw $(TESTING_LIT) | ||
84 | TESTING_SRC_LIT=destest.c speed.c des_opts.c | ||
85 | TESTING_SRC_FULL=rpw.c $(TESTING_SRC_LIT) | ||
86 | HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h | ||
87 | HEADERS_FULL= $(HEADERS_LIT) rpc_des.h | ||
88 | LIBDES_LIT=cbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c fcrypt_b.c | ||
89 | LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c \ | ||
90 | cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c \ | ||
91 | enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \ | ||
92 | rand_key.c rpc_enc.c str2key.c supp.c \ | ||
93 | xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c | ||
94 | |||
95 | PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl | ||
96 | |||
97 | OBJ= $(OBJ_LIT) | ||
98 | GENERAL=$(GENERAL_LIT) | ||
99 | TESTING=$(TESTING_LIT) | ||
100 | TESTING_SRC=$(TESTING_SRC_LIT) | ||
101 | HEADERS=$(HEADERS_LIT) | ||
102 | LIBDES= $(LIBDES_LIT) | ||
103 | |||
104 | ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS) | ||
105 | |||
106 | DLIB= libdes.a | ||
107 | |||
108 | all: $(DLIB) $(TESTING) | ||
109 | |||
110 | cc: | ||
111 | $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all | ||
112 | |||
113 | gcc: | ||
114 | $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all | ||
115 | |||
116 | x86-elf: | ||
117 | $(MAKE) DES_ENC='asm/dx86-elf.o asm/yx86-elf.o' CC=$(CC) CFLAGS="-DELF $(OPTS) $(CFLAG)" all | ||
118 | |||
119 | x86-out: | ||
120 | $(MAKE) DES_ENC='asm/dx86-out.o asm/yx86-out.o' CC=$(CC) CFLAGS="-DOUT $(OPTS) $(CFLAG)" all | ||
121 | |||
122 | x86-solaris: | ||
123 | $(MAKE) DES_ENC='asm/dx86-sol.o asm/yx86-sol.o' CC=$(CC) CFLAGS="-DSOL $(OPTS) $(CFLAG)" all | ||
124 | |||
125 | x86-bsdi: | ||
126 | $(MAKE) DES_ENC='asm/dx86bsdi.o asm/yx86bsdi.o' CC=$(CC) CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all | ||
127 | |||
128 | # elf | ||
129 | asm/dx86-elf.o: asm/dx86unix.cpp | ||
130 | $(CPP) -DELF asm/dx86unix.cpp | $(AS) -o asm/dx86-elf.o | ||
131 | |||
132 | asm/yx86-elf.o: asm/yx86unix.cpp | ||
133 | $(CPP) -DELF asm/yx86unix.cpp | $(AS) -o asm/yx86-elf.o | ||
134 | |||
135 | # solaris | ||
136 | asm/dx86-sol.o: asm/dx86unix.cpp | ||
137 | $(CC) -E -DSOL asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s | ||
138 | as -o asm/dx86-sol.o asm/dx86-sol.s | ||
139 | rm -f asm/dx86-sol.s | ||
140 | |||
141 | asm/yx86-sol.o: asm/yx86unix.cpp | ||
142 | $(CC) -E -DSOL asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s | ||
143 | as -o asm/yx86-sol.o asm/yx86-sol.s | ||
144 | rm -f asm/yx86-sol.s | ||
145 | |||
146 | # a.out | ||
147 | asm/dx86-out.o: asm/dx86unix.cpp | ||
148 | $(CPP) -DOUT asm/dx86unix.cpp | $(AS) -o asm/dx86-out.o | ||
149 | |||
150 | asm/yx86-out.o: asm/yx86unix.cpp | ||
151 | $(CPP) -DOUT asm/yx86unix.cpp | $(AS) -o asm/yx86-out.o | ||
152 | |||
153 | # bsdi | ||
154 | asm/dx86bsdi.o: asm/dx86unix.cpp | ||
155 | $(CPP) -DBSDI asm/dx86unix.cpp | $(AS) -o asm/dx86bsdi.o | ||
156 | |||
157 | asm/yx86bsdi.o: asm/yx86unix.cpp | ||
158 | $(CPP) -DBSDI asm/yx86unix.cpp | $(AS) -o asm/yx86bsdi.o | ||
159 | |||
160 | asm/dx86unix.cpp: | ||
161 | (cd asm; perl des-586.pl cpp >dx86unix.cpp) | ||
162 | |||
163 | asm/yx86unix.cpp: | ||
164 | (cd asm; perl crypt586.pl cpp >yx86unix.cpp) | ||
165 | |||
166 | test: all | ||
167 | ./destest | ||
168 | |||
169 | $(DLIB): $(OBJ) | ||
170 | /bin/rm -f $(DLIB) | ||
171 | ar cr $(DLIB) $(OBJ) | ||
172 | -if test -s /bin/ranlib; then /bin/ranlib $(DLIB); \ | ||
173 | else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(DLIB); \ | ||
174 | else exit 0; fi; fi | ||
175 | |||
176 | des_opts: des_opts.o $(DLIB) | ||
177 | $(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB) | ||
178 | |||
179 | destest: destest.o $(DLIB) | ||
180 | $(CC) $(CFLAGS) -o destest destest.o $(DLIB) | ||
181 | |||
182 | rpw: rpw.o $(DLIB) | ||
183 | $(CC) $(CFLAGS) -o rpw rpw.o $(DLIB) | ||
184 | |||
185 | speed: speed.o $(DLIB) | ||
186 | $(CC) $(CFLAGS) -o speed speed.o $(DLIB) | ||
187 | |||
188 | des: des.o $(DLIB) | ||
189 | $(CC) $(CFLAGS) -o des des.o $(DLIB) | ||
190 | |||
191 | tags: | ||
192 | ctags $(TESTING_SRC) $(LIBDES) | ||
193 | |||
194 | tar_lit: | ||
195 | /bin/mv Makefile Makefile.tmp | ||
196 | /bin/cp Makefile.lit Makefile | ||
197 | tar chf libdes-l.tar $(LIBDES_LIT) $(HEADERS_LIT) \ | ||
198 | $(GENERAL_LIT) $(TESTING_SRC_LIT) | ||
199 | /bin/rm -f Makefile | ||
200 | /bin/mv Makefile.tmp Makefile | ||
201 | |||
202 | tar: | ||
203 | tar chf libdes.tar $(ALL) | ||
204 | |||
205 | shar: | ||
206 | shar $(ALL) >libdes.shar | ||
207 | |||
208 | depend: | ||
209 | makedepend $(LIBDES) $(TESTING_SRC) | ||
210 | |||
211 | clean: | ||
212 | /bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o | ||
213 | |||
214 | dclean: | ||
215 | sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new | ||
216 | mv -f Makefile.new Makefile | ||
217 | |||
218 | # Eric is probably going to choke when he next looks at this --tjh | ||
219 | install: | ||
220 | if test $(INSTALLTOP); then \ | ||
221 | echo SSL style install; \ | ||
222 | cp $(DLIB) $(INSTALLTOP)/lib; \ | ||
223 | if test -s /bin/ranlib; then \ | ||
224 | /bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \ | ||
225 | else \ | ||
226 | if test -s /usr/bin/ranlib; then \ | ||
227 | /usr/bin/ranlib $(INSTALLTOP)/lib/$(DLIB); \ | ||
228 | fi; fi; \ | ||
229 | chmod 644 $(INSTALLTOP)/lib/$(DLIB); \ | ||
230 | cp des.h $(INSTALLTOP)/include; \ | ||
231 | chmod 644 $(INSTALLTOP)/include/des.h; \ | ||
232 | else \ | ||
233 | echo Standalone install; \ | ||
234 | cp $(DLIB) $(LIBDIR)/$(DLIB); \ | ||
235 | if test -s /bin/ranlib; then \ | ||
236 | /bin/ranlib $(LIBDIR)/$(DLIB); \ | ||
237 | else \ | ||
238 | if test -s /usr/bin/ranlib; then \ | ||
239 | /usr/bin/ranlib $(LIBDIR)/$(DLIB); \ | ||
240 | fi; \ | ||
241 | fi; \ | ||
242 | chmod 644 $(LIBDIR)/$(DLIB); \ | ||
243 | cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \ | ||
244 | chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \ | ||
245 | cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \ | ||
246 | chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \ | ||
247 | cp des.h $(INCDIR)/des.h; \ | ||
248 | chmod 644 $(INCDIR)/des.h; \ | ||
249 | fi | ||
250 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/des/Makefile.ssl b/src/lib/libcrypto/des/Makefile.ssl index 41976655e9..3eb0738b7b 100644 --- a/src/lib/libcrypto/des/Makefile.ssl +++ b/src/lib/libcrypto/des/Makefile.ssl | |||
@@ -32,21 +32,21 @@ LIBSRC= cbc_cksm.c cbc_enc.c cfb64enc.c cfb_enc.c \ | |||
32 | fcrypt.c ofb64enc.c ofb_enc.c pcbc_enc.c \ | 32 | fcrypt.c ofb64enc.c ofb_enc.c pcbc_enc.c \ |
33 | qud_cksm.c rand_key.c read_pwd.c rpc_enc.c set_key.c \ | 33 | qud_cksm.c rand_key.c read_pwd.c rpc_enc.c set_key.c \ |
34 | des_enc.c fcrypt_b.c read2pwd.c \ | 34 | des_enc.c fcrypt_b.c read2pwd.c \ |
35 | fcrypt.c xcbc_enc.c \ | 35 | xcbc_enc.c \ |
36 | str2key.c cfb64ede.c ofb64ede.c supp.c ede_cbcm_enc.c | 36 | str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c |
37 | 37 | ||
38 | LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ | 38 | LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ |
39 | ecb3_enc.o cfb64enc.o cfb64ede.o cfb_enc.o ofb64ede.o \ | 39 | ecb3_enc.o cfb64enc.o cfb64ede.o cfb_enc.o ofb64ede.o \ |
40 | enc_read.o enc_writ.o ofb64enc.o \ | 40 | enc_read.o enc_writ.o ofb64enc.o \ |
41 | ofb_enc.o str2key.o pcbc_enc.o qud_cksm.o rand_key.o \ | 41 | ofb_enc.o str2key.o pcbc_enc.o qud_cksm.o rand_key.o \ |
42 | ${DES_ENC} read2pwd.o \ | 42 | ${DES_ENC} read2pwd.o \ |
43 | fcrypt.o xcbc_enc.o read_pwd.o rpc_enc.o cbc_cksm.o supp.o \ | 43 | fcrypt.o xcbc_enc.o read_pwd.o rpc_enc.o cbc_cksm.o \ |
44 | ede_cbcm_enc.o | 44 | ede_cbcm_enc.o |
45 | 45 | ||
46 | SRC= $(LIBSRC) | 46 | SRC= $(LIBSRC) |
47 | 47 | ||
48 | EXHEADER= des.h | 48 | EXHEADER= des.h |
49 | HEADER= des_locl.h rpc_des.h podd.h sk.h spr.h des_ver.h $(EXHEADER) | 49 | HEADER= des_locl.h rpc_des.h spr.h des_ver.h $(EXHEADER) |
50 | 50 | ||
51 | ALL= $(GENERAL) $(SRC) $(HEADER) | 51 | ALL= $(GENERAL) $(SRC) $(HEADER) |
52 | 52 | ||
@@ -65,10 +65,10 @@ des: des.o cbc3_enc.o lib | |||
65 | 65 | ||
66 | # elf | 66 | # elf |
67 | asm/dx86-elf.o: asm/dx86unix.cpp | 67 | asm/dx86-elf.o: asm/dx86unix.cpp |
68 | $(CPP) -DELF asm/dx86unix.cpp | as -o asm/dx86-elf.o | 68 | $(CPP) -DELF -x c asm/dx86unix.cpp | as -o asm/dx86-elf.o |
69 | 69 | ||
70 | asm/yx86-elf.o: asm/yx86unix.cpp | 70 | asm/yx86-elf.o: asm/yx86unix.cpp |
71 | $(CPP) -DELF asm/yx86unix.cpp | as -o asm/yx86-elf.o | 71 | $(CPP) -DELF -x c asm/yx86unix.cpp | as -o asm/yx86-elf.o |
72 | 72 | ||
73 | # solaris | 73 | # solaris |
74 | asm/dx86-sol.o: asm/dx86unix.cpp | 74 | asm/dx86-sol.o: asm/dx86unix.cpp |
@@ -95,10 +95,10 @@ asm/dx86bsdi.o: asm/dx86unix.cpp | |||
95 | asm/yx86bsdi.o: asm/yx86unix.cpp | 95 | asm/yx86bsdi.o: asm/yx86unix.cpp |
96 | $(CPP) -DBSDI asm/yx86unix.cpp | sed 's/ :/:/' | as -o asm/yx86bsdi.o | 96 | $(CPP) -DBSDI asm/yx86unix.cpp | sed 's/ :/:/' | as -o asm/yx86bsdi.o |
97 | 97 | ||
98 | asm/dx86unix.cpp: asm/des-586.pl | 98 | asm/dx86unix.cpp: asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl |
99 | (cd asm; $(PERL) des-586.pl cpp >dx86unix.cpp) | 99 | (cd asm; $(PERL) des-586.pl cpp >dx86unix.cpp) |
100 | 100 | ||
101 | asm/yx86unix.cpp: asm/crypt586.pl | 101 | asm/yx86unix.cpp: asm/crypt586.pl ../perlasm/x86asm.pl |
102 | (cd asm; $(PERL) crypt586.pl cpp >yx86unix.cpp) | 102 | (cd asm; $(PERL) crypt586.pl cpp >yx86unix.cpp) |
103 | 103 | ||
104 | files: | 104 | files: |
@@ -172,10 +172,8 @@ enc_writ.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h | |||
172 | enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h | 172 | enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h |
173 | enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 173 | enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
174 | enc_writ.o: ../cryptlib.h des_locl.h | 174 | enc_writ.o: ../cryptlib.h des_locl.h |
175 | fcrypt.o: ../../include/openssl/des.h ../../include/openssl/des.h | 175 | fcrypt.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
176 | fcrypt.o: ../../include/openssl/e_os2.h ../../include/openssl/e_os2.h | 176 | fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h |
177 | fcrypt.o: ../../include/openssl/opensslconf.h | ||
178 | fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h des_locl.h | ||
179 | fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | 177 | fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
180 | fcrypt_b.o: ../../include/openssl/opensslconf.h des_locl.h | 178 | fcrypt_b.o: ../../include/openssl/opensslconf.h des_locl.h |
181 | ofb64ede.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | 179 | ofb64ede.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
@@ -201,10 +199,8 @@ read_pwd.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h | |||
201 | rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | 199 | rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
202 | rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h | 200 | rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h |
203 | set_key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | 201 | set_key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
204 | set_key.o: ../../include/openssl/opensslconf.h des_locl.h podd.h sk.h | 202 | set_key.o: ../../include/openssl/opensslconf.h des_locl.h |
205 | str2key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | 203 | str2key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
206 | str2key.o: ../../include/openssl/opensslconf.h des_locl.h | 204 | str2key.o: ../../include/openssl/opensslconf.h des_locl.h |
207 | supp.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | ||
208 | supp.o: ../../include/openssl/opensslconf.h des_locl.h | ||
209 | xcbc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h | 205 | xcbc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h |
210 | xcbc_enc.o: ../../include/openssl/opensslconf.h des_locl.h | 206 | xcbc_enc.o: ../../include/openssl/opensslconf.h des_locl.h |
diff --git a/src/lib/libcrypto/des/Makefile.uni b/src/lib/libcrypto/des/Makefile.uni index ec19d75b81..e69de29bb2 100644 --- a/src/lib/libcrypto/des/Makefile.uni +++ b/src/lib/libcrypto/des/Makefile.uni | |||
@@ -1,251 +0,0 @@ | |||
1 | # You must select the correct terminal control system to be used to | ||
2 | # turn character echo off when reading passwords. There a 5 systems | ||
3 | # SGTTY - the old BSD system | ||
4 | # TERMIO - most system V boxes | ||
5 | # TERMIOS - SGI (ala IRIX). | ||
6 | # VMS - the DEC operating system | ||
7 | # MSDOS - we all know what it is :-) | ||
8 | # read_pwd.c makes a reasonable guess at what is correct. | ||
9 | |||
10 | # Targets | ||
11 | # make - twidle the options yourself :-) | ||
12 | # make cc - standard cc options | ||
13 | # make gcc - standard gcc options | ||
14 | # make x86-elf - linux-elf etc | ||
15 | # make x86-out - linux-a.out, FreeBSD etc | ||
16 | # make x86-solaris | ||
17 | # make x86-bdsi | ||
18 | |||
19 | # If you are on a DEC Alpha, edit des.h and change the DES_LONG | ||
20 | # define to 'unsigned int'. I have seen this give a %20 speedup. | ||
21 | |||
22 | OPTS0= -DRAND -DTERMIO #-DNOCONST | ||
23 | |||
24 | # Version 1.94 has changed the strings_to_key function so that it is | ||
25 | # now compatible with MITs when the string is longer than 8 characters. | ||
26 | # If you wish to keep the old version, uncomment the following line. | ||
27 | # This will affect the -E/-D options on des(1). | ||
28 | #OPTS1= -DOLD_STR_TO_KEY | ||
29 | |||
30 | # There are 4 possible performance options | ||
31 | # -DDES_PTR | ||
32 | # -DDES_RISC1 | ||
33 | # -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2) | ||
34 | # -DDES_UNROLL | ||
35 | # after the initial build, run 'des_opts' to see which options are best | ||
36 | # for your platform. There are some listed in options.txt | ||
37 | #OPTS2= -DDES_PTR | ||
38 | #OPTS3= -DDES_RISC1 # or DES_RISC2 | ||
39 | #OPTS4= -DDES_UNROLL | ||
40 | |||
41 | OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4) | ||
42 | |||
43 | MAKE=make -f Makefile | ||
44 | #CC=cc | ||
45 | #CFLAG= -O | ||
46 | |||
47 | CC=gcc | ||
48 | #CFLAG= -O4 -funroll-loops -fomit-frame-pointer | ||
49 | CFLAG= -O3 -fomit-frame-pointer | ||
50 | |||
51 | CFLAGS=$(OPTS) $(CFLAG) | ||
52 | CPP=$(CC) -E | ||
53 | AS=as | ||
54 | RANLIB=ranlib | ||
55 | |||
56 | # Assember version of des_encrypt*(). | ||
57 | DES_ENC=des_enc.o fcrypt_b.o # normal C version | ||
58 | #DES_ENC=asm/dx86-elf.o asm/yx86-elf.o # elf format x86 | ||
59 | #DES_ENC=asm/dx86-out.o asm/yx86-out.o # a.out format x86 | ||
60 | #DES_ENC=asm/dx86-sol.o asm/yx86-sol.o # solaris format x86 | ||
61 | #DES_ENC=asm/dx86bsdi.o asm/yx86basi.o # bsdi format x86 | ||
62 | |||
63 | LIBDIR=/usr/local/lib | ||
64 | BINDIR=/usr/local/bin | ||
65 | INCDIR=/usr/local/include | ||
66 | MANDIR=/usr/local/man | ||
67 | MAN1=1 | ||
68 | MAN3=3 | ||
69 | SHELL=/bin/sh | ||
70 | OBJ_LIT=cbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o | ||
71 | OBJ_FULL=cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \ | ||
72 | xcbc_enc.o qud_cksm.o cbc3_enc.o \ | ||
73 | cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o \ | ||
74 | enc_read.o enc_writ.o ofb64ede.o ofb64enc.o ofb_enc.o \ | ||
75 | rand_key.o read_pwd.o read2pwd.o rpc_enc.o str2key.o supp.o | ||
76 | |||
77 | GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \ | ||
78 | des.doc options.txt asm | ||
79 | GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \ | ||
80 | des.man DES.pm DES.pod DES.xs Makefile.PL dess.cpp des3s.cpp \ | ||
81 | Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \ | ||
82 | des.org des_locl.org | ||
83 | TESTING_LIT= destest speed des_opts | ||
84 | TESTING_FULL= rpw des $(TESTING_LIT) | ||
85 | TESTING_SRC_LIT=destest.c speed.c des_opts.c | ||
86 | TESTING_SRC_FULL=rpw.c des.c $(TESTING_SRC_LIT) | ||
87 | HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h | ||
88 | HEADERS_FULL= $(HEADERS_LIT) rpc_des.h | ||
89 | LIBDES_LIT=cbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c fcrypt_b.c | ||
90 | LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c cbc3_enc.c \ | ||
91 | cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c \ | ||
92 | enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \ | ||
93 | rand_key.c rpc_enc.c str2key.c supp.c \ | ||
94 | xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c | ||
95 | |||
96 | PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl | ||
97 | |||
98 | OBJ= $(OBJ_FULL) | ||
99 | GENERAL=$(GENERAL_FULL) | ||
100 | TESTING=$(TESTING_FULL) | ||
101 | TESTING_SRC=$(TESTING_SRC_FULL) | ||
102 | HEADERS=$(HEADERS_FULL) | ||
103 | LIBDES= $(LIBDES_FULL) | ||
104 | |||
105 | ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS) | ||
106 | |||
107 | DLIB= libdes.a | ||
108 | |||
109 | all: $(DLIB) $(TESTING) | ||
110 | |||
111 | cc: | ||
112 | $(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all | ||
113 | |||
114 | gcc: | ||
115 | $(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all | ||
116 | |||
117 | x86-elf: | ||
118 | $(MAKE) DES_ENC='asm/dx86-elf.o asm/yx86-elf.o' CC=$(CC) CFLAGS="-DELF $(OPTS) $(CFLAG)" all | ||
119 | |||
120 | x86-out: | ||
121 | $(MAKE) DES_ENC='asm/dx86-out.o asm/yx86-out.o' CC=$(CC) CFLAGS="-DOUT $(OPTS) $(CFLAG)" all | ||
122 | |||
123 | x86-solaris: | ||
124 | $(MAKE) DES_ENC='asm/dx86-sol.o asm/yx86-sol.o' CC=$(CC) CFLAGS="-DSOL $(OPTS) $(CFLAG)" all | ||
125 | |||
126 | x86-bsdi: | ||
127 | $(MAKE) DES_ENC='asm/dx86bsdi.o asm/yx86bsdi.o' CC=$(CC) CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all | ||
128 | |||
129 | # elf | ||
130 | asm/dx86-elf.o: asm/dx86unix.cpp | ||
131 | $(CPP) -DELF asm/dx86unix.cpp | $(AS) -o asm/dx86-elf.o | ||
132 | |||
133 | asm/yx86-elf.o: asm/yx86unix.cpp | ||
134 | $(CPP) -DELF asm/yx86unix.cpp | $(AS) -o asm/yx86-elf.o | ||
135 | |||
136 | # solaris | ||
137 | asm/dx86-sol.o: asm/dx86unix.cpp | ||
138 | $(CC) -E -DSOL asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s | ||
139 | as -o asm/dx86-sol.o asm/dx86-sol.s | ||
140 | rm -f asm/dx86-sol.s | ||
141 | |||
142 | asm/yx86-sol.o: asm/yx86unix.cpp | ||
143 | $(CC) -E -DSOL asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s | ||
144 | as -o asm/yx86-sol.o asm/yx86-sol.s | ||
145 | rm -f asm/yx86-sol.s | ||
146 | |||
147 | # a.out | ||
148 | asm/dx86-out.o: asm/dx86unix.cpp | ||
149 | $(CPP) -DOUT asm/dx86unix.cpp | $(AS) -o asm/dx86-out.o | ||
150 | |||
151 | asm/yx86-out.o: asm/yx86unix.cpp | ||
152 | $(CPP) -DOUT asm/yx86unix.cpp | $(AS) -o asm/yx86-out.o | ||
153 | |||
154 | # bsdi | ||
155 | asm/dx86bsdi.o: asm/dx86unix.cpp | ||
156 | $(CPP) -DBSDI asm/dx86unix.cpp | $(AS) -o asm/dx86bsdi.o | ||
157 | |||
158 | asm/yx86bsdi.o: asm/yx86unix.cpp | ||
159 | $(CPP) -DBSDI asm/yx86unix.cpp | $(AS) -o asm/yx86bsdi.o | ||
160 | |||
161 | asm/dx86unix.cpp: | ||
162 | (cd asm; perl des-586.pl cpp >dx86unix.cpp) | ||
163 | |||
164 | asm/yx86unix.cpp: | ||
165 | (cd asm; perl crypt586.pl cpp >yx86unix.cpp) | ||
166 | |||
167 | test: all | ||
168 | ./destest | ||
169 | |||
170 | $(DLIB): $(OBJ) | ||
171 | /bin/rm -f $(DLIB) | ||
172 | ar cr $(DLIB) $(OBJ) | ||
173 | $(RANLIB) $(DLIB) | ||
174 | |||
175 | des_opts: des_opts.o $(DLIB) | ||
176 | $(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB) | ||
177 | |||
178 | destest: destest.o $(DLIB) | ||
179 | $(CC) $(CFLAGS) -o destest destest.o $(DLIB) | ||
180 | |||
181 | rpw: rpw.o $(DLIB) | ||
182 | $(CC) $(CFLAGS) -o rpw rpw.o $(DLIB) | ||
183 | |||
184 | speed: speed.o $(DLIB) | ||
185 | $(CC) $(CFLAGS) -o speed speed.o $(DLIB) | ||
186 | |||
187 | des: des.o $(DLIB) | ||
188 | $(CC) $(CFLAGS) -o des des.o $(DLIB) | ||
189 | |||
190 | tags: | ||
191 | ctags $(TESTING_SRC) $(LIBDES) | ||
192 | |||
193 | tar_lit: | ||
194 | /bin/mv Makefile Makefile.tmp | ||
195 | /bin/cp Makefile.lit Makefile | ||
196 | for i in $(HEADERS_LIT) $(LIBDES_LIT) $(GENERAL_LIT) $(TESTING_SRC_LIT) ;\ | ||
197 | do \ | ||
198 | n="$$n des/$$i"; \ | ||
199 | done; \ | ||
200 | ( cd .. ; tar chf - $$n )| gzip > libdes-l.tgz | ||
201 | /bin/rm -f Makefile | ||
202 | /bin/mv Makefile.tmp Makefile | ||
203 | |||
204 | tar: | ||
205 | mv Makefile Makefile.tmp | ||
206 | /bin/cp Makefile.uni Makefile | ||
207 | for i in $(ALL) ;\ | ||
208 | do \ | ||
209 | n="$$n des/$$i"; \ | ||
210 | done; \ | ||
211 | ( cd .. ; tar chf - $$n )| gzip > libdes.tgz | ||
212 | /bin/rm -f Makefile | ||
213 | /bin/mv Makefile.tmp Makefile | ||
214 | |||
215 | shar: | ||
216 | shar $(ALL) >libdes.shar | ||
217 | |||
218 | depend: | ||
219 | makedepend $(LIBDES) $(TESTING_SRC) | ||
220 | |||
221 | clean: | ||
222 | /bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o | ||
223 | |||
224 | dclean: | ||
225 | sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new | ||
226 | mv -f Makefile.new Makefile | ||
227 | |||
228 | # Eric is probably going to choke when he next looks at this --tjh | ||
229 | install: des | ||
230 | if test $(INSTALLTOP); then \ | ||
231 | echo SSL style install; \ | ||
232 | cp $(DLIB) $(INSTALLTOP)/lib; \ | ||
233 | $(RANLIB) $(DLIB); \ | ||
234 | chmod 644 $(INSTALLTOP)/lib/$(DLIB); \ | ||
235 | cp des.h $(INSTALLTOP)/include; \ | ||
236 | chmod 644 $(INSTALLTOP)/include/des.h; \ | ||
237 | else \ | ||
238 | echo Standalone install; \ | ||
239 | cp $(DLIB) $(LIBDIR)/$(DLIB); \ | ||
240 | $(RANLIB) $(DLIB); \ | ||
241 | chmod 644 $(LIBDIR)/$(DLIB); \ | ||
242 | cp des $(BINDIR)/des; \ | ||
243 | chmod 711 $(BINDIR)/des; \ | ||
244 | cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \ | ||
245 | chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \ | ||
246 | cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \ | ||
247 | chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \ | ||
248 | cp des.h $(INCDIR)/des.h; \ | ||
249 | chmod 644 $(INCDIR)/des.h; \ | ||
250 | fi | ||
251 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/des/PC1 b/src/lib/libcrypto/des/PC1 index efb8348b72..e69de29bb2 100644 --- a/src/lib/libcrypto/des/PC1 +++ b/src/lib/libcrypto/des/PC1 | |||
@@ -1,28 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | @PC1=( 57,49,41,33,25,17, 9, | ||
4 | 1,58,50,42,34,26,18, | ||
5 | 10, 2,59,51,43,35,27, | ||
6 | 19,11, 3,60,52,44,36, | ||
7 | "-","-","-","-", | ||
8 | 63,55,47,39,31,23,15, | ||
9 | 7,62,54,46,38,30,22, | ||
10 | 14, 6,61,53,45,37,29, | ||
11 | 21,13, 5,28,20,12, 4, | ||
12 | "-","-","-","-", | ||
13 | ); | ||
14 | |||
15 | foreach (@PC1) | ||
16 | { | ||
17 | if ($_ ne "-") | ||
18 | { | ||
19 | $_--; | ||
20 | $_=int($_/8)*8+7-($_%8); | ||
21 | printf "%2d ",$_; | ||
22 | } | ||
23 | else | ||
24 | { print "-- "; } | ||
25 | print "\n" if (((++$i) % 8) == 0); | ||
26 | print "\n" if ((($i) % 32) == 0); | ||
27 | } | ||
28 | |||
diff --git a/src/lib/libcrypto/des/PC2 b/src/lib/libcrypto/des/PC2 index 2d560270ec..e69de29bb2 100644 --- a/src/lib/libcrypto/des/PC2 +++ b/src/lib/libcrypto/des/PC2 | |||
@@ -1,57 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | @PC2_C=(14,17,11,24, 1, 5, | ||
4 | 3,28,15, 6,21,10, | ||
5 | 23,19,12, 4,26, 8, | ||
6 | 16, 7,27,20,13, 2, | ||
7 | ); | ||
8 | |||
9 | @PC2_D=(41,52,31,37,47,55, | ||
10 | 30,40,51,45,33,48, | ||
11 | 44,49,39,56,34,53, | ||
12 | 46,42,50,36,29,32, | ||
13 | ); | ||
14 | |||
15 | foreach (@PC2_C) { | ||
16 | if ($_ ne "-") | ||
17 | { | ||
18 | $_--; | ||
19 | printf "%2d ",$_; } | ||
20 | else { print "-- "; } | ||
21 | $C{$_}=1; | ||
22 | print "\n" if (((++$i) % 8) == 0); | ||
23 | } | ||
24 | $i=0; | ||
25 | print "\n"; | ||
26 | foreach (@PC2_D) { | ||
27 | if ($_ ne "-") | ||
28 | { | ||
29 | $_-=29; | ||
30 | printf "%2d ",$_; } | ||
31 | else { print "-- "; } | ||
32 | $D{$_}=1; | ||
33 | print "\n" if (((++$i) % 8) == 0); } | ||
34 | |||
35 | print "\n"; | ||
36 | foreach $i (0 .. 27) | ||
37 | { | ||
38 | $_=$C{$i}; | ||
39 | if ($_ ne "-") {printf "%2d ",$_;} | ||
40 | else { print "-- "; } | ||
41 | print "\n" if (((++$i) % 8) == 0); | ||
42 | } | ||
43 | print "\n"; | ||
44 | |||
45 | print "\n"; | ||
46 | foreach $i (0 .. 27) | ||
47 | { | ||
48 | $_=$D{$i}; | ||
49 | if ($_ ne "-") {printf "%2d ",$_;} | ||
50 | else { print "-- "; } | ||
51 | print "\n" if (((++$i) % 8) == 0); | ||
52 | } | ||
53 | print "\n"; | ||
54 | sub numsort | ||
55 | { | ||
56 | $a-$b; | ||
57 | } | ||
diff --git a/src/lib/libcrypto/des/asm/d-win32.asm b/src/lib/libcrypto/des/asm/d-win32.asm index 9e3dc9cd87..e69de29bb2 100644 --- a/src/lib/libcrypto/des/asm/d-win32.asm +++ b/src/lib/libcrypto/des/asm/d-win32.asm | |||
@@ -1,3132 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by des-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE des-586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _des_encrypt | ||
12 | EXTRN _des_SPtrans:DWORD | ||
13 | _des_encrypt PROC NEAR | ||
14 | push esi | ||
15 | push edi | ||
16 | ; | ||
17 | ; Load the 2 words | ||
18 | mov esi, DWORD PTR 12[esp] | ||
19 | xor ecx, ecx | ||
20 | push ebx | ||
21 | push ebp | ||
22 | mov eax, DWORD PTR [esi] | ||
23 | mov ebx, DWORD PTR 28[esp] | ||
24 | mov edi, DWORD PTR 4[esi] | ||
25 | ; | ||
26 | ; IP | ||
27 | rol eax, 4 | ||
28 | mov esi, eax | ||
29 | xor eax, edi | ||
30 | and eax, 0f0f0f0f0h | ||
31 | xor esi, eax | ||
32 | xor edi, eax | ||
33 | ; | ||
34 | rol edi, 20 | ||
35 | mov eax, edi | ||
36 | xor edi, esi | ||
37 | and edi, 0fff0000fh | ||
38 | xor eax, edi | ||
39 | xor esi, edi | ||
40 | ; | ||
41 | rol eax, 14 | ||
42 | mov edi, eax | ||
43 | xor eax, esi | ||
44 | and eax, 033333333h | ||
45 | xor edi, eax | ||
46 | xor esi, eax | ||
47 | ; | ||
48 | rol esi, 22 | ||
49 | mov eax, esi | ||
50 | xor esi, edi | ||
51 | and esi, 003fc03fch | ||
52 | xor eax, esi | ||
53 | xor edi, esi | ||
54 | ; | ||
55 | rol eax, 9 | ||
56 | mov esi, eax | ||
57 | xor eax, edi | ||
58 | and eax, 0aaaaaaaah | ||
59 | xor esi, eax | ||
60 | xor edi, eax | ||
61 | ; | ||
62 | rol edi, 1 | ||
63 | mov ebp, DWORD PTR 24[esp] | ||
64 | cmp ebx, 0 | ||
65 | je $L000start_decrypt | ||
66 | ; | ||
67 | ; Round 0 | ||
68 | mov eax, DWORD PTR [ebp] | ||
69 | xor ebx, ebx | ||
70 | mov edx, DWORD PTR 4[ebp] | ||
71 | xor eax, esi | ||
72 | xor edx, esi | ||
73 | and eax, 0fcfcfcfch | ||
74 | and edx, 0cfcfcfcfh | ||
75 | mov bl, al | ||
76 | mov cl, ah | ||
77 | ror edx, 4 | ||
78 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
79 | mov bl, dl | ||
80 | xor edi, ebp | ||
81 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
82 | xor edi, ebp | ||
83 | mov cl, dh | ||
84 | shr eax, 16 | ||
85 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
86 | xor edi, ebp | ||
87 | mov bl, ah | ||
88 | shr edx, 16 | ||
89 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
90 | xor edi, ebp | ||
91 | mov ebp, DWORD PTR 24[esp] | ||
92 | mov cl, dh | ||
93 | and eax, 0ffh | ||
94 | and edx, 0ffh | ||
95 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
96 | xor edi, ebx | ||
97 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
98 | xor edi, ebx | ||
99 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
100 | xor edi, ebx | ||
101 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
102 | xor edi, ebx | ||
103 | ; | ||
104 | ; Round 1 | ||
105 | mov eax, DWORD PTR 8[ebp] | ||
106 | xor ebx, ebx | ||
107 | mov edx, DWORD PTR 12[ebp] | ||
108 | xor eax, edi | ||
109 | xor edx, edi | ||
110 | and eax, 0fcfcfcfch | ||
111 | and edx, 0cfcfcfcfh | ||
112 | mov bl, al | ||
113 | mov cl, ah | ||
114 | ror edx, 4 | ||
115 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
116 | mov bl, dl | ||
117 | xor esi, ebp | ||
118 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
119 | xor esi, ebp | ||
120 | mov cl, dh | ||
121 | shr eax, 16 | ||
122 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
123 | xor esi, ebp | ||
124 | mov bl, ah | ||
125 | shr edx, 16 | ||
126 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
127 | xor esi, ebp | ||
128 | mov ebp, DWORD PTR 24[esp] | ||
129 | mov cl, dh | ||
130 | and eax, 0ffh | ||
131 | and edx, 0ffh | ||
132 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
133 | xor esi, ebx | ||
134 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
135 | xor esi, ebx | ||
136 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
137 | xor esi, ebx | ||
138 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
139 | xor esi, ebx | ||
140 | ; | ||
141 | ; Round 2 | ||
142 | mov eax, DWORD PTR 16[ebp] | ||
143 | xor ebx, ebx | ||
144 | mov edx, DWORD PTR 20[ebp] | ||
145 | xor eax, esi | ||
146 | xor edx, esi | ||
147 | and eax, 0fcfcfcfch | ||
148 | and edx, 0cfcfcfcfh | ||
149 | mov bl, al | ||
150 | mov cl, ah | ||
151 | ror edx, 4 | ||
152 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
153 | mov bl, dl | ||
154 | xor edi, ebp | ||
155 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
156 | xor edi, ebp | ||
157 | mov cl, dh | ||
158 | shr eax, 16 | ||
159 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
160 | xor edi, ebp | ||
161 | mov bl, ah | ||
162 | shr edx, 16 | ||
163 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
164 | xor edi, ebp | ||
165 | mov ebp, DWORD PTR 24[esp] | ||
166 | mov cl, dh | ||
167 | and eax, 0ffh | ||
168 | and edx, 0ffh | ||
169 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
170 | xor edi, ebx | ||
171 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
172 | xor edi, ebx | ||
173 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
174 | xor edi, ebx | ||
175 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
176 | xor edi, ebx | ||
177 | ; | ||
178 | ; Round 3 | ||
179 | mov eax, DWORD PTR 24[ebp] | ||
180 | xor ebx, ebx | ||
181 | mov edx, DWORD PTR 28[ebp] | ||
182 | xor eax, edi | ||
183 | xor edx, edi | ||
184 | and eax, 0fcfcfcfch | ||
185 | and edx, 0cfcfcfcfh | ||
186 | mov bl, al | ||
187 | mov cl, ah | ||
188 | ror edx, 4 | ||
189 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
190 | mov bl, dl | ||
191 | xor esi, ebp | ||
192 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
193 | xor esi, ebp | ||
194 | mov cl, dh | ||
195 | shr eax, 16 | ||
196 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
197 | xor esi, ebp | ||
198 | mov bl, ah | ||
199 | shr edx, 16 | ||
200 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
201 | xor esi, ebp | ||
202 | mov ebp, DWORD PTR 24[esp] | ||
203 | mov cl, dh | ||
204 | and eax, 0ffh | ||
205 | and edx, 0ffh | ||
206 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
207 | xor esi, ebx | ||
208 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
209 | xor esi, ebx | ||
210 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
211 | xor esi, ebx | ||
212 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
213 | xor esi, ebx | ||
214 | ; | ||
215 | ; Round 4 | ||
216 | mov eax, DWORD PTR 32[ebp] | ||
217 | xor ebx, ebx | ||
218 | mov edx, DWORD PTR 36[ebp] | ||
219 | xor eax, esi | ||
220 | xor edx, esi | ||
221 | and eax, 0fcfcfcfch | ||
222 | and edx, 0cfcfcfcfh | ||
223 | mov bl, al | ||
224 | mov cl, ah | ||
225 | ror edx, 4 | ||
226 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
227 | mov bl, dl | ||
228 | xor edi, ebp | ||
229 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
230 | xor edi, ebp | ||
231 | mov cl, dh | ||
232 | shr eax, 16 | ||
233 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
234 | xor edi, ebp | ||
235 | mov bl, ah | ||
236 | shr edx, 16 | ||
237 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
238 | xor edi, ebp | ||
239 | mov ebp, DWORD PTR 24[esp] | ||
240 | mov cl, dh | ||
241 | and eax, 0ffh | ||
242 | and edx, 0ffh | ||
243 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
244 | xor edi, ebx | ||
245 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
246 | xor edi, ebx | ||
247 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
248 | xor edi, ebx | ||
249 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
250 | xor edi, ebx | ||
251 | ; | ||
252 | ; Round 5 | ||
253 | mov eax, DWORD PTR 40[ebp] | ||
254 | xor ebx, ebx | ||
255 | mov edx, DWORD PTR 44[ebp] | ||
256 | xor eax, edi | ||
257 | xor edx, edi | ||
258 | and eax, 0fcfcfcfch | ||
259 | and edx, 0cfcfcfcfh | ||
260 | mov bl, al | ||
261 | mov cl, ah | ||
262 | ror edx, 4 | ||
263 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
264 | mov bl, dl | ||
265 | xor esi, ebp | ||
266 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
267 | xor esi, ebp | ||
268 | mov cl, dh | ||
269 | shr eax, 16 | ||
270 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
271 | xor esi, ebp | ||
272 | mov bl, ah | ||
273 | shr edx, 16 | ||
274 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
275 | xor esi, ebp | ||
276 | mov ebp, DWORD PTR 24[esp] | ||
277 | mov cl, dh | ||
278 | and eax, 0ffh | ||
279 | and edx, 0ffh | ||
280 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
281 | xor esi, ebx | ||
282 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
283 | xor esi, ebx | ||
284 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
285 | xor esi, ebx | ||
286 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
287 | xor esi, ebx | ||
288 | ; | ||
289 | ; Round 6 | ||
290 | mov eax, DWORD PTR 48[ebp] | ||
291 | xor ebx, ebx | ||
292 | mov edx, DWORD PTR 52[ebp] | ||
293 | xor eax, esi | ||
294 | xor edx, esi | ||
295 | and eax, 0fcfcfcfch | ||
296 | and edx, 0cfcfcfcfh | ||
297 | mov bl, al | ||
298 | mov cl, ah | ||
299 | ror edx, 4 | ||
300 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
301 | mov bl, dl | ||
302 | xor edi, ebp | ||
303 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
304 | xor edi, ebp | ||
305 | mov cl, dh | ||
306 | shr eax, 16 | ||
307 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
308 | xor edi, ebp | ||
309 | mov bl, ah | ||
310 | shr edx, 16 | ||
311 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
312 | xor edi, ebp | ||
313 | mov ebp, DWORD PTR 24[esp] | ||
314 | mov cl, dh | ||
315 | and eax, 0ffh | ||
316 | and edx, 0ffh | ||
317 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
318 | xor edi, ebx | ||
319 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
320 | xor edi, ebx | ||
321 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
322 | xor edi, ebx | ||
323 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
324 | xor edi, ebx | ||
325 | ; | ||
326 | ; Round 7 | ||
327 | mov eax, DWORD PTR 56[ebp] | ||
328 | xor ebx, ebx | ||
329 | mov edx, DWORD PTR 60[ebp] | ||
330 | xor eax, edi | ||
331 | xor edx, edi | ||
332 | and eax, 0fcfcfcfch | ||
333 | and edx, 0cfcfcfcfh | ||
334 | mov bl, al | ||
335 | mov cl, ah | ||
336 | ror edx, 4 | ||
337 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
338 | mov bl, dl | ||
339 | xor esi, ebp | ||
340 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
341 | xor esi, ebp | ||
342 | mov cl, dh | ||
343 | shr eax, 16 | ||
344 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
345 | xor esi, ebp | ||
346 | mov bl, ah | ||
347 | shr edx, 16 | ||
348 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
349 | xor esi, ebp | ||
350 | mov ebp, DWORD PTR 24[esp] | ||
351 | mov cl, dh | ||
352 | and eax, 0ffh | ||
353 | and edx, 0ffh | ||
354 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
355 | xor esi, ebx | ||
356 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
357 | xor esi, ebx | ||
358 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
359 | xor esi, ebx | ||
360 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
361 | xor esi, ebx | ||
362 | ; | ||
363 | ; Round 8 | ||
364 | mov eax, DWORD PTR 64[ebp] | ||
365 | xor ebx, ebx | ||
366 | mov edx, DWORD PTR 68[ebp] | ||
367 | xor eax, esi | ||
368 | xor edx, esi | ||
369 | and eax, 0fcfcfcfch | ||
370 | and edx, 0cfcfcfcfh | ||
371 | mov bl, al | ||
372 | mov cl, ah | ||
373 | ror edx, 4 | ||
374 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
375 | mov bl, dl | ||
376 | xor edi, ebp | ||
377 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
378 | xor edi, ebp | ||
379 | mov cl, dh | ||
380 | shr eax, 16 | ||
381 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
382 | xor edi, ebp | ||
383 | mov bl, ah | ||
384 | shr edx, 16 | ||
385 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
386 | xor edi, ebp | ||
387 | mov ebp, DWORD PTR 24[esp] | ||
388 | mov cl, dh | ||
389 | and eax, 0ffh | ||
390 | and edx, 0ffh | ||
391 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
392 | xor edi, ebx | ||
393 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
394 | xor edi, ebx | ||
395 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
396 | xor edi, ebx | ||
397 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
398 | xor edi, ebx | ||
399 | ; | ||
400 | ; Round 9 | ||
401 | mov eax, DWORD PTR 72[ebp] | ||
402 | xor ebx, ebx | ||
403 | mov edx, DWORD PTR 76[ebp] | ||
404 | xor eax, edi | ||
405 | xor edx, edi | ||
406 | and eax, 0fcfcfcfch | ||
407 | and edx, 0cfcfcfcfh | ||
408 | mov bl, al | ||
409 | mov cl, ah | ||
410 | ror edx, 4 | ||
411 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
412 | mov bl, dl | ||
413 | xor esi, ebp | ||
414 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
415 | xor esi, ebp | ||
416 | mov cl, dh | ||
417 | shr eax, 16 | ||
418 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
419 | xor esi, ebp | ||
420 | mov bl, ah | ||
421 | shr edx, 16 | ||
422 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
423 | xor esi, ebp | ||
424 | mov ebp, DWORD PTR 24[esp] | ||
425 | mov cl, dh | ||
426 | and eax, 0ffh | ||
427 | and edx, 0ffh | ||
428 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
429 | xor esi, ebx | ||
430 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
431 | xor esi, ebx | ||
432 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
433 | xor esi, ebx | ||
434 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
435 | xor esi, ebx | ||
436 | ; | ||
437 | ; Round 10 | ||
438 | mov eax, DWORD PTR 80[ebp] | ||
439 | xor ebx, ebx | ||
440 | mov edx, DWORD PTR 84[ebp] | ||
441 | xor eax, esi | ||
442 | xor edx, esi | ||
443 | and eax, 0fcfcfcfch | ||
444 | and edx, 0cfcfcfcfh | ||
445 | mov bl, al | ||
446 | mov cl, ah | ||
447 | ror edx, 4 | ||
448 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
449 | mov bl, dl | ||
450 | xor edi, ebp | ||
451 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
452 | xor edi, ebp | ||
453 | mov cl, dh | ||
454 | shr eax, 16 | ||
455 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
456 | xor edi, ebp | ||
457 | mov bl, ah | ||
458 | shr edx, 16 | ||
459 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
460 | xor edi, ebp | ||
461 | mov ebp, DWORD PTR 24[esp] | ||
462 | mov cl, dh | ||
463 | and eax, 0ffh | ||
464 | and edx, 0ffh | ||
465 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
466 | xor edi, ebx | ||
467 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
468 | xor edi, ebx | ||
469 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
470 | xor edi, ebx | ||
471 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
472 | xor edi, ebx | ||
473 | ; | ||
474 | ; Round 11 | ||
475 | mov eax, DWORD PTR 88[ebp] | ||
476 | xor ebx, ebx | ||
477 | mov edx, DWORD PTR 92[ebp] | ||
478 | xor eax, edi | ||
479 | xor edx, edi | ||
480 | and eax, 0fcfcfcfch | ||
481 | and edx, 0cfcfcfcfh | ||
482 | mov bl, al | ||
483 | mov cl, ah | ||
484 | ror edx, 4 | ||
485 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
486 | mov bl, dl | ||
487 | xor esi, ebp | ||
488 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
489 | xor esi, ebp | ||
490 | mov cl, dh | ||
491 | shr eax, 16 | ||
492 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
493 | xor esi, ebp | ||
494 | mov bl, ah | ||
495 | shr edx, 16 | ||
496 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
497 | xor esi, ebp | ||
498 | mov ebp, DWORD PTR 24[esp] | ||
499 | mov cl, dh | ||
500 | and eax, 0ffh | ||
501 | and edx, 0ffh | ||
502 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
503 | xor esi, ebx | ||
504 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
505 | xor esi, ebx | ||
506 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
507 | xor esi, ebx | ||
508 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
509 | xor esi, ebx | ||
510 | ; | ||
511 | ; Round 12 | ||
512 | mov eax, DWORD PTR 96[ebp] | ||
513 | xor ebx, ebx | ||
514 | mov edx, DWORD PTR 100[ebp] | ||
515 | xor eax, esi | ||
516 | xor edx, esi | ||
517 | and eax, 0fcfcfcfch | ||
518 | and edx, 0cfcfcfcfh | ||
519 | mov bl, al | ||
520 | mov cl, ah | ||
521 | ror edx, 4 | ||
522 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
523 | mov bl, dl | ||
524 | xor edi, ebp | ||
525 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
526 | xor edi, ebp | ||
527 | mov cl, dh | ||
528 | shr eax, 16 | ||
529 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
530 | xor edi, ebp | ||
531 | mov bl, ah | ||
532 | shr edx, 16 | ||
533 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
534 | xor edi, ebp | ||
535 | mov ebp, DWORD PTR 24[esp] | ||
536 | mov cl, dh | ||
537 | and eax, 0ffh | ||
538 | and edx, 0ffh | ||
539 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
540 | xor edi, ebx | ||
541 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
542 | xor edi, ebx | ||
543 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
544 | xor edi, ebx | ||
545 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
546 | xor edi, ebx | ||
547 | ; | ||
548 | ; Round 13 | ||
549 | mov eax, DWORD PTR 104[ebp] | ||
550 | xor ebx, ebx | ||
551 | mov edx, DWORD PTR 108[ebp] | ||
552 | xor eax, edi | ||
553 | xor edx, edi | ||
554 | and eax, 0fcfcfcfch | ||
555 | and edx, 0cfcfcfcfh | ||
556 | mov bl, al | ||
557 | mov cl, ah | ||
558 | ror edx, 4 | ||
559 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
560 | mov bl, dl | ||
561 | xor esi, ebp | ||
562 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
563 | xor esi, ebp | ||
564 | mov cl, dh | ||
565 | shr eax, 16 | ||
566 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
567 | xor esi, ebp | ||
568 | mov bl, ah | ||
569 | shr edx, 16 | ||
570 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
571 | xor esi, ebp | ||
572 | mov ebp, DWORD PTR 24[esp] | ||
573 | mov cl, dh | ||
574 | and eax, 0ffh | ||
575 | and edx, 0ffh | ||
576 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
577 | xor esi, ebx | ||
578 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
579 | xor esi, ebx | ||
580 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
581 | xor esi, ebx | ||
582 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
583 | xor esi, ebx | ||
584 | ; | ||
585 | ; Round 14 | ||
586 | mov eax, DWORD PTR 112[ebp] | ||
587 | xor ebx, ebx | ||
588 | mov edx, DWORD PTR 116[ebp] | ||
589 | xor eax, esi | ||
590 | xor edx, esi | ||
591 | and eax, 0fcfcfcfch | ||
592 | and edx, 0cfcfcfcfh | ||
593 | mov bl, al | ||
594 | mov cl, ah | ||
595 | ror edx, 4 | ||
596 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
597 | mov bl, dl | ||
598 | xor edi, ebp | ||
599 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
600 | xor edi, ebp | ||
601 | mov cl, dh | ||
602 | shr eax, 16 | ||
603 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
604 | xor edi, ebp | ||
605 | mov bl, ah | ||
606 | shr edx, 16 | ||
607 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
608 | xor edi, ebp | ||
609 | mov ebp, DWORD PTR 24[esp] | ||
610 | mov cl, dh | ||
611 | and eax, 0ffh | ||
612 | and edx, 0ffh | ||
613 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
614 | xor edi, ebx | ||
615 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
616 | xor edi, ebx | ||
617 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
618 | xor edi, ebx | ||
619 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
620 | xor edi, ebx | ||
621 | ; | ||
622 | ; Round 15 | ||
623 | mov eax, DWORD PTR 120[ebp] | ||
624 | xor ebx, ebx | ||
625 | mov edx, DWORD PTR 124[ebp] | ||
626 | xor eax, edi | ||
627 | xor edx, edi | ||
628 | and eax, 0fcfcfcfch | ||
629 | and edx, 0cfcfcfcfh | ||
630 | mov bl, al | ||
631 | mov cl, ah | ||
632 | ror edx, 4 | ||
633 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
634 | mov bl, dl | ||
635 | xor esi, ebp | ||
636 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
637 | xor esi, ebp | ||
638 | mov cl, dh | ||
639 | shr eax, 16 | ||
640 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
641 | xor esi, ebp | ||
642 | mov bl, ah | ||
643 | shr edx, 16 | ||
644 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
645 | xor esi, ebp | ||
646 | mov ebp, DWORD PTR 24[esp] | ||
647 | mov cl, dh | ||
648 | and eax, 0ffh | ||
649 | and edx, 0ffh | ||
650 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
651 | xor esi, ebx | ||
652 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
653 | xor esi, ebx | ||
654 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
655 | xor esi, ebx | ||
656 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
657 | xor esi, ebx | ||
658 | jmp $L001end | ||
659 | $L000start_decrypt: | ||
660 | ; | ||
661 | ; Round 15 | ||
662 | mov eax, DWORD PTR 120[ebp] | ||
663 | xor ebx, ebx | ||
664 | mov edx, DWORD PTR 124[ebp] | ||
665 | xor eax, esi | ||
666 | xor edx, esi | ||
667 | and eax, 0fcfcfcfch | ||
668 | and edx, 0cfcfcfcfh | ||
669 | mov bl, al | ||
670 | mov cl, ah | ||
671 | ror edx, 4 | ||
672 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
673 | mov bl, dl | ||
674 | xor edi, ebp | ||
675 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
676 | xor edi, ebp | ||
677 | mov cl, dh | ||
678 | shr eax, 16 | ||
679 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
680 | xor edi, ebp | ||
681 | mov bl, ah | ||
682 | shr edx, 16 | ||
683 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
684 | xor edi, ebp | ||
685 | mov ebp, DWORD PTR 24[esp] | ||
686 | mov cl, dh | ||
687 | and eax, 0ffh | ||
688 | and edx, 0ffh | ||
689 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
690 | xor edi, ebx | ||
691 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
692 | xor edi, ebx | ||
693 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
694 | xor edi, ebx | ||
695 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
696 | xor edi, ebx | ||
697 | ; | ||
698 | ; Round 14 | ||
699 | mov eax, DWORD PTR 112[ebp] | ||
700 | xor ebx, ebx | ||
701 | mov edx, DWORD PTR 116[ebp] | ||
702 | xor eax, edi | ||
703 | xor edx, edi | ||
704 | and eax, 0fcfcfcfch | ||
705 | and edx, 0cfcfcfcfh | ||
706 | mov bl, al | ||
707 | mov cl, ah | ||
708 | ror edx, 4 | ||
709 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
710 | mov bl, dl | ||
711 | xor esi, ebp | ||
712 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
713 | xor esi, ebp | ||
714 | mov cl, dh | ||
715 | shr eax, 16 | ||
716 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
717 | xor esi, ebp | ||
718 | mov bl, ah | ||
719 | shr edx, 16 | ||
720 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
721 | xor esi, ebp | ||
722 | mov ebp, DWORD PTR 24[esp] | ||
723 | mov cl, dh | ||
724 | and eax, 0ffh | ||
725 | and edx, 0ffh | ||
726 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
727 | xor esi, ebx | ||
728 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
729 | xor esi, ebx | ||
730 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
731 | xor esi, ebx | ||
732 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
733 | xor esi, ebx | ||
734 | ; | ||
735 | ; Round 13 | ||
736 | mov eax, DWORD PTR 104[ebp] | ||
737 | xor ebx, ebx | ||
738 | mov edx, DWORD PTR 108[ebp] | ||
739 | xor eax, esi | ||
740 | xor edx, esi | ||
741 | and eax, 0fcfcfcfch | ||
742 | and edx, 0cfcfcfcfh | ||
743 | mov bl, al | ||
744 | mov cl, ah | ||
745 | ror edx, 4 | ||
746 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
747 | mov bl, dl | ||
748 | xor edi, ebp | ||
749 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
750 | xor edi, ebp | ||
751 | mov cl, dh | ||
752 | shr eax, 16 | ||
753 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
754 | xor edi, ebp | ||
755 | mov bl, ah | ||
756 | shr edx, 16 | ||
757 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
758 | xor edi, ebp | ||
759 | mov ebp, DWORD PTR 24[esp] | ||
760 | mov cl, dh | ||
761 | and eax, 0ffh | ||
762 | and edx, 0ffh | ||
763 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
764 | xor edi, ebx | ||
765 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
766 | xor edi, ebx | ||
767 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
768 | xor edi, ebx | ||
769 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
770 | xor edi, ebx | ||
771 | ; | ||
772 | ; Round 12 | ||
773 | mov eax, DWORD PTR 96[ebp] | ||
774 | xor ebx, ebx | ||
775 | mov edx, DWORD PTR 100[ebp] | ||
776 | xor eax, edi | ||
777 | xor edx, edi | ||
778 | and eax, 0fcfcfcfch | ||
779 | and edx, 0cfcfcfcfh | ||
780 | mov bl, al | ||
781 | mov cl, ah | ||
782 | ror edx, 4 | ||
783 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
784 | mov bl, dl | ||
785 | xor esi, ebp | ||
786 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
787 | xor esi, ebp | ||
788 | mov cl, dh | ||
789 | shr eax, 16 | ||
790 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
791 | xor esi, ebp | ||
792 | mov bl, ah | ||
793 | shr edx, 16 | ||
794 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
795 | xor esi, ebp | ||
796 | mov ebp, DWORD PTR 24[esp] | ||
797 | mov cl, dh | ||
798 | and eax, 0ffh | ||
799 | and edx, 0ffh | ||
800 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
801 | xor esi, ebx | ||
802 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
803 | xor esi, ebx | ||
804 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
805 | xor esi, ebx | ||
806 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
807 | xor esi, ebx | ||
808 | ; | ||
809 | ; Round 11 | ||
810 | mov eax, DWORD PTR 88[ebp] | ||
811 | xor ebx, ebx | ||
812 | mov edx, DWORD PTR 92[ebp] | ||
813 | xor eax, esi | ||
814 | xor edx, esi | ||
815 | and eax, 0fcfcfcfch | ||
816 | and edx, 0cfcfcfcfh | ||
817 | mov bl, al | ||
818 | mov cl, ah | ||
819 | ror edx, 4 | ||
820 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
821 | mov bl, dl | ||
822 | xor edi, ebp | ||
823 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
824 | xor edi, ebp | ||
825 | mov cl, dh | ||
826 | shr eax, 16 | ||
827 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
828 | xor edi, ebp | ||
829 | mov bl, ah | ||
830 | shr edx, 16 | ||
831 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
832 | xor edi, ebp | ||
833 | mov ebp, DWORD PTR 24[esp] | ||
834 | mov cl, dh | ||
835 | and eax, 0ffh | ||
836 | and edx, 0ffh | ||
837 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
838 | xor edi, ebx | ||
839 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
840 | xor edi, ebx | ||
841 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
842 | xor edi, ebx | ||
843 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
844 | xor edi, ebx | ||
845 | ; | ||
846 | ; Round 10 | ||
847 | mov eax, DWORD PTR 80[ebp] | ||
848 | xor ebx, ebx | ||
849 | mov edx, DWORD PTR 84[ebp] | ||
850 | xor eax, edi | ||
851 | xor edx, edi | ||
852 | and eax, 0fcfcfcfch | ||
853 | and edx, 0cfcfcfcfh | ||
854 | mov bl, al | ||
855 | mov cl, ah | ||
856 | ror edx, 4 | ||
857 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
858 | mov bl, dl | ||
859 | xor esi, ebp | ||
860 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
861 | xor esi, ebp | ||
862 | mov cl, dh | ||
863 | shr eax, 16 | ||
864 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
865 | xor esi, ebp | ||
866 | mov bl, ah | ||
867 | shr edx, 16 | ||
868 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
869 | xor esi, ebp | ||
870 | mov ebp, DWORD PTR 24[esp] | ||
871 | mov cl, dh | ||
872 | and eax, 0ffh | ||
873 | and edx, 0ffh | ||
874 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
875 | xor esi, ebx | ||
876 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
877 | xor esi, ebx | ||
878 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
879 | xor esi, ebx | ||
880 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
881 | xor esi, ebx | ||
882 | ; | ||
883 | ; Round 9 | ||
884 | mov eax, DWORD PTR 72[ebp] | ||
885 | xor ebx, ebx | ||
886 | mov edx, DWORD PTR 76[ebp] | ||
887 | xor eax, esi | ||
888 | xor edx, esi | ||
889 | and eax, 0fcfcfcfch | ||
890 | and edx, 0cfcfcfcfh | ||
891 | mov bl, al | ||
892 | mov cl, ah | ||
893 | ror edx, 4 | ||
894 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
895 | mov bl, dl | ||
896 | xor edi, ebp | ||
897 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
898 | xor edi, ebp | ||
899 | mov cl, dh | ||
900 | shr eax, 16 | ||
901 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
902 | xor edi, ebp | ||
903 | mov bl, ah | ||
904 | shr edx, 16 | ||
905 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
906 | xor edi, ebp | ||
907 | mov ebp, DWORD PTR 24[esp] | ||
908 | mov cl, dh | ||
909 | and eax, 0ffh | ||
910 | and edx, 0ffh | ||
911 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
912 | xor edi, ebx | ||
913 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
914 | xor edi, ebx | ||
915 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
916 | xor edi, ebx | ||
917 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
918 | xor edi, ebx | ||
919 | ; | ||
920 | ; Round 8 | ||
921 | mov eax, DWORD PTR 64[ebp] | ||
922 | xor ebx, ebx | ||
923 | mov edx, DWORD PTR 68[ebp] | ||
924 | xor eax, edi | ||
925 | xor edx, edi | ||
926 | and eax, 0fcfcfcfch | ||
927 | and edx, 0cfcfcfcfh | ||
928 | mov bl, al | ||
929 | mov cl, ah | ||
930 | ror edx, 4 | ||
931 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
932 | mov bl, dl | ||
933 | xor esi, ebp | ||
934 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
935 | xor esi, ebp | ||
936 | mov cl, dh | ||
937 | shr eax, 16 | ||
938 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
939 | xor esi, ebp | ||
940 | mov bl, ah | ||
941 | shr edx, 16 | ||
942 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
943 | xor esi, ebp | ||
944 | mov ebp, DWORD PTR 24[esp] | ||
945 | mov cl, dh | ||
946 | and eax, 0ffh | ||
947 | and edx, 0ffh | ||
948 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
949 | xor esi, ebx | ||
950 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
951 | xor esi, ebx | ||
952 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
953 | xor esi, ebx | ||
954 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
955 | xor esi, ebx | ||
956 | ; | ||
957 | ; Round 7 | ||
958 | mov eax, DWORD PTR 56[ebp] | ||
959 | xor ebx, ebx | ||
960 | mov edx, DWORD PTR 60[ebp] | ||
961 | xor eax, esi | ||
962 | xor edx, esi | ||
963 | and eax, 0fcfcfcfch | ||
964 | and edx, 0cfcfcfcfh | ||
965 | mov bl, al | ||
966 | mov cl, ah | ||
967 | ror edx, 4 | ||
968 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
969 | mov bl, dl | ||
970 | xor edi, ebp | ||
971 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
972 | xor edi, ebp | ||
973 | mov cl, dh | ||
974 | shr eax, 16 | ||
975 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
976 | xor edi, ebp | ||
977 | mov bl, ah | ||
978 | shr edx, 16 | ||
979 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
980 | xor edi, ebp | ||
981 | mov ebp, DWORD PTR 24[esp] | ||
982 | mov cl, dh | ||
983 | and eax, 0ffh | ||
984 | and edx, 0ffh | ||
985 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
986 | xor edi, ebx | ||
987 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
988 | xor edi, ebx | ||
989 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
990 | xor edi, ebx | ||
991 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
992 | xor edi, ebx | ||
993 | ; | ||
994 | ; Round 6 | ||
995 | mov eax, DWORD PTR 48[ebp] | ||
996 | xor ebx, ebx | ||
997 | mov edx, DWORD PTR 52[ebp] | ||
998 | xor eax, edi | ||
999 | xor edx, edi | ||
1000 | and eax, 0fcfcfcfch | ||
1001 | and edx, 0cfcfcfcfh | ||
1002 | mov bl, al | ||
1003 | mov cl, ah | ||
1004 | ror edx, 4 | ||
1005 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1006 | mov bl, dl | ||
1007 | xor esi, ebp | ||
1008 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1009 | xor esi, ebp | ||
1010 | mov cl, dh | ||
1011 | shr eax, 16 | ||
1012 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1013 | xor esi, ebp | ||
1014 | mov bl, ah | ||
1015 | shr edx, 16 | ||
1016 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1017 | xor esi, ebp | ||
1018 | mov ebp, DWORD PTR 24[esp] | ||
1019 | mov cl, dh | ||
1020 | and eax, 0ffh | ||
1021 | and edx, 0ffh | ||
1022 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1023 | xor esi, ebx | ||
1024 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1025 | xor esi, ebx | ||
1026 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1027 | xor esi, ebx | ||
1028 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1029 | xor esi, ebx | ||
1030 | ; | ||
1031 | ; Round 5 | ||
1032 | mov eax, DWORD PTR 40[ebp] | ||
1033 | xor ebx, ebx | ||
1034 | mov edx, DWORD PTR 44[ebp] | ||
1035 | xor eax, esi | ||
1036 | xor edx, esi | ||
1037 | and eax, 0fcfcfcfch | ||
1038 | and edx, 0cfcfcfcfh | ||
1039 | mov bl, al | ||
1040 | mov cl, ah | ||
1041 | ror edx, 4 | ||
1042 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1043 | mov bl, dl | ||
1044 | xor edi, ebp | ||
1045 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1046 | xor edi, ebp | ||
1047 | mov cl, dh | ||
1048 | shr eax, 16 | ||
1049 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1050 | xor edi, ebp | ||
1051 | mov bl, ah | ||
1052 | shr edx, 16 | ||
1053 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1054 | xor edi, ebp | ||
1055 | mov ebp, DWORD PTR 24[esp] | ||
1056 | mov cl, dh | ||
1057 | and eax, 0ffh | ||
1058 | and edx, 0ffh | ||
1059 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1060 | xor edi, ebx | ||
1061 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1062 | xor edi, ebx | ||
1063 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1064 | xor edi, ebx | ||
1065 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1066 | xor edi, ebx | ||
1067 | ; | ||
1068 | ; Round 4 | ||
1069 | mov eax, DWORD PTR 32[ebp] | ||
1070 | xor ebx, ebx | ||
1071 | mov edx, DWORD PTR 36[ebp] | ||
1072 | xor eax, edi | ||
1073 | xor edx, edi | ||
1074 | and eax, 0fcfcfcfch | ||
1075 | and edx, 0cfcfcfcfh | ||
1076 | mov bl, al | ||
1077 | mov cl, ah | ||
1078 | ror edx, 4 | ||
1079 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1080 | mov bl, dl | ||
1081 | xor esi, ebp | ||
1082 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1083 | xor esi, ebp | ||
1084 | mov cl, dh | ||
1085 | shr eax, 16 | ||
1086 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1087 | xor esi, ebp | ||
1088 | mov bl, ah | ||
1089 | shr edx, 16 | ||
1090 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1091 | xor esi, ebp | ||
1092 | mov ebp, DWORD PTR 24[esp] | ||
1093 | mov cl, dh | ||
1094 | and eax, 0ffh | ||
1095 | and edx, 0ffh | ||
1096 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1097 | xor esi, ebx | ||
1098 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1099 | xor esi, ebx | ||
1100 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1101 | xor esi, ebx | ||
1102 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1103 | xor esi, ebx | ||
1104 | ; | ||
1105 | ; Round 3 | ||
1106 | mov eax, DWORD PTR 24[ebp] | ||
1107 | xor ebx, ebx | ||
1108 | mov edx, DWORD PTR 28[ebp] | ||
1109 | xor eax, esi | ||
1110 | xor edx, esi | ||
1111 | and eax, 0fcfcfcfch | ||
1112 | and edx, 0cfcfcfcfh | ||
1113 | mov bl, al | ||
1114 | mov cl, ah | ||
1115 | ror edx, 4 | ||
1116 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1117 | mov bl, dl | ||
1118 | xor edi, ebp | ||
1119 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1120 | xor edi, ebp | ||
1121 | mov cl, dh | ||
1122 | shr eax, 16 | ||
1123 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1124 | xor edi, ebp | ||
1125 | mov bl, ah | ||
1126 | shr edx, 16 | ||
1127 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1128 | xor edi, ebp | ||
1129 | mov ebp, DWORD PTR 24[esp] | ||
1130 | mov cl, dh | ||
1131 | and eax, 0ffh | ||
1132 | and edx, 0ffh | ||
1133 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1134 | xor edi, ebx | ||
1135 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1136 | xor edi, ebx | ||
1137 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1138 | xor edi, ebx | ||
1139 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1140 | xor edi, ebx | ||
1141 | ; | ||
1142 | ; Round 2 | ||
1143 | mov eax, DWORD PTR 16[ebp] | ||
1144 | xor ebx, ebx | ||
1145 | mov edx, DWORD PTR 20[ebp] | ||
1146 | xor eax, edi | ||
1147 | xor edx, edi | ||
1148 | and eax, 0fcfcfcfch | ||
1149 | and edx, 0cfcfcfcfh | ||
1150 | mov bl, al | ||
1151 | mov cl, ah | ||
1152 | ror edx, 4 | ||
1153 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1154 | mov bl, dl | ||
1155 | xor esi, ebp | ||
1156 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1157 | xor esi, ebp | ||
1158 | mov cl, dh | ||
1159 | shr eax, 16 | ||
1160 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1161 | xor esi, ebp | ||
1162 | mov bl, ah | ||
1163 | shr edx, 16 | ||
1164 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1165 | xor esi, ebp | ||
1166 | mov ebp, DWORD PTR 24[esp] | ||
1167 | mov cl, dh | ||
1168 | and eax, 0ffh | ||
1169 | and edx, 0ffh | ||
1170 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1171 | xor esi, ebx | ||
1172 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1173 | xor esi, ebx | ||
1174 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1175 | xor esi, ebx | ||
1176 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1177 | xor esi, ebx | ||
1178 | ; | ||
1179 | ; Round 1 | ||
1180 | mov eax, DWORD PTR 8[ebp] | ||
1181 | xor ebx, ebx | ||
1182 | mov edx, DWORD PTR 12[ebp] | ||
1183 | xor eax, esi | ||
1184 | xor edx, esi | ||
1185 | and eax, 0fcfcfcfch | ||
1186 | and edx, 0cfcfcfcfh | ||
1187 | mov bl, al | ||
1188 | mov cl, ah | ||
1189 | ror edx, 4 | ||
1190 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1191 | mov bl, dl | ||
1192 | xor edi, ebp | ||
1193 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1194 | xor edi, ebp | ||
1195 | mov cl, dh | ||
1196 | shr eax, 16 | ||
1197 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1198 | xor edi, ebp | ||
1199 | mov bl, ah | ||
1200 | shr edx, 16 | ||
1201 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1202 | xor edi, ebp | ||
1203 | mov ebp, DWORD PTR 24[esp] | ||
1204 | mov cl, dh | ||
1205 | and eax, 0ffh | ||
1206 | and edx, 0ffh | ||
1207 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1208 | xor edi, ebx | ||
1209 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1210 | xor edi, ebx | ||
1211 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1212 | xor edi, ebx | ||
1213 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1214 | xor edi, ebx | ||
1215 | ; | ||
1216 | ; Round 0 | ||
1217 | mov eax, DWORD PTR [ebp] | ||
1218 | xor ebx, ebx | ||
1219 | mov edx, DWORD PTR 4[ebp] | ||
1220 | xor eax, edi | ||
1221 | xor edx, edi | ||
1222 | and eax, 0fcfcfcfch | ||
1223 | and edx, 0cfcfcfcfh | ||
1224 | mov bl, al | ||
1225 | mov cl, ah | ||
1226 | ror edx, 4 | ||
1227 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1228 | mov bl, dl | ||
1229 | xor esi, ebp | ||
1230 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1231 | xor esi, ebp | ||
1232 | mov cl, dh | ||
1233 | shr eax, 16 | ||
1234 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1235 | xor esi, ebp | ||
1236 | mov bl, ah | ||
1237 | shr edx, 16 | ||
1238 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1239 | xor esi, ebp | ||
1240 | mov ebp, DWORD PTR 24[esp] | ||
1241 | mov cl, dh | ||
1242 | and eax, 0ffh | ||
1243 | and edx, 0ffh | ||
1244 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1245 | xor esi, ebx | ||
1246 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1247 | xor esi, ebx | ||
1248 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1249 | xor esi, ebx | ||
1250 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1251 | xor esi, ebx | ||
1252 | $L001end: | ||
1253 | ; | ||
1254 | ; FP | ||
1255 | mov edx, DWORD PTR 20[esp] | ||
1256 | ror esi, 1 | ||
1257 | mov eax, edi | ||
1258 | xor edi, esi | ||
1259 | and edi, 0aaaaaaaah | ||
1260 | xor eax, edi | ||
1261 | xor esi, edi | ||
1262 | ; | ||
1263 | rol eax, 23 | ||
1264 | mov edi, eax | ||
1265 | xor eax, esi | ||
1266 | and eax, 003fc03fch | ||
1267 | xor edi, eax | ||
1268 | xor esi, eax | ||
1269 | ; | ||
1270 | rol edi, 10 | ||
1271 | mov eax, edi | ||
1272 | xor edi, esi | ||
1273 | and edi, 033333333h | ||
1274 | xor eax, edi | ||
1275 | xor esi, edi | ||
1276 | ; | ||
1277 | rol esi, 18 | ||
1278 | mov edi, esi | ||
1279 | xor esi, eax | ||
1280 | and esi, 0fff0000fh | ||
1281 | xor edi, esi | ||
1282 | xor eax, esi | ||
1283 | ; | ||
1284 | rol edi, 12 | ||
1285 | mov esi, edi | ||
1286 | xor edi, eax | ||
1287 | and edi, 0f0f0f0f0h | ||
1288 | xor esi, edi | ||
1289 | xor eax, edi | ||
1290 | ; | ||
1291 | ror eax, 4 | ||
1292 | mov DWORD PTR [edx],eax | ||
1293 | mov DWORD PTR 4[edx],esi | ||
1294 | pop ebp | ||
1295 | pop ebx | ||
1296 | pop edi | ||
1297 | pop esi | ||
1298 | ret | ||
1299 | _des_encrypt ENDP | ||
1300 | _TEXT ENDS | ||
1301 | _TEXT SEGMENT | ||
1302 | PUBLIC _des_encrypt2 | ||
1303 | EXTRN _des_SPtrans:DWORD | ||
1304 | _des_encrypt2 PROC NEAR | ||
1305 | push esi | ||
1306 | push edi | ||
1307 | ; | ||
1308 | ; Load the 2 words | ||
1309 | mov eax, DWORD PTR 12[esp] | ||
1310 | xor ecx, ecx | ||
1311 | push ebx | ||
1312 | push ebp | ||
1313 | mov esi, DWORD PTR [eax] | ||
1314 | mov ebx, DWORD PTR 28[esp] | ||
1315 | rol esi, 3 | ||
1316 | mov edi, DWORD PTR 4[eax] | ||
1317 | rol edi, 3 | ||
1318 | mov ebp, DWORD PTR 24[esp] | ||
1319 | cmp ebx, 0 | ||
1320 | je $L002start_decrypt | ||
1321 | ; | ||
1322 | ; Round 0 | ||
1323 | mov eax, DWORD PTR [ebp] | ||
1324 | xor ebx, ebx | ||
1325 | mov edx, DWORD PTR 4[ebp] | ||
1326 | xor eax, esi | ||
1327 | xor edx, esi | ||
1328 | and eax, 0fcfcfcfch | ||
1329 | and edx, 0cfcfcfcfh | ||
1330 | mov bl, al | ||
1331 | mov cl, ah | ||
1332 | ror edx, 4 | ||
1333 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1334 | mov bl, dl | ||
1335 | xor edi, ebp | ||
1336 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1337 | xor edi, ebp | ||
1338 | mov cl, dh | ||
1339 | shr eax, 16 | ||
1340 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1341 | xor edi, ebp | ||
1342 | mov bl, ah | ||
1343 | shr edx, 16 | ||
1344 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1345 | xor edi, ebp | ||
1346 | mov ebp, DWORD PTR 24[esp] | ||
1347 | mov cl, dh | ||
1348 | and eax, 0ffh | ||
1349 | and edx, 0ffh | ||
1350 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1351 | xor edi, ebx | ||
1352 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1353 | xor edi, ebx | ||
1354 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1355 | xor edi, ebx | ||
1356 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1357 | xor edi, ebx | ||
1358 | ; | ||
1359 | ; Round 1 | ||
1360 | mov eax, DWORD PTR 8[ebp] | ||
1361 | xor ebx, ebx | ||
1362 | mov edx, DWORD PTR 12[ebp] | ||
1363 | xor eax, edi | ||
1364 | xor edx, edi | ||
1365 | and eax, 0fcfcfcfch | ||
1366 | and edx, 0cfcfcfcfh | ||
1367 | mov bl, al | ||
1368 | mov cl, ah | ||
1369 | ror edx, 4 | ||
1370 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1371 | mov bl, dl | ||
1372 | xor esi, ebp | ||
1373 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1374 | xor esi, ebp | ||
1375 | mov cl, dh | ||
1376 | shr eax, 16 | ||
1377 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1378 | xor esi, ebp | ||
1379 | mov bl, ah | ||
1380 | shr edx, 16 | ||
1381 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1382 | xor esi, ebp | ||
1383 | mov ebp, DWORD PTR 24[esp] | ||
1384 | mov cl, dh | ||
1385 | and eax, 0ffh | ||
1386 | and edx, 0ffh | ||
1387 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1388 | xor esi, ebx | ||
1389 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1390 | xor esi, ebx | ||
1391 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1392 | xor esi, ebx | ||
1393 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1394 | xor esi, ebx | ||
1395 | ; | ||
1396 | ; Round 2 | ||
1397 | mov eax, DWORD PTR 16[ebp] | ||
1398 | xor ebx, ebx | ||
1399 | mov edx, DWORD PTR 20[ebp] | ||
1400 | xor eax, esi | ||
1401 | xor edx, esi | ||
1402 | and eax, 0fcfcfcfch | ||
1403 | and edx, 0cfcfcfcfh | ||
1404 | mov bl, al | ||
1405 | mov cl, ah | ||
1406 | ror edx, 4 | ||
1407 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1408 | mov bl, dl | ||
1409 | xor edi, ebp | ||
1410 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1411 | xor edi, ebp | ||
1412 | mov cl, dh | ||
1413 | shr eax, 16 | ||
1414 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1415 | xor edi, ebp | ||
1416 | mov bl, ah | ||
1417 | shr edx, 16 | ||
1418 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1419 | xor edi, ebp | ||
1420 | mov ebp, DWORD PTR 24[esp] | ||
1421 | mov cl, dh | ||
1422 | and eax, 0ffh | ||
1423 | and edx, 0ffh | ||
1424 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1425 | xor edi, ebx | ||
1426 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1427 | xor edi, ebx | ||
1428 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1429 | xor edi, ebx | ||
1430 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1431 | xor edi, ebx | ||
1432 | ; | ||
1433 | ; Round 3 | ||
1434 | mov eax, DWORD PTR 24[ebp] | ||
1435 | xor ebx, ebx | ||
1436 | mov edx, DWORD PTR 28[ebp] | ||
1437 | xor eax, edi | ||
1438 | xor edx, edi | ||
1439 | and eax, 0fcfcfcfch | ||
1440 | and edx, 0cfcfcfcfh | ||
1441 | mov bl, al | ||
1442 | mov cl, ah | ||
1443 | ror edx, 4 | ||
1444 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1445 | mov bl, dl | ||
1446 | xor esi, ebp | ||
1447 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1448 | xor esi, ebp | ||
1449 | mov cl, dh | ||
1450 | shr eax, 16 | ||
1451 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1452 | xor esi, ebp | ||
1453 | mov bl, ah | ||
1454 | shr edx, 16 | ||
1455 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1456 | xor esi, ebp | ||
1457 | mov ebp, DWORD PTR 24[esp] | ||
1458 | mov cl, dh | ||
1459 | and eax, 0ffh | ||
1460 | and edx, 0ffh | ||
1461 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1462 | xor esi, ebx | ||
1463 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1464 | xor esi, ebx | ||
1465 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1466 | xor esi, ebx | ||
1467 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1468 | xor esi, ebx | ||
1469 | ; | ||
1470 | ; Round 4 | ||
1471 | mov eax, DWORD PTR 32[ebp] | ||
1472 | xor ebx, ebx | ||
1473 | mov edx, DWORD PTR 36[ebp] | ||
1474 | xor eax, esi | ||
1475 | xor edx, esi | ||
1476 | and eax, 0fcfcfcfch | ||
1477 | and edx, 0cfcfcfcfh | ||
1478 | mov bl, al | ||
1479 | mov cl, ah | ||
1480 | ror edx, 4 | ||
1481 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1482 | mov bl, dl | ||
1483 | xor edi, ebp | ||
1484 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1485 | xor edi, ebp | ||
1486 | mov cl, dh | ||
1487 | shr eax, 16 | ||
1488 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1489 | xor edi, ebp | ||
1490 | mov bl, ah | ||
1491 | shr edx, 16 | ||
1492 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1493 | xor edi, ebp | ||
1494 | mov ebp, DWORD PTR 24[esp] | ||
1495 | mov cl, dh | ||
1496 | and eax, 0ffh | ||
1497 | and edx, 0ffh | ||
1498 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1499 | xor edi, ebx | ||
1500 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1501 | xor edi, ebx | ||
1502 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1503 | xor edi, ebx | ||
1504 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1505 | xor edi, ebx | ||
1506 | ; | ||
1507 | ; Round 5 | ||
1508 | mov eax, DWORD PTR 40[ebp] | ||
1509 | xor ebx, ebx | ||
1510 | mov edx, DWORD PTR 44[ebp] | ||
1511 | xor eax, edi | ||
1512 | xor edx, edi | ||
1513 | and eax, 0fcfcfcfch | ||
1514 | and edx, 0cfcfcfcfh | ||
1515 | mov bl, al | ||
1516 | mov cl, ah | ||
1517 | ror edx, 4 | ||
1518 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1519 | mov bl, dl | ||
1520 | xor esi, ebp | ||
1521 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1522 | xor esi, ebp | ||
1523 | mov cl, dh | ||
1524 | shr eax, 16 | ||
1525 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1526 | xor esi, ebp | ||
1527 | mov bl, ah | ||
1528 | shr edx, 16 | ||
1529 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1530 | xor esi, ebp | ||
1531 | mov ebp, DWORD PTR 24[esp] | ||
1532 | mov cl, dh | ||
1533 | and eax, 0ffh | ||
1534 | and edx, 0ffh | ||
1535 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1536 | xor esi, ebx | ||
1537 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1538 | xor esi, ebx | ||
1539 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1540 | xor esi, ebx | ||
1541 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1542 | xor esi, ebx | ||
1543 | ; | ||
1544 | ; Round 6 | ||
1545 | mov eax, DWORD PTR 48[ebp] | ||
1546 | xor ebx, ebx | ||
1547 | mov edx, DWORD PTR 52[ebp] | ||
1548 | xor eax, esi | ||
1549 | xor edx, esi | ||
1550 | and eax, 0fcfcfcfch | ||
1551 | and edx, 0cfcfcfcfh | ||
1552 | mov bl, al | ||
1553 | mov cl, ah | ||
1554 | ror edx, 4 | ||
1555 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1556 | mov bl, dl | ||
1557 | xor edi, ebp | ||
1558 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1559 | xor edi, ebp | ||
1560 | mov cl, dh | ||
1561 | shr eax, 16 | ||
1562 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1563 | xor edi, ebp | ||
1564 | mov bl, ah | ||
1565 | shr edx, 16 | ||
1566 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1567 | xor edi, ebp | ||
1568 | mov ebp, DWORD PTR 24[esp] | ||
1569 | mov cl, dh | ||
1570 | and eax, 0ffh | ||
1571 | and edx, 0ffh | ||
1572 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1573 | xor edi, ebx | ||
1574 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1575 | xor edi, ebx | ||
1576 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1577 | xor edi, ebx | ||
1578 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1579 | xor edi, ebx | ||
1580 | ; | ||
1581 | ; Round 7 | ||
1582 | mov eax, DWORD PTR 56[ebp] | ||
1583 | xor ebx, ebx | ||
1584 | mov edx, DWORD PTR 60[ebp] | ||
1585 | xor eax, edi | ||
1586 | xor edx, edi | ||
1587 | and eax, 0fcfcfcfch | ||
1588 | and edx, 0cfcfcfcfh | ||
1589 | mov bl, al | ||
1590 | mov cl, ah | ||
1591 | ror edx, 4 | ||
1592 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1593 | mov bl, dl | ||
1594 | xor esi, ebp | ||
1595 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1596 | xor esi, ebp | ||
1597 | mov cl, dh | ||
1598 | shr eax, 16 | ||
1599 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1600 | xor esi, ebp | ||
1601 | mov bl, ah | ||
1602 | shr edx, 16 | ||
1603 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1604 | xor esi, ebp | ||
1605 | mov ebp, DWORD PTR 24[esp] | ||
1606 | mov cl, dh | ||
1607 | and eax, 0ffh | ||
1608 | and edx, 0ffh | ||
1609 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1610 | xor esi, ebx | ||
1611 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1612 | xor esi, ebx | ||
1613 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1614 | xor esi, ebx | ||
1615 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1616 | xor esi, ebx | ||
1617 | ; | ||
1618 | ; Round 8 | ||
1619 | mov eax, DWORD PTR 64[ebp] | ||
1620 | xor ebx, ebx | ||
1621 | mov edx, DWORD PTR 68[ebp] | ||
1622 | xor eax, esi | ||
1623 | xor edx, esi | ||
1624 | and eax, 0fcfcfcfch | ||
1625 | and edx, 0cfcfcfcfh | ||
1626 | mov bl, al | ||
1627 | mov cl, ah | ||
1628 | ror edx, 4 | ||
1629 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1630 | mov bl, dl | ||
1631 | xor edi, ebp | ||
1632 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1633 | xor edi, ebp | ||
1634 | mov cl, dh | ||
1635 | shr eax, 16 | ||
1636 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1637 | xor edi, ebp | ||
1638 | mov bl, ah | ||
1639 | shr edx, 16 | ||
1640 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1641 | xor edi, ebp | ||
1642 | mov ebp, DWORD PTR 24[esp] | ||
1643 | mov cl, dh | ||
1644 | and eax, 0ffh | ||
1645 | and edx, 0ffh | ||
1646 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1647 | xor edi, ebx | ||
1648 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1649 | xor edi, ebx | ||
1650 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1651 | xor edi, ebx | ||
1652 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1653 | xor edi, ebx | ||
1654 | ; | ||
1655 | ; Round 9 | ||
1656 | mov eax, DWORD PTR 72[ebp] | ||
1657 | xor ebx, ebx | ||
1658 | mov edx, DWORD PTR 76[ebp] | ||
1659 | xor eax, edi | ||
1660 | xor edx, edi | ||
1661 | and eax, 0fcfcfcfch | ||
1662 | and edx, 0cfcfcfcfh | ||
1663 | mov bl, al | ||
1664 | mov cl, ah | ||
1665 | ror edx, 4 | ||
1666 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1667 | mov bl, dl | ||
1668 | xor esi, ebp | ||
1669 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1670 | xor esi, ebp | ||
1671 | mov cl, dh | ||
1672 | shr eax, 16 | ||
1673 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1674 | xor esi, ebp | ||
1675 | mov bl, ah | ||
1676 | shr edx, 16 | ||
1677 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1678 | xor esi, ebp | ||
1679 | mov ebp, DWORD PTR 24[esp] | ||
1680 | mov cl, dh | ||
1681 | and eax, 0ffh | ||
1682 | and edx, 0ffh | ||
1683 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1684 | xor esi, ebx | ||
1685 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1686 | xor esi, ebx | ||
1687 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1688 | xor esi, ebx | ||
1689 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1690 | xor esi, ebx | ||
1691 | ; | ||
1692 | ; Round 10 | ||
1693 | mov eax, DWORD PTR 80[ebp] | ||
1694 | xor ebx, ebx | ||
1695 | mov edx, DWORD PTR 84[ebp] | ||
1696 | xor eax, esi | ||
1697 | xor edx, esi | ||
1698 | and eax, 0fcfcfcfch | ||
1699 | and edx, 0cfcfcfcfh | ||
1700 | mov bl, al | ||
1701 | mov cl, ah | ||
1702 | ror edx, 4 | ||
1703 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1704 | mov bl, dl | ||
1705 | xor edi, ebp | ||
1706 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1707 | xor edi, ebp | ||
1708 | mov cl, dh | ||
1709 | shr eax, 16 | ||
1710 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1711 | xor edi, ebp | ||
1712 | mov bl, ah | ||
1713 | shr edx, 16 | ||
1714 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1715 | xor edi, ebp | ||
1716 | mov ebp, DWORD PTR 24[esp] | ||
1717 | mov cl, dh | ||
1718 | and eax, 0ffh | ||
1719 | and edx, 0ffh | ||
1720 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1721 | xor edi, ebx | ||
1722 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1723 | xor edi, ebx | ||
1724 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1725 | xor edi, ebx | ||
1726 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1727 | xor edi, ebx | ||
1728 | ; | ||
1729 | ; Round 11 | ||
1730 | mov eax, DWORD PTR 88[ebp] | ||
1731 | xor ebx, ebx | ||
1732 | mov edx, DWORD PTR 92[ebp] | ||
1733 | xor eax, edi | ||
1734 | xor edx, edi | ||
1735 | and eax, 0fcfcfcfch | ||
1736 | and edx, 0cfcfcfcfh | ||
1737 | mov bl, al | ||
1738 | mov cl, ah | ||
1739 | ror edx, 4 | ||
1740 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1741 | mov bl, dl | ||
1742 | xor esi, ebp | ||
1743 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1744 | xor esi, ebp | ||
1745 | mov cl, dh | ||
1746 | shr eax, 16 | ||
1747 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1748 | xor esi, ebp | ||
1749 | mov bl, ah | ||
1750 | shr edx, 16 | ||
1751 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1752 | xor esi, ebp | ||
1753 | mov ebp, DWORD PTR 24[esp] | ||
1754 | mov cl, dh | ||
1755 | and eax, 0ffh | ||
1756 | and edx, 0ffh | ||
1757 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1758 | xor esi, ebx | ||
1759 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1760 | xor esi, ebx | ||
1761 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1762 | xor esi, ebx | ||
1763 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1764 | xor esi, ebx | ||
1765 | ; | ||
1766 | ; Round 12 | ||
1767 | mov eax, DWORD PTR 96[ebp] | ||
1768 | xor ebx, ebx | ||
1769 | mov edx, DWORD PTR 100[ebp] | ||
1770 | xor eax, esi | ||
1771 | xor edx, esi | ||
1772 | and eax, 0fcfcfcfch | ||
1773 | and edx, 0cfcfcfcfh | ||
1774 | mov bl, al | ||
1775 | mov cl, ah | ||
1776 | ror edx, 4 | ||
1777 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1778 | mov bl, dl | ||
1779 | xor edi, ebp | ||
1780 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1781 | xor edi, ebp | ||
1782 | mov cl, dh | ||
1783 | shr eax, 16 | ||
1784 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1785 | xor edi, ebp | ||
1786 | mov bl, ah | ||
1787 | shr edx, 16 | ||
1788 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1789 | xor edi, ebp | ||
1790 | mov ebp, DWORD PTR 24[esp] | ||
1791 | mov cl, dh | ||
1792 | and eax, 0ffh | ||
1793 | and edx, 0ffh | ||
1794 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1795 | xor edi, ebx | ||
1796 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1797 | xor edi, ebx | ||
1798 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1799 | xor edi, ebx | ||
1800 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1801 | xor edi, ebx | ||
1802 | ; | ||
1803 | ; Round 13 | ||
1804 | mov eax, DWORD PTR 104[ebp] | ||
1805 | xor ebx, ebx | ||
1806 | mov edx, DWORD PTR 108[ebp] | ||
1807 | xor eax, edi | ||
1808 | xor edx, edi | ||
1809 | and eax, 0fcfcfcfch | ||
1810 | and edx, 0cfcfcfcfh | ||
1811 | mov bl, al | ||
1812 | mov cl, ah | ||
1813 | ror edx, 4 | ||
1814 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1815 | mov bl, dl | ||
1816 | xor esi, ebp | ||
1817 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1818 | xor esi, ebp | ||
1819 | mov cl, dh | ||
1820 | shr eax, 16 | ||
1821 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1822 | xor esi, ebp | ||
1823 | mov bl, ah | ||
1824 | shr edx, 16 | ||
1825 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1826 | xor esi, ebp | ||
1827 | mov ebp, DWORD PTR 24[esp] | ||
1828 | mov cl, dh | ||
1829 | and eax, 0ffh | ||
1830 | and edx, 0ffh | ||
1831 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1832 | xor esi, ebx | ||
1833 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1834 | xor esi, ebx | ||
1835 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1836 | xor esi, ebx | ||
1837 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1838 | xor esi, ebx | ||
1839 | ; | ||
1840 | ; Round 14 | ||
1841 | mov eax, DWORD PTR 112[ebp] | ||
1842 | xor ebx, ebx | ||
1843 | mov edx, DWORD PTR 116[ebp] | ||
1844 | xor eax, esi | ||
1845 | xor edx, esi | ||
1846 | and eax, 0fcfcfcfch | ||
1847 | and edx, 0cfcfcfcfh | ||
1848 | mov bl, al | ||
1849 | mov cl, ah | ||
1850 | ror edx, 4 | ||
1851 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1852 | mov bl, dl | ||
1853 | xor edi, ebp | ||
1854 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1855 | xor edi, ebp | ||
1856 | mov cl, dh | ||
1857 | shr eax, 16 | ||
1858 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1859 | xor edi, ebp | ||
1860 | mov bl, ah | ||
1861 | shr edx, 16 | ||
1862 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1863 | xor edi, ebp | ||
1864 | mov ebp, DWORD PTR 24[esp] | ||
1865 | mov cl, dh | ||
1866 | and eax, 0ffh | ||
1867 | and edx, 0ffh | ||
1868 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1869 | xor edi, ebx | ||
1870 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1871 | xor edi, ebx | ||
1872 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1873 | xor edi, ebx | ||
1874 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1875 | xor edi, ebx | ||
1876 | ; | ||
1877 | ; Round 15 | ||
1878 | mov eax, DWORD PTR 120[ebp] | ||
1879 | xor ebx, ebx | ||
1880 | mov edx, DWORD PTR 124[ebp] | ||
1881 | xor eax, edi | ||
1882 | xor edx, edi | ||
1883 | and eax, 0fcfcfcfch | ||
1884 | and edx, 0cfcfcfcfh | ||
1885 | mov bl, al | ||
1886 | mov cl, ah | ||
1887 | ror edx, 4 | ||
1888 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1889 | mov bl, dl | ||
1890 | xor esi, ebp | ||
1891 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1892 | xor esi, ebp | ||
1893 | mov cl, dh | ||
1894 | shr eax, 16 | ||
1895 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1896 | xor esi, ebp | ||
1897 | mov bl, ah | ||
1898 | shr edx, 16 | ||
1899 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1900 | xor esi, ebp | ||
1901 | mov ebp, DWORD PTR 24[esp] | ||
1902 | mov cl, dh | ||
1903 | and eax, 0ffh | ||
1904 | and edx, 0ffh | ||
1905 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1906 | xor esi, ebx | ||
1907 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1908 | xor esi, ebx | ||
1909 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1910 | xor esi, ebx | ||
1911 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1912 | xor esi, ebx | ||
1913 | jmp $L003end | ||
1914 | $L002start_decrypt: | ||
1915 | ; | ||
1916 | ; Round 15 | ||
1917 | mov eax, DWORD PTR 120[ebp] | ||
1918 | xor ebx, ebx | ||
1919 | mov edx, DWORD PTR 124[ebp] | ||
1920 | xor eax, esi | ||
1921 | xor edx, esi | ||
1922 | and eax, 0fcfcfcfch | ||
1923 | and edx, 0cfcfcfcfh | ||
1924 | mov bl, al | ||
1925 | mov cl, ah | ||
1926 | ror edx, 4 | ||
1927 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1928 | mov bl, dl | ||
1929 | xor edi, ebp | ||
1930 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1931 | xor edi, ebp | ||
1932 | mov cl, dh | ||
1933 | shr eax, 16 | ||
1934 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1935 | xor edi, ebp | ||
1936 | mov bl, ah | ||
1937 | shr edx, 16 | ||
1938 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1939 | xor edi, ebp | ||
1940 | mov ebp, DWORD PTR 24[esp] | ||
1941 | mov cl, dh | ||
1942 | and eax, 0ffh | ||
1943 | and edx, 0ffh | ||
1944 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1945 | xor edi, ebx | ||
1946 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1947 | xor edi, ebx | ||
1948 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1949 | xor edi, ebx | ||
1950 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1951 | xor edi, ebx | ||
1952 | ; | ||
1953 | ; Round 14 | ||
1954 | mov eax, DWORD PTR 112[ebp] | ||
1955 | xor ebx, ebx | ||
1956 | mov edx, DWORD PTR 116[ebp] | ||
1957 | xor eax, edi | ||
1958 | xor edx, edi | ||
1959 | and eax, 0fcfcfcfch | ||
1960 | and edx, 0cfcfcfcfh | ||
1961 | mov bl, al | ||
1962 | mov cl, ah | ||
1963 | ror edx, 4 | ||
1964 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
1965 | mov bl, dl | ||
1966 | xor esi, ebp | ||
1967 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
1968 | xor esi, ebp | ||
1969 | mov cl, dh | ||
1970 | shr eax, 16 | ||
1971 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
1972 | xor esi, ebp | ||
1973 | mov bl, ah | ||
1974 | shr edx, 16 | ||
1975 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
1976 | xor esi, ebp | ||
1977 | mov ebp, DWORD PTR 24[esp] | ||
1978 | mov cl, dh | ||
1979 | and eax, 0ffh | ||
1980 | and edx, 0ffh | ||
1981 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
1982 | xor esi, ebx | ||
1983 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
1984 | xor esi, ebx | ||
1985 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
1986 | xor esi, ebx | ||
1987 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
1988 | xor esi, ebx | ||
1989 | ; | ||
1990 | ; Round 13 | ||
1991 | mov eax, DWORD PTR 104[ebp] | ||
1992 | xor ebx, ebx | ||
1993 | mov edx, DWORD PTR 108[ebp] | ||
1994 | xor eax, esi | ||
1995 | xor edx, esi | ||
1996 | and eax, 0fcfcfcfch | ||
1997 | and edx, 0cfcfcfcfh | ||
1998 | mov bl, al | ||
1999 | mov cl, ah | ||
2000 | ror edx, 4 | ||
2001 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2002 | mov bl, dl | ||
2003 | xor edi, ebp | ||
2004 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2005 | xor edi, ebp | ||
2006 | mov cl, dh | ||
2007 | shr eax, 16 | ||
2008 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2009 | xor edi, ebp | ||
2010 | mov bl, ah | ||
2011 | shr edx, 16 | ||
2012 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2013 | xor edi, ebp | ||
2014 | mov ebp, DWORD PTR 24[esp] | ||
2015 | mov cl, dh | ||
2016 | and eax, 0ffh | ||
2017 | and edx, 0ffh | ||
2018 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2019 | xor edi, ebx | ||
2020 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2021 | xor edi, ebx | ||
2022 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2023 | xor edi, ebx | ||
2024 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2025 | xor edi, ebx | ||
2026 | ; | ||
2027 | ; Round 12 | ||
2028 | mov eax, DWORD PTR 96[ebp] | ||
2029 | xor ebx, ebx | ||
2030 | mov edx, DWORD PTR 100[ebp] | ||
2031 | xor eax, edi | ||
2032 | xor edx, edi | ||
2033 | and eax, 0fcfcfcfch | ||
2034 | and edx, 0cfcfcfcfh | ||
2035 | mov bl, al | ||
2036 | mov cl, ah | ||
2037 | ror edx, 4 | ||
2038 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2039 | mov bl, dl | ||
2040 | xor esi, ebp | ||
2041 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2042 | xor esi, ebp | ||
2043 | mov cl, dh | ||
2044 | shr eax, 16 | ||
2045 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2046 | xor esi, ebp | ||
2047 | mov bl, ah | ||
2048 | shr edx, 16 | ||
2049 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2050 | xor esi, ebp | ||
2051 | mov ebp, DWORD PTR 24[esp] | ||
2052 | mov cl, dh | ||
2053 | and eax, 0ffh | ||
2054 | and edx, 0ffh | ||
2055 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2056 | xor esi, ebx | ||
2057 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2058 | xor esi, ebx | ||
2059 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2060 | xor esi, ebx | ||
2061 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2062 | xor esi, ebx | ||
2063 | ; | ||
2064 | ; Round 11 | ||
2065 | mov eax, DWORD PTR 88[ebp] | ||
2066 | xor ebx, ebx | ||
2067 | mov edx, DWORD PTR 92[ebp] | ||
2068 | xor eax, esi | ||
2069 | xor edx, esi | ||
2070 | and eax, 0fcfcfcfch | ||
2071 | and edx, 0cfcfcfcfh | ||
2072 | mov bl, al | ||
2073 | mov cl, ah | ||
2074 | ror edx, 4 | ||
2075 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2076 | mov bl, dl | ||
2077 | xor edi, ebp | ||
2078 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2079 | xor edi, ebp | ||
2080 | mov cl, dh | ||
2081 | shr eax, 16 | ||
2082 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2083 | xor edi, ebp | ||
2084 | mov bl, ah | ||
2085 | shr edx, 16 | ||
2086 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2087 | xor edi, ebp | ||
2088 | mov ebp, DWORD PTR 24[esp] | ||
2089 | mov cl, dh | ||
2090 | and eax, 0ffh | ||
2091 | and edx, 0ffh | ||
2092 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2093 | xor edi, ebx | ||
2094 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2095 | xor edi, ebx | ||
2096 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2097 | xor edi, ebx | ||
2098 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2099 | xor edi, ebx | ||
2100 | ; | ||
2101 | ; Round 10 | ||
2102 | mov eax, DWORD PTR 80[ebp] | ||
2103 | xor ebx, ebx | ||
2104 | mov edx, DWORD PTR 84[ebp] | ||
2105 | xor eax, edi | ||
2106 | xor edx, edi | ||
2107 | and eax, 0fcfcfcfch | ||
2108 | and edx, 0cfcfcfcfh | ||
2109 | mov bl, al | ||
2110 | mov cl, ah | ||
2111 | ror edx, 4 | ||
2112 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2113 | mov bl, dl | ||
2114 | xor esi, ebp | ||
2115 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2116 | xor esi, ebp | ||
2117 | mov cl, dh | ||
2118 | shr eax, 16 | ||
2119 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2120 | xor esi, ebp | ||
2121 | mov bl, ah | ||
2122 | shr edx, 16 | ||
2123 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2124 | xor esi, ebp | ||
2125 | mov ebp, DWORD PTR 24[esp] | ||
2126 | mov cl, dh | ||
2127 | and eax, 0ffh | ||
2128 | and edx, 0ffh | ||
2129 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2130 | xor esi, ebx | ||
2131 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2132 | xor esi, ebx | ||
2133 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2134 | xor esi, ebx | ||
2135 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2136 | xor esi, ebx | ||
2137 | ; | ||
2138 | ; Round 9 | ||
2139 | mov eax, DWORD PTR 72[ebp] | ||
2140 | xor ebx, ebx | ||
2141 | mov edx, DWORD PTR 76[ebp] | ||
2142 | xor eax, esi | ||
2143 | xor edx, esi | ||
2144 | and eax, 0fcfcfcfch | ||
2145 | and edx, 0cfcfcfcfh | ||
2146 | mov bl, al | ||
2147 | mov cl, ah | ||
2148 | ror edx, 4 | ||
2149 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2150 | mov bl, dl | ||
2151 | xor edi, ebp | ||
2152 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2153 | xor edi, ebp | ||
2154 | mov cl, dh | ||
2155 | shr eax, 16 | ||
2156 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2157 | xor edi, ebp | ||
2158 | mov bl, ah | ||
2159 | shr edx, 16 | ||
2160 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2161 | xor edi, ebp | ||
2162 | mov ebp, DWORD PTR 24[esp] | ||
2163 | mov cl, dh | ||
2164 | and eax, 0ffh | ||
2165 | and edx, 0ffh | ||
2166 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2167 | xor edi, ebx | ||
2168 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2169 | xor edi, ebx | ||
2170 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2171 | xor edi, ebx | ||
2172 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2173 | xor edi, ebx | ||
2174 | ; | ||
2175 | ; Round 8 | ||
2176 | mov eax, DWORD PTR 64[ebp] | ||
2177 | xor ebx, ebx | ||
2178 | mov edx, DWORD PTR 68[ebp] | ||
2179 | xor eax, edi | ||
2180 | xor edx, edi | ||
2181 | and eax, 0fcfcfcfch | ||
2182 | and edx, 0cfcfcfcfh | ||
2183 | mov bl, al | ||
2184 | mov cl, ah | ||
2185 | ror edx, 4 | ||
2186 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2187 | mov bl, dl | ||
2188 | xor esi, ebp | ||
2189 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2190 | xor esi, ebp | ||
2191 | mov cl, dh | ||
2192 | shr eax, 16 | ||
2193 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2194 | xor esi, ebp | ||
2195 | mov bl, ah | ||
2196 | shr edx, 16 | ||
2197 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2198 | xor esi, ebp | ||
2199 | mov ebp, DWORD PTR 24[esp] | ||
2200 | mov cl, dh | ||
2201 | and eax, 0ffh | ||
2202 | and edx, 0ffh | ||
2203 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2204 | xor esi, ebx | ||
2205 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2206 | xor esi, ebx | ||
2207 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2208 | xor esi, ebx | ||
2209 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2210 | xor esi, ebx | ||
2211 | ; | ||
2212 | ; Round 7 | ||
2213 | mov eax, DWORD PTR 56[ebp] | ||
2214 | xor ebx, ebx | ||
2215 | mov edx, DWORD PTR 60[ebp] | ||
2216 | xor eax, esi | ||
2217 | xor edx, esi | ||
2218 | and eax, 0fcfcfcfch | ||
2219 | and edx, 0cfcfcfcfh | ||
2220 | mov bl, al | ||
2221 | mov cl, ah | ||
2222 | ror edx, 4 | ||
2223 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2224 | mov bl, dl | ||
2225 | xor edi, ebp | ||
2226 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2227 | xor edi, ebp | ||
2228 | mov cl, dh | ||
2229 | shr eax, 16 | ||
2230 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2231 | xor edi, ebp | ||
2232 | mov bl, ah | ||
2233 | shr edx, 16 | ||
2234 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2235 | xor edi, ebp | ||
2236 | mov ebp, DWORD PTR 24[esp] | ||
2237 | mov cl, dh | ||
2238 | and eax, 0ffh | ||
2239 | and edx, 0ffh | ||
2240 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2241 | xor edi, ebx | ||
2242 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2243 | xor edi, ebx | ||
2244 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2245 | xor edi, ebx | ||
2246 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2247 | xor edi, ebx | ||
2248 | ; | ||
2249 | ; Round 6 | ||
2250 | mov eax, DWORD PTR 48[ebp] | ||
2251 | xor ebx, ebx | ||
2252 | mov edx, DWORD PTR 52[ebp] | ||
2253 | xor eax, edi | ||
2254 | xor edx, edi | ||
2255 | and eax, 0fcfcfcfch | ||
2256 | and edx, 0cfcfcfcfh | ||
2257 | mov bl, al | ||
2258 | mov cl, ah | ||
2259 | ror edx, 4 | ||
2260 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2261 | mov bl, dl | ||
2262 | xor esi, ebp | ||
2263 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2264 | xor esi, ebp | ||
2265 | mov cl, dh | ||
2266 | shr eax, 16 | ||
2267 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2268 | xor esi, ebp | ||
2269 | mov bl, ah | ||
2270 | shr edx, 16 | ||
2271 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2272 | xor esi, ebp | ||
2273 | mov ebp, DWORD PTR 24[esp] | ||
2274 | mov cl, dh | ||
2275 | and eax, 0ffh | ||
2276 | and edx, 0ffh | ||
2277 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2278 | xor esi, ebx | ||
2279 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2280 | xor esi, ebx | ||
2281 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2282 | xor esi, ebx | ||
2283 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2284 | xor esi, ebx | ||
2285 | ; | ||
2286 | ; Round 5 | ||
2287 | mov eax, DWORD PTR 40[ebp] | ||
2288 | xor ebx, ebx | ||
2289 | mov edx, DWORD PTR 44[ebp] | ||
2290 | xor eax, esi | ||
2291 | xor edx, esi | ||
2292 | and eax, 0fcfcfcfch | ||
2293 | and edx, 0cfcfcfcfh | ||
2294 | mov bl, al | ||
2295 | mov cl, ah | ||
2296 | ror edx, 4 | ||
2297 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2298 | mov bl, dl | ||
2299 | xor edi, ebp | ||
2300 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2301 | xor edi, ebp | ||
2302 | mov cl, dh | ||
2303 | shr eax, 16 | ||
2304 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2305 | xor edi, ebp | ||
2306 | mov bl, ah | ||
2307 | shr edx, 16 | ||
2308 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2309 | xor edi, ebp | ||
2310 | mov ebp, DWORD PTR 24[esp] | ||
2311 | mov cl, dh | ||
2312 | and eax, 0ffh | ||
2313 | and edx, 0ffh | ||
2314 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2315 | xor edi, ebx | ||
2316 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2317 | xor edi, ebx | ||
2318 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2319 | xor edi, ebx | ||
2320 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2321 | xor edi, ebx | ||
2322 | ; | ||
2323 | ; Round 4 | ||
2324 | mov eax, DWORD PTR 32[ebp] | ||
2325 | xor ebx, ebx | ||
2326 | mov edx, DWORD PTR 36[ebp] | ||
2327 | xor eax, edi | ||
2328 | xor edx, edi | ||
2329 | and eax, 0fcfcfcfch | ||
2330 | and edx, 0cfcfcfcfh | ||
2331 | mov bl, al | ||
2332 | mov cl, ah | ||
2333 | ror edx, 4 | ||
2334 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2335 | mov bl, dl | ||
2336 | xor esi, ebp | ||
2337 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2338 | xor esi, ebp | ||
2339 | mov cl, dh | ||
2340 | shr eax, 16 | ||
2341 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2342 | xor esi, ebp | ||
2343 | mov bl, ah | ||
2344 | shr edx, 16 | ||
2345 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2346 | xor esi, ebp | ||
2347 | mov ebp, DWORD PTR 24[esp] | ||
2348 | mov cl, dh | ||
2349 | and eax, 0ffh | ||
2350 | and edx, 0ffh | ||
2351 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2352 | xor esi, ebx | ||
2353 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2354 | xor esi, ebx | ||
2355 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2356 | xor esi, ebx | ||
2357 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2358 | xor esi, ebx | ||
2359 | ; | ||
2360 | ; Round 3 | ||
2361 | mov eax, DWORD PTR 24[ebp] | ||
2362 | xor ebx, ebx | ||
2363 | mov edx, DWORD PTR 28[ebp] | ||
2364 | xor eax, esi | ||
2365 | xor edx, esi | ||
2366 | and eax, 0fcfcfcfch | ||
2367 | and edx, 0cfcfcfcfh | ||
2368 | mov bl, al | ||
2369 | mov cl, ah | ||
2370 | ror edx, 4 | ||
2371 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2372 | mov bl, dl | ||
2373 | xor edi, ebp | ||
2374 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2375 | xor edi, ebp | ||
2376 | mov cl, dh | ||
2377 | shr eax, 16 | ||
2378 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2379 | xor edi, ebp | ||
2380 | mov bl, ah | ||
2381 | shr edx, 16 | ||
2382 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2383 | xor edi, ebp | ||
2384 | mov ebp, DWORD PTR 24[esp] | ||
2385 | mov cl, dh | ||
2386 | and eax, 0ffh | ||
2387 | and edx, 0ffh | ||
2388 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2389 | xor edi, ebx | ||
2390 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2391 | xor edi, ebx | ||
2392 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2393 | xor edi, ebx | ||
2394 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2395 | xor edi, ebx | ||
2396 | ; | ||
2397 | ; Round 2 | ||
2398 | mov eax, DWORD PTR 16[ebp] | ||
2399 | xor ebx, ebx | ||
2400 | mov edx, DWORD PTR 20[ebp] | ||
2401 | xor eax, edi | ||
2402 | xor edx, edi | ||
2403 | and eax, 0fcfcfcfch | ||
2404 | and edx, 0cfcfcfcfh | ||
2405 | mov bl, al | ||
2406 | mov cl, ah | ||
2407 | ror edx, 4 | ||
2408 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2409 | mov bl, dl | ||
2410 | xor esi, ebp | ||
2411 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2412 | xor esi, ebp | ||
2413 | mov cl, dh | ||
2414 | shr eax, 16 | ||
2415 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2416 | xor esi, ebp | ||
2417 | mov bl, ah | ||
2418 | shr edx, 16 | ||
2419 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2420 | xor esi, ebp | ||
2421 | mov ebp, DWORD PTR 24[esp] | ||
2422 | mov cl, dh | ||
2423 | and eax, 0ffh | ||
2424 | and edx, 0ffh | ||
2425 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2426 | xor esi, ebx | ||
2427 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2428 | xor esi, ebx | ||
2429 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2430 | xor esi, ebx | ||
2431 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2432 | xor esi, ebx | ||
2433 | ; | ||
2434 | ; Round 1 | ||
2435 | mov eax, DWORD PTR 8[ebp] | ||
2436 | xor ebx, ebx | ||
2437 | mov edx, DWORD PTR 12[ebp] | ||
2438 | xor eax, esi | ||
2439 | xor edx, esi | ||
2440 | and eax, 0fcfcfcfch | ||
2441 | and edx, 0cfcfcfcfh | ||
2442 | mov bl, al | ||
2443 | mov cl, ah | ||
2444 | ror edx, 4 | ||
2445 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2446 | mov bl, dl | ||
2447 | xor edi, ebp | ||
2448 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2449 | xor edi, ebp | ||
2450 | mov cl, dh | ||
2451 | shr eax, 16 | ||
2452 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2453 | xor edi, ebp | ||
2454 | mov bl, ah | ||
2455 | shr edx, 16 | ||
2456 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2457 | xor edi, ebp | ||
2458 | mov ebp, DWORD PTR 24[esp] | ||
2459 | mov cl, dh | ||
2460 | and eax, 0ffh | ||
2461 | and edx, 0ffh | ||
2462 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2463 | xor edi, ebx | ||
2464 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2465 | xor edi, ebx | ||
2466 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2467 | xor edi, ebx | ||
2468 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2469 | xor edi, ebx | ||
2470 | ; | ||
2471 | ; Round 0 | ||
2472 | mov eax, DWORD PTR [ebp] | ||
2473 | xor ebx, ebx | ||
2474 | mov edx, DWORD PTR 4[ebp] | ||
2475 | xor eax, edi | ||
2476 | xor edx, edi | ||
2477 | and eax, 0fcfcfcfch | ||
2478 | and edx, 0cfcfcfcfh | ||
2479 | mov bl, al | ||
2480 | mov cl, ah | ||
2481 | ror edx, 4 | ||
2482 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
2483 | mov bl, dl | ||
2484 | xor esi, ebp | ||
2485 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
2486 | xor esi, ebp | ||
2487 | mov cl, dh | ||
2488 | shr eax, 16 | ||
2489 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
2490 | xor esi, ebp | ||
2491 | mov bl, ah | ||
2492 | shr edx, 16 | ||
2493 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
2494 | xor esi, ebp | ||
2495 | mov ebp, DWORD PTR 24[esp] | ||
2496 | mov cl, dh | ||
2497 | and eax, 0ffh | ||
2498 | and edx, 0ffh | ||
2499 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
2500 | xor esi, ebx | ||
2501 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
2502 | xor esi, ebx | ||
2503 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
2504 | xor esi, ebx | ||
2505 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
2506 | xor esi, ebx | ||
2507 | $L003end: | ||
2508 | ; | ||
2509 | ; Fixup | ||
2510 | ror edi, 3 | ||
2511 | mov eax, DWORD PTR 20[esp] | ||
2512 | ror esi, 3 | ||
2513 | mov DWORD PTR [eax],edi | ||
2514 | mov DWORD PTR 4[eax],esi | ||
2515 | pop ebp | ||
2516 | pop ebx | ||
2517 | pop edi | ||
2518 | pop esi | ||
2519 | ret | ||
2520 | _des_encrypt2 ENDP | ||
2521 | _TEXT ENDS | ||
2522 | _TEXT SEGMENT | ||
2523 | PUBLIC _des_encrypt3 | ||
2524 | |||
2525 | _des_encrypt3 PROC NEAR | ||
2526 | push ebx | ||
2527 | mov ebx, DWORD PTR 8[esp] | ||
2528 | push ebp | ||
2529 | push esi | ||
2530 | push edi | ||
2531 | ; | ||
2532 | ; Load the data words | ||
2533 | mov edi, DWORD PTR [ebx] | ||
2534 | mov esi, DWORD PTR 4[ebx] | ||
2535 | sub esp, 12 | ||
2536 | ; | ||
2537 | ; IP | ||
2538 | rol edi, 4 | ||
2539 | mov edx, edi | ||
2540 | xor edi, esi | ||
2541 | and edi, 0f0f0f0f0h | ||
2542 | xor edx, edi | ||
2543 | xor esi, edi | ||
2544 | ; | ||
2545 | rol esi, 20 | ||
2546 | mov edi, esi | ||
2547 | xor esi, edx | ||
2548 | and esi, 0fff0000fh | ||
2549 | xor edi, esi | ||
2550 | xor edx, esi | ||
2551 | ; | ||
2552 | rol edi, 14 | ||
2553 | mov esi, edi | ||
2554 | xor edi, edx | ||
2555 | and edi, 033333333h | ||
2556 | xor esi, edi | ||
2557 | xor edx, edi | ||
2558 | ; | ||
2559 | rol edx, 22 | ||
2560 | mov edi, edx | ||
2561 | xor edx, esi | ||
2562 | and edx, 003fc03fch | ||
2563 | xor edi, edx | ||
2564 | xor esi, edx | ||
2565 | ; | ||
2566 | rol edi, 9 | ||
2567 | mov edx, edi | ||
2568 | xor edi, esi | ||
2569 | and edi, 0aaaaaaaah | ||
2570 | xor edx, edi | ||
2571 | xor esi, edi | ||
2572 | ; | ||
2573 | ror edx, 3 | ||
2574 | ror esi, 2 | ||
2575 | mov DWORD PTR 4[ebx],esi | ||
2576 | mov eax, DWORD PTR 36[esp] | ||
2577 | mov DWORD PTR [ebx],edx | ||
2578 | mov edi, DWORD PTR 40[esp] | ||
2579 | mov esi, DWORD PTR 44[esp] | ||
2580 | mov DWORD PTR 8[esp],1 | ||
2581 | mov DWORD PTR 4[esp],eax | ||
2582 | mov DWORD PTR [esp],ebx | ||
2583 | call _des_encrypt2 | ||
2584 | mov DWORD PTR 8[esp],0 | ||
2585 | mov DWORD PTR 4[esp],edi | ||
2586 | mov DWORD PTR [esp],ebx | ||
2587 | call _des_encrypt2 | ||
2588 | mov DWORD PTR 8[esp],1 | ||
2589 | mov DWORD PTR 4[esp],esi | ||
2590 | mov DWORD PTR [esp],ebx | ||
2591 | call _des_encrypt2 | ||
2592 | add esp, 12 | ||
2593 | mov edi, DWORD PTR [ebx] | ||
2594 | mov esi, DWORD PTR 4[ebx] | ||
2595 | ; | ||
2596 | ; FP | ||
2597 | rol esi, 2 | ||
2598 | rol edi, 3 | ||
2599 | mov eax, edi | ||
2600 | xor edi, esi | ||
2601 | and edi, 0aaaaaaaah | ||
2602 | xor eax, edi | ||
2603 | xor esi, edi | ||
2604 | ; | ||
2605 | rol eax, 23 | ||
2606 | mov edi, eax | ||
2607 | xor eax, esi | ||
2608 | and eax, 003fc03fch | ||
2609 | xor edi, eax | ||
2610 | xor esi, eax | ||
2611 | ; | ||
2612 | rol edi, 10 | ||
2613 | mov eax, edi | ||
2614 | xor edi, esi | ||
2615 | and edi, 033333333h | ||
2616 | xor eax, edi | ||
2617 | xor esi, edi | ||
2618 | ; | ||
2619 | rol esi, 18 | ||
2620 | mov edi, esi | ||
2621 | xor esi, eax | ||
2622 | and esi, 0fff0000fh | ||
2623 | xor edi, esi | ||
2624 | xor eax, esi | ||
2625 | ; | ||
2626 | rol edi, 12 | ||
2627 | mov esi, edi | ||
2628 | xor edi, eax | ||
2629 | and edi, 0f0f0f0f0h | ||
2630 | xor esi, edi | ||
2631 | xor eax, edi | ||
2632 | ; | ||
2633 | ror eax, 4 | ||
2634 | mov DWORD PTR [ebx],eax | ||
2635 | mov DWORD PTR 4[ebx],esi | ||
2636 | pop edi | ||
2637 | pop esi | ||
2638 | pop ebp | ||
2639 | pop ebx | ||
2640 | ret | ||
2641 | _des_encrypt3 ENDP | ||
2642 | _TEXT ENDS | ||
2643 | _TEXT SEGMENT | ||
2644 | PUBLIC _des_decrypt3 | ||
2645 | |||
2646 | _des_decrypt3 PROC NEAR | ||
2647 | push ebx | ||
2648 | mov ebx, DWORD PTR 8[esp] | ||
2649 | push ebp | ||
2650 | push esi | ||
2651 | push edi | ||
2652 | ; | ||
2653 | ; Load the data words | ||
2654 | mov edi, DWORD PTR [ebx] | ||
2655 | mov esi, DWORD PTR 4[ebx] | ||
2656 | sub esp, 12 | ||
2657 | ; | ||
2658 | ; IP | ||
2659 | rol edi, 4 | ||
2660 | mov edx, edi | ||
2661 | xor edi, esi | ||
2662 | and edi, 0f0f0f0f0h | ||
2663 | xor edx, edi | ||
2664 | xor esi, edi | ||
2665 | ; | ||
2666 | rol esi, 20 | ||
2667 | mov edi, esi | ||
2668 | xor esi, edx | ||
2669 | and esi, 0fff0000fh | ||
2670 | xor edi, esi | ||
2671 | xor edx, esi | ||
2672 | ; | ||
2673 | rol edi, 14 | ||
2674 | mov esi, edi | ||
2675 | xor edi, edx | ||
2676 | and edi, 033333333h | ||
2677 | xor esi, edi | ||
2678 | xor edx, edi | ||
2679 | ; | ||
2680 | rol edx, 22 | ||
2681 | mov edi, edx | ||
2682 | xor edx, esi | ||
2683 | and edx, 003fc03fch | ||
2684 | xor edi, edx | ||
2685 | xor esi, edx | ||
2686 | ; | ||
2687 | rol edi, 9 | ||
2688 | mov edx, edi | ||
2689 | xor edi, esi | ||
2690 | and edi, 0aaaaaaaah | ||
2691 | xor edx, edi | ||
2692 | xor esi, edi | ||
2693 | ; | ||
2694 | ror edx, 3 | ||
2695 | ror esi, 2 | ||
2696 | mov DWORD PTR 4[ebx],esi | ||
2697 | mov esi, DWORD PTR 36[esp] | ||
2698 | mov DWORD PTR [ebx],edx | ||
2699 | mov edi, DWORD PTR 40[esp] | ||
2700 | mov eax, DWORD PTR 44[esp] | ||
2701 | mov DWORD PTR 8[esp],0 | ||
2702 | mov DWORD PTR 4[esp],eax | ||
2703 | mov DWORD PTR [esp],ebx | ||
2704 | call _des_encrypt2 | ||
2705 | mov DWORD PTR 8[esp],1 | ||
2706 | mov DWORD PTR 4[esp],edi | ||
2707 | mov DWORD PTR [esp],ebx | ||
2708 | call _des_encrypt2 | ||
2709 | mov DWORD PTR 8[esp],0 | ||
2710 | mov DWORD PTR 4[esp],esi | ||
2711 | mov DWORD PTR [esp],ebx | ||
2712 | call _des_encrypt2 | ||
2713 | add esp, 12 | ||
2714 | mov edi, DWORD PTR [ebx] | ||
2715 | mov esi, DWORD PTR 4[ebx] | ||
2716 | ; | ||
2717 | ; FP | ||
2718 | rol esi, 2 | ||
2719 | rol edi, 3 | ||
2720 | mov eax, edi | ||
2721 | xor edi, esi | ||
2722 | and edi, 0aaaaaaaah | ||
2723 | xor eax, edi | ||
2724 | xor esi, edi | ||
2725 | ; | ||
2726 | rol eax, 23 | ||
2727 | mov edi, eax | ||
2728 | xor eax, esi | ||
2729 | and eax, 003fc03fch | ||
2730 | xor edi, eax | ||
2731 | xor esi, eax | ||
2732 | ; | ||
2733 | rol edi, 10 | ||
2734 | mov eax, edi | ||
2735 | xor edi, esi | ||
2736 | and edi, 033333333h | ||
2737 | xor eax, edi | ||
2738 | xor esi, edi | ||
2739 | ; | ||
2740 | rol esi, 18 | ||
2741 | mov edi, esi | ||
2742 | xor esi, eax | ||
2743 | and esi, 0fff0000fh | ||
2744 | xor edi, esi | ||
2745 | xor eax, esi | ||
2746 | ; | ||
2747 | rol edi, 12 | ||
2748 | mov esi, edi | ||
2749 | xor edi, eax | ||
2750 | and edi, 0f0f0f0f0h | ||
2751 | xor esi, edi | ||
2752 | xor eax, edi | ||
2753 | ; | ||
2754 | ror eax, 4 | ||
2755 | mov DWORD PTR [ebx],eax | ||
2756 | mov DWORD PTR 4[ebx],esi | ||
2757 | pop edi | ||
2758 | pop esi | ||
2759 | pop ebp | ||
2760 | pop ebx | ||
2761 | ret | ||
2762 | _des_decrypt3 ENDP | ||
2763 | _TEXT ENDS | ||
2764 | _TEXT SEGMENT | ||
2765 | PUBLIC _des_ncbc_encrypt | ||
2766 | |||
2767 | _des_ncbc_encrypt PROC NEAR | ||
2768 | ; | ||
2769 | push ebp | ||
2770 | push ebx | ||
2771 | push esi | ||
2772 | push edi | ||
2773 | mov ebp, DWORD PTR 28[esp] | ||
2774 | ; getting iv ptr from parameter 4 | ||
2775 | mov ebx, DWORD PTR 36[esp] | ||
2776 | mov esi, DWORD PTR [ebx] | ||
2777 | mov edi, DWORD PTR 4[ebx] | ||
2778 | push edi | ||
2779 | push esi | ||
2780 | push edi | ||
2781 | push esi | ||
2782 | mov ebx, esp | ||
2783 | mov esi, DWORD PTR 36[esp] | ||
2784 | mov edi, DWORD PTR 40[esp] | ||
2785 | ; getting encrypt flag from parameter 5 | ||
2786 | mov ecx, DWORD PTR 56[esp] | ||
2787 | ; get and push parameter 5 | ||
2788 | push ecx | ||
2789 | ; get and push parameter 3 | ||
2790 | mov eax, DWORD PTR 52[esp] | ||
2791 | push eax | ||
2792 | push ebx | ||
2793 | cmp ecx, 0 | ||
2794 | jz $L004decrypt | ||
2795 | and ebp, 4294967288 | ||
2796 | mov eax, DWORD PTR 12[esp] | ||
2797 | mov ebx, DWORD PTR 16[esp] | ||
2798 | jz $L005encrypt_finish | ||
2799 | L006encrypt_loop: | ||
2800 | mov ecx, DWORD PTR [esi] | ||
2801 | mov edx, DWORD PTR 4[esi] | ||
2802 | xor eax, ecx | ||
2803 | xor ebx, edx | ||
2804 | mov DWORD PTR 12[esp],eax | ||
2805 | mov DWORD PTR 16[esp],ebx | ||
2806 | call _des_encrypt | ||
2807 | mov eax, DWORD PTR 12[esp] | ||
2808 | mov ebx, DWORD PTR 16[esp] | ||
2809 | mov DWORD PTR [edi],eax | ||
2810 | mov DWORD PTR 4[edi],ebx | ||
2811 | add esi, 8 | ||
2812 | add edi, 8 | ||
2813 | sub ebp, 8 | ||
2814 | jnz L006encrypt_loop | ||
2815 | $L005encrypt_finish: | ||
2816 | mov ebp, DWORD PTR 56[esp] | ||
2817 | and ebp, 7 | ||
2818 | jz $L007finish | ||
2819 | xor ecx, ecx | ||
2820 | xor edx, edx | ||
2821 | mov ebp, DWORD PTR $L008cbc_enc_jmp_table[ebp*4] | ||
2822 | jmp ebp | ||
2823 | L009ej7: | ||
2824 | mov dh, BYTE PTR 6[esi] | ||
2825 | shl edx, 8 | ||
2826 | L010ej6: | ||
2827 | mov dh, BYTE PTR 5[esi] | ||
2828 | L011ej5: | ||
2829 | mov dl, BYTE PTR 4[esi] | ||
2830 | L012ej4: | ||
2831 | mov ecx, DWORD PTR [esi] | ||
2832 | jmp $L013ejend | ||
2833 | L014ej3: | ||
2834 | mov ch, BYTE PTR 2[esi] | ||
2835 | shl ecx, 8 | ||
2836 | L015ej2: | ||
2837 | mov ch, BYTE PTR 1[esi] | ||
2838 | L016ej1: | ||
2839 | mov cl, BYTE PTR [esi] | ||
2840 | $L013ejend: | ||
2841 | xor eax, ecx | ||
2842 | xor ebx, edx | ||
2843 | mov DWORD PTR 12[esp],eax | ||
2844 | mov DWORD PTR 16[esp],ebx | ||
2845 | call _des_encrypt | ||
2846 | mov eax, DWORD PTR 12[esp] | ||
2847 | mov ebx, DWORD PTR 16[esp] | ||
2848 | mov DWORD PTR [edi],eax | ||
2849 | mov DWORD PTR 4[edi],ebx | ||
2850 | jmp $L007finish | ||
2851 | $L004decrypt: | ||
2852 | and ebp, 4294967288 | ||
2853 | mov eax, DWORD PTR 20[esp] | ||
2854 | mov ebx, DWORD PTR 24[esp] | ||
2855 | jz $L017decrypt_finish | ||
2856 | L018decrypt_loop: | ||
2857 | mov eax, DWORD PTR [esi] | ||
2858 | mov ebx, DWORD PTR 4[esi] | ||
2859 | mov DWORD PTR 12[esp],eax | ||
2860 | mov DWORD PTR 16[esp],ebx | ||
2861 | call _des_encrypt | ||
2862 | mov eax, DWORD PTR 12[esp] | ||
2863 | mov ebx, DWORD PTR 16[esp] | ||
2864 | mov ecx, DWORD PTR 20[esp] | ||
2865 | mov edx, DWORD PTR 24[esp] | ||
2866 | xor ecx, eax | ||
2867 | xor edx, ebx | ||
2868 | mov eax, DWORD PTR [esi] | ||
2869 | mov ebx, DWORD PTR 4[esi] | ||
2870 | mov DWORD PTR [edi],ecx | ||
2871 | mov DWORD PTR 4[edi],edx | ||
2872 | mov DWORD PTR 20[esp],eax | ||
2873 | mov DWORD PTR 24[esp],ebx | ||
2874 | add esi, 8 | ||
2875 | add edi, 8 | ||
2876 | sub ebp, 8 | ||
2877 | jnz L018decrypt_loop | ||
2878 | $L017decrypt_finish: | ||
2879 | mov ebp, DWORD PTR 56[esp] | ||
2880 | and ebp, 7 | ||
2881 | jz $L007finish | ||
2882 | mov eax, DWORD PTR [esi] | ||
2883 | mov ebx, DWORD PTR 4[esi] | ||
2884 | mov DWORD PTR 12[esp],eax | ||
2885 | mov DWORD PTR 16[esp],ebx | ||
2886 | call _des_encrypt | ||
2887 | mov eax, DWORD PTR 12[esp] | ||
2888 | mov ebx, DWORD PTR 16[esp] | ||
2889 | mov ecx, DWORD PTR 20[esp] | ||
2890 | mov edx, DWORD PTR 24[esp] | ||
2891 | xor ecx, eax | ||
2892 | xor edx, ebx | ||
2893 | mov eax, DWORD PTR [esi] | ||
2894 | mov ebx, DWORD PTR 4[esi] | ||
2895 | L019dj7: | ||
2896 | ror edx, 16 | ||
2897 | mov BYTE PTR 6[edi],dl | ||
2898 | shr edx, 16 | ||
2899 | L020dj6: | ||
2900 | mov BYTE PTR 5[edi],dh | ||
2901 | L021dj5: | ||
2902 | mov BYTE PTR 4[edi],dl | ||
2903 | L022dj4: | ||
2904 | mov DWORD PTR [edi],ecx | ||
2905 | jmp $L023djend | ||
2906 | L024dj3: | ||
2907 | ror ecx, 16 | ||
2908 | mov BYTE PTR 2[edi],cl | ||
2909 | shl ecx, 16 | ||
2910 | L025dj2: | ||
2911 | mov BYTE PTR 1[esi],ch | ||
2912 | L026dj1: | ||
2913 | mov BYTE PTR [esi], cl | ||
2914 | $L023djend: | ||
2915 | jmp $L007finish | ||
2916 | $L007finish: | ||
2917 | mov ecx, DWORD PTR 64[esp] | ||
2918 | add esp, 28 | ||
2919 | mov DWORD PTR [ecx],eax | ||
2920 | mov DWORD PTR 4[ecx],ebx | ||
2921 | pop edi | ||
2922 | pop esi | ||
2923 | pop ebx | ||
2924 | pop ebp | ||
2925 | ret | ||
2926 | $L008cbc_enc_jmp_table: | ||
2927 | DD 0 | ||
2928 | DD L016ej1 | ||
2929 | DD L015ej2 | ||
2930 | DD L014ej3 | ||
2931 | DD L012ej4 | ||
2932 | DD L011ej5 | ||
2933 | DD L010ej6 | ||
2934 | DD L009ej7 | ||
2935 | L027cbc_dec_jmp_table: | ||
2936 | DD 0 | ||
2937 | DD L026dj1 | ||
2938 | DD L025dj2 | ||
2939 | DD L024dj3 | ||
2940 | DD L022dj4 | ||
2941 | DD L021dj5 | ||
2942 | DD L020dj6 | ||
2943 | DD L019dj7 | ||
2944 | _des_ncbc_encrypt ENDP | ||
2945 | _TEXT ENDS | ||
2946 | _TEXT SEGMENT | ||
2947 | PUBLIC _des_ede3_cbc_encrypt | ||
2948 | |||
2949 | _des_ede3_cbc_encrypt PROC NEAR | ||
2950 | ; | ||
2951 | push ebp | ||
2952 | push ebx | ||
2953 | push esi | ||
2954 | push edi | ||
2955 | mov ebp, DWORD PTR 28[esp] | ||
2956 | ; getting iv ptr from parameter 6 | ||
2957 | mov ebx, DWORD PTR 44[esp] | ||
2958 | mov esi, DWORD PTR [ebx] | ||
2959 | mov edi, DWORD PTR 4[ebx] | ||
2960 | push edi | ||
2961 | push esi | ||
2962 | push edi | ||
2963 | push esi | ||
2964 | mov ebx, esp | ||
2965 | mov esi, DWORD PTR 36[esp] | ||
2966 | mov edi, DWORD PTR 40[esp] | ||
2967 | ; getting encrypt flag from parameter 7 | ||
2968 | mov ecx, DWORD PTR 64[esp] | ||
2969 | ; get and push parameter 5 | ||
2970 | mov eax, DWORD PTR 56[esp] | ||
2971 | push eax | ||
2972 | ; get and push parameter 4 | ||
2973 | mov eax, DWORD PTR 56[esp] | ||
2974 | push eax | ||
2975 | ; get and push parameter 3 | ||
2976 | mov eax, DWORD PTR 56[esp] | ||
2977 | push eax | ||
2978 | push ebx | ||
2979 | cmp ecx, 0 | ||
2980 | jz $L028decrypt | ||
2981 | and ebp, 4294967288 | ||
2982 | mov eax, DWORD PTR 16[esp] | ||
2983 | mov ebx, DWORD PTR 20[esp] | ||
2984 | jz $L029encrypt_finish | ||
2985 | L030encrypt_loop: | ||
2986 | mov ecx, DWORD PTR [esi] | ||
2987 | mov edx, DWORD PTR 4[esi] | ||
2988 | xor eax, ecx | ||
2989 | xor ebx, edx | ||
2990 | mov DWORD PTR 16[esp],eax | ||
2991 | mov DWORD PTR 20[esp],ebx | ||
2992 | call _des_encrypt3 | ||
2993 | mov eax, DWORD PTR 16[esp] | ||
2994 | mov ebx, DWORD PTR 20[esp] | ||
2995 | mov DWORD PTR [edi],eax | ||
2996 | mov DWORD PTR 4[edi],ebx | ||
2997 | add esi, 8 | ||
2998 | add edi, 8 | ||
2999 | sub ebp, 8 | ||
3000 | jnz L030encrypt_loop | ||
3001 | $L029encrypt_finish: | ||
3002 | mov ebp, DWORD PTR 60[esp] | ||
3003 | and ebp, 7 | ||
3004 | jz $L031finish | ||
3005 | xor ecx, ecx | ||
3006 | xor edx, edx | ||
3007 | mov ebp, DWORD PTR $L032cbc_enc_jmp_table[ebp*4] | ||
3008 | jmp ebp | ||
3009 | L033ej7: | ||
3010 | mov dh, BYTE PTR 6[esi] | ||
3011 | shl edx, 8 | ||
3012 | L034ej6: | ||
3013 | mov dh, BYTE PTR 5[esi] | ||
3014 | L035ej5: | ||
3015 | mov dl, BYTE PTR 4[esi] | ||
3016 | L036ej4: | ||
3017 | mov ecx, DWORD PTR [esi] | ||
3018 | jmp $L037ejend | ||
3019 | L038ej3: | ||
3020 | mov ch, BYTE PTR 2[esi] | ||
3021 | shl ecx, 8 | ||
3022 | L039ej2: | ||
3023 | mov ch, BYTE PTR 1[esi] | ||
3024 | L040ej1: | ||
3025 | mov cl, BYTE PTR [esi] | ||
3026 | $L037ejend: | ||
3027 | xor eax, ecx | ||
3028 | xor ebx, edx | ||
3029 | mov DWORD PTR 16[esp],eax | ||
3030 | mov DWORD PTR 20[esp],ebx | ||
3031 | call _des_encrypt3 | ||
3032 | mov eax, DWORD PTR 16[esp] | ||
3033 | mov ebx, DWORD PTR 20[esp] | ||
3034 | mov DWORD PTR [edi],eax | ||
3035 | mov DWORD PTR 4[edi],ebx | ||
3036 | jmp $L031finish | ||
3037 | $L028decrypt: | ||
3038 | and ebp, 4294967288 | ||
3039 | mov eax, DWORD PTR 24[esp] | ||
3040 | mov ebx, DWORD PTR 28[esp] | ||
3041 | jz $L041decrypt_finish | ||
3042 | L042decrypt_loop: | ||
3043 | mov eax, DWORD PTR [esi] | ||
3044 | mov ebx, DWORD PTR 4[esi] | ||
3045 | mov DWORD PTR 16[esp],eax | ||
3046 | mov DWORD PTR 20[esp],ebx | ||
3047 | call _des_decrypt3 | ||
3048 | mov eax, DWORD PTR 16[esp] | ||
3049 | mov ebx, DWORD PTR 20[esp] | ||
3050 | mov ecx, DWORD PTR 24[esp] | ||
3051 | mov edx, DWORD PTR 28[esp] | ||
3052 | xor ecx, eax | ||
3053 | xor edx, ebx | ||
3054 | mov eax, DWORD PTR [esi] | ||
3055 | mov ebx, DWORD PTR 4[esi] | ||
3056 | mov DWORD PTR [edi],ecx | ||
3057 | mov DWORD PTR 4[edi],edx | ||
3058 | mov DWORD PTR 24[esp],eax | ||
3059 | mov DWORD PTR 28[esp],ebx | ||
3060 | add esi, 8 | ||
3061 | add edi, 8 | ||
3062 | sub ebp, 8 | ||
3063 | jnz L042decrypt_loop | ||
3064 | $L041decrypt_finish: | ||
3065 | mov ebp, DWORD PTR 60[esp] | ||
3066 | and ebp, 7 | ||
3067 | jz $L031finish | ||
3068 | mov eax, DWORD PTR [esi] | ||
3069 | mov ebx, DWORD PTR 4[esi] | ||
3070 | mov DWORD PTR 16[esp],eax | ||
3071 | mov DWORD PTR 20[esp],ebx | ||
3072 | call _des_decrypt3 | ||
3073 | mov eax, DWORD PTR 16[esp] | ||
3074 | mov ebx, DWORD PTR 20[esp] | ||
3075 | mov ecx, DWORD PTR 24[esp] | ||
3076 | mov edx, DWORD PTR 28[esp] | ||
3077 | xor ecx, eax | ||
3078 | xor edx, ebx | ||
3079 | mov eax, DWORD PTR [esi] | ||
3080 | mov ebx, DWORD PTR 4[esi] | ||
3081 | L043dj7: | ||
3082 | ror edx, 16 | ||
3083 | mov BYTE PTR 6[edi],dl | ||
3084 | shr edx, 16 | ||
3085 | L044dj6: | ||
3086 | mov BYTE PTR 5[edi],dh | ||
3087 | L045dj5: | ||
3088 | mov BYTE PTR 4[edi],dl | ||
3089 | L046dj4: | ||
3090 | mov DWORD PTR [edi],ecx | ||
3091 | jmp $L047djend | ||
3092 | L048dj3: | ||
3093 | ror ecx, 16 | ||
3094 | mov BYTE PTR 2[edi],cl | ||
3095 | shl ecx, 16 | ||
3096 | L049dj2: | ||
3097 | mov BYTE PTR 1[esi],ch | ||
3098 | L050dj1: | ||
3099 | mov BYTE PTR [esi], cl | ||
3100 | $L047djend: | ||
3101 | jmp $L031finish | ||
3102 | $L031finish: | ||
3103 | mov ecx, DWORD PTR 76[esp] | ||
3104 | add esp, 32 | ||
3105 | mov DWORD PTR [ecx],eax | ||
3106 | mov DWORD PTR 4[ecx],ebx | ||
3107 | pop edi | ||
3108 | pop esi | ||
3109 | pop ebx | ||
3110 | pop ebp | ||
3111 | ret | ||
3112 | $L032cbc_enc_jmp_table: | ||
3113 | DD 0 | ||
3114 | DD L040ej1 | ||
3115 | DD L039ej2 | ||
3116 | DD L038ej3 | ||
3117 | DD L036ej4 | ||
3118 | DD L035ej5 | ||
3119 | DD L034ej6 | ||
3120 | DD L033ej7 | ||
3121 | L051cbc_dec_jmp_table: | ||
3122 | DD 0 | ||
3123 | DD L050dj1 | ||
3124 | DD L049dj2 | ||
3125 | DD L048dj3 | ||
3126 | DD L046dj4 | ||
3127 | DD L045dj5 | ||
3128 | DD L044dj6 | ||
3129 | DD L043dj7 | ||
3130 | _des_ede3_cbc_encrypt ENDP | ||
3131 | _TEXT ENDS | ||
3132 | END | ||
diff --git a/src/lib/libcrypto/des/asm/y-win32.asm b/src/lib/libcrypto/des/asm/y-win32.asm index af5c102422..e69de29bb2 100644 --- a/src/lib/libcrypto/des/asm/y-win32.asm +++ b/src/lib/libcrypto/des/asm/y-win32.asm | |||
@@ -1,929 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by crypt586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE crypt586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _fcrypt_body | ||
12 | EXTRN _des_SPtrans:DWORD | ||
13 | _fcrypt_body PROC NEAR | ||
14 | push ebp | ||
15 | push ebx | ||
16 | push esi | ||
17 | push edi | ||
18 | ; | ||
19 | ; Load the 2 words | ||
20 | xor edi, edi | ||
21 | xor esi, esi | ||
22 | mov ebp, DWORD PTR 24[esp] | ||
23 | push 25 | ||
24 | L000start: | ||
25 | ; | ||
26 | ; Round 0 | ||
27 | mov eax, DWORD PTR 32[esp] | ||
28 | mov edx, esi | ||
29 | shr edx, 16 | ||
30 | mov ecx, DWORD PTR 36[esp] | ||
31 | xor edx, esi | ||
32 | and eax, edx | ||
33 | and edx, ecx | ||
34 | mov ebx, eax | ||
35 | shl ebx, 16 | ||
36 | mov ecx, edx | ||
37 | shl ecx, 16 | ||
38 | xor eax, ebx | ||
39 | xor edx, ecx | ||
40 | mov ebx, DWORD PTR [ebp] | ||
41 | xor eax, ebx | ||
42 | mov ecx, DWORD PTR 4[ebp] | ||
43 | xor eax, esi | ||
44 | xor edx, esi | ||
45 | xor edx, ecx | ||
46 | and eax, 0fcfcfcfch | ||
47 | xor ebx, ebx | ||
48 | and edx, 0cfcfcfcfh | ||
49 | xor ecx, ecx | ||
50 | mov bl, al | ||
51 | mov cl, ah | ||
52 | ror edx, 4 | ||
53 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
54 | mov bl, dl | ||
55 | xor edi, ebp | ||
56 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
57 | xor edi, ebp | ||
58 | mov cl, dh | ||
59 | shr eax, 16 | ||
60 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
61 | xor edi, ebp | ||
62 | mov bl, ah | ||
63 | shr edx, 16 | ||
64 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
65 | xor edi, ebp | ||
66 | mov ebp, DWORD PTR 28[esp] | ||
67 | mov cl, dh | ||
68 | and eax, 0ffh | ||
69 | and edx, 0ffh | ||
70 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
71 | xor edi, ebx | ||
72 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
73 | xor edi, ebx | ||
74 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
75 | xor edi, ebx | ||
76 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
77 | xor edi, ebx | ||
78 | ; | ||
79 | ; Round 1 | ||
80 | mov eax, DWORD PTR 32[esp] | ||
81 | mov edx, edi | ||
82 | shr edx, 16 | ||
83 | mov ecx, DWORD PTR 36[esp] | ||
84 | xor edx, edi | ||
85 | and eax, edx | ||
86 | and edx, ecx | ||
87 | mov ebx, eax | ||
88 | shl ebx, 16 | ||
89 | mov ecx, edx | ||
90 | shl ecx, 16 | ||
91 | xor eax, ebx | ||
92 | xor edx, ecx | ||
93 | mov ebx, DWORD PTR 8[ebp] | ||
94 | xor eax, ebx | ||
95 | mov ecx, DWORD PTR 12[ebp] | ||
96 | xor eax, edi | ||
97 | xor edx, edi | ||
98 | xor edx, ecx | ||
99 | and eax, 0fcfcfcfch | ||
100 | xor ebx, ebx | ||
101 | and edx, 0cfcfcfcfh | ||
102 | xor ecx, ecx | ||
103 | mov bl, al | ||
104 | mov cl, ah | ||
105 | ror edx, 4 | ||
106 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
107 | mov bl, dl | ||
108 | xor esi, ebp | ||
109 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
110 | xor esi, ebp | ||
111 | mov cl, dh | ||
112 | shr eax, 16 | ||
113 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
114 | xor esi, ebp | ||
115 | mov bl, ah | ||
116 | shr edx, 16 | ||
117 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
118 | xor esi, ebp | ||
119 | mov ebp, DWORD PTR 28[esp] | ||
120 | mov cl, dh | ||
121 | and eax, 0ffh | ||
122 | and edx, 0ffh | ||
123 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
124 | xor esi, ebx | ||
125 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
126 | xor esi, ebx | ||
127 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
128 | xor esi, ebx | ||
129 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
130 | xor esi, ebx | ||
131 | ; | ||
132 | ; Round 2 | ||
133 | mov eax, DWORD PTR 32[esp] | ||
134 | mov edx, esi | ||
135 | shr edx, 16 | ||
136 | mov ecx, DWORD PTR 36[esp] | ||
137 | xor edx, esi | ||
138 | and eax, edx | ||
139 | and edx, ecx | ||
140 | mov ebx, eax | ||
141 | shl ebx, 16 | ||
142 | mov ecx, edx | ||
143 | shl ecx, 16 | ||
144 | xor eax, ebx | ||
145 | xor edx, ecx | ||
146 | mov ebx, DWORD PTR 16[ebp] | ||
147 | xor eax, ebx | ||
148 | mov ecx, DWORD PTR 20[ebp] | ||
149 | xor eax, esi | ||
150 | xor edx, esi | ||
151 | xor edx, ecx | ||
152 | and eax, 0fcfcfcfch | ||
153 | xor ebx, ebx | ||
154 | and edx, 0cfcfcfcfh | ||
155 | xor ecx, ecx | ||
156 | mov bl, al | ||
157 | mov cl, ah | ||
158 | ror edx, 4 | ||
159 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
160 | mov bl, dl | ||
161 | xor edi, ebp | ||
162 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
163 | xor edi, ebp | ||
164 | mov cl, dh | ||
165 | shr eax, 16 | ||
166 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
167 | xor edi, ebp | ||
168 | mov bl, ah | ||
169 | shr edx, 16 | ||
170 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
171 | xor edi, ebp | ||
172 | mov ebp, DWORD PTR 28[esp] | ||
173 | mov cl, dh | ||
174 | and eax, 0ffh | ||
175 | and edx, 0ffh | ||
176 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
177 | xor edi, ebx | ||
178 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
179 | xor edi, ebx | ||
180 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
181 | xor edi, ebx | ||
182 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
183 | xor edi, ebx | ||
184 | ; | ||
185 | ; Round 3 | ||
186 | mov eax, DWORD PTR 32[esp] | ||
187 | mov edx, edi | ||
188 | shr edx, 16 | ||
189 | mov ecx, DWORD PTR 36[esp] | ||
190 | xor edx, edi | ||
191 | and eax, edx | ||
192 | and edx, ecx | ||
193 | mov ebx, eax | ||
194 | shl ebx, 16 | ||
195 | mov ecx, edx | ||
196 | shl ecx, 16 | ||
197 | xor eax, ebx | ||
198 | xor edx, ecx | ||
199 | mov ebx, DWORD PTR 24[ebp] | ||
200 | xor eax, ebx | ||
201 | mov ecx, DWORD PTR 28[ebp] | ||
202 | xor eax, edi | ||
203 | xor edx, edi | ||
204 | xor edx, ecx | ||
205 | and eax, 0fcfcfcfch | ||
206 | xor ebx, ebx | ||
207 | and edx, 0cfcfcfcfh | ||
208 | xor ecx, ecx | ||
209 | mov bl, al | ||
210 | mov cl, ah | ||
211 | ror edx, 4 | ||
212 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
213 | mov bl, dl | ||
214 | xor esi, ebp | ||
215 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
216 | xor esi, ebp | ||
217 | mov cl, dh | ||
218 | shr eax, 16 | ||
219 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
220 | xor esi, ebp | ||
221 | mov bl, ah | ||
222 | shr edx, 16 | ||
223 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
224 | xor esi, ebp | ||
225 | mov ebp, DWORD PTR 28[esp] | ||
226 | mov cl, dh | ||
227 | and eax, 0ffh | ||
228 | and edx, 0ffh | ||
229 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
230 | xor esi, ebx | ||
231 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
232 | xor esi, ebx | ||
233 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
234 | xor esi, ebx | ||
235 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
236 | xor esi, ebx | ||
237 | ; | ||
238 | ; Round 4 | ||
239 | mov eax, DWORD PTR 32[esp] | ||
240 | mov edx, esi | ||
241 | shr edx, 16 | ||
242 | mov ecx, DWORD PTR 36[esp] | ||
243 | xor edx, esi | ||
244 | and eax, edx | ||
245 | and edx, ecx | ||
246 | mov ebx, eax | ||
247 | shl ebx, 16 | ||
248 | mov ecx, edx | ||
249 | shl ecx, 16 | ||
250 | xor eax, ebx | ||
251 | xor edx, ecx | ||
252 | mov ebx, DWORD PTR 32[ebp] | ||
253 | xor eax, ebx | ||
254 | mov ecx, DWORD PTR 36[ebp] | ||
255 | xor eax, esi | ||
256 | xor edx, esi | ||
257 | xor edx, ecx | ||
258 | and eax, 0fcfcfcfch | ||
259 | xor ebx, ebx | ||
260 | and edx, 0cfcfcfcfh | ||
261 | xor ecx, ecx | ||
262 | mov bl, al | ||
263 | mov cl, ah | ||
264 | ror edx, 4 | ||
265 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
266 | mov bl, dl | ||
267 | xor edi, ebp | ||
268 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
269 | xor edi, ebp | ||
270 | mov cl, dh | ||
271 | shr eax, 16 | ||
272 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
273 | xor edi, ebp | ||
274 | mov bl, ah | ||
275 | shr edx, 16 | ||
276 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
277 | xor edi, ebp | ||
278 | mov ebp, DWORD PTR 28[esp] | ||
279 | mov cl, dh | ||
280 | and eax, 0ffh | ||
281 | and edx, 0ffh | ||
282 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
283 | xor edi, ebx | ||
284 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
285 | xor edi, ebx | ||
286 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
287 | xor edi, ebx | ||
288 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
289 | xor edi, ebx | ||
290 | ; | ||
291 | ; Round 5 | ||
292 | mov eax, DWORD PTR 32[esp] | ||
293 | mov edx, edi | ||
294 | shr edx, 16 | ||
295 | mov ecx, DWORD PTR 36[esp] | ||
296 | xor edx, edi | ||
297 | and eax, edx | ||
298 | and edx, ecx | ||
299 | mov ebx, eax | ||
300 | shl ebx, 16 | ||
301 | mov ecx, edx | ||
302 | shl ecx, 16 | ||
303 | xor eax, ebx | ||
304 | xor edx, ecx | ||
305 | mov ebx, DWORD PTR 40[ebp] | ||
306 | xor eax, ebx | ||
307 | mov ecx, DWORD PTR 44[ebp] | ||
308 | xor eax, edi | ||
309 | xor edx, edi | ||
310 | xor edx, ecx | ||
311 | and eax, 0fcfcfcfch | ||
312 | xor ebx, ebx | ||
313 | and edx, 0cfcfcfcfh | ||
314 | xor ecx, ecx | ||
315 | mov bl, al | ||
316 | mov cl, ah | ||
317 | ror edx, 4 | ||
318 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
319 | mov bl, dl | ||
320 | xor esi, ebp | ||
321 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
322 | xor esi, ebp | ||
323 | mov cl, dh | ||
324 | shr eax, 16 | ||
325 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
326 | xor esi, ebp | ||
327 | mov bl, ah | ||
328 | shr edx, 16 | ||
329 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
330 | xor esi, ebp | ||
331 | mov ebp, DWORD PTR 28[esp] | ||
332 | mov cl, dh | ||
333 | and eax, 0ffh | ||
334 | and edx, 0ffh | ||
335 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
336 | xor esi, ebx | ||
337 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
338 | xor esi, ebx | ||
339 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
340 | xor esi, ebx | ||
341 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
342 | xor esi, ebx | ||
343 | ; | ||
344 | ; Round 6 | ||
345 | mov eax, DWORD PTR 32[esp] | ||
346 | mov edx, esi | ||
347 | shr edx, 16 | ||
348 | mov ecx, DWORD PTR 36[esp] | ||
349 | xor edx, esi | ||
350 | and eax, edx | ||
351 | and edx, ecx | ||
352 | mov ebx, eax | ||
353 | shl ebx, 16 | ||
354 | mov ecx, edx | ||
355 | shl ecx, 16 | ||
356 | xor eax, ebx | ||
357 | xor edx, ecx | ||
358 | mov ebx, DWORD PTR 48[ebp] | ||
359 | xor eax, ebx | ||
360 | mov ecx, DWORD PTR 52[ebp] | ||
361 | xor eax, esi | ||
362 | xor edx, esi | ||
363 | xor edx, ecx | ||
364 | and eax, 0fcfcfcfch | ||
365 | xor ebx, ebx | ||
366 | and edx, 0cfcfcfcfh | ||
367 | xor ecx, ecx | ||
368 | mov bl, al | ||
369 | mov cl, ah | ||
370 | ror edx, 4 | ||
371 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
372 | mov bl, dl | ||
373 | xor edi, ebp | ||
374 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
375 | xor edi, ebp | ||
376 | mov cl, dh | ||
377 | shr eax, 16 | ||
378 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
379 | xor edi, ebp | ||
380 | mov bl, ah | ||
381 | shr edx, 16 | ||
382 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
383 | xor edi, ebp | ||
384 | mov ebp, DWORD PTR 28[esp] | ||
385 | mov cl, dh | ||
386 | and eax, 0ffh | ||
387 | and edx, 0ffh | ||
388 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
389 | xor edi, ebx | ||
390 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
391 | xor edi, ebx | ||
392 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
393 | xor edi, ebx | ||
394 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
395 | xor edi, ebx | ||
396 | ; | ||
397 | ; Round 7 | ||
398 | mov eax, DWORD PTR 32[esp] | ||
399 | mov edx, edi | ||
400 | shr edx, 16 | ||
401 | mov ecx, DWORD PTR 36[esp] | ||
402 | xor edx, edi | ||
403 | and eax, edx | ||
404 | and edx, ecx | ||
405 | mov ebx, eax | ||
406 | shl ebx, 16 | ||
407 | mov ecx, edx | ||
408 | shl ecx, 16 | ||
409 | xor eax, ebx | ||
410 | xor edx, ecx | ||
411 | mov ebx, DWORD PTR 56[ebp] | ||
412 | xor eax, ebx | ||
413 | mov ecx, DWORD PTR 60[ebp] | ||
414 | xor eax, edi | ||
415 | xor edx, edi | ||
416 | xor edx, ecx | ||
417 | and eax, 0fcfcfcfch | ||
418 | xor ebx, ebx | ||
419 | and edx, 0cfcfcfcfh | ||
420 | xor ecx, ecx | ||
421 | mov bl, al | ||
422 | mov cl, ah | ||
423 | ror edx, 4 | ||
424 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
425 | mov bl, dl | ||
426 | xor esi, ebp | ||
427 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
428 | xor esi, ebp | ||
429 | mov cl, dh | ||
430 | shr eax, 16 | ||
431 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
432 | xor esi, ebp | ||
433 | mov bl, ah | ||
434 | shr edx, 16 | ||
435 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
436 | xor esi, ebp | ||
437 | mov ebp, DWORD PTR 28[esp] | ||
438 | mov cl, dh | ||
439 | and eax, 0ffh | ||
440 | and edx, 0ffh | ||
441 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
442 | xor esi, ebx | ||
443 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
444 | xor esi, ebx | ||
445 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
446 | xor esi, ebx | ||
447 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
448 | xor esi, ebx | ||
449 | ; | ||
450 | ; Round 8 | ||
451 | mov eax, DWORD PTR 32[esp] | ||
452 | mov edx, esi | ||
453 | shr edx, 16 | ||
454 | mov ecx, DWORD PTR 36[esp] | ||
455 | xor edx, esi | ||
456 | and eax, edx | ||
457 | and edx, ecx | ||
458 | mov ebx, eax | ||
459 | shl ebx, 16 | ||
460 | mov ecx, edx | ||
461 | shl ecx, 16 | ||
462 | xor eax, ebx | ||
463 | xor edx, ecx | ||
464 | mov ebx, DWORD PTR 64[ebp] | ||
465 | xor eax, ebx | ||
466 | mov ecx, DWORD PTR 68[ebp] | ||
467 | xor eax, esi | ||
468 | xor edx, esi | ||
469 | xor edx, ecx | ||
470 | and eax, 0fcfcfcfch | ||
471 | xor ebx, ebx | ||
472 | and edx, 0cfcfcfcfh | ||
473 | xor ecx, ecx | ||
474 | mov bl, al | ||
475 | mov cl, ah | ||
476 | ror edx, 4 | ||
477 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
478 | mov bl, dl | ||
479 | xor edi, ebp | ||
480 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
481 | xor edi, ebp | ||
482 | mov cl, dh | ||
483 | shr eax, 16 | ||
484 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
485 | xor edi, ebp | ||
486 | mov bl, ah | ||
487 | shr edx, 16 | ||
488 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
489 | xor edi, ebp | ||
490 | mov ebp, DWORD PTR 28[esp] | ||
491 | mov cl, dh | ||
492 | and eax, 0ffh | ||
493 | and edx, 0ffh | ||
494 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
495 | xor edi, ebx | ||
496 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
497 | xor edi, ebx | ||
498 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
499 | xor edi, ebx | ||
500 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
501 | xor edi, ebx | ||
502 | ; | ||
503 | ; Round 9 | ||
504 | mov eax, DWORD PTR 32[esp] | ||
505 | mov edx, edi | ||
506 | shr edx, 16 | ||
507 | mov ecx, DWORD PTR 36[esp] | ||
508 | xor edx, edi | ||
509 | and eax, edx | ||
510 | and edx, ecx | ||
511 | mov ebx, eax | ||
512 | shl ebx, 16 | ||
513 | mov ecx, edx | ||
514 | shl ecx, 16 | ||
515 | xor eax, ebx | ||
516 | xor edx, ecx | ||
517 | mov ebx, DWORD PTR 72[ebp] | ||
518 | xor eax, ebx | ||
519 | mov ecx, DWORD PTR 76[ebp] | ||
520 | xor eax, edi | ||
521 | xor edx, edi | ||
522 | xor edx, ecx | ||
523 | and eax, 0fcfcfcfch | ||
524 | xor ebx, ebx | ||
525 | and edx, 0cfcfcfcfh | ||
526 | xor ecx, ecx | ||
527 | mov bl, al | ||
528 | mov cl, ah | ||
529 | ror edx, 4 | ||
530 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
531 | mov bl, dl | ||
532 | xor esi, ebp | ||
533 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
534 | xor esi, ebp | ||
535 | mov cl, dh | ||
536 | shr eax, 16 | ||
537 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
538 | xor esi, ebp | ||
539 | mov bl, ah | ||
540 | shr edx, 16 | ||
541 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
542 | xor esi, ebp | ||
543 | mov ebp, DWORD PTR 28[esp] | ||
544 | mov cl, dh | ||
545 | and eax, 0ffh | ||
546 | and edx, 0ffh | ||
547 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
548 | xor esi, ebx | ||
549 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
550 | xor esi, ebx | ||
551 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
552 | xor esi, ebx | ||
553 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
554 | xor esi, ebx | ||
555 | ; | ||
556 | ; Round 10 | ||
557 | mov eax, DWORD PTR 32[esp] | ||
558 | mov edx, esi | ||
559 | shr edx, 16 | ||
560 | mov ecx, DWORD PTR 36[esp] | ||
561 | xor edx, esi | ||
562 | and eax, edx | ||
563 | and edx, ecx | ||
564 | mov ebx, eax | ||
565 | shl ebx, 16 | ||
566 | mov ecx, edx | ||
567 | shl ecx, 16 | ||
568 | xor eax, ebx | ||
569 | xor edx, ecx | ||
570 | mov ebx, DWORD PTR 80[ebp] | ||
571 | xor eax, ebx | ||
572 | mov ecx, DWORD PTR 84[ebp] | ||
573 | xor eax, esi | ||
574 | xor edx, esi | ||
575 | xor edx, ecx | ||
576 | and eax, 0fcfcfcfch | ||
577 | xor ebx, ebx | ||
578 | and edx, 0cfcfcfcfh | ||
579 | xor ecx, ecx | ||
580 | mov bl, al | ||
581 | mov cl, ah | ||
582 | ror edx, 4 | ||
583 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
584 | mov bl, dl | ||
585 | xor edi, ebp | ||
586 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
587 | xor edi, ebp | ||
588 | mov cl, dh | ||
589 | shr eax, 16 | ||
590 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
591 | xor edi, ebp | ||
592 | mov bl, ah | ||
593 | shr edx, 16 | ||
594 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
595 | xor edi, ebp | ||
596 | mov ebp, DWORD PTR 28[esp] | ||
597 | mov cl, dh | ||
598 | and eax, 0ffh | ||
599 | and edx, 0ffh | ||
600 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
601 | xor edi, ebx | ||
602 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
603 | xor edi, ebx | ||
604 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
605 | xor edi, ebx | ||
606 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
607 | xor edi, ebx | ||
608 | ; | ||
609 | ; Round 11 | ||
610 | mov eax, DWORD PTR 32[esp] | ||
611 | mov edx, edi | ||
612 | shr edx, 16 | ||
613 | mov ecx, DWORD PTR 36[esp] | ||
614 | xor edx, edi | ||
615 | and eax, edx | ||
616 | and edx, ecx | ||
617 | mov ebx, eax | ||
618 | shl ebx, 16 | ||
619 | mov ecx, edx | ||
620 | shl ecx, 16 | ||
621 | xor eax, ebx | ||
622 | xor edx, ecx | ||
623 | mov ebx, DWORD PTR 88[ebp] | ||
624 | xor eax, ebx | ||
625 | mov ecx, DWORD PTR 92[ebp] | ||
626 | xor eax, edi | ||
627 | xor edx, edi | ||
628 | xor edx, ecx | ||
629 | and eax, 0fcfcfcfch | ||
630 | xor ebx, ebx | ||
631 | and edx, 0cfcfcfcfh | ||
632 | xor ecx, ecx | ||
633 | mov bl, al | ||
634 | mov cl, ah | ||
635 | ror edx, 4 | ||
636 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
637 | mov bl, dl | ||
638 | xor esi, ebp | ||
639 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
640 | xor esi, ebp | ||
641 | mov cl, dh | ||
642 | shr eax, 16 | ||
643 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
644 | xor esi, ebp | ||
645 | mov bl, ah | ||
646 | shr edx, 16 | ||
647 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
648 | xor esi, ebp | ||
649 | mov ebp, DWORD PTR 28[esp] | ||
650 | mov cl, dh | ||
651 | and eax, 0ffh | ||
652 | and edx, 0ffh | ||
653 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
654 | xor esi, ebx | ||
655 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
656 | xor esi, ebx | ||
657 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
658 | xor esi, ebx | ||
659 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
660 | xor esi, ebx | ||
661 | ; | ||
662 | ; Round 12 | ||
663 | mov eax, DWORD PTR 32[esp] | ||
664 | mov edx, esi | ||
665 | shr edx, 16 | ||
666 | mov ecx, DWORD PTR 36[esp] | ||
667 | xor edx, esi | ||
668 | and eax, edx | ||
669 | and edx, ecx | ||
670 | mov ebx, eax | ||
671 | shl ebx, 16 | ||
672 | mov ecx, edx | ||
673 | shl ecx, 16 | ||
674 | xor eax, ebx | ||
675 | xor edx, ecx | ||
676 | mov ebx, DWORD PTR 96[ebp] | ||
677 | xor eax, ebx | ||
678 | mov ecx, DWORD PTR 100[ebp] | ||
679 | xor eax, esi | ||
680 | xor edx, esi | ||
681 | xor edx, ecx | ||
682 | and eax, 0fcfcfcfch | ||
683 | xor ebx, ebx | ||
684 | and edx, 0cfcfcfcfh | ||
685 | xor ecx, ecx | ||
686 | mov bl, al | ||
687 | mov cl, ah | ||
688 | ror edx, 4 | ||
689 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
690 | mov bl, dl | ||
691 | xor edi, ebp | ||
692 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
693 | xor edi, ebp | ||
694 | mov cl, dh | ||
695 | shr eax, 16 | ||
696 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
697 | xor edi, ebp | ||
698 | mov bl, ah | ||
699 | shr edx, 16 | ||
700 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
701 | xor edi, ebp | ||
702 | mov ebp, DWORD PTR 28[esp] | ||
703 | mov cl, dh | ||
704 | and eax, 0ffh | ||
705 | and edx, 0ffh | ||
706 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
707 | xor edi, ebx | ||
708 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
709 | xor edi, ebx | ||
710 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
711 | xor edi, ebx | ||
712 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
713 | xor edi, ebx | ||
714 | ; | ||
715 | ; Round 13 | ||
716 | mov eax, DWORD PTR 32[esp] | ||
717 | mov edx, edi | ||
718 | shr edx, 16 | ||
719 | mov ecx, DWORD PTR 36[esp] | ||
720 | xor edx, edi | ||
721 | and eax, edx | ||
722 | and edx, ecx | ||
723 | mov ebx, eax | ||
724 | shl ebx, 16 | ||
725 | mov ecx, edx | ||
726 | shl ecx, 16 | ||
727 | xor eax, ebx | ||
728 | xor edx, ecx | ||
729 | mov ebx, DWORD PTR 104[ebp] | ||
730 | xor eax, ebx | ||
731 | mov ecx, DWORD PTR 108[ebp] | ||
732 | xor eax, edi | ||
733 | xor edx, edi | ||
734 | xor edx, ecx | ||
735 | and eax, 0fcfcfcfch | ||
736 | xor ebx, ebx | ||
737 | and edx, 0cfcfcfcfh | ||
738 | xor ecx, ecx | ||
739 | mov bl, al | ||
740 | mov cl, ah | ||
741 | ror edx, 4 | ||
742 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
743 | mov bl, dl | ||
744 | xor esi, ebp | ||
745 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
746 | xor esi, ebp | ||
747 | mov cl, dh | ||
748 | shr eax, 16 | ||
749 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
750 | xor esi, ebp | ||
751 | mov bl, ah | ||
752 | shr edx, 16 | ||
753 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
754 | xor esi, ebp | ||
755 | mov ebp, DWORD PTR 28[esp] | ||
756 | mov cl, dh | ||
757 | and eax, 0ffh | ||
758 | and edx, 0ffh | ||
759 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
760 | xor esi, ebx | ||
761 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
762 | xor esi, ebx | ||
763 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
764 | xor esi, ebx | ||
765 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
766 | xor esi, ebx | ||
767 | ; | ||
768 | ; Round 14 | ||
769 | mov eax, DWORD PTR 32[esp] | ||
770 | mov edx, esi | ||
771 | shr edx, 16 | ||
772 | mov ecx, DWORD PTR 36[esp] | ||
773 | xor edx, esi | ||
774 | and eax, edx | ||
775 | and edx, ecx | ||
776 | mov ebx, eax | ||
777 | shl ebx, 16 | ||
778 | mov ecx, edx | ||
779 | shl ecx, 16 | ||
780 | xor eax, ebx | ||
781 | xor edx, ecx | ||
782 | mov ebx, DWORD PTR 112[ebp] | ||
783 | xor eax, ebx | ||
784 | mov ecx, DWORD PTR 116[ebp] | ||
785 | xor eax, esi | ||
786 | xor edx, esi | ||
787 | xor edx, ecx | ||
788 | and eax, 0fcfcfcfch | ||
789 | xor ebx, ebx | ||
790 | and edx, 0cfcfcfcfh | ||
791 | xor ecx, ecx | ||
792 | mov bl, al | ||
793 | mov cl, ah | ||
794 | ror edx, 4 | ||
795 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
796 | mov bl, dl | ||
797 | xor edi, ebp | ||
798 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
799 | xor edi, ebp | ||
800 | mov cl, dh | ||
801 | shr eax, 16 | ||
802 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
803 | xor edi, ebp | ||
804 | mov bl, ah | ||
805 | shr edx, 16 | ||
806 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
807 | xor edi, ebp | ||
808 | mov ebp, DWORD PTR 28[esp] | ||
809 | mov cl, dh | ||
810 | and eax, 0ffh | ||
811 | and edx, 0ffh | ||
812 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
813 | xor edi, ebx | ||
814 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
815 | xor edi, ebx | ||
816 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
817 | xor edi, ebx | ||
818 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
819 | xor edi, ebx | ||
820 | ; | ||
821 | ; Round 15 | ||
822 | mov eax, DWORD PTR 32[esp] | ||
823 | mov edx, edi | ||
824 | shr edx, 16 | ||
825 | mov ecx, DWORD PTR 36[esp] | ||
826 | xor edx, edi | ||
827 | and eax, edx | ||
828 | and edx, ecx | ||
829 | mov ebx, eax | ||
830 | shl ebx, 16 | ||
831 | mov ecx, edx | ||
832 | shl ecx, 16 | ||
833 | xor eax, ebx | ||
834 | xor edx, ecx | ||
835 | mov ebx, DWORD PTR 120[ebp] | ||
836 | xor eax, ebx | ||
837 | mov ecx, DWORD PTR 124[ebp] | ||
838 | xor eax, edi | ||
839 | xor edx, edi | ||
840 | xor edx, ecx | ||
841 | and eax, 0fcfcfcfch | ||
842 | xor ebx, ebx | ||
843 | and edx, 0cfcfcfcfh | ||
844 | xor ecx, ecx | ||
845 | mov bl, al | ||
846 | mov cl, ah | ||
847 | ror edx, 4 | ||
848 | mov ebp, DWORD PTR _des_SPtrans[ebx] | ||
849 | mov bl, dl | ||
850 | xor esi, ebp | ||
851 | mov ebp, DWORD PTR _des_SPtrans[0200h+ecx] | ||
852 | xor esi, ebp | ||
853 | mov cl, dh | ||
854 | shr eax, 16 | ||
855 | mov ebp, DWORD PTR _des_SPtrans[0100h+ebx] | ||
856 | xor esi, ebp | ||
857 | mov bl, ah | ||
858 | shr edx, 16 | ||
859 | mov ebp, DWORD PTR _des_SPtrans[0300h+ecx] | ||
860 | xor esi, ebp | ||
861 | mov ebp, DWORD PTR 28[esp] | ||
862 | mov cl, dh | ||
863 | and eax, 0ffh | ||
864 | and edx, 0ffh | ||
865 | mov ebx, DWORD PTR _des_SPtrans[0600h+ebx] | ||
866 | xor esi, ebx | ||
867 | mov ebx, DWORD PTR _des_SPtrans[0700h+ecx] | ||
868 | xor esi, ebx | ||
869 | mov ebx, DWORD PTR _des_SPtrans[0400h+eax] | ||
870 | xor esi, ebx | ||
871 | mov ebx, DWORD PTR _des_SPtrans[0500h+edx] | ||
872 | xor esi, ebx | ||
873 | mov ebx, DWORD PTR [esp] | ||
874 | mov eax, edi | ||
875 | dec ebx | ||
876 | mov edi, esi | ||
877 | mov esi, eax | ||
878 | mov DWORD PTR [esp],ebx | ||
879 | jnz L000start | ||
880 | ; | ||
881 | ; FP | ||
882 | mov edx, DWORD PTR 24[esp] | ||
883 | ror edi, 1 | ||
884 | mov eax, esi | ||
885 | xor esi, edi | ||
886 | and esi, 0aaaaaaaah | ||
887 | xor eax, esi | ||
888 | xor edi, esi | ||
889 | ; | ||
890 | rol eax, 23 | ||
891 | mov esi, eax | ||
892 | xor eax, edi | ||
893 | and eax, 003fc03fch | ||
894 | xor esi, eax | ||
895 | xor edi, eax | ||
896 | ; | ||
897 | rol esi, 10 | ||
898 | mov eax, esi | ||
899 | xor esi, edi | ||
900 | and esi, 033333333h | ||
901 | xor eax, esi | ||
902 | xor edi, esi | ||
903 | ; | ||
904 | rol edi, 18 | ||
905 | mov esi, edi | ||
906 | xor edi, eax | ||
907 | and edi, 0fff0000fh | ||
908 | xor esi, edi | ||
909 | xor eax, edi | ||
910 | ; | ||
911 | rol esi, 12 | ||
912 | mov edi, esi | ||
913 | xor esi, eax | ||
914 | and esi, 0f0f0f0f0h | ||
915 | xor edi, esi | ||
916 | xor eax, esi | ||
917 | ; | ||
918 | ror eax, 4 | ||
919 | mov DWORD PTR [edx],eax | ||
920 | mov DWORD PTR 4[edx],edi | ||
921 | pop ecx | ||
922 | pop edi | ||
923 | pop esi | ||
924 | pop ebx | ||
925 | pop ebp | ||
926 | ret | ||
927 | _fcrypt_body ENDP | ||
928 | _TEXT ENDS | ||
929 | END | ||
diff --git a/src/lib/libcrypto/des/des.c b/src/lib/libcrypto/des/des.c index 91d7153b34..0197489c9e 100644 --- a/src/lib/libcrypto/des/des.c +++ b/src/lib/libcrypto/des/des.c | |||
@@ -58,6 +58,7 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <stdlib.h> | 60 | #include <stdlib.h> |
61 | #include <string.h> | ||
61 | #ifndef MSDOS | 62 | #ifndef MSDOS |
62 | #ifndef VMS | 63 | #ifndef VMS |
63 | #include <openssl/opensslconf.h> | 64 | #include <openssl/opensslconf.h> |
@@ -69,7 +70,7 @@ | |||
69 | #include <math.h> | 70 | #include <math.h> |
70 | #endif /* __DECC */ | 71 | #endif /* __DECC */ |
71 | #endif /* VMS */ | 72 | #endif /* VMS */ |
72 | #else | 73 | #else /* MSDOS */ |
73 | #include <io.h> | 74 | #include <io.h> |
74 | #endif | 75 | #endif |
75 | 76 | ||
@@ -88,10 +89,6 @@ | |||
88 | #include <openssl/des.h> | 89 | #include <openssl/des.h> |
89 | #include <openssl/rand.h> | 90 | #include <openssl/rand.h> |
90 | 91 | ||
91 | #if defined(__STDC__) || defined(VMS) || defined(M_XENIX) || defined(MSDOS) | ||
92 | #include <string.h> | ||
93 | #endif | ||
94 | |||
95 | void usage(void); | 92 | void usage(void); |
96 | void doencryption(void); | 93 | void doencryption(void); |
97 | int uufwrite(unsigned char *data, int size, unsigned int num, FILE *fp); | 94 | int uufwrite(unsigned char *data, int size, unsigned int num, FILE *fp); |
diff --git a/src/lib/libcrypto/des/des.h b/src/lib/libcrypto/des/des.h index 98a9c4127c..ead67986d9 100644 --- a/src/lib/libcrypto/des/des.h +++ b/src/lib/libcrypto/des/des.h | |||
@@ -78,10 +78,7 @@ extern "C" { | |||
78 | typedef unsigned char des_cblock[8]; | 78 | typedef unsigned char des_cblock[8]; |
79 | typedef /* const */ unsigned char const_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 * | 80 | /* With "const", gcc 2.8.1 on Solaris thinks that des_cblock * |
81 | * and const_des_cblock * are incompatible pointer types. | 81 | * and const_des_cblock * are incompatible pointer types. */ |
82 | * I haven't seen that warning on other systems ... I'll look | ||
83 | * what the standard says. */ | ||
84 | |||
85 | 82 | ||
86 | typedef struct des_ks_struct | 83 | typedef struct des_ks_struct |
87 | { | 84 | { |
@@ -141,8 +138,26 @@ void des_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits, | |||
141 | int enc); | 138 | int enc); |
142 | void des_ecb_encrypt(const_des_cblock *input,des_cblock *output, | 139 | void des_ecb_encrypt(const_des_cblock *input,des_cblock *output, |
143 | des_key_schedule ks,int enc); | 140 | des_key_schedule ks,int enc); |
141 | |||
142 | /* This is the DES encryption function that gets called by just about | ||
143 | every other DES routine in the library. You should not use this | ||
144 | function except to implement 'modes' of DES. I say this because the | ||
145 | functions that call this routine do the conversion from 'char *' to | ||
146 | long, and this needs to be done to make sure 'non-aligned' memory | ||
147 | access do not occur. The characters are loaded 'little endian'. | ||
148 | Data is a pointer to 2 unsigned long's and ks is the | ||
149 | des_key_schedule to use. enc, is non zero specifies encryption, | ||
150 | zero if decryption. */ | ||
144 | void des_encrypt(DES_LONG *data,des_key_schedule ks, int enc); | 151 | void des_encrypt(DES_LONG *data,des_key_schedule ks, int enc); |
152 | |||
153 | /* This functions is the same as des_encrypt() except that the DES | ||
154 | initial permutation (IP) and final permutation (FP) have been left | ||
155 | out. As for des_encrypt(), you should not use this function. | ||
156 | It is used by the routines in the library that implement triple DES. | ||
157 | IP() des_encrypt2() des_encrypt2() des_encrypt2() FP() is the same | ||
158 | as des_encrypt() des_encrypt() des_encrypt() except faster :-). */ | ||
145 | void des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc); | 159 | void des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc); |
160 | |||
146 | void des_encrypt3(DES_LONG *data, des_key_schedule ks1, | 161 | void des_encrypt3(DES_LONG *data, des_key_schedule ks1, |
147 | des_key_schedule ks2, des_key_schedule ks3); | 162 | des_key_schedule ks2, des_key_schedule ks3); |
148 | void des_decrypt3(DES_LONG *data, des_key_schedule ks1, | 163 | void des_decrypt3(DES_LONG *data, des_key_schedule ks1, |
@@ -192,6 +207,7 @@ int des_read_2passwords(des_cblock *key1,des_cblock *key2, | |||
192 | const char *prompt,int verify); | 207 | const char *prompt,int verify); |
193 | int des_read_pw_string(char *buf,int length,const char *prompt,int verify); | 208 | int des_read_pw_string(char *buf,int length,const char *prompt,int verify); |
194 | void des_set_odd_parity(des_cblock *key); | 209 | void des_set_odd_parity(des_cblock *key); |
210 | int des_check_key_parity(const_des_cblock *key); | ||
195 | int des_is_weak_key(const_des_cblock *key); | 211 | int des_is_weak_key(const_des_cblock *key); |
196 | /* des_set_key (= set_key = des_key_sched = key_sched) calls | 212 | /* des_set_key (= set_key = des_key_sched = key_sched) calls |
197 | * des_set_key_checked if global variable des_check_key is set, | 213 | * des_set_key_checked if global variable des_check_key is set, |
@@ -209,9 +225,6 @@ void des_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length, | |||
209 | des_key_schedule schedule,des_cblock *ivec,int *num); | 225 | des_key_schedule schedule,des_cblock *ivec,int *num); |
210 | int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); | 226 | int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); |
211 | 227 | ||
212 | /* Extra functions from Mark Murray <mark@grondar.za> */ | ||
213 | void des_cblock_print_file(const_des_cblock *cb, FILE *fp); | ||
214 | |||
215 | /* The following definitions provide compatibility with the MIT Kerberos | 228 | /* The following definitions provide compatibility with the MIT Kerberos |
216 | * library. The des_key_schedule structure is not binary compatible. */ | 229 | * library. The des_key_schedule structure is not binary compatible. */ |
217 | 230 | ||
@@ -241,11 +254,11 @@ void des_cblock_print_file(const_des_cblock *cb, FILE *fp); | |||
241 | # define xcbc_encrypt des_xcbc_encrypt | 254 | # define xcbc_encrypt des_xcbc_encrypt |
242 | # define cbc_cksum des_cbc_cksum | 255 | # define cbc_cksum des_cbc_cksum |
243 | # define quad_cksum des_quad_cksum | 256 | # define quad_cksum des_quad_cksum |
257 | # define check_parity des_check_key_parity | ||
244 | #endif | 258 | #endif |
245 | 259 | ||
246 | typedef des_key_schedule bit_64; | 260 | typedef des_key_schedule bit_64; |
247 | #define des_fixup_key_parity des_set_odd_parity | 261 | #define des_fixup_key_parity des_set_odd_parity |
248 | #define des_check_key_parity check_parity | ||
249 | 262 | ||
250 | #ifdef __cplusplus | 263 | #ifdef __cplusplus |
251 | } | 264 | } |
diff --git a/src/lib/libcrypto/des/des.man b/src/lib/libcrypto/des/des.man index 7e06a1851a..e69de29bb2 100644 --- a/src/lib/libcrypto/des/des.man +++ b/src/lib/libcrypto/des/des.man | |||
@@ -1,186 +0,0 @@ | |||
1 | .TH DES 1 | ||
2 | .SH NAME | ||
3 | des - encrypt or decrypt data using Data Encryption Standard | ||
4 | .SH SYNOPSIS | ||
5 | .B des | ||
6 | ( | ||
7 | .B \-e | ||
8 | | | ||
9 | .B \-E | ||
10 | ) | ( | ||
11 | .B \-d | ||
12 | | | ||
13 | .B \-D | ||
14 | ) | ( | ||
15 | .B \-\fR[\fPcC\fR][\fPckname\fR]\fP | ||
16 | ) | | ||
17 | [ | ||
18 | .B \-b3hfs | ||
19 | ] [ | ||
20 | .B \-k | ||
21 | .I key | ||
22 | ] | ||
23 | ] [ | ||
24 | .B \-u\fR[\fIuuname\fR] | ||
25 | [ | ||
26 | .I input-file | ||
27 | [ | ||
28 | .I output-file | ||
29 | ] ] | ||
30 | .SH DESCRIPTION | ||
31 | .B des | ||
32 | encrypts and decrypts data using the | ||
33 | Data Encryption Standard algorithm. | ||
34 | One of | ||
35 | .B \-e, \-E | ||
36 | (for encrypt) or | ||
37 | .B \-d, \-D | ||
38 | (for decrypt) must be specified. | ||
39 | It is also possible to use | ||
40 | .B \-c | ||
41 | or | ||
42 | .B \-C | ||
43 | in conjunction or instead of the a encrypt/decrypt option to generate | ||
44 | a 16 character hexadecimal checksum, generated via the | ||
45 | .I des_cbc_cksum. | ||
46 | .LP | ||
47 | Two standard encryption modes are supported by the | ||
48 | .B des | ||
49 | program, Cipher Block Chaining (the default) and Electronic Code Book | ||
50 | (specified with | ||
51 | .B \-b | ||
52 | ). | ||
53 | .LP | ||
54 | The key used for the DES | ||
55 | algorithm is obtained by prompting the user unless the | ||
56 | .B `\-k | ||
57 | .I key' | ||
58 | option is given. | ||
59 | If the key is an argument to the | ||
60 | .B des | ||
61 | command, it is potentially visible to users executing | ||
62 | .BR ps (1) | ||
63 | or a derivative. To minimise this possibility, | ||
64 | .B des | ||
65 | takes care to destroy the key argument immediately upon entry. | ||
66 | If your shell keeps a history file be careful to make sure it is not | ||
67 | world readable. | ||
68 | .LP | ||
69 | Since this program attempts to maintain compatability with sunOS's | ||
70 | des(1) command, there are 2 different methods used to convert the user | ||
71 | supplied key to a des key. | ||
72 | Whenever and one or more of | ||
73 | .B \-E, \-D, \-C | ||
74 | or | ||
75 | .B \-3 | ||
76 | options are used, the key conversion procedure will not be compatible | ||
77 | with the sunOS des(1) version but will use all the user supplied | ||
78 | character to generate the des key. | ||
79 | .B des | ||
80 | command reads from standard input unless | ||
81 | .I input-file | ||
82 | is specified and writes to standard output unless | ||
83 | .I output-file | ||
84 | is given. | ||
85 | .SH OPTIONS | ||
86 | .TP | ||
87 | .B \-b | ||
88 | Select ECB | ||
89 | (eight bytes at a time) encryption mode. | ||
90 | .TP | ||
91 | .B \-3 | ||
92 | Encrypt using triple encryption. | ||
93 | By default triple cbc encryption is used but if the | ||
94 | .B \-b | ||
95 | option is used then triple ecb encryption is performed. | ||
96 | If the key is less than 8 characters long, the flag has no effect. | ||
97 | .TP | ||
98 | .B \-e | ||
99 | Encrypt data using an 8 byte key in a manner compatible with sunOS | ||
100 | des(1). | ||
101 | .TP | ||
102 | .B \-E | ||
103 | Encrypt data using a key of nearly unlimited length (1024 bytes). | ||
104 | This will product a more secure encryption. | ||
105 | .TP | ||
106 | .B \-d | ||
107 | Decrypt data that was encrypted with the \-e option. | ||
108 | .TP | ||
109 | .B \-D | ||
110 | Decrypt data that was encrypted with the \-E option. | ||
111 | .TP | ||
112 | .B \-c | ||
113 | Generate a 16 character hexadecimal cbc checksum and output this to | ||
114 | stderr. | ||
115 | If a filename was specified after the | ||
116 | .B \-c | ||
117 | option, the checksum is output to that file. | ||
118 | The checksum is generated using a key generated in a sunOS compatible | ||
119 | manner. | ||
120 | .TP | ||
121 | .B \-C | ||
122 | A cbc checksum is generated in the same manner as described for the | ||
123 | .B \-c | ||
124 | option but the DES key is generated in the same manner as used for the | ||
125 | .B \-E | ||
126 | and | ||
127 | .B \-D | ||
128 | options | ||
129 | .TP | ||
130 | .B \-f | ||
131 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
132 | .TP | ||
133 | .B \-s | ||
134 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
135 | .TP | ||
136 | .B "\-k \fIkey\fP" | ||
137 | Use the encryption | ||
138 | .I key | ||
139 | specified. | ||
140 | .TP | ||
141 | .B "\-h" | ||
142 | The | ||
143 | .I key | ||
144 | is assumed to be a 16 character hexadecimal number. | ||
145 | If the | ||
146 | .B "\-3" | ||
147 | option is used the key is assumed to be a 32 character hexadecimal | ||
148 | number. | ||
149 | .TP | ||
150 | .B \-u | ||
151 | This flag is used to read and write uuencoded files. If decrypting, | ||
152 | the input file is assumed to contain uuencoded, DES encrypted data. | ||
153 | If encrypting, the characters following the -u are used as the name of | ||
154 | the uuencoded file to embed in the begin line of the uuencoded | ||
155 | output. If there is no name specified after the -u, the name text.des | ||
156 | will be embedded in the header. | ||
157 | .SH SEE ALSO | ||
158 | .B ps (1) | ||
159 | .B des_crypt(3) | ||
160 | .SH BUGS | ||
161 | .LP | ||
162 | The problem with using the | ||
163 | .B -e | ||
164 | option is the short key length. | ||
165 | It would be better to use a real 56-bit key rather than an | ||
166 | ASCII-based 56-bit pattern. Knowing that the key was derived from ASCII | ||
167 | radically reduces the time necessary for a brute-force cryptographic attack. | ||
168 | My attempt to remove this problem is to add an alternative text-key to | ||
169 | DES-key function. This alternative function (accessed via | ||
170 | .B -E, -D, -S | ||
171 | and | ||
172 | .B -3 | ||
173 | ) | ||
174 | uses DES to help generate the key. | ||
175 | .LP | ||
176 | Be carefully when using the -u option. Doing des -ud <filename> will | ||
177 | not decrypt filename (the -u option will gobble the d option). | ||
178 | .LP | ||
179 | The VMS operating system operates in a world where files are always a | ||
180 | multiple of 512 bytes. This causes problems when encrypted data is | ||
181 | send from unix to VMS since a 88 byte file will suddenly be padded | ||
182 | with 424 null bytes. To get around this problem, use the -u option | ||
183 | to uuencode the data before it is send to the VMS system. | ||
184 | .SH AUTHOR | ||
185 | .LP | ||
186 | Eric Young (eay@cryptsoft.com) | ||
diff --git a/src/lib/libcrypto/des/des.pl b/src/lib/libcrypto/des/des.pl index 8a3f7e3ed6..e69de29bb2 100644 --- a/src/lib/libcrypto/des/des.pl +++ b/src/lib/libcrypto/des/des.pl | |||
@@ -1,552 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | # des.pl - eric young 22/11/1991 eay@cryptsoft.com | ||
3 | # | ||
4 | # Copyright (C) 1993 Eric Young | ||
5 | # | ||
6 | # 11 April 1996 - patched to circumvent Perl 5 (through 5.002) problem | ||
7 | # with sign-extension on right shift operations. | ||
8 | # Ed Kubaitis - ejk@uiuc.edu | ||
9 | # | ||
10 | # eay - 92/08/31 - I think I have fixed all problems for 64bit | ||
11 | # versions of perl but I could be wrong since I have not tested it yet :-). | ||
12 | # | ||
13 | # This is an implementation of DES in perl. | ||
14 | # The two routines (des_set_key and des_ecb_encrypt) | ||
15 | # take 8 byte objects as arguments. | ||
16 | # | ||
17 | # des_set_key takes an 8 byte string as a key and returns a key schedule | ||
18 | # for use in calls to des_ecb_encrypt. | ||
19 | # des_ecb_encrypt takes three arguments, the first is a key schedule | ||
20 | # (make sure to pass it by reference with the *), the second is 1 | ||
21 | # to encrypt, 0 to decrypt. The third argument is an 8 byte object | ||
22 | # to encrypt. The function returns an 8 byte object that has been | ||
23 | # DES encrypted. | ||
24 | # | ||
25 | # example: | ||
26 | # require 'des.pl' | ||
27 | # | ||
28 | # $key =pack("C8",0x12,0x23,0x45,0x67,0x89,0xab,0xcd,0xef); | ||
29 | # @ks= &des_set_key($key); | ||
30 | # | ||
31 | # $outbytes= &des_ecb_encrypt(*ks,1,$data); | ||
32 | # @enc =unpack("C8",$outbytes); | ||
33 | # | ||
34 | |||
35 | package des; | ||
36 | |||
37 | eval("use integer;") if (int($]) > 4); | ||
38 | |||
39 | # The following 8 arrays are used in des_set_key | ||
40 | @skb0=( | ||
41 | # for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 | ||
42 | 0x00000000,0x00000010,0x20000000,0x20000010, | ||
43 | 0x00010000,0x00010010,0x20010000,0x20010010, | ||
44 | 0x00000800,0x00000810,0x20000800,0x20000810, | ||
45 | 0x00010800,0x00010810,0x20010800,0x20010810, | ||
46 | 0x00000020,0x00000030,0x20000020,0x20000030, | ||
47 | 0x00010020,0x00010030,0x20010020,0x20010030, | ||
48 | 0x00000820,0x00000830,0x20000820,0x20000830, | ||
49 | 0x00010820,0x00010830,0x20010820,0x20010830, | ||
50 | 0x00080000,0x00080010,0x20080000,0x20080010, | ||
51 | 0x00090000,0x00090010,0x20090000,0x20090010, | ||
52 | 0x00080800,0x00080810,0x20080800,0x20080810, | ||
53 | 0x00090800,0x00090810,0x20090800,0x20090810, | ||
54 | 0x00080020,0x00080030,0x20080020,0x20080030, | ||
55 | 0x00090020,0x00090030,0x20090020,0x20090030, | ||
56 | 0x00080820,0x00080830,0x20080820,0x20080830, | ||
57 | 0x00090820,0x00090830,0x20090820,0x20090830, | ||
58 | ); | ||
59 | @skb1=( | ||
60 | # for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 | ||
61 | 0x00000000,0x02000000,0x00002000,0x02002000, | ||
62 | 0x00200000,0x02200000,0x00202000,0x02202000, | ||
63 | 0x00000004,0x02000004,0x00002004,0x02002004, | ||
64 | 0x00200004,0x02200004,0x00202004,0x02202004, | ||
65 | 0x00000400,0x02000400,0x00002400,0x02002400, | ||
66 | 0x00200400,0x02200400,0x00202400,0x02202400, | ||
67 | 0x00000404,0x02000404,0x00002404,0x02002404, | ||
68 | 0x00200404,0x02200404,0x00202404,0x02202404, | ||
69 | 0x10000000,0x12000000,0x10002000,0x12002000, | ||
70 | 0x10200000,0x12200000,0x10202000,0x12202000, | ||
71 | 0x10000004,0x12000004,0x10002004,0x12002004, | ||
72 | 0x10200004,0x12200004,0x10202004,0x12202004, | ||
73 | 0x10000400,0x12000400,0x10002400,0x12002400, | ||
74 | 0x10200400,0x12200400,0x10202400,0x12202400, | ||
75 | 0x10000404,0x12000404,0x10002404,0x12002404, | ||
76 | 0x10200404,0x12200404,0x10202404,0x12202404, | ||
77 | ); | ||
78 | @skb2=( | ||
79 | # for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 | ||
80 | 0x00000000,0x00000001,0x00040000,0x00040001, | ||
81 | 0x01000000,0x01000001,0x01040000,0x01040001, | ||
82 | 0x00000002,0x00000003,0x00040002,0x00040003, | ||
83 | 0x01000002,0x01000003,0x01040002,0x01040003, | ||
84 | 0x00000200,0x00000201,0x00040200,0x00040201, | ||
85 | 0x01000200,0x01000201,0x01040200,0x01040201, | ||
86 | 0x00000202,0x00000203,0x00040202,0x00040203, | ||
87 | 0x01000202,0x01000203,0x01040202,0x01040203, | ||
88 | 0x08000000,0x08000001,0x08040000,0x08040001, | ||
89 | 0x09000000,0x09000001,0x09040000,0x09040001, | ||
90 | 0x08000002,0x08000003,0x08040002,0x08040003, | ||
91 | 0x09000002,0x09000003,0x09040002,0x09040003, | ||
92 | 0x08000200,0x08000201,0x08040200,0x08040201, | ||
93 | 0x09000200,0x09000201,0x09040200,0x09040201, | ||
94 | 0x08000202,0x08000203,0x08040202,0x08040203, | ||
95 | 0x09000202,0x09000203,0x09040202,0x09040203, | ||
96 | ); | ||
97 | @skb3=( | ||
98 | # for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 | ||
99 | 0x00000000,0x00100000,0x00000100,0x00100100, | ||
100 | 0x00000008,0x00100008,0x00000108,0x00100108, | ||
101 | 0x00001000,0x00101000,0x00001100,0x00101100, | ||
102 | 0x00001008,0x00101008,0x00001108,0x00101108, | ||
103 | 0x04000000,0x04100000,0x04000100,0x04100100, | ||
104 | 0x04000008,0x04100008,0x04000108,0x04100108, | ||
105 | 0x04001000,0x04101000,0x04001100,0x04101100, | ||
106 | 0x04001008,0x04101008,0x04001108,0x04101108, | ||
107 | 0x00020000,0x00120000,0x00020100,0x00120100, | ||
108 | 0x00020008,0x00120008,0x00020108,0x00120108, | ||
109 | 0x00021000,0x00121000,0x00021100,0x00121100, | ||
110 | 0x00021008,0x00121008,0x00021108,0x00121108, | ||
111 | 0x04020000,0x04120000,0x04020100,0x04120100, | ||
112 | 0x04020008,0x04120008,0x04020108,0x04120108, | ||
113 | 0x04021000,0x04121000,0x04021100,0x04121100, | ||
114 | 0x04021008,0x04121008,0x04021108,0x04121108, | ||
115 | ); | ||
116 | @skb4=( | ||
117 | # for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 | ||
118 | 0x00000000,0x10000000,0x00010000,0x10010000, | ||
119 | 0x00000004,0x10000004,0x00010004,0x10010004, | ||
120 | 0x20000000,0x30000000,0x20010000,0x30010000, | ||
121 | 0x20000004,0x30000004,0x20010004,0x30010004, | ||
122 | 0x00100000,0x10100000,0x00110000,0x10110000, | ||
123 | 0x00100004,0x10100004,0x00110004,0x10110004, | ||
124 | 0x20100000,0x30100000,0x20110000,0x30110000, | ||
125 | 0x20100004,0x30100004,0x20110004,0x30110004, | ||
126 | 0x00001000,0x10001000,0x00011000,0x10011000, | ||
127 | 0x00001004,0x10001004,0x00011004,0x10011004, | ||
128 | 0x20001000,0x30001000,0x20011000,0x30011000, | ||
129 | 0x20001004,0x30001004,0x20011004,0x30011004, | ||
130 | 0x00101000,0x10101000,0x00111000,0x10111000, | ||
131 | 0x00101004,0x10101004,0x00111004,0x10111004, | ||
132 | 0x20101000,0x30101000,0x20111000,0x30111000, | ||
133 | 0x20101004,0x30101004,0x20111004,0x30111004, | ||
134 | ); | ||
135 | @skb5=( | ||
136 | # for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 | ||
137 | 0x00000000,0x08000000,0x00000008,0x08000008, | ||
138 | 0x00000400,0x08000400,0x00000408,0x08000408, | ||
139 | 0x00020000,0x08020000,0x00020008,0x08020008, | ||
140 | 0x00020400,0x08020400,0x00020408,0x08020408, | ||
141 | 0x00000001,0x08000001,0x00000009,0x08000009, | ||
142 | 0x00000401,0x08000401,0x00000409,0x08000409, | ||
143 | 0x00020001,0x08020001,0x00020009,0x08020009, | ||
144 | 0x00020401,0x08020401,0x00020409,0x08020409, | ||
145 | 0x02000000,0x0A000000,0x02000008,0x0A000008, | ||
146 | 0x02000400,0x0A000400,0x02000408,0x0A000408, | ||
147 | 0x02020000,0x0A020000,0x02020008,0x0A020008, | ||
148 | 0x02020400,0x0A020400,0x02020408,0x0A020408, | ||
149 | 0x02000001,0x0A000001,0x02000009,0x0A000009, | ||
150 | 0x02000401,0x0A000401,0x02000409,0x0A000409, | ||
151 | 0x02020001,0x0A020001,0x02020009,0x0A020009, | ||
152 | 0x02020401,0x0A020401,0x02020409,0x0A020409, | ||
153 | ); | ||
154 | @skb6=( | ||
155 | # for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 | ||
156 | 0x00000000,0x00000100,0x00080000,0x00080100, | ||
157 | 0x01000000,0x01000100,0x01080000,0x01080100, | ||
158 | 0x00000010,0x00000110,0x00080010,0x00080110, | ||
159 | 0x01000010,0x01000110,0x01080010,0x01080110, | ||
160 | 0x00200000,0x00200100,0x00280000,0x00280100, | ||
161 | 0x01200000,0x01200100,0x01280000,0x01280100, | ||
162 | 0x00200010,0x00200110,0x00280010,0x00280110, | ||
163 | 0x01200010,0x01200110,0x01280010,0x01280110, | ||
164 | 0x00000200,0x00000300,0x00080200,0x00080300, | ||
165 | 0x01000200,0x01000300,0x01080200,0x01080300, | ||
166 | 0x00000210,0x00000310,0x00080210,0x00080310, | ||
167 | 0x01000210,0x01000310,0x01080210,0x01080310, | ||
168 | 0x00200200,0x00200300,0x00280200,0x00280300, | ||
169 | 0x01200200,0x01200300,0x01280200,0x01280300, | ||
170 | 0x00200210,0x00200310,0x00280210,0x00280310, | ||
171 | 0x01200210,0x01200310,0x01280210,0x01280310, | ||
172 | ); | ||
173 | @skb7=( | ||
174 | # for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 | ||
175 | 0x00000000,0x04000000,0x00040000,0x04040000, | ||
176 | 0x00000002,0x04000002,0x00040002,0x04040002, | ||
177 | 0x00002000,0x04002000,0x00042000,0x04042000, | ||
178 | 0x00002002,0x04002002,0x00042002,0x04042002, | ||
179 | 0x00000020,0x04000020,0x00040020,0x04040020, | ||
180 | 0x00000022,0x04000022,0x00040022,0x04040022, | ||
181 | 0x00002020,0x04002020,0x00042020,0x04042020, | ||
182 | 0x00002022,0x04002022,0x00042022,0x04042022, | ||
183 | 0x00000800,0x04000800,0x00040800,0x04040800, | ||
184 | 0x00000802,0x04000802,0x00040802,0x04040802, | ||
185 | 0x00002800,0x04002800,0x00042800,0x04042800, | ||
186 | 0x00002802,0x04002802,0x00042802,0x04042802, | ||
187 | 0x00000820,0x04000820,0x00040820,0x04040820, | ||
188 | 0x00000822,0x04000822,0x00040822,0x04040822, | ||
189 | 0x00002820,0x04002820,0x00042820,0x04042820, | ||
190 | 0x00002822,0x04002822,0x00042822,0x04042822, | ||
191 | ); | ||
192 | |||
193 | @shifts2=(0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0); | ||
194 | |||
195 | # used in ecb_encrypt | ||
196 | @SP0=( | ||
197 | 0x00410100, 0x00010000, 0x40400000, 0x40410100, | ||
198 | 0x00400000, 0x40010100, 0x40010000, 0x40400000, | ||
199 | 0x40010100, 0x00410100, 0x00410000, 0x40000100, | ||
200 | 0x40400100, 0x00400000, 0x00000000, 0x40010000, | ||
201 | 0x00010000, 0x40000000, 0x00400100, 0x00010100, | ||
202 | 0x40410100, 0x00410000, 0x40000100, 0x00400100, | ||
203 | 0x40000000, 0x00000100, 0x00010100, 0x40410000, | ||
204 | 0x00000100, 0x40400100, 0x40410000, 0x00000000, | ||
205 | 0x00000000, 0x40410100, 0x00400100, 0x40010000, | ||
206 | 0x00410100, 0x00010000, 0x40000100, 0x00400100, | ||
207 | 0x40410000, 0x00000100, 0x00010100, 0x40400000, | ||
208 | 0x40010100, 0x40000000, 0x40400000, 0x00410000, | ||
209 | 0x40410100, 0x00010100, 0x00410000, 0x40400100, | ||
210 | 0x00400000, 0x40000100, 0x40010000, 0x00000000, | ||
211 | 0x00010000, 0x00400000, 0x40400100, 0x00410100, | ||
212 | 0x40000000, 0x40410000, 0x00000100, 0x40010100, | ||
213 | ); | ||
214 | @SP1=( | ||
215 | 0x08021002, 0x00000000, 0x00021000, 0x08020000, | ||
216 | 0x08000002, 0x00001002, 0x08001000, 0x00021000, | ||
217 | 0x00001000, 0x08020002, 0x00000002, 0x08001000, | ||
218 | 0x00020002, 0x08021000, 0x08020000, 0x00000002, | ||
219 | 0x00020000, 0x08001002, 0x08020002, 0x00001000, | ||
220 | 0x00021002, 0x08000000, 0x00000000, 0x00020002, | ||
221 | 0x08001002, 0x00021002, 0x08021000, 0x08000002, | ||
222 | 0x08000000, 0x00020000, 0x00001002, 0x08021002, | ||
223 | 0x00020002, 0x08021000, 0x08001000, 0x00021002, | ||
224 | 0x08021002, 0x00020002, 0x08000002, 0x00000000, | ||
225 | 0x08000000, 0x00001002, 0x00020000, 0x08020002, | ||
226 | 0x00001000, 0x08000000, 0x00021002, 0x08001002, | ||
227 | 0x08021000, 0x00001000, 0x00000000, 0x08000002, | ||
228 | 0x00000002, 0x08021002, 0x00021000, 0x08020000, | ||
229 | 0x08020002, 0x00020000, 0x00001002, 0x08001000, | ||
230 | 0x08001002, 0x00000002, 0x08020000, 0x00021000, | ||
231 | ); | ||
232 | @SP2=( | ||
233 | 0x20800000, 0x00808020, 0x00000020, 0x20800020, | ||
234 | 0x20008000, 0x00800000, 0x20800020, 0x00008020, | ||
235 | 0x00800020, 0x00008000, 0x00808000, 0x20000000, | ||
236 | 0x20808020, 0x20000020, 0x20000000, 0x20808000, | ||
237 | 0x00000000, 0x20008000, 0x00808020, 0x00000020, | ||
238 | 0x20000020, 0x20808020, 0x00008000, 0x20800000, | ||
239 | 0x20808000, 0x00800020, 0x20008020, 0x00808000, | ||
240 | 0x00008020, 0x00000000, 0x00800000, 0x20008020, | ||
241 | 0x00808020, 0x00000020, 0x20000000, 0x00008000, | ||
242 | 0x20000020, 0x20008000, 0x00808000, 0x20800020, | ||
243 | 0x00000000, 0x00808020, 0x00008020, 0x20808000, | ||
244 | 0x20008000, 0x00800000, 0x20808020, 0x20000000, | ||
245 | 0x20008020, 0x20800000, 0x00800000, 0x20808020, | ||
246 | 0x00008000, 0x00800020, 0x20800020, 0x00008020, | ||
247 | 0x00800020, 0x00000000, 0x20808000, 0x20000020, | ||
248 | 0x20800000, 0x20008020, 0x00000020, 0x00808000, | ||
249 | ); | ||
250 | @SP3=( | ||
251 | 0x00080201, 0x02000200, 0x00000001, 0x02080201, | ||
252 | 0x00000000, 0x02080000, 0x02000201, 0x00080001, | ||
253 | 0x02080200, 0x02000001, 0x02000000, 0x00000201, | ||
254 | 0x02000001, 0x00080201, 0x00080000, 0x02000000, | ||
255 | 0x02080001, 0x00080200, 0x00000200, 0x00000001, | ||
256 | 0x00080200, 0x02000201, 0x02080000, 0x00000200, | ||
257 | 0x00000201, 0x00000000, 0x00080001, 0x02080200, | ||
258 | 0x02000200, 0x02080001, 0x02080201, 0x00080000, | ||
259 | 0x02080001, 0x00000201, 0x00080000, 0x02000001, | ||
260 | 0x00080200, 0x02000200, 0x00000001, 0x02080000, | ||
261 | 0x02000201, 0x00000000, 0x00000200, 0x00080001, | ||
262 | 0x00000000, 0x02080001, 0x02080200, 0x00000200, | ||
263 | 0x02000000, 0x02080201, 0x00080201, 0x00080000, | ||
264 | 0x02080201, 0x00000001, 0x02000200, 0x00080201, | ||
265 | 0x00080001, 0x00080200, 0x02080000, 0x02000201, | ||
266 | 0x00000201, 0x02000000, 0x02000001, 0x02080200, | ||
267 | ); | ||
268 | @SP4=( | ||
269 | 0x01000000, 0x00002000, 0x00000080, 0x01002084, | ||
270 | 0x01002004, 0x01000080, 0x00002084, 0x01002000, | ||
271 | 0x00002000, 0x00000004, 0x01000004, 0x00002080, | ||
272 | 0x01000084, 0x01002004, 0x01002080, 0x00000000, | ||
273 | 0x00002080, 0x01000000, 0x00002004, 0x00000084, | ||
274 | 0x01000080, 0x00002084, 0x00000000, 0x01000004, | ||
275 | 0x00000004, 0x01000084, 0x01002084, 0x00002004, | ||
276 | 0x01002000, 0x00000080, 0x00000084, 0x01002080, | ||
277 | 0x01002080, 0x01000084, 0x00002004, 0x01002000, | ||
278 | 0x00002000, 0x00000004, 0x01000004, 0x01000080, | ||
279 | 0x01000000, 0x00002080, 0x01002084, 0x00000000, | ||
280 | 0x00002084, 0x01000000, 0x00000080, 0x00002004, | ||
281 | 0x01000084, 0x00000080, 0x00000000, 0x01002084, | ||
282 | 0x01002004, 0x01002080, 0x00000084, 0x00002000, | ||
283 | 0x00002080, 0x01002004, 0x01000080, 0x00000084, | ||
284 | 0x00000004, 0x00002084, 0x01002000, 0x01000004, | ||
285 | ); | ||
286 | @SP5=( | ||
287 | 0x10000008, 0x00040008, 0x00000000, 0x10040400, | ||
288 | 0x00040008, 0x00000400, 0x10000408, 0x00040000, | ||
289 | 0x00000408, 0x10040408, 0x00040400, 0x10000000, | ||
290 | 0x10000400, 0x10000008, 0x10040000, 0x00040408, | ||
291 | 0x00040000, 0x10000408, 0x10040008, 0x00000000, | ||
292 | 0x00000400, 0x00000008, 0x10040400, 0x10040008, | ||
293 | 0x10040408, 0x10040000, 0x10000000, 0x00000408, | ||
294 | 0x00000008, 0x00040400, 0x00040408, 0x10000400, | ||
295 | 0x00000408, 0x10000000, 0x10000400, 0x00040408, | ||
296 | 0x10040400, 0x00040008, 0x00000000, 0x10000400, | ||
297 | 0x10000000, 0x00000400, 0x10040008, 0x00040000, | ||
298 | 0x00040008, 0x10040408, 0x00040400, 0x00000008, | ||
299 | 0x10040408, 0x00040400, 0x00040000, 0x10000408, | ||
300 | 0x10000008, 0x10040000, 0x00040408, 0x00000000, | ||
301 | 0x00000400, 0x10000008, 0x10000408, 0x10040400, | ||
302 | 0x10040000, 0x00000408, 0x00000008, 0x10040008, | ||
303 | ); | ||
304 | @SP6=( | ||
305 | 0x00000800, 0x00000040, 0x00200040, 0x80200000, | ||
306 | 0x80200840, 0x80000800, 0x00000840, 0x00000000, | ||
307 | 0x00200000, 0x80200040, 0x80000040, 0x00200800, | ||
308 | 0x80000000, 0x00200840, 0x00200800, 0x80000040, | ||
309 | 0x80200040, 0x00000800, 0x80000800, 0x80200840, | ||
310 | 0x00000000, 0x00200040, 0x80200000, 0x00000840, | ||
311 | 0x80200800, 0x80000840, 0x00200840, 0x80000000, | ||
312 | 0x80000840, 0x80200800, 0x00000040, 0x00200000, | ||
313 | 0x80000840, 0x00200800, 0x80200800, 0x80000040, | ||
314 | 0x00000800, 0x00000040, 0x00200000, 0x80200800, | ||
315 | 0x80200040, 0x80000840, 0x00000840, 0x00000000, | ||
316 | 0x00000040, 0x80200000, 0x80000000, 0x00200040, | ||
317 | 0x00000000, 0x80200040, 0x00200040, 0x00000840, | ||
318 | 0x80000040, 0x00000800, 0x80200840, 0x00200000, | ||
319 | 0x00200840, 0x80000000, 0x80000800, 0x80200840, | ||
320 | 0x80200000, 0x00200840, 0x00200800, 0x80000800, | ||
321 | ); | ||
322 | @SP7=( | ||
323 | 0x04100010, 0x04104000, 0x00004010, 0x00000000, | ||
324 | 0x04004000, 0x00100010, 0x04100000, 0x04104010, | ||
325 | 0x00000010, 0x04000000, 0x00104000, 0x00004010, | ||
326 | 0x00104010, 0x04004010, 0x04000010, 0x04100000, | ||
327 | 0x00004000, 0x00104010, 0x00100010, 0x04004000, | ||
328 | 0x04104010, 0x04000010, 0x00000000, 0x00104000, | ||
329 | 0x04000000, 0x00100000, 0x04004010, 0x04100010, | ||
330 | 0x00100000, 0x00004000, 0x04104000, 0x00000010, | ||
331 | 0x00100000, 0x00004000, 0x04000010, 0x04104010, | ||
332 | 0x00004010, 0x04000000, 0x00000000, 0x00104000, | ||
333 | 0x04100010, 0x04004010, 0x04004000, 0x00100010, | ||
334 | 0x04104000, 0x00000010, 0x00100010, 0x04004000, | ||
335 | 0x04104010, 0x00100000, 0x04100000, 0x04000010, | ||
336 | 0x00104000, 0x00004010, 0x04004010, 0x04100000, | ||
337 | 0x00000010, 0x04104000, 0x00104010, 0x00000000, | ||
338 | 0x04000000, 0x04100010, 0x00004000, 0x00104010, | ||
339 | ); | ||
340 | |||
341 | sub main'des_set_key | ||
342 | { | ||
343 | local($param)=@_; | ||
344 | local(@key); | ||
345 | local($c,$d,$i,$s,$t); | ||
346 | local(@ks)=(); | ||
347 | |||
348 | # Get the bytes in the order we want. | ||
349 | @key=unpack("C8",$param); | ||
350 | |||
351 | $c= ($key[0] )| | ||
352 | ($key[1]<< 8)| | ||
353 | ($key[2]<<16)| | ||
354 | ($key[3]<<24); | ||
355 | $d= ($key[4] )| | ||
356 | ($key[5]<< 8)| | ||
357 | ($key[6]<<16)| | ||
358 | ($key[7]<<24); | ||
359 | |||
360 | &doPC1(*c,*d); | ||
361 | |||
362 | for $i (@shifts2) | ||
363 | { | ||
364 | if ($i) | ||
365 | { | ||
366 | $c=($c>>2)|($c<<26); | ||
367 | $d=($d>>2)|($d<<26); | ||
368 | } | ||
369 | else | ||
370 | { | ||
371 | $c=($c>>1)|($c<<27); | ||
372 | $d=($d>>1)|($d<<27); | ||
373 | } | ||
374 | $c&=0x0fffffff; | ||
375 | $d&=0x0fffffff; | ||
376 | $s= $skb0[ ($c )&0x3f ]| | ||
377 | $skb1[(($c>> 6)&0x03)|(($c>> 7)&0x3c)]| | ||
378 | $skb2[(($c>>13)&0x0f)|(($c>>14)&0x30)]| | ||
379 | $skb3[(($c>>20)&0x01)|(($c>>21)&0x06) | | ||
380 | (($c>>22)&0x38)]; | ||
381 | $t= $skb4[ ($d )&0x3f ]| | ||
382 | $skb5[(($d>> 7)&0x03)|(($d>> 8)&0x3c)]| | ||
383 | $skb6[ ($d>>15)&0x3f ]| | ||
384 | $skb7[(($d>>21)&0x0f)|(($d>>22)&0x30)]; | ||
385 | push(@ks,(($t<<16)|($s&0x0000ffff))&0xffffffff); | ||
386 | $s= (($s>>16)&0x0000ffff)|($t&0xffff0000) ; | ||
387 | push(@ks,(($s<<4)|(($s>>28)&0xf))&0xffffffff); | ||
388 | } | ||
389 | @ks; | ||
390 | } | ||
391 | |||
392 | sub doPC1 | ||
393 | { | ||
394 | local(*a,*b)=@_; | ||
395 | local($t); | ||
396 | |||
397 | $t=(($b>>4)^$a)&0x0f0f0f0f; | ||
398 | $b^=($t<<4); $a^=$t; | ||
399 | # do $a first | ||
400 | $t=(($a<<18)^$a)&0xcccc0000; | ||
401 | $a=$a^$t^(($t>>18)&0x00003fff); | ||
402 | $t=(($a<<17)^$a)&0xaaaa0000; | ||
403 | $a=$a^$t^(($t>>17)&0x00007fff); | ||
404 | $t=(($a<< 8)^$a)&0x00ff0000; | ||
405 | $a=$a^$t^(($t>> 8)&0x00ffffff); | ||
406 | $t=(($a<<17)^$a)&0xaaaa0000; | ||
407 | $a=$a^$t^(($t>>17)&0x00007fff); | ||
408 | |||
409 | # now do $b | ||
410 | $t=(($b<<24)^$b)&0xff000000; | ||
411 | $b=$b^$t^(($t>>24)&0x000000ff); | ||
412 | $t=(($b<< 8)^$b)&0x00ff0000; | ||
413 | $b=$b^$t^(($t>> 8)&0x00ffffff); | ||
414 | $t=(($b<<14)^$b)&0x33330000; | ||
415 | $b=$b^$t^(($t>>14)&0x0003ffff); | ||
416 | $b=(($b&0x00aa00aa)<<7)|(($b&0x55005500)>>7)|($b&0xaa55aa55); | ||
417 | $b=(($b>>8)&0x00ffffff)|((($a&0xf0000000)>>4)&0x0fffffff); | ||
418 | $a&=0x0fffffff; | ||
419 | } | ||
420 | |||
421 | sub doIP | ||
422 | { | ||
423 | local(*a,*b)=@_; | ||
424 | local($t); | ||
425 | |||
426 | $t=(($b>> 4)^$a)&0x0f0f0f0f; | ||
427 | $b^=($t<< 4); $a^=$t; | ||
428 | $t=(($a>>16)^$b)&0x0000ffff; | ||
429 | $a^=($t<<16); $b^=$t; | ||
430 | $t=(($b>> 2)^$a)&0x33333333; | ||
431 | $b^=($t<< 2); $a^=$t; | ||
432 | $t=(($a>> 8)^$b)&0x00ff00ff; | ||
433 | $a^=($t<< 8); $b^=$t; | ||
434 | $t=(($b>> 1)^$a)&0x55555555; | ||
435 | $b^=($t<< 1); $a^=$t; | ||
436 | $t=$a; | ||
437 | $a=$b&0xffffffff; | ||
438 | $b=$t&0xffffffff; | ||
439 | } | ||
440 | |||
441 | sub doFP | ||
442 | { | ||
443 | local(*a,*b)=@_; | ||
444 | local($t); | ||
445 | |||
446 | $t=(($b>> 1)^$a)&0x55555555; | ||
447 | $b^=($t<< 1); $a^=$t; | ||
448 | $t=(($a>> 8)^$b)&0x00ff00ff; | ||
449 | $a^=($t<< 8); $b^=$t; | ||
450 | $t=(($b>> 2)^$a)&0x33333333; | ||
451 | $b^=($t<< 2); $a^=$t; | ||
452 | $t=(($a>>16)^$b)&0x0000ffff; | ||
453 | $a^=($t<<16); $b^=$t; | ||
454 | $t=(($b>> 4)^$a)&0x0f0f0f0f; | ||
455 | $b^=($t<< 4); $a^=$t; | ||
456 | $a&=0xffffffff; | ||
457 | $b&=0xffffffff; | ||
458 | } | ||
459 | |||
460 | sub main'des_ecb_encrypt | ||
461 | { | ||
462 | local(*ks,$encrypt,$in)=@_; | ||
463 | local($l,$r,$i,$t,$u,@input); | ||
464 | |||
465 | @input=unpack("C8",$in); | ||
466 | # Get the bytes in the order we want. | ||
467 | $l= ($input[0] )| | ||
468 | ($input[1]<< 8)| | ||
469 | ($input[2]<<16)| | ||
470 | ($input[3]<<24); | ||
471 | $r= ($input[4] )| | ||
472 | ($input[5]<< 8)| | ||
473 | ($input[6]<<16)| | ||
474 | ($input[7]<<24); | ||
475 | |||
476 | $l&=0xffffffff; | ||
477 | $r&=0xffffffff; | ||
478 | &doIP(*l,*r); | ||
479 | if ($encrypt) | ||
480 | { | ||
481 | for ($i=0; $i<32; $i+=4) | ||
482 | { | ||
483 | $t=((($r&0x7fffffff)<<1)|(($r>>31)&0x00000001)); | ||
484 | $u=$t^$ks[$i ]; | ||
485 | $t=$t^$ks[$i+1]; | ||
486 | $t2=(($t&0x0000000f)<<28); | ||
487 | |||
488 | $t=((($t>>4)&0x0fffffff)|(($t&0x0000000f)<<28)); | ||
489 | $l^= $SP1[ $t &0x3f]| | ||
490 | $SP3[($t>> 8)&0x3f]| | ||
491 | $SP5[($t>>16)&0x3f]| | ||
492 | $SP7[($t>>24)&0x3f]| | ||
493 | $SP0[ $u &0x3f]| | ||
494 | $SP2[($u>> 8)&0x3f]| | ||
495 | $SP4[($u>>16)&0x3f]| | ||
496 | $SP6[($u>>24)&0x3f]; | ||
497 | |||
498 | $t=(($l<<1)|(($l>>31)&0x1))&0xffffffff; | ||
499 | $u=$t^$ks[$i+2]; | ||
500 | $t=$t^$ks[$i+3]; | ||
501 | $t=((($t>>4)&0x0fffffff)|($t<<28))&0xffffffff; | ||
502 | $r^= $SP1[ $t &0x3f]| | ||
503 | $SP3[($t>> 8)&0x3f]| | ||
504 | $SP5[($t>>16)&0x3f]| | ||
505 | $SP7[($t>>24)&0x3f]| | ||
506 | $SP0[ $u &0x3f]| | ||
507 | $SP2[($u>> 8)&0x3f]| | ||
508 | $SP4[($u>>16)&0x3f]| | ||
509 | $SP6[($u>>24)&0x3f]; | ||
510 | } | ||
511 | } | ||
512 | else | ||
513 | { | ||
514 | for ($i=30; $i>0; $i-=4) | ||
515 | { | ||
516 | $t=(($r<<1)|(($r>>31)&0x1))&0xffffffff; | ||
517 | $u=$t^$ks[$i ]; | ||
518 | $t=$t^$ks[$i+1]; | ||
519 | $t=((($t>>4)&0x0fffffff)|($t<<28))&0xffffffff; | ||
520 | $l^= $SP1[ $t &0x3f]| | ||
521 | $SP3[($t>> 8)&0x3f]| | ||
522 | $SP5[($t>>16)&0x3f]| | ||
523 | $SP7[($t>>24)&0x3f]| | ||
524 | $SP0[ $u &0x3f]| | ||
525 | $SP2[($u>> 8)&0x3f]| | ||
526 | $SP4[($u>>16)&0x3f]| | ||
527 | $SP6[($u>>24)&0x3f]; | ||
528 | |||
529 | $t=(($l<<1)|(($l>>31)&0x1))&0xffffffff; | ||
530 | $u=$t^$ks[$i-2]; | ||
531 | $t=$t^$ks[$i-1]; | ||
532 | $t=((($t>>4)&0x0fffffff)|($t<<28))&0xffffffff; | ||
533 | $r^= $SP1[ $t &0x3f]| | ||
534 | $SP3[($t>> 8)&0x3f]| | ||
535 | $SP5[($t>>16)&0x3f]| | ||
536 | $SP7[($t>>24)&0x3f]| | ||
537 | $SP0[ $u &0x3f]| | ||
538 | $SP2[($u>> 8)&0x3f]| | ||
539 | $SP4[($u>>16)&0x3f]| | ||
540 | $SP6[($u>>24)&0x3f]; | ||
541 | } | ||
542 | } | ||
543 | &doFP(*l,*r); | ||
544 | pack("C8",$l&0xff, | ||
545 | ($l>> 8)&0x00ffffff, | ||
546 | ($l>>16)&0x0000ffff, | ||
547 | ($l>>24)&0x000000ff, | ||
548 | $r&0xff, | ||
549 | ($r>> 8)&0x00ffffff, | ||
550 | ($r>>16)&0x0000ffff, | ||
551 | ($r>>24)&0x000000ff); | ||
552 | } | ||
diff --git a/src/lib/libcrypto/des/des.pod b/src/lib/libcrypto/des/des.pod new file mode 100644 index 0000000000..bf479e83d2 --- /dev/null +++ b/src/lib/libcrypto/des/des.pod | |||
@@ -0,0 +1,217 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | des - encrypt or decrypt data using Data Encryption Standard | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | B<des> | ||
10 | ( | ||
11 | B<-e> | ||
12 | | | ||
13 | B<-E> | ||
14 | ) | ( | ||
15 | B<-d> | ||
16 | | | ||
17 | B<-D> | ||
18 | ) | ( | ||
19 | B<->[B<cC>][B<ckname>] | ||
20 | ) | | ||
21 | [ | ||
22 | B<-b3hfs> | ||
23 | ] [ | ||
24 | B<-k> | ||
25 | I<key> | ||
26 | ] | ||
27 | ] [ | ||
28 | B<-u>[I<uuname>] | ||
29 | [ | ||
30 | I<input-file> | ||
31 | [ | ||
32 | I<output-file> | ||
33 | ] ] | ||
34 | |||
35 | =head1 NOTE | ||
36 | |||
37 | This page describes the B<des> stand-alone program, not the B<openssl des> | ||
38 | command. | ||
39 | |||
40 | =head1 DESCRIPTION | ||
41 | |||
42 | B<des> | ||
43 | encrypts and decrypts data using the | ||
44 | Data Encryption Standard algorithm. | ||
45 | One of | ||
46 | B<-e>, B<-E> | ||
47 | (for encrypt) or | ||
48 | B<-d>, B<-D> | ||
49 | (for decrypt) must be specified. | ||
50 | It is also possible to use | ||
51 | B<-c> | ||
52 | or | ||
53 | B<-C> | ||
54 | in conjunction or instead of the a encrypt/decrypt option to generate | ||
55 | a 16 character hexadecimal checksum, generated via the | ||
56 | I<des_cbc_cksum>. | ||
57 | |||
58 | Two standard encryption modes are supported by the | ||
59 | B<des> | ||
60 | program, Cipher Block Chaining (the default) and Electronic Code Book | ||
61 | (specified with | ||
62 | B<-b>). | ||
63 | |||
64 | The key used for the DES | ||
65 | algorithm is obtained by prompting the user unless the | ||
66 | B<-k> | ||
67 | I<key> | ||
68 | option is given. | ||
69 | If the key is an argument to the | ||
70 | B<des> | ||
71 | command, it is potentially visible to users executing | ||
72 | ps(1) | ||
73 | or a derivative. To minimise this possibility, | ||
74 | B<des> | ||
75 | takes care to destroy the key argument immediately upon entry. | ||
76 | If your shell keeps a history file be careful to make sure it is not | ||
77 | world readable. | ||
78 | |||
79 | Since this program attempts to maintain compatibility with sunOS's | ||
80 | des(1) command, there are 2 different methods used to convert the user | ||
81 | supplied key to a des key. | ||
82 | Whenever and one or more of | ||
83 | B<-E>, B<-D>, B<-C> | ||
84 | or | ||
85 | B<-3> | ||
86 | options are used, the key conversion procedure will not be compatible | ||
87 | with the sunOS des(1) version but will use all the user supplied | ||
88 | character to generate the des key. | ||
89 | B<des> | ||
90 | command reads from standard input unless | ||
91 | I<input-file> | ||
92 | is specified and writes to standard output unless | ||
93 | I<output-file> | ||
94 | is given. | ||
95 | |||
96 | =head1 OPTIONS | ||
97 | |||
98 | =over 4 | ||
99 | |||
100 | =item B<-b> | ||
101 | |||
102 | Select ECB | ||
103 | (eight bytes at a time) encryption mode. | ||
104 | |||
105 | =item B<-3> | ||
106 | |||
107 | Encrypt using triple encryption. | ||
108 | By default triple cbc encryption is used but if the | ||
109 | B<-b> | ||
110 | option is used then triple ECB encryption is performed. | ||
111 | If the key is less than 8 characters long, the flag has no effect. | ||
112 | |||
113 | =item B<-e> | ||
114 | |||
115 | Encrypt data using an 8 byte key in a manner compatible with sunOS | ||
116 | des(1). | ||
117 | |||
118 | =item B<-E> | ||
119 | |||
120 | Encrypt data using a key of nearly unlimited length (1024 bytes). | ||
121 | This will product a more secure encryption. | ||
122 | |||
123 | =item B<-d> | ||
124 | |||
125 | Decrypt data that was encrypted with the B<-e> option. | ||
126 | |||
127 | =item B<-D> | ||
128 | |||
129 | Decrypt data that was encrypted with the B<-E> option. | ||
130 | |||
131 | =item B<-c> | ||
132 | |||
133 | Generate a 16 character hexadecimal cbc checksum and output this to | ||
134 | stderr. | ||
135 | If a filename was specified after the | ||
136 | B<-c> | ||
137 | option, the checksum is output to that file. | ||
138 | The checksum is generated using a key generated in a sunOS compatible | ||
139 | manner. | ||
140 | |||
141 | =item B<-C> | ||
142 | |||
143 | A cbc checksum is generated in the same manner as described for the | ||
144 | B<-c> | ||
145 | option but the DES key is generated in the same manner as used for the | ||
146 | B<-E> | ||
147 | and | ||
148 | B<-D> | ||
149 | options | ||
150 | |||
151 | =item B<-f> | ||
152 | |||
153 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
154 | |||
155 | =item B<-s> | ||
156 | |||
157 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
158 | |||
159 | =item B<-k> I<key> | ||
160 | |||
161 | Use the encryption | ||
162 | I<key> | ||
163 | specified. | ||
164 | |||
165 | =item B<-h> | ||
166 | |||
167 | The | ||
168 | I<key> | ||
169 | is assumed to be a 16 character hexadecimal number. | ||
170 | If the | ||
171 | B<-3> | ||
172 | option is used the key is assumed to be a 32 character hexadecimal | ||
173 | number. | ||
174 | |||
175 | =item B<-u> | ||
176 | |||
177 | This flag is used to read and write uuencoded files. If decrypting, | ||
178 | the input file is assumed to contain uuencoded, DES encrypted data. | ||
179 | If encrypting, the characters following the B<-u> are used as the name of | ||
180 | the uuencoded file to embed in the begin line of the uuencoded | ||
181 | output. If there is no name specified after the B<-u>, the name text.des | ||
182 | will be embedded in the header. | ||
183 | |||
184 | =head1 SEE ALSO | ||
185 | |||
186 | ps(1), | ||
187 | L<des_crypt(3)|des_crypt(3)> | ||
188 | |||
189 | =head1 BUGS | ||
190 | |||
191 | The problem with using the | ||
192 | B<-e> | ||
193 | option is the short key length. | ||
194 | It would be better to use a real 56-bit key rather than an | ||
195 | ASCII-based 56-bit pattern. Knowing that the key was derived from ASCII | ||
196 | radically reduces the time necessary for a brute-force cryptographic attack. | ||
197 | My attempt to remove this problem is to add an alternative text-key to | ||
198 | DES-key function. This alternative function (accessed via | ||
199 | B<-E>, B<-D>, B<-S> | ||
200 | and | ||
201 | B<-3>) | ||
202 | uses DES to help generate the key. | ||
203 | |||
204 | Be carefully when using the B<-u> option. Doing B<des -ud> I<filename> will | ||
205 | not decrypt filename (the B<-u> option will gobble the B<-d> option). | ||
206 | |||
207 | The VMS operating system operates in a world where files are always a | ||
208 | multiple of 512 bytes. This causes problems when encrypted data is | ||
209 | send from Unix to VMS since a 88 byte file will suddenly be padded | ||
210 | with 424 null bytes. To get around this problem, use the B<-u> option | ||
211 | to uuencode the data before it is send to the VMS system. | ||
212 | |||
213 | =head1 AUTHOR | ||
214 | |||
215 | Eric Young (eay@cryptsoft.com) | ||
216 | |||
217 | =cut | ||
diff --git a/src/lib/libcrypto/des/des_crypt.man b/src/lib/libcrypto/des/des_crypt.man index 0ecc416877..e69de29bb2 100644 --- a/src/lib/libcrypto/des/des_crypt.man +++ b/src/lib/libcrypto/des/des_crypt.man | |||
@@ -1,508 +0,0 @@ | |||
1 | .TH DES_CRYPT 3 | ||
2 | .SH NAME | ||
3 | des_read_password, des_read_2password, | ||
4 | des_string_to_key, des_string_to_2key, des_read_pw_string, | ||
5 | des_random_key, des_set_key, | ||
6 | des_key_sched, des_ecb_encrypt, des_ecb3_encrypt, des_cbc_encrypt, | ||
7 | des_3cbc_encrypt, | ||
8 | des_pcbc_encrypt, des_cfb_encrypt, des_ofb_encrypt, | ||
9 | des_cbc_cksum, des_quad_cksum, | ||
10 | des_enc_read, des_enc_write, des_set_odd_parity, | ||
11 | des_is_weak_key, crypt \- (non USA) DES encryption | ||
12 | .SH SYNOPSIS | ||
13 | .nf | ||
14 | .nj | ||
15 | .ft B | ||
16 | #include <des.h> | ||
17 | .PP | ||
18 | .B int des_read_password(key,prompt,verify) | ||
19 | des_cblock *key; | ||
20 | char *prompt; | ||
21 | int verify; | ||
22 | .PP | ||
23 | .B int des_read_2password(key1,key2,prompt,verify) | ||
24 | des_cblock *key1,*key2; | ||
25 | char *prompt; | ||
26 | int verify; | ||
27 | .PP | ||
28 | .B int des_string_to_key(str,key) | ||
29 | char *str; | ||
30 | des_cblock *key; | ||
31 | .PP | ||
32 | .B int des_string_to_2keys(str,key1,key2) | ||
33 | char *str; | ||
34 | des_cblock *key1,*key2; | ||
35 | .PP | ||
36 | .B int des_read_pw_string(buf,length,prompt,verify) | ||
37 | char *buf; | ||
38 | int length; | ||
39 | char *prompt; | ||
40 | int verify; | ||
41 | .PP | ||
42 | .B int des_random_key(key) | ||
43 | des_cblock *key; | ||
44 | .PP | ||
45 | .B int des_set_key(key,schedule) | ||
46 | des_cblock *key; | ||
47 | des_key_schedule schedule; | ||
48 | .PP | ||
49 | .B int des_key_sched(key,schedule) | ||
50 | des_cblock *key; | ||
51 | des_key_schedule schedule; | ||
52 | .PP | ||
53 | .B int des_ecb_encrypt(input,output,schedule,encrypt) | ||
54 | des_cblock *input; | ||
55 | des_cblock *output; | ||
56 | des_key_schedule schedule; | ||
57 | int encrypt; | ||
58 | .PP | ||
59 | .B int des_ecb3_encrypt(input,output,ks1,ks2,encrypt) | ||
60 | des_cblock *input; | ||
61 | des_cblock *output; | ||
62 | des_key_schedule ks1,ks2; | ||
63 | int encrypt; | ||
64 | .PP | ||
65 | .B int des_cbc_encrypt(input,output,length,schedule,ivec,encrypt) | ||
66 | des_cblock *input; | ||
67 | des_cblock *output; | ||
68 | long length; | ||
69 | des_key_schedule schedule; | ||
70 | des_cblock *ivec; | ||
71 | int encrypt; | ||
72 | .PP | ||
73 | .B int des_3cbc_encrypt(input,output,length,sk1,sk2,ivec1,ivec2,encrypt) | ||
74 | des_cblock *input; | ||
75 | des_cblock *output; | ||
76 | long length; | ||
77 | des_key_schedule sk1; | ||
78 | des_key_schedule sk2; | ||
79 | des_cblock *ivec1; | ||
80 | des_cblock *ivec2; | ||
81 | int encrypt; | ||
82 | .PP | ||
83 | .B int des_pcbc_encrypt(input,output,length,schedule,ivec,encrypt) | ||
84 | des_cblock *input; | ||
85 | des_cblock *output; | ||
86 | long length; | ||
87 | des_key_schedule schedule; | ||
88 | des_cblock *ivec; | ||
89 | int encrypt; | ||
90 | .PP | ||
91 | .B int des_cfb_encrypt(input,output,numbits,length,schedule,ivec,encrypt) | ||
92 | unsigned char *input; | ||
93 | unsigned char *output; | ||
94 | int numbits; | ||
95 | long length; | ||
96 | des_key_schedule schedule; | ||
97 | des_cblock *ivec; | ||
98 | int encrypt; | ||
99 | .PP | ||
100 | .B int des_ofb_encrypt(input,output,numbits,length,schedule,ivec) | ||
101 | unsigned char *input,*output; | ||
102 | int numbits; | ||
103 | long length; | ||
104 | des_key_schedule schedule; | ||
105 | des_cblock *ivec; | ||
106 | .PP | ||
107 | .B unsigned long des_cbc_cksum(input,output,length,schedule,ivec) | ||
108 | des_cblock *input; | ||
109 | des_cblock *output; | ||
110 | long length; | ||
111 | des_key_schedule schedule; | ||
112 | des_cblock *ivec; | ||
113 | .PP | ||
114 | .B unsigned long des_quad_cksum(input,output,length,out_count,seed) | ||
115 | des_cblock *input; | ||
116 | des_cblock *output; | ||
117 | long length; | ||
118 | int out_count; | ||
119 | des_cblock *seed; | ||
120 | .PP | ||
121 | .B int des_check_key; | ||
122 | .PP | ||
123 | .B int des_enc_read(fd,buf,len,sched,iv) | ||
124 | int fd; | ||
125 | char *buf; | ||
126 | int len; | ||
127 | des_key_schedule sched; | ||
128 | des_cblock *iv; | ||
129 | .PP | ||
130 | .B int des_enc_write(fd,buf,len,sched,iv) | ||
131 | int fd; | ||
132 | char *buf; | ||
133 | int len; | ||
134 | des_key_schedule sched; | ||
135 | des_cblock *iv; | ||
136 | .PP | ||
137 | .B extern int des_rw_mode; | ||
138 | .PP | ||
139 | .B void des_set_odd_parity(key) | ||
140 | des_cblock *key; | ||
141 | .PP | ||
142 | .B int des_is_weak_key(key) | ||
143 | des_cblock *key; | ||
144 | .PP | ||
145 | .B char *crypt(passwd,salt) | ||
146 | char *passwd; | ||
147 | char *salt; | ||
148 | .PP | ||
149 | .fi | ||
150 | .SH DESCRIPTION | ||
151 | This library contains a fast implementation of the DES encryption | ||
152 | algorithm. | ||
153 | .PP | ||
154 | There are two phases to the use of DES encryption. | ||
155 | The first is the generation of a | ||
156 | .I des_key_schedule | ||
157 | from a key, | ||
158 | the second is the actual encryption. | ||
159 | A des key is of type | ||
160 | .I des_cblock. | ||
161 | This type is made from 8 characters with odd parity. | ||
162 | The least significant bit in the character is the parity bit. | ||
163 | The key schedule is an expanded form of the key; it is used to speed the | ||
164 | encryption process. | ||
165 | .PP | ||
166 | .I des_read_password | ||
167 | writes the string specified by prompt to the standard output, | ||
168 | turns off echo and reads an input string from standard input | ||
169 | until terminated with a newline. | ||
170 | If verify is non-zero, it prompts and reads the input again and verifies | ||
171 | that both entered passwords are the same. | ||
172 | The entered string is converted into a des key by using the | ||
173 | .I des_string_to_key | ||
174 | routine. | ||
175 | The new key is placed in the | ||
176 | .I des_cblock | ||
177 | that was passed (by reference) to the routine. | ||
178 | If there were no errors, | ||
179 | .I des_read_password | ||
180 | returns 0, | ||
181 | -1 is returned if there was a terminal error and 1 is returned for | ||
182 | any other error. | ||
183 | .PP | ||
184 | .I des_read_2password | ||
185 | operates in the same way as | ||
186 | .I des_read_password | ||
187 | except that it generates 2 keys by using the | ||
188 | .I des_string_to_2key | ||
189 | function. | ||
190 | .PP | ||
191 | .I des_read_pw_string | ||
192 | is called by | ||
193 | .I des_read_password | ||
194 | to read and verify a string from a terminal device. | ||
195 | The string is returned in | ||
196 | .I buf. | ||
197 | The size of | ||
198 | .I buf | ||
199 | is passed to the routine via the | ||
200 | .I length | ||
201 | parameter. | ||
202 | .PP | ||
203 | .I des_string_to_key | ||
204 | converts a string into a valid des key. | ||
205 | .PP | ||
206 | .I des_string_to_2key | ||
207 | converts a string into 2 valid des keys. | ||
208 | This routine is best suited for used to generate keys for use with | ||
209 | .I des_ecb3_encrypt. | ||
210 | .PP | ||
211 | .I des_random_key | ||
212 | returns a random key that is made of a combination of process id, | ||
213 | time and an increasing counter. | ||
214 | .PP | ||
215 | Before a des key can be used it is converted into a | ||
216 | .I des_key_schedule | ||
217 | via the | ||
218 | .I des_set_key | ||
219 | routine. | ||
220 | If the | ||
221 | .I des_check_key | ||
222 | flag is non-zero, | ||
223 | .I des_set_key | ||
224 | will check that the key passed is of odd parity and is not a week or | ||
225 | semi-weak key. | ||
226 | If the parity is wrong, | ||
227 | then -1 is returned. | ||
228 | If the key is a weak key, | ||
229 | then -2 is returned. | ||
230 | If an error is returned, | ||
231 | the key schedule is not generated. | ||
232 | .PP | ||
233 | .I des_key_sched | ||
234 | is another name for the | ||
235 | .I des_set_key | ||
236 | function. | ||
237 | .PP | ||
238 | The following routines mostly operate on an input and output stream of | ||
239 | .I des_cblock's. | ||
240 | .PP | ||
241 | .I des_ecb_encrypt | ||
242 | is the basic DES encryption routine that encrypts or decrypts a single 8-byte | ||
243 | .I des_cblock | ||
244 | in | ||
245 | .I electronic code book | ||
246 | mode. | ||
247 | It always transforms the input data, pointed to by | ||
248 | .I input, | ||
249 | into the output data, | ||
250 | pointed to by the | ||
251 | .I output | ||
252 | argument. | ||
253 | If the | ||
254 | .I encrypt | ||
255 | argument is non-zero (DES_ENCRYPT), | ||
256 | the | ||
257 | .I input | ||
258 | (cleartext) is encrypted in to the | ||
259 | .I output | ||
260 | (ciphertext) using the key_schedule specified by the | ||
261 | .I schedule | ||
262 | argument, | ||
263 | previously set via | ||
264 | .I des_set_key. | ||
265 | If | ||
266 | .I encrypt | ||
267 | is zero (DES_DECRYPT), | ||
268 | the | ||
269 | .I input | ||
270 | (now ciphertext) | ||
271 | is decrypted into the | ||
272 | .I output | ||
273 | (now cleartext). | ||
274 | Input and output may overlap. | ||
275 | No meaningful value is returned. | ||
276 | .PP | ||
277 | .I des_ecb3_encrypt | ||
278 | encrypts/decrypts the | ||
279 | .I input | ||
280 | block by using triple ecb DES encryption. | ||
281 | This involves encrypting the input with | ||
282 | .I ks1, | ||
283 | decryption with the key schedule | ||
284 | .I ks2, | ||
285 | and then encryption with the first again. | ||
286 | This routine greatly reduces the chances of brute force breaking of | ||
287 | DES and has the advantage of if | ||
288 | .I ks1 | ||
289 | and | ||
290 | .I ks2 | ||
291 | are the same, it is equivalent to just encryption using ecb mode and | ||
292 | .I ks1 | ||
293 | as the key. | ||
294 | .PP | ||
295 | .I des_cbc_encrypt | ||
296 | encrypts/decrypts using the | ||
297 | .I cipher-block-chaining | ||
298 | mode of DES. | ||
299 | If the | ||
300 | .I encrypt | ||
301 | argument is non-zero, | ||
302 | the routine cipher-block-chain encrypts the cleartext data pointed to by the | ||
303 | .I input | ||
304 | argument into the ciphertext pointed to by the | ||
305 | .I output | ||
306 | argument, | ||
307 | using the key schedule provided by the | ||
308 | .I schedule | ||
309 | argument, | ||
310 | and initialisation vector provided by the | ||
311 | .I ivec | ||
312 | argument. | ||
313 | If the | ||
314 | .I length | ||
315 | argument is not an integral multiple of eight bytes, | ||
316 | the last block is copied to a temporary area and zero filled. | ||
317 | The output is always | ||
318 | an integral multiple of eight bytes. | ||
319 | To make multiple cbc encrypt calls on a large amount of data appear to | ||
320 | be one | ||
321 | .I des_cbc_encrypt | ||
322 | call, the | ||
323 | .I ivec | ||
324 | of subsequent calls should be the last 8 bytes of the output. | ||
325 | .PP | ||
326 | .I des_3cbc_encrypt | ||
327 | encrypts/decrypts the | ||
328 | .I input | ||
329 | block by using triple cbc DES encryption. | ||
330 | This involves encrypting the input with key schedule | ||
331 | .I ks1, | ||
332 | decryption with the key schedule | ||
333 | .I ks2, | ||
334 | and then encryption with the first again. | ||
335 | 2 initialisation vectors are required, | ||
336 | .I ivec1 | ||
337 | and | ||
338 | .I ivec2. | ||
339 | Unlike | ||
340 | .I des_cbc_encrypt, | ||
341 | these initialisation vectors are modified by the subroutine. | ||
342 | This routine greatly reduces the chances of brute force breaking of | ||
343 | DES and has the advantage of if | ||
344 | .I ks1 | ||
345 | and | ||
346 | .I ks2 | ||
347 | are the same, it is equivalent to just encryption using cbc mode and | ||
348 | .I ks1 | ||
349 | as the key. | ||
350 | .PP | ||
351 | .I des_pcbc_encrypt | ||
352 | encrypt/decrypts using a modified block chaining mode. | ||
353 | It provides better error propagation characteristics than cbc | ||
354 | encryption. | ||
355 | .PP | ||
356 | .I des_cfb_encrypt | ||
357 | encrypt/decrypts using cipher feedback mode. This method takes an | ||
358 | array of characters as input and outputs and array of characters. It | ||
359 | does not require any padding to 8 character groups. Note: the ivec | ||
360 | variable is changed and the new changed value needs to be passed to | ||
361 | the next call to this function. Since this function runs a complete | ||
362 | DES ecb encryption per numbits, this function is only suggested for | ||
363 | use when sending small numbers of characters. | ||
364 | .PP | ||
365 | .I des_ofb_encrypt | ||
366 | encrypt using output feedback mode. This method takes an | ||
367 | array of characters as input and outputs and array of characters. It | ||
368 | does not require any padding to 8 character groups. Note: the ivec | ||
369 | variable is changed and the new changed value needs to be passed to | ||
370 | the next call to this function. Since this function runs a complete | ||
371 | DES ecb encryption per numbits, this function is only suggested for | ||
372 | use when sending small numbers of characters. | ||
373 | .PP | ||
374 | .I des_cbc_cksum | ||
375 | produces an 8 byte checksum based on the input stream (via cbc encryption). | ||
376 | The last 4 bytes of the checksum is returned and the complete 8 bytes is | ||
377 | placed in | ||
378 | .I output. | ||
379 | .PP | ||
380 | .I des_quad_cksum | ||
381 | returns a 4 byte checksum from the input bytes. | ||
382 | The algorithm can be iterated over the input, | ||
383 | depending on | ||
384 | .I out_count, | ||
385 | 1, 2, 3 or 4 times. | ||
386 | If | ||
387 | .I output | ||
388 | is non-NULL, | ||
389 | the 8 bytes generated by each pass are written into | ||
390 | .I output. | ||
391 | .PP | ||
392 | .I des_enc_write | ||
393 | is used to write | ||
394 | .I len | ||
395 | bytes | ||
396 | to file descriptor | ||
397 | .I fd | ||
398 | from buffer | ||
399 | .I buf. | ||
400 | The data is encrypted via | ||
401 | .I pcbc_encrypt | ||
402 | (default) using | ||
403 | .I sched | ||
404 | for the key and | ||
405 | .I iv | ||
406 | as a starting vector. | ||
407 | The actual data send down | ||
408 | .I fd | ||
409 | consists of 4 bytes (in network byte order) containing the length of the | ||
410 | following encrypted data. The encrypted data then follows, padded with random | ||
411 | data out to a multiple of 8 bytes. | ||
412 | .PP | ||
413 | .I des_enc_read | ||
414 | is used to read | ||
415 | .I len | ||
416 | bytes | ||
417 | from file descriptor | ||
418 | .I fd | ||
419 | into buffer | ||
420 | .I buf. | ||
421 | The data being read from | ||
422 | .I fd | ||
423 | is assumed to have come from | ||
424 | .I des_enc_write | ||
425 | and is decrypted using | ||
426 | .I sched | ||
427 | for the key schedule and | ||
428 | .I iv | ||
429 | for the initial vector. | ||
430 | The | ||
431 | .I des_enc_read/des_enc_write | ||
432 | pair can be used to read/write to files, pipes and sockets. | ||
433 | I have used them in implementing a version of rlogin in which all | ||
434 | data is encrypted. | ||
435 | .PP | ||
436 | .I des_rw_mode | ||
437 | is used to specify the encryption mode to use with | ||
438 | .I des_enc_read | ||
439 | and | ||
440 | .I des_end_write. | ||
441 | If set to | ||
442 | .I DES_PCBC_MODE | ||
443 | (the default), des_pcbc_encrypt is used. | ||
444 | If set to | ||
445 | .I DES_CBC_MODE | ||
446 | des_cbc_encrypt is used. | ||
447 | These two routines and the variable are not part of the normal MIT library. | ||
448 | .PP | ||
449 | .I des_set_odd_parity | ||
450 | sets the parity of the passed | ||
451 | .I key | ||
452 | to odd. This routine is not part of the standard MIT library. | ||
453 | .PP | ||
454 | .I des_is_weak_key | ||
455 | returns 1 is the passed key is a weak key (pick again :-), | ||
456 | 0 if it is ok. | ||
457 | This routine is not part of the standard MIT library. | ||
458 | .PP | ||
459 | .I crypt | ||
460 | is a replacement for the normal system crypt. | ||
461 | It is much faster than the system crypt. | ||
462 | .PP | ||
463 | .SH FILES | ||
464 | /usr/include/des.h | ||
465 | .br | ||
466 | /usr/lib/libdes.a | ||
467 | .PP | ||
468 | The encryption routines have been tested on 16bit, 32bit and 64bit | ||
469 | machines of various endian and even works under VMS. | ||
470 | .PP | ||
471 | .SH BUGS | ||
472 | .PP | ||
473 | If you think this manual is sparse, | ||
474 | read the des_crypt(3) manual from the MIT kerberos (or bones outside | ||
475 | of the USA) distribution. | ||
476 | .PP | ||
477 | .I des_cfb_encrypt | ||
478 | and | ||
479 | .I des_ofb_encrypt | ||
480 | operates on input of 8 bits. What this means is that if you set | ||
481 | numbits to 12, and length to 2, the first 12 bits will come from the 1st | ||
482 | input byte and the low half of the second input byte. The second 12 | ||
483 | bits will have the low 8 bits taken from the 3rd input byte and the | ||
484 | top 4 bits taken from the 4th input byte. The same holds for output. | ||
485 | This function has been implemented this way because most people will | ||
486 | be using a multiple of 8 and because once you get into pulling bytes input | ||
487 | bytes apart things get ugly! | ||
488 | .PP | ||
489 | .I des_read_pw_string | ||
490 | is the most machine/OS dependent function and normally generates the | ||
491 | most problems when porting this code. | ||
492 | .PP | ||
493 | .I des_string_to_key | ||
494 | is probably different from the MIT version since there are lots | ||
495 | of fun ways to implement one-way encryption of a text string. | ||
496 | .PP | ||
497 | The routines are optimised for 32 bit machines and so are not efficient | ||
498 | on IBM PCs. | ||
499 | .PP | ||
500 | NOTE: extensive work has been done on this library since this document | ||
501 | was origionally written. Please try to read des.doc from the libdes | ||
502 | distribution since it is far more upto date and documents more of the | ||
503 | functions. Libdes is now also being shipped as part of SSLeay, a | ||
504 | general cryptographic library that amonst other things implements | ||
505 | netscapes SSL protocoll. The most recent version can be found in | ||
506 | SSLeay distributions. | ||
507 | .SH AUTHOR | ||
508 | Eric Young (eay@cryptsoft.com) | ||
diff --git a/src/lib/libcrypto/des/des_locl.h b/src/lib/libcrypto/des/des_locl.h index 4dfed199a7..1ace8f5930 100644 --- a/src/lib/libcrypto/des/des_locl.h +++ b/src/lib/libcrypto/des/des_locl.h | |||
@@ -155,7 +155,7 @@ | |||
155 | } \ | 155 | } \ |
156 | } | 156 | } |
157 | 157 | ||
158 | #if defined(WIN32) | 158 | #if defined(WIN32) && defined(_MSC_VER) |
159 | #define ROTATE(a,n) (_lrotr(a,n)) | 159 | #define ROTATE(a,n) (_lrotr(a,n)) |
160 | #else | 160 | #else |
161 | #define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n)))) | 161 | #define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n)))) |
diff --git a/src/lib/libcrypto/des/destest.c b/src/lib/libcrypto/des/destest.c index 9ad4ecb072..df0d615d6b 100644 --- a/src/lib/libcrypto/des/destest.c +++ b/src/lib/libcrypto/des/destest.c | |||
@@ -336,8 +336,15 @@ int main(int argc, char *argv[]) | |||
336 | unsigned char cbc_in[40]; | 336 | unsigned char cbc_in[40]; |
337 | unsigned char cbc_out[40]; | 337 | unsigned char cbc_out[40]; |
338 | DES_LONG cs; | 338 | DES_LONG cs; |
339 | unsigned char qret[4][4],cret[8]; | 339 | unsigned char cret[8]; |
340 | DES_LONG lqret[4]; | 340 | #ifdef _CRAY |
341 | struct { | ||
342 | int a:32; | ||
343 | int b:32; | ||
344 | } lqret[2]; | ||
345 | #else | ||
346 | DES_LONG lqret[4]; | ||
347 | #endif | ||
341 | int num; | 348 | int num; |
342 | char *str; | 349 | char *str; |
343 | 350 | ||
@@ -701,43 +708,40 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); | |||
701 | } | 708 | } |
702 | 709 | ||
703 | printf("Doing quad_cksum\n"); | 710 | printf("Doing quad_cksum\n"); |
704 | /* This is obviously done this way especially to puzzle me. Although | 711 | cs=quad_cksum(cbc_data,(des_cblock *)lqret, |
705 | quad_cksum returns up to 4 groups of 8 bytes, this test gets it to | 712 | (long)strlen((char *)cbc_data),2,(des_cblock *)cbc_iv); |
706 | produce 2 groups then treats them as 4 groups of 4 bytes. | 713 | if (cs != 0x70d7a63aL) |
707 | Ben 13 Feb 1999 */ | ||
708 | cs=quad_cksum(cbc_data,(des_cblock *)qret,strlen((char *)cbc_data),2, | ||
709 | &cbc_iv); | ||
710 | |||
711 | { /* Big-endian fix */ | ||
712 | static DES_LONG l=1; | ||
713 | static unsigned char *c=(unsigned char *)&l; | ||
714 | DES_LONG ll; | ||
715 | |||
716 | j=sizeof(lqret[0])-4; | ||
717 | for (i=0; i<4; i++) | ||
718 | { | 714 | { |
719 | lqret[i]=0; | 715 | printf("quad_cksum error, ret %08lx should be 70d7a63a\n", |
720 | memcpy(&(lqret[i]),&(qret[i][0]),4); | 716 | (unsigned long)cs); |
721 | if (!c[0] && (j > 0)) | 717 | err=1; |
722 | lqret[i]=lqret[i]>>(j*8); /* For Cray */ | ||
723 | } | 718 | } |
724 | 719 | #ifdef _CRAY | |
725 | if (!c[0]) | 720 | if (lqret[0].a != 0x327eba8dL) |
726 | { | 721 | { |
727 | ll=lqret[0]^lqret[3]; | 722 | printf("quad_cksum error, out[0] %08lx is not %08lx\n", |
728 | lqret[0]^=ll; | 723 | (unsigned long)lqret[0].a,0x327eba8dUL); |
729 | lqret[3]^=ll; | 724 | err=1; |
730 | ll=lqret[1]^lqret[2]; | ||
731 | lqret[1]^=ll; | ||
732 | lqret[2]^=ll; | ||
733 | } | 725 | } |
734 | } | 726 | if (lqret[0].b != 0x201a49ccL) |
735 | if (cs != 0x70d7a63aL) | ||
736 | { | 727 | { |
737 | printf("quad_cksum error, ret %08lx should be 70d7a63a\n", | 728 | printf("quad_cksum error, out[1] %08lx is not %08lx\n", |
738 | (unsigned long)cs); | 729 | (unsigned long)lqret[0].b,0x201a49ccUL); |
730 | err=1; | ||
731 | } | ||
732 | if (lqret[1].a != 0x70d7a63aL) | ||
733 | { | ||
734 | printf("quad_cksum error, out[2] %08lx is not %08lx\n", | ||
735 | (unsigned long)lqret[1].a,0x70d7a63aUL); | ||
739 | err=1; | 736 | err=1; |
740 | } | 737 | } |
738 | if (lqret[1].b != 0x501c2c26L) | ||
739 | { | ||
740 | printf("quad_cksum error, out[3] %08lx is not %08lx\n", | ||
741 | (unsigned long)lqret[1].b,0x501c2c26UL); | ||
742 | err=1; | ||
743 | } | ||
744 | #else | ||
741 | if (lqret[0] != 0x327eba8dL) | 745 | if (lqret[0] != 0x327eba8dL) |
742 | { | 746 | { |
743 | printf("quad_cksum error, out[0] %08lx is not %08lx\n", | 747 | printf("quad_cksum error, out[0] %08lx is not %08lx\n", |
@@ -763,6 +767,7 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); | |||
763 | err=1; | 767 | err=1; |
764 | } | 768 | } |
765 | #endif | 769 | #endif |
770 | #endif | ||
766 | 771 | ||
767 | printf("input word alignment test"); | 772 | printf("input word alignment test"); |
768 | for (i=0; i<4; i++) | 773 | for (i=0; i<4; i++) |
diff --git a/src/lib/libcrypto/des/doIP b/src/lib/libcrypto/des/doIP index 18cf231303..e69de29bb2 100644 --- a/src/lib/libcrypto/des/doIP +++ b/src/lib/libcrypto/des/doIP | |||
@@ -1,46 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | @l=( | ||
4 | 0, 1, 2, 3, 4, 5, 6, 7, | ||
5 | 8, 9,10,11,12,13,14,15, | ||
6 | 16,17,18,19,20,21,22,23, | ||
7 | 24,25,26,27,28,29,30,31 | ||
8 | ); | ||
9 | @r=( | ||
10 | 32,33,34,35,36,37,38,39, | ||
11 | 40,41,42,43,44,45,46,47, | ||
12 | 48,49,50,51,52,53,54,55, | ||
13 | 56,57,58,59,60,61,62,63 | ||
14 | ); | ||
15 | |||
16 | require 'shifts.pl'; | ||
17 | |||
18 | sub PERM_OP | ||
19 | { | ||
20 | local(*a,*b,*t,$n,$m)=@_; | ||
21 | |||
22 | @z=&shift(*a,-$n); | ||
23 | @z=&xor(*b,*z); | ||
24 | @z=&and(*z,$m); | ||
25 | @b=&xor(*b,*z); | ||
26 | @z=&shift(*z,$n); | ||
27 | @a=&xor(*a,*z); | ||
28 | } | ||
29 | |||
30 | |||
31 | @L=@l; | ||
32 | @R=@r; | ||
33 | &PERM_OP(*R,*L,*T,4,0x0f0f0f0f); | ||
34 | &PERM_OP(*L,*R,*T,16,0x0000ffff); | ||
35 | &PERM_OP(*R,*L,*T,2,0x33333333); | ||
36 | &PERM_OP(*L,*R,*T,8,0x00ff00ff); | ||
37 | &PERM_OP(*R,*L,*T,1,0x55555555); | ||
38 | &printit(@L); | ||
39 | &printit(@R); | ||
40 | &PERM_OP(*R,*L,*T,1,0x55555555); | ||
41 | &PERM_OP(*L,*R,*T,8,0x00ff00ff); | ||
42 | &PERM_OP(*R,*L,*T,2,0x33333333); | ||
43 | &PERM_OP(*L,*R,*T,16,0x0000ffff); | ||
44 | &PERM_OP(*R,*L,*T,4,0x0f0f0f0f); | ||
45 | &printit(@L); | ||
46 | &printit(@R); | ||
diff --git a/src/lib/libcrypto/des/doPC1 b/src/lib/libcrypto/des/doPC1 index 096afd8c46..e69de29bb2 100644 --- a/src/lib/libcrypto/des/doPC1 +++ b/src/lib/libcrypto/des/doPC1 | |||
@@ -1,110 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | @l=( | ||
4 | 0, 1, 2, 3, 4, 5, 6, 7, | ||
5 | 8, 9,10,11,12,13,14,15, | ||
6 | 16,17,18,19,20,21,22,23, | ||
7 | 24,25,26,27,28,29,30,31 | ||
8 | ); | ||
9 | @r=( | ||
10 | 32,33,34,35,36,37,38,39, | ||
11 | 40,41,42,43,44,45,46,47, | ||
12 | 48,49,50,51,52,53,54,55, | ||
13 | 56,57,58,59,60,61,62,63 | ||
14 | ); | ||
15 | |||
16 | require 'shifts.pl'; | ||
17 | |||
18 | sub PERM_OP | ||
19 | { | ||
20 | local(*a,*b,*t,$n,$m)=@_; | ||
21 | |||
22 | @z=&shift(*a,-$n); | ||
23 | @z=&xor(*b,*z); | ||
24 | @z=&and(*z,$m); | ||
25 | @b=&xor(*b,*z); | ||
26 | @z=&shift(*z,$n); | ||
27 | @a=&xor(*a,*z); | ||
28 | } | ||
29 | |||
30 | sub HPERM_OP2 | ||
31 | { | ||
32 | local(*a,*t,$n,$m)=@_; | ||
33 | local(@x,@y,$i); | ||
34 | |||
35 | @z=&shift(*a,16-$n); | ||
36 | @z=&xor(*a,*z); | ||
37 | @z=&and(*z,$m); | ||
38 | @a=&xor(*a,*z); | ||
39 | @z=&shift(*z,$n-16); | ||
40 | @a=&xor(*a,*z); | ||
41 | } | ||
42 | |||
43 | sub HPERM_OP | ||
44 | { | ||
45 | local(*a,*t,$n,$m)=@_; | ||
46 | local(@x,@y,$i); | ||
47 | |||
48 | for ($i=0; $i<16; $i++) | ||
49 | { | ||
50 | $x[$i]=$a[$i]; | ||
51 | $y[$i]=$a[16+$i]; | ||
52 | } | ||
53 | @z=&shift(*x,-$n); | ||
54 | @z=&xor(*y,*z); | ||
55 | @z=&and(*z,$m); | ||
56 | @y=&xor(*y,*z); | ||
57 | @z=&shift(*z,$n); | ||
58 | @x=&xor(*x,*z); | ||
59 | for ($i=0; $i<16; $i++) | ||
60 | { | ||
61 | $a[$i]=$x[$i]; | ||
62 | $a[16+$i]=$y[$i]; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | @L=@l; | ||
67 | @R=@r; | ||
68 | |||
69 | print "---\n"; &printit(@R); | ||
70 | &PERM_OP(*R,*L,*T,4,0x0f0f0f0f); | ||
71 | print "---\n"; &printit(@R); | ||
72 | &HPERM_OP2(*L,*T,-2,0xcccc0000); | ||
73 | &HPERM_OP2(*R,*T,-2,0xcccc0000); | ||
74 | print "---\n"; &printit(@R); | ||
75 | &PERM_OP(*R,*L,*T,1,0x55555555); | ||
76 | print "---\n"; &printit(@R); | ||
77 | &PERM_OP(*L,*R,*T,8,0x00ff00ff); | ||
78 | print "---\n"; &printit(@R); | ||
79 | &PERM_OP(*R,*L,*T,1,0x55555555); | ||
80 | print "---\n"; &printit(@R); | ||
81 | # &printit(@L); | ||
82 | &printit(@R); | ||
83 | print <<"EOF"; | ||
84 | ============================== | ||
85 | 63 55 47 39 31 23 15 7 | ||
86 | 62 54 46 38 30 22 14 6 | ||
87 | 61 53 45 37 29 21 13 5 | ||
88 | 60 52 44 36 -- -- -- -- | ||
89 | |||
90 | 57 49 41 33 25 17 9 1 | ||
91 | 58 50 42 34 26 18 10 2 | ||
92 | 59 51 43 35 27 19 11 3 | ||
93 | 28 20 12 4 -- -- -- -- | ||
94 | EOF | ||
95 | exit(1); | ||
96 | @A=&and(*R,0x000000ff); | ||
97 | @A=&shift(*A,16); | ||
98 | @B=&and(*R,0x0000ff00); | ||
99 | @C=&and(*R,0x00ff0000); | ||
100 | @C=&shift(*C,-16); | ||
101 | @D=&and(*L,0xf0000000); | ||
102 | @D=&shift(*D,-4); | ||
103 | @A=&or(*A,*B); | ||
104 | @B=&or(*D,*C); | ||
105 | @R=&or(*A,*B); | ||
106 | @L=&and(*L,0x0fffffff); | ||
107 | |||
108 | &printit(@L); | ||
109 | &printit(@R); | ||
110 | |||
diff --git a/src/lib/libcrypto/des/doPC2 b/src/lib/libcrypto/des/doPC2 index fa5cf74cf7..e69de29bb2 100644 --- a/src/lib/libcrypto/des/doPC2 +++ b/src/lib/libcrypto/des/doPC2 | |||
@@ -1,94 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | @PC2_C=(14,17,11,24, 1, 5, | ||
4 | 3,28,15, 6,21,10, | ||
5 | 23,19,12, 4,26, 8, | ||
6 | 16, 7,27,20,13, 2, | ||
7 | ); | ||
8 | |||
9 | @PC2_D=(41,52,31,37,47,55, | ||
10 | 30,40,51,45,33,48, | ||
11 | 44,49,39,56,34,53, | ||
12 | 46,42,50,36,29,32, | ||
13 | ); | ||
14 | |||
15 | $i=0; | ||
16 | foreach (@PC2_C) { | ||
17 | $_--; | ||
18 | # printf "%2d,",$_; | ||
19 | $C{$_}=$i; | ||
20 | ++$i; | ||
21 | # print "\n" if ((($i) % 8) == 0); | ||
22 | } | ||
23 | $i=0; | ||
24 | #print "\n"; | ||
25 | foreach (@PC2_D) { | ||
26 | $_-=28; | ||
27 | $_--; | ||
28 | # printf "%2d,",$_; | ||
29 | $D{$_}=$i; | ||
30 | $i++; | ||
31 | # print "\n" if ((($i) % 8) == 0); | ||
32 | } | ||
33 | |||
34 | #print "\n"; | ||
35 | foreach $i (0 .. 27) | ||
36 | { | ||
37 | $_=$C{$i}; | ||
38 | # printf "%2d,",$_; | ||
39 | $i++; | ||
40 | # print "\n" if ((($i) % 8) == 0); | ||
41 | } | ||
42 | #print "\n"; | ||
43 | |||
44 | #print "\n"; | ||
45 | foreach $i (0 .. 27) | ||
46 | { | ||
47 | $_=$D{$i}; | ||
48 | # printf "%2d,",$_; | ||
49 | $i++; | ||
50 | # print "\n" if ((($i) % 8) == 0); | ||
51 | } | ||
52 | #print "\n"; | ||
53 | |||
54 | print "static ulong skb[8][64]={\n"; | ||
55 | &doit("C",*C, 0, 1, 2, 3, 4, 5); | ||
56 | &doit("C",*C, 6, 7, 9,10,11,12); | ||
57 | &doit("C",*C,13,14,15,16,18,19); | ||
58 | &doit("C",*C,20,22,23,25,26,27); | ||
59 | |||
60 | &doit("D",*D, 0, 1, 2, 3, 4, 5); | ||
61 | &doit("D",*D, 7, 8,10,11,12,13); | ||
62 | &doit("D",*D,15,16,17,18,19,20); | ||
63 | &doit("D",*D,21,22,23,24,26,27); | ||
64 | print "};\n"; | ||
65 | |||
66 | sub doit | ||
67 | { | ||
68 | local($l,*A,@b)=@_; | ||
69 | local(@out); | ||
70 | |||
71 | printf("/* for $l bits (numbered as per FIPS 46) %d %d %d %d %d %d */\n", | ||
72 | $b[0]+1, $b[1]+1, $b[2]+1, $b[3]+1, $b[4]+1, $b[5]+1); | ||
73 | for ($i=0; $i<64; $i++) | ||
74 | { | ||
75 | $out[$i]=0; | ||
76 | $j=1; | ||
77 | #print "\n"; | ||
78 | for ($k=0; $k<6; $k++) | ||
79 | { | ||
80 | $l=$A{$b[$k]}; | ||
81 | #print"$l - "; | ||
82 | if ((1<<$k) & $i) | ||
83 | { | ||
84 | $ll=int($l/6)*8+($l%6); | ||
85 | $out[$i]|=1<<($ll); | ||
86 | } | ||
87 | } | ||
88 | $pp=$out[$i]; | ||
89 | $pp=($pp&0xff0000ff)| (($pp&0x00ff0000)>>8)| | ||
90 | (($pp&0x0000ff00)<<8); | ||
91 | printf("0x%08X,",$pp); | ||
92 | print "\n" if (($i+1) % 4 == 0); | ||
93 | } | ||
94 | } | ||
diff --git a/src/lib/libcrypto/des/fcrypt.c b/src/lib/libcrypto/des/fcrypt.c index fa1b8aa34a..9b21f81cc2 100644 --- a/src/lib/libcrypto/des/fcrypt.c +++ b/src/lib/libcrypto/des/fcrypt.c | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | /* This version of crypt has been developed from my MIT compatible | 4 | /* This version of crypt has been developed from my MIT compatible |
5 | * DES library. | 5 | * DES library. |
6 | * The library is available at pub/Crypto/DES at ftp.psy.uq.oz.au | ||
7 | * Eric Young (eay@cryptsoft.com) | 6 | * Eric Young (eay@cryptsoft.com) |
8 | */ | 7 | */ |
9 | 8 | ||
diff --git a/src/lib/libcrypto/des/fcrypt_b.c b/src/lib/libcrypto/des/fcrypt_b.c index 83c94054e3..22c87f5983 100644 --- a/src/lib/libcrypto/des/fcrypt_b.c +++ b/src/lib/libcrypto/des/fcrypt_b.c | |||
@@ -97,7 +97,7 @@ void fcrypt_body(DES_LONG *out, des_key_schedule ks, DES_LONG Eswap0, | |||
97 | 97 | ||
98 | for (j=0; j<25; j++) | 98 | for (j=0; j<25; j++) |
99 | { | 99 | { |
100 | #ifdef DES_UNROLL | 100 | #ifndef DES_UNROLL |
101 | register int i; | 101 | register int i; |
102 | 102 | ||
103 | for (i=0; i<32; i+=8) | 103 | for (i=0; i<32; i+=8) |
diff --git a/src/lib/libcrypto/des/ncbc_enc.c b/src/lib/libcrypto/des/ncbc_enc.c index e0e67a417d..3b681691a9 100644 --- a/src/lib/libcrypto/des/ncbc_enc.c +++ b/src/lib/libcrypto/des/ncbc_enc.c | |||
@@ -1,4 +1,9 @@ | |||
1 | /* crypto/des/ncbc_enc.c */ | 1 | /* crypto/des/ncbc_enc.c */ |
2 | /* | ||
3 | * #included by: | ||
4 | * cbc_enc.c (des_cbc_encrypt) | ||
5 | * des_enc.c (des_ncbc_encrypt) | ||
6 | */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 7 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 8 | * All rights reserved. |
4 | * | 9 | * |
diff --git a/src/lib/libcrypto/des/podd.h b/src/lib/libcrypto/des/podd.h index 1b2bfe0843..e69de29bb2 100644 --- a/src/lib/libcrypto/des/podd.h +++ b/src/lib/libcrypto/des/podd.h | |||
@@ -1,75 +0,0 @@ | |||
1 | /* crypto/des/podd.h */ | ||
2 | /* Copyright (C) 1995-1998 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 | static const unsigned char odd_parity[256]={ | ||
60 | 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14, | ||
61 | 16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31, | ||
62 | 32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47, | ||
63 | 49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62, | ||
64 | 64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79, | ||
65 | 81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94, | ||
66 | 97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110, | ||
67 | 112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127, | ||
68 | 128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143, | ||
69 | 145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158, | ||
70 | 161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174, | ||
71 | 176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191, | ||
72 | 193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206, | ||
73 | 208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223, | ||
74 | 224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239, | ||
75 | 241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254}; | ||
diff --git a/src/lib/libcrypto/des/qud_cksm.c b/src/lib/libcrypto/des/qud_cksm.c index 6ce8c61b42..5f0ec5387f 100644 --- a/src/lib/libcrypto/des/qud_cksm.c +++ b/src/lib/libcrypto/des/qud_cksm.c | |||
@@ -80,10 +80,14 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[], | |||
80 | int i; | 80 | int i; |
81 | long l; | 81 | long l; |
82 | const unsigned char *cp; | 82 | const unsigned char *cp; |
83 | unsigned char *lp; | 83 | #ifdef _CRAY |
84 | short *lp; | ||
85 | #else | ||
86 | DES_LONG *lp; | ||
87 | #endif | ||
84 | 88 | ||
85 | if (out_count < 1) out_count=1; | 89 | if (out_count < 1) out_count=1; |
86 | lp = &(output[0])[0]; | 90 | lp = (DES_LONG *) &(output[0])[0]; |
87 | 91 | ||
88 | z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); | 92 | z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); |
89 | z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); | 93 | z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); |
@@ -114,25 +118,10 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[], | |||
114 | } | 118 | } |
115 | if (lp != NULL) | 119 | if (lp != NULL) |
116 | { | 120 | { |
117 | /* I believe I finally have things worked out. | 121 | /* The MIT library assumes that the checksum is |
118 | * The MIT library assumes that the checksum | 122 | * composed of 2*out_count 32 bit ints */ |
119 | * is one huge number and it is returned in a | 123 | *lp++ = z0; |
120 | * host dependant byte order. | 124 | *lp++ = z1; |
121 | */ | ||
122 | static DES_LONG ltmp=1; | ||
123 | static unsigned char *c=(unsigned char *)<mp; | ||
124 | |||
125 | if (c[0]) | ||
126 | { | ||
127 | l2c(z0,lp); | ||
128 | l2c(z1,lp); | ||
129 | } | ||
130 | else | ||
131 | { | ||
132 | lp = &(output[out_count-i-1])[0]; | ||
133 | l2n(z1,lp); | ||
134 | l2n(z0,lp); | ||
135 | } | ||
136 | } | 125 | } |
137 | } | 126 | } |
138 | return(z0); | 127 | return(z0); |
diff --git a/src/lib/libcrypto/des/rand_key.c b/src/lib/libcrypto/des/rand_key.c index 7816a8f25c..ee1a6c274e 100644 --- a/src/lib/libcrypto/des/rand_key.c +++ b/src/lib/libcrypto/des/rand_key.c | |||
@@ -63,7 +63,11 @@ void des_random_seed(des_cblock *key) | |||
63 | 63 | ||
64 | int des_random_key(des_cblock *ret) | 64 | int des_random_key(des_cblock *ret) |
65 | { | 65 | { |
66 | int r = RAND_bytes((unsigned char *)ret, sizeof(des_cblock)); | 66 | do |
67 | { | ||
68 | if (RAND_bytes((unsigned char *)ret, sizeof(des_cblock)) != 1) | ||
69 | return (0); | ||
70 | } while (des_is_weak_key(ret)); | ||
67 | des_set_odd_parity(ret); | 71 | des_set_odd_parity(ret); |
68 | return r; | 72 | return (1); |
69 | } | 73 | } |
diff --git a/src/lib/libcrypto/des/set_key.c b/src/lib/libcrypto/des/set_key.c index bbdc71ba6b..09afd4fc03 100644 --- a/src/lib/libcrypto/des/set_key.c +++ b/src/lib/libcrypto/des/set_key.c | |||
@@ -64,12 +64,27 @@ | |||
64 | * 1.0 First working version | 64 | * 1.0 First working version |
65 | */ | 65 | */ |
66 | #include "des_locl.h" | 66 | #include "des_locl.h" |
67 | #include "podd.h" | ||
68 | #include "sk.h" | ||
69 | 67 | ||
70 | static int check_parity(const_des_cblock *key); | ||
71 | OPENSSL_GLOBAL int des_check_key=0; | 68 | OPENSSL_GLOBAL int des_check_key=0; |
72 | 69 | ||
70 | static const unsigned char odd_parity[256]={ | ||
71 | 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14, | ||
72 | 16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31, | ||
73 | 32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47, | ||
74 | 49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62, | ||
75 | 64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79, | ||
76 | 81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94, | ||
77 | 97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110, | ||
78 | 112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127, | ||
79 | 128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143, | ||
80 | 145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158, | ||
81 | 161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174, | ||
82 | 176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191, | ||
83 | 193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206, | ||
84 | 208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223, | ||
85 | 224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239, | ||
86 | 241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254}; | ||
87 | |||
73 | void des_set_odd_parity(des_cblock *key) | 88 | void des_set_odd_parity(des_cblock *key) |
74 | { | 89 | { |
75 | int i; | 90 | int i; |
@@ -78,7 +93,7 @@ void des_set_odd_parity(des_cblock *key) | |||
78 | (*key)[i]=odd_parity[(*key)[i]]; | 93 | (*key)[i]=odd_parity[(*key)[i]]; |
79 | } | 94 | } |
80 | 95 | ||
81 | static int check_parity(const_des_cblock *key) | 96 | int des_check_key_parity(const_des_cblock *key) |
82 | { | 97 | { |
83 | int i; | 98 | int i; |
84 | 99 | ||
@@ -145,6 +160,153 @@ int des_is_weak_key(const_des_cblock *key) | |||
145 | #define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\ | 160 | #define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\ |
146 | (a)=(a)^(t)^(t>>(16-(n)))) | 161 | (a)=(a)^(t)^(t>>(16-(n)))) |
147 | 162 | ||
163 | static const DES_LONG des_skb[8][64]={ | ||
164 | { | ||
165 | /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ | ||
166 | 0x00000000L,0x00000010L,0x20000000L,0x20000010L, | ||
167 | 0x00010000L,0x00010010L,0x20010000L,0x20010010L, | ||
168 | 0x00000800L,0x00000810L,0x20000800L,0x20000810L, | ||
169 | 0x00010800L,0x00010810L,0x20010800L,0x20010810L, | ||
170 | 0x00000020L,0x00000030L,0x20000020L,0x20000030L, | ||
171 | 0x00010020L,0x00010030L,0x20010020L,0x20010030L, | ||
172 | 0x00000820L,0x00000830L,0x20000820L,0x20000830L, | ||
173 | 0x00010820L,0x00010830L,0x20010820L,0x20010830L, | ||
174 | 0x00080000L,0x00080010L,0x20080000L,0x20080010L, | ||
175 | 0x00090000L,0x00090010L,0x20090000L,0x20090010L, | ||
176 | 0x00080800L,0x00080810L,0x20080800L,0x20080810L, | ||
177 | 0x00090800L,0x00090810L,0x20090800L,0x20090810L, | ||
178 | 0x00080020L,0x00080030L,0x20080020L,0x20080030L, | ||
179 | 0x00090020L,0x00090030L,0x20090020L,0x20090030L, | ||
180 | 0x00080820L,0x00080830L,0x20080820L,0x20080830L, | ||
181 | 0x00090820L,0x00090830L,0x20090820L,0x20090830L, | ||
182 | },{ | ||
183 | /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */ | ||
184 | 0x00000000L,0x02000000L,0x00002000L,0x02002000L, | ||
185 | 0x00200000L,0x02200000L,0x00202000L,0x02202000L, | ||
186 | 0x00000004L,0x02000004L,0x00002004L,0x02002004L, | ||
187 | 0x00200004L,0x02200004L,0x00202004L,0x02202004L, | ||
188 | 0x00000400L,0x02000400L,0x00002400L,0x02002400L, | ||
189 | 0x00200400L,0x02200400L,0x00202400L,0x02202400L, | ||
190 | 0x00000404L,0x02000404L,0x00002404L,0x02002404L, | ||
191 | 0x00200404L,0x02200404L,0x00202404L,0x02202404L, | ||
192 | 0x10000000L,0x12000000L,0x10002000L,0x12002000L, | ||
193 | 0x10200000L,0x12200000L,0x10202000L,0x12202000L, | ||
194 | 0x10000004L,0x12000004L,0x10002004L,0x12002004L, | ||
195 | 0x10200004L,0x12200004L,0x10202004L,0x12202004L, | ||
196 | 0x10000400L,0x12000400L,0x10002400L,0x12002400L, | ||
197 | 0x10200400L,0x12200400L,0x10202400L,0x12202400L, | ||
198 | 0x10000404L,0x12000404L,0x10002404L,0x12002404L, | ||
199 | 0x10200404L,0x12200404L,0x10202404L,0x12202404L, | ||
200 | },{ | ||
201 | /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */ | ||
202 | 0x00000000L,0x00000001L,0x00040000L,0x00040001L, | ||
203 | 0x01000000L,0x01000001L,0x01040000L,0x01040001L, | ||
204 | 0x00000002L,0x00000003L,0x00040002L,0x00040003L, | ||
205 | 0x01000002L,0x01000003L,0x01040002L,0x01040003L, | ||
206 | 0x00000200L,0x00000201L,0x00040200L,0x00040201L, | ||
207 | 0x01000200L,0x01000201L,0x01040200L,0x01040201L, | ||
208 | 0x00000202L,0x00000203L,0x00040202L,0x00040203L, | ||
209 | 0x01000202L,0x01000203L,0x01040202L,0x01040203L, | ||
210 | 0x08000000L,0x08000001L,0x08040000L,0x08040001L, | ||
211 | 0x09000000L,0x09000001L,0x09040000L,0x09040001L, | ||
212 | 0x08000002L,0x08000003L,0x08040002L,0x08040003L, | ||
213 | 0x09000002L,0x09000003L,0x09040002L,0x09040003L, | ||
214 | 0x08000200L,0x08000201L,0x08040200L,0x08040201L, | ||
215 | 0x09000200L,0x09000201L,0x09040200L,0x09040201L, | ||
216 | 0x08000202L,0x08000203L,0x08040202L,0x08040203L, | ||
217 | 0x09000202L,0x09000203L,0x09040202L,0x09040203L, | ||
218 | },{ | ||
219 | /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */ | ||
220 | 0x00000000L,0x00100000L,0x00000100L,0x00100100L, | ||
221 | 0x00000008L,0x00100008L,0x00000108L,0x00100108L, | ||
222 | 0x00001000L,0x00101000L,0x00001100L,0x00101100L, | ||
223 | 0x00001008L,0x00101008L,0x00001108L,0x00101108L, | ||
224 | 0x04000000L,0x04100000L,0x04000100L,0x04100100L, | ||
225 | 0x04000008L,0x04100008L,0x04000108L,0x04100108L, | ||
226 | 0x04001000L,0x04101000L,0x04001100L,0x04101100L, | ||
227 | 0x04001008L,0x04101008L,0x04001108L,0x04101108L, | ||
228 | 0x00020000L,0x00120000L,0x00020100L,0x00120100L, | ||
229 | 0x00020008L,0x00120008L,0x00020108L,0x00120108L, | ||
230 | 0x00021000L,0x00121000L,0x00021100L,0x00121100L, | ||
231 | 0x00021008L,0x00121008L,0x00021108L,0x00121108L, | ||
232 | 0x04020000L,0x04120000L,0x04020100L,0x04120100L, | ||
233 | 0x04020008L,0x04120008L,0x04020108L,0x04120108L, | ||
234 | 0x04021000L,0x04121000L,0x04021100L,0x04121100L, | ||
235 | 0x04021008L,0x04121008L,0x04021108L,0x04121108L, | ||
236 | },{ | ||
237 | /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ | ||
238 | 0x00000000L,0x10000000L,0x00010000L,0x10010000L, | ||
239 | 0x00000004L,0x10000004L,0x00010004L,0x10010004L, | ||
240 | 0x20000000L,0x30000000L,0x20010000L,0x30010000L, | ||
241 | 0x20000004L,0x30000004L,0x20010004L,0x30010004L, | ||
242 | 0x00100000L,0x10100000L,0x00110000L,0x10110000L, | ||
243 | 0x00100004L,0x10100004L,0x00110004L,0x10110004L, | ||
244 | 0x20100000L,0x30100000L,0x20110000L,0x30110000L, | ||
245 | 0x20100004L,0x30100004L,0x20110004L,0x30110004L, | ||
246 | 0x00001000L,0x10001000L,0x00011000L,0x10011000L, | ||
247 | 0x00001004L,0x10001004L,0x00011004L,0x10011004L, | ||
248 | 0x20001000L,0x30001000L,0x20011000L,0x30011000L, | ||
249 | 0x20001004L,0x30001004L,0x20011004L,0x30011004L, | ||
250 | 0x00101000L,0x10101000L,0x00111000L,0x10111000L, | ||
251 | 0x00101004L,0x10101004L,0x00111004L,0x10111004L, | ||
252 | 0x20101000L,0x30101000L,0x20111000L,0x30111000L, | ||
253 | 0x20101004L,0x30101004L,0x20111004L,0x30111004L, | ||
254 | },{ | ||
255 | /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */ | ||
256 | 0x00000000L,0x08000000L,0x00000008L,0x08000008L, | ||
257 | 0x00000400L,0x08000400L,0x00000408L,0x08000408L, | ||
258 | 0x00020000L,0x08020000L,0x00020008L,0x08020008L, | ||
259 | 0x00020400L,0x08020400L,0x00020408L,0x08020408L, | ||
260 | 0x00000001L,0x08000001L,0x00000009L,0x08000009L, | ||
261 | 0x00000401L,0x08000401L,0x00000409L,0x08000409L, | ||
262 | 0x00020001L,0x08020001L,0x00020009L,0x08020009L, | ||
263 | 0x00020401L,0x08020401L,0x00020409L,0x08020409L, | ||
264 | 0x02000000L,0x0A000000L,0x02000008L,0x0A000008L, | ||
265 | 0x02000400L,0x0A000400L,0x02000408L,0x0A000408L, | ||
266 | 0x02020000L,0x0A020000L,0x02020008L,0x0A020008L, | ||
267 | 0x02020400L,0x0A020400L,0x02020408L,0x0A020408L, | ||
268 | 0x02000001L,0x0A000001L,0x02000009L,0x0A000009L, | ||
269 | 0x02000401L,0x0A000401L,0x02000409L,0x0A000409L, | ||
270 | 0x02020001L,0x0A020001L,0x02020009L,0x0A020009L, | ||
271 | 0x02020401L,0x0A020401L,0x02020409L,0x0A020409L, | ||
272 | },{ | ||
273 | /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */ | ||
274 | 0x00000000L,0x00000100L,0x00080000L,0x00080100L, | ||
275 | 0x01000000L,0x01000100L,0x01080000L,0x01080100L, | ||
276 | 0x00000010L,0x00000110L,0x00080010L,0x00080110L, | ||
277 | 0x01000010L,0x01000110L,0x01080010L,0x01080110L, | ||
278 | 0x00200000L,0x00200100L,0x00280000L,0x00280100L, | ||
279 | 0x01200000L,0x01200100L,0x01280000L,0x01280100L, | ||
280 | 0x00200010L,0x00200110L,0x00280010L,0x00280110L, | ||
281 | 0x01200010L,0x01200110L,0x01280010L,0x01280110L, | ||
282 | 0x00000200L,0x00000300L,0x00080200L,0x00080300L, | ||
283 | 0x01000200L,0x01000300L,0x01080200L,0x01080300L, | ||
284 | 0x00000210L,0x00000310L,0x00080210L,0x00080310L, | ||
285 | 0x01000210L,0x01000310L,0x01080210L,0x01080310L, | ||
286 | 0x00200200L,0x00200300L,0x00280200L,0x00280300L, | ||
287 | 0x01200200L,0x01200300L,0x01280200L,0x01280300L, | ||
288 | 0x00200210L,0x00200310L,0x00280210L,0x00280310L, | ||
289 | 0x01200210L,0x01200310L,0x01280210L,0x01280310L, | ||
290 | },{ | ||
291 | /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */ | ||
292 | 0x00000000L,0x04000000L,0x00040000L,0x04040000L, | ||
293 | 0x00000002L,0x04000002L,0x00040002L,0x04040002L, | ||
294 | 0x00002000L,0x04002000L,0x00042000L,0x04042000L, | ||
295 | 0x00002002L,0x04002002L,0x00042002L,0x04042002L, | ||
296 | 0x00000020L,0x04000020L,0x00040020L,0x04040020L, | ||
297 | 0x00000022L,0x04000022L,0x00040022L,0x04040022L, | ||
298 | 0x00002020L,0x04002020L,0x00042020L,0x04042020L, | ||
299 | 0x00002022L,0x04002022L,0x00042022L,0x04042022L, | ||
300 | 0x00000800L,0x04000800L,0x00040800L,0x04040800L, | ||
301 | 0x00000802L,0x04000802L,0x00040802L,0x04040802L, | ||
302 | 0x00002800L,0x04002800L,0x00042800L,0x04042800L, | ||
303 | 0x00002802L,0x04002802L,0x00042802L,0x04042802L, | ||
304 | 0x00000820L,0x04000820L,0x00040820L,0x04040820L, | ||
305 | 0x00000822L,0x04000822L,0x00040822L,0x04040822L, | ||
306 | 0x00002820L,0x04002820L,0x00042820L,0x04042820L, | ||
307 | 0x00002822L,0x04002822L,0x00042822L,0x04042822L, | ||
308 | }}; | ||
309 | |||
148 | int des_set_key(const_des_cblock *key, des_key_schedule schedule) | 310 | int des_set_key(const_des_cblock *key, des_key_schedule schedule) |
149 | { | 311 | { |
150 | if (des_check_key) | 312 | if (des_check_key) |
@@ -164,7 +326,7 @@ int des_set_key(const_des_cblock *key, des_key_schedule schedule) | |||
164 | */ | 326 | */ |
165 | int des_set_key_checked(const_des_cblock *key, des_key_schedule schedule) | 327 | int des_set_key_checked(const_des_cblock *key, des_key_schedule schedule) |
166 | { | 328 | { |
167 | if (!check_parity(key)) | 329 | if (!des_check_key_parity(key)) |
168 | return(-1); | 330 | return(-1); |
169 | if (des_is_weak_key(key)) | 331 | if (des_is_weak_key(key)) |
170 | return(-2); | 332 | return(-2); |
@@ -186,20 +348,7 @@ void des_set_key_unchecked(const_des_cblock *key, des_key_schedule schedule) | |||
186 | c2l(in,c); | 348 | c2l(in,c); |
187 | c2l(in,d); | 349 | c2l(in,d); |
188 | 350 | ||
189 | /* do PC1 in 60 simple operations */ | 351 | /* do PC1 in 47 simple operations :-) |
190 | /* PERM_OP(d,c,t,4,0x0f0f0f0fL); | ||
191 | HPERM_OP(c,t,-2, 0xcccc0000L); | ||
192 | HPERM_OP(c,t,-1, 0xaaaa0000L); | ||
193 | HPERM_OP(c,t, 8, 0x00ff0000L); | ||
194 | HPERM_OP(c,t,-1, 0xaaaa0000L); | ||
195 | HPERM_OP(d,t,-8, 0xff000000L); | ||
196 | HPERM_OP(d,t, 8, 0x00ff0000L); | ||
197 | HPERM_OP(d,t, 2, 0x33330000L); | ||
198 | d=((d&0x00aa00aaL)<<7L)|((d&0x55005500L)>>7L)|(d&0xaa55aa55L); | ||
199 | d=(d>>8)|((c&0xf0000000L)>>4); | ||
200 | c&=0x0fffffffL; */ | ||
201 | |||
202 | /* I now do it in 47 simple operations :-) | ||
203 | * Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov) | 352 | * Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov) |
204 | * for the inspiration. :-) */ | 353 | * for the inspiration. :-) */ |
205 | PERM_OP (d,c,t,4,0x0f0f0f0fL); | 354 | PERM_OP (d,c,t,4,0x0f0f0f0fL); |
@@ -223,9 +372,9 @@ void des_set_key_unchecked(const_des_cblock *key, des_key_schedule schedule) | |||
223 | /* could be a few less shifts but I am to lazy at this | 372 | /* could be a few less shifts but I am to lazy at this |
224 | * point in time to investigate */ | 373 | * point in time to investigate */ |
225 | s= des_skb[0][ (c )&0x3f ]| | 374 | s= des_skb[0][ (c )&0x3f ]| |
226 | des_skb[1][((c>> 6)&0x03)|((c>> 7L)&0x3c)]| | 375 | des_skb[1][((c>> 6L)&0x03)|((c>> 7L)&0x3c)]| |
227 | des_skb[2][((c>>13)&0x0f)|((c>>14L)&0x30)]| | 376 | des_skb[2][((c>>13L)&0x0f)|((c>>14L)&0x30)]| |
228 | des_skb[3][((c>>20)&0x01)|((c>>21L)&0x06) | | 377 | des_skb[3][((c>>20L)&0x01)|((c>>21L)&0x06) | |
229 | ((c>>22L)&0x38)]; | 378 | ((c>>22L)&0x38)]; |
230 | t= des_skb[4][ (d )&0x3f ]| | 379 | t= des_skb[4][ (d )&0x3f ]| |
231 | des_skb[5][((d>> 7L)&0x03)|((d>> 8L)&0x3c)]| | 380 | des_skb[5][((d>> 7L)&0x03)|((d>> 8L)&0x3c)]| |
@@ -245,3 +394,9 @@ int des_key_sched(const_des_cblock *key, des_key_schedule schedule) | |||
245 | { | 394 | { |
246 | return(des_set_key(key,schedule)); | 395 | return(des_set_key(key,schedule)); |
247 | } | 396 | } |
397 | |||
398 | #undef des_fixup_key_parity | ||
399 | void des_fixup_key_parity(des_cblock *key) | ||
400 | { | ||
401 | des_set_odd_parity(key); | ||
402 | } | ||
diff --git a/src/lib/libcrypto/des/shifts.pl b/src/lib/libcrypto/des/shifts.pl index ba686d8ef5..e69de29bb2 100644 --- a/src/lib/libcrypto/des/shifts.pl +++ b/src/lib/libcrypto/des/shifts.pl | |||
@@ -1,198 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | sub lab_shift | ||
4 | { | ||
5 | local(*a,$n)=@_; | ||
6 | local(@r,$i,$j,$k,$d,@z); | ||
7 | |||
8 | @r=&shift(*a,$n); | ||
9 | foreach $i (0 .. 31) | ||
10 | { | ||
11 | @z=split(/\^/,$r[$i]); | ||
12 | for ($j=0; $j <= $#z; $j++) | ||
13 | { | ||
14 | ($d)=($z[$j] =~ /^(..)/); | ||
15 | ($k)=($z[$j] =~ /\[(.*)\]$/); | ||
16 | $k.=",$n" if ($k ne ""); | ||
17 | $k="$n" if ($k eq ""); | ||
18 | $d="$d[$k]"; | ||
19 | $z[$j]=$d; | ||
20 | } | ||
21 | $r[$i]=join('^',@z); | ||
22 | } | ||
23 | return(@r); | ||
24 | } | ||
25 | |||
26 | sub shift | ||
27 | { | ||
28 | local(*a,$n)=@_; | ||
29 | local(@f); | ||
30 | |||
31 | if ($n > 0) | ||
32 | { | ||
33 | @f=&shiftl(*a,$n); | ||
34 | } | ||
35 | else | ||
36 | { | ||
37 | @f=&shiftr(*a,-$n); | ||
38 | } | ||
39 | return(@f); | ||
40 | } | ||
41 | |||
42 | sub rotate | ||
43 | { | ||
44 | local(*a,$n)=@_; | ||
45 | local(@f); | ||
46 | |||
47 | if ($n > 0) | ||
48 | { @f=&rotatel(*a,$n); } | ||
49 | else | ||
50 | { @f=&rotater(*a,-$n); } | ||
51 | return(@f); | ||
52 | } | ||
53 | |||
54 | sub rotater | ||
55 | { | ||
56 | local(*a,$n)=@_; | ||
57 | local(@f,@g); | ||
58 | |||
59 | @f=&shiftr(*a,$n); | ||
60 | @g=&shiftl(*a,32-$n); | ||
61 | $#f=31; | ||
62 | $#g=31; | ||
63 | return(&or(*f,*g)); | ||
64 | } | ||
65 | |||
66 | sub rotatel | ||
67 | { | ||
68 | local(*a,$n)=@_; | ||
69 | local(@f,@g); | ||
70 | |||
71 | @f=&shiftl(*a,$n); | ||
72 | @g=&shiftr(*a,32-$n); | ||
73 | $#f=31; | ||
74 | $#g=31; | ||
75 | return(&or(*f,*g)); | ||
76 | } | ||
77 | |||
78 | sub shiftr | ||
79 | { | ||
80 | local(*a,$n)=@_; | ||
81 | local(@r,$i); | ||
82 | |||
83 | $#r=31; | ||
84 | foreach $i (0 .. 31) | ||
85 | { | ||
86 | if (($i+$n) > 31) | ||
87 | { | ||
88 | $r[$i]="--"; | ||
89 | } | ||
90 | else | ||
91 | { | ||
92 | $r[$i]=$a[$i+$n]; | ||
93 | } | ||
94 | } | ||
95 | return(@r); | ||
96 | } | ||
97 | |||
98 | sub shiftl | ||
99 | { | ||
100 | local(*a,$n)=@_; | ||
101 | local(@r,$i); | ||
102 | |||
103 | $#r=31; | ||
104 | foreach $i (0 .. 31) | ||
105 | { | ||
106 | if ($i < $n) | ||
107 | { | ||
108 | $r[$i]="--"; | ||
109 | } | ||
110 | else | ||
111 | { | ||
112 | $r[$i]=$a[$i-$n]; | ||
113 | } | ||
114 | } | ||
115 | return(@r); | ||
116 | } | ||
117 | |||
118 | sub printit | ||
119 | { | ||
120 | local(@a)=@_; | ||
121 | local($i); | ||
122 | |||
123 | foreach $i (0 .. 31) | ||
124 | { | ||
125 | printf "%2s ",$a[$i]; | ||
126 | print "\n" if (($i%8) == 7); | ||
127 | } | ||
128 | print "\n"; | ||
129 | } | ||
130 | |||
131 | sub xor | ||
132 | { | ||
133 | local(*a,*b)=@_; | ||
134 | local(@r,$i); | ||
135 | |||
136 | $#r=31; | ||
137 | foreach $i (0 .. 31) | ||
138 | { | ||
139 | $r[$i]=&compress($a[$i].'^'.$b[$i]); | ||
140 | # $r[$i]=$a[$i]."^".$b[$i]; | ||
141 | } | ||
142 | return(@r); | ||
143 | } | ||
144 | |||
145 | sub and | ||
146 | { | ||
147 | local(*a,$m)=@_; | ||
148 | local(@r,$i); | ||
149 | |||
150 | $#r=31; | ||
151 | foreach $i (0 .. 31) | ||
152 | { | ||
153 | $r[$i]=(($m & (1<<$i))?($a[$i]):('--')); | ||
154 | } | ||
155 | return(@r); | ||
156 | } | ||
157 | |||
158 | sub or | ||
159 | { | ||
160 | local(*a,*b)=@_; | ||
161 | local(@r,$i); | ||
162 | |||
163 | $#r=31; | ||
164 | foreach $i (0 .. 31) | ||
165 | { | ||
166 | $r[$i]='--' if (($a[$i] eq '--') && ($b[$i] eq '--')); | ||
167 | $r[$i]=$a[$i] if (($a[$i] ne '--') && ($b[$i] eq '--')); | ||
168 | $r[$i]=$b[$i] if (($a[$i] eq '--') && ($b[$i] ne '--')); | ||
169 | $r[$i]='++' if (($a[$i] ne '--') && ($b[$i] ne '--')); | ||
170 | } | ||
171 | return(@r); | ||
172 | } | ||
173 | |||
174 | sub compress | ||
175 | { | ||
176 | local($s)=@_; | ||
177 | local($_,$i,@a,%a,$r); | ||
178 | |||
179 | $s =~ s/\^\^/\^/g; | ||
180 | $s =~ s/^\^//; | ||
181 | $s =~ s/\^$//; | ||
182 | @a=split(/\^/,$s); | ||
183 | |||
184 | while ($#a >= 0) | ||
185 | { | ||
186 | $_=shift(@a); | ||
187 | next unless /\d/; | ||
188 | $a{$_}++; | ||
189 | } | ||
190 | foreach $i (sort keys %a) | ||
191 | { | ||
192 | next if ($a{$i}%2 == 0); | ||
193 | $r.="$i^"; | ||
194 | } | ||
195 | chop($r); | ||
196 | return($r); | ||
197 | } | ||
198 | 1; | ||
diff --git a/src/lib/libcrypto/des/sk.h b/src/lib/libcrypto/des/sk.h index f2ade88c7c..e69de29bb2 100644 --- a/src/lib/libcrypto/des/sk.h +++ b/src/lib/libcrypto/des/sk.h | |||
@@ -1,204 +0,0 @@ | |||
1 | /* crypto/des/sk.h */ | ||
2 | /* Copyright (C) 1995-1998 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 | static const DES_LONG des_skb[8][64]={ | ||
60 | { | ||
61 | /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ | ||
62 | 0x00000000L,0x00000010L,0x20000000L,0x20000010L, | ||
63 | 0x00010000L,0x00010010L,0x20010000L,0x20010010L, | ||
64 | 0x00000800L,0x00000810L,0x20000800L,0x20000810L, | ||
65 | 0x00010800L,0x00010810L,0x20010800L,0x20010810L, | ||
66 | 0x00000020L,0x00000030L,0x20000020L,0x20000030L, | ||
67 | 0x00010020L,0x00010030L,0x20010020L,0x20010030L, | ||
68 | 0x00000820L,0x00000830L,0x20000820L,0x20000830L, | ||
69 | 0x00010820L,0x00010830L,0x20010820L,0x20010830L, | ||
70 | 0x00080000L,0x00080010L,0x20080000L,0x20080010L, | ||
71 | 0x00090000L,0x00090010L,0x20090000L,0x20090010L, | ||
72 | 0x00080800L,0x00080810L,0x20080800L,0x20080810L, | ||
73 | 0x00090800L,0x00090810L,0x20090800L,0x20090810L, | ||
74 | 0x00080020L,0x00080030L,0x20080020L,0x20080030L, | ||
75 | 0x00090020L,0x00090030L,0x20090020L,0x20090030L, | ||
76 | 0x00080820L,0x00080830L,0x20080820L,0x20080830L, | ||
77 | 0x00090820L,0x00090830L,0x20090820L,0x20090830L, | ||
78 | },{ | ||
79 | /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */ | ||
80 | 0x00000000L,0x02000000L,0x00002000L,0x02002000L, | ||
81 | 0x00200000L,0x02200000L,0x00202000L,0x02202000L, | ||
82 | 0x00000004L,0x02000004L,0x00002004L,0x02002004L, | ||
83 | 0x00200004L,0x02200004L,0x00202004L,0x02202004L, | ||
84 | 0x00000400L,0x02000400L,0x00002400L,0x02002400L, | ||
85 | 0x00200400L,0x02200400L,0x00202400L,0x02202400L, | ||
86 | 0x00000404L,0x02000404L,0x00002404L,0x02002404L, | ||
87 | 0x00200404L,0x02200404L,0x00202404L,0x02202404L, | ||
88 | 0x10000000L,0x12000000L,0x10002000L,0x12002000L, | ||
89 | 0x10200000L,0x12200000L,0x10202000L,0x12202000L, | ||
90 | 0x10000004L,0x12000004L,0x10002004L,0x12002004L, | ||
91 | 0x10200004L,0x12200004L,0x10202004L,0x12202004L, | ||
92 | 0x10000400L,0x12000400L,0x10002400L,0x12002400L, | ||
93 | 0x10200400L,0x12200400L,0x10202400L,0x12202400L, | ||
94 | 0x10000404L,0x12000404L,0x10002404L,0x12002404L, | ||
95 | 0x10200404L,0x12200404L,0x10202404L,0x12202404L, | ||
96 | },{ | ||
97 | /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */ | ||
98 | 0x00000000L,0x00000001L,0x00040000L,0x00040001L, | ||
99 | 0x01000000L,0x01000001L,0x01040000L,0x01040001L, | ||
100 | 0x00000002L,0x00000003L,0x00040002L,0x00040003L, | ||
101 | 0x01000002L,0x01000003L,0x01040002L,0x01040003L, | ||
102 | 0x00000200L,0x00000201L,0x00040200L,0x00040201L, | ||
103 | 0x01000200L,0x01000201L,0x01040200L,0x01040201L, | ||
104 | 0x00000202L,0x00000203L,0x00040202L,0x00040203L, | ||
105 | 0x01000202L,0x01000203L,0x01040202L,0x01040203L, | ||
106 | 0x08000000L,0x08000001L,0x08040000L,0x08040001L, | ||
107 | 0x09000000L,0x09000001L,0x09040000L,0x09040001L, | ||
108 | 0x08000002L,0x08000003L,0x08040002L,0x08040003L, | ||
109 | 0x09000002L,0x09000003L,0x09040002L,0x09040003L, | ||
110 | 0x08000200L,0x08000201L,0x08040200L,0x08040201L, | ||
111 | 0x09000200L,0x09000201L,0x09040200L,0x09040201L, | ||
112 | 0x08000202L,0x08000203L,0x08040202L,0x08040203L, | ||
113 | 0x09000202L,0x09000203L,0x09040202L,0x09040203L, | ||
114 | },{ | ||
115 | /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */ | ||
116 | 0x00000000L,0x00100000L,0x00000100L,0x00100100L, | ||
117 | 0x00000008L,0x00100008L,0x00000108L,0x00100108L, | ||
118 | 0x00001000L,0x00101000L,0x00001100L,0x00101100L, | ||
119 | 0x00001008L,0x00101008L,0x00001108L,0x00101108L, | ||
120 | 0x04000000L,0x04100000L,0x04000100L,0x04100100L, | ||
121 | 0x04000008L,0x04100008L,0x04000108L,0x04100108L, | ||
122 | 0x04001000L,0x04101000L,0x04001100L,0x04101100L, | ||
123 | 0x04001008L,0x04101008L,0x04001108L,0x04101108L, | ||
124 | 0x00020000L,0x00120000L,0x00020100L,0x00120100L, | ||
125 | 0x00020008L,0x00120008L,0x00020108L,0x00120108L, | ||
126 | 0x00021000L,0x00121000L,0x00021100L,0x00121100L, | ||
127 | 0x00021008L,0x00121008L,0x00021108L,0x00121108L, | ||
128 | 0x04020000L,0x04120000L,0x04020100L,0x04120100L, | ||
129 | 0x04020008L,0x04120008L,0x04020108L,0x04120108L, | ||
130 | 0x04021000L,0x04121000L,0x04021100L,0x04121100L, | ||
131 | 0x04021008L,0x04121008L,0x04021108L,0x04121108L, | ||
132 | },{ | ||
133 | /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ | ||
134 | 0x00000000L,0x10000000L,0x00010000L,0x10010000L, | ||
135 | 0x00000004L,0x10000004L,0x00010004L,0x10010004L, | ||
136 | 0x20000000L,0x30000000L,0x20010000L,0x30010000L, | ||
137 | 0x20000004L,0x30000004L,0x20010004L,0x30010004L, | ||
138 | 0x00100000L,0x10100000L,0x00110000L,0x10110000L, | ||
139 | 0x00100004L,0x10100004L,0x00110004L,0x10110004L, | ||
140 | 0x20100000L,0x30100000L,0x20110000L,0x30110000L, | ||
141 | 0x20100004L,0x30100004L,0x20110004L,0x30110004L, | ||
142 | 0x00001000L,0x10001000L,0x00011000L,0x10011000L, | ||
143 | 0x00001004L,0x10001004L,0x00011004L,0x10011004L, | ||
144 | 0x20001000L,0x30001000L,0x20011000L,0x30011000L, | ||
145 | 0x20001004L,0x30001004L,0x20011004L,0x30011004L, | ||
146 | 0x00101000L,0x10101000L,0x00111000L,0x10111000L, | ||
147 | 0x00101004L,0x10101004L,0x00111004L,0x10111004L, | ||
148 | 0x20101000L,0x30101000L,0x20111000L,0x30111000L, | ||
149 | 0x20101004L,0x30101004L,0x20111004L,0x30111004L, | ||
150 | },{ | ||
151 | /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */ | ||
152 | 0x00000000L,0x08000000L,0x00000008L,0x08000008L, | ||
153 | 0x00000400L,0x08000400L,0x00000408L,0x08000408L, | ||
154 | 0x00020000L,0x08020000L,0x00020008L,0x08020008L, | ||
155 | 0x00020400L,0x08020400L,0x00020408L,0x08020408L, | ||
156 | 0x00000001L,0x08000001L,0x00000009L,0x08000009L, | ||
157 | 0x00000401L,0x08000401L,0x00000409L,0x08000409L, | ||
158 | 0x00020001L,0x08020001L,0x00020009L,0x08020009L, | ||
159 | 0x00020401L,0x08020401L,0x00020409L,0x08020409L, | ||
160 | 0x02000000L,0x0A000000L,0x02000008L,0x0A000008L, | ||
161 | 0x02000400L,0x0A000400L,0x02000408L,0x0A000408L, | ||
162 | 0x02020000L,0x0A020000L,0x02020008L,0x0A020008L, | ||
163 | 0x02020400L,0x0A020400L,0x02020408L,0x0A020408L, | ||
164 | 0x02000001L,0x0A000001L,0x02000009L,0x0A000009L, | ||
165 | 0x02000401L,0x0A000401L,0x02000409L,0x0A000409L, | ||
166 | 0x02020001L,0x0A020001L,0x02020009L,0x0A020009L, | ||
167 | 0x02020401L,0x0A020401L,0x02020409L,0x0A020409L, | ||
168 | },{ | ||
169 | /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */ | ||
170 | 0x00000000L,0x00000100L,0x00080000L,0x00080100L, | ||
171 | 0x01000000L,0x01000100L,0x01080000L,0x01080100L, | ||
172 | 0x00000010L,0x00000110L,0x00080010L,0x00080110L, | ||
173 | 0x01000010L,0x01000110L,0x01080010L,0x01080110L, | ||
174 | 0x00200000L,0x00200100L,0x00280000L,0x00280100L, | ||
175 | 0x01200000L,0x01200100L,0x01280000L,0x01280100L, | ||
176 | 0x00200010L,0x00200110L,0x00280010L,0x00280110L, | ||
177 | 0x01200010L,0x01200110L,0x01280010L,0x01280110L, | ||
178 | 0x00000200L,0x00000300L,0x00080200L,0x00080300L, | ||
179 | 0x01000200L,0x01000300L,0x01080200L,0x01080300L, | ||
180 | 0x00000210L,0x00000310L,0x00080210L,0x00080310L, | ||
181 | 0x01000210L,0x01000310L,0x01080210L,0x01080310L, | ||
182 | 0x00200200L,0x00200300L,0x00280200L,0x00280300L, | ||
183 | 0x01200200L,0x01200300L,0x01280200L,0x01280300L, | ||
184 | 0x00200210L,0x00200310L,0x00280210L,0x00280310L, | ||
185 | 0x01200210L,0x01200310L,0x01280210L,0x01280310L, | ||
186 | },{ | ||
187 | /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */ | ||
188 | 0x00000000L,0x04000000L,0x00040000L,0x04040000L, | ||
189 | 0x00000002L,0x04000002L,0x00040002L,0x04040002L, | ||
190 | 0x00002000L,0x04002000L,0x00042000L,0x04042000L, | ||
191 | 0x00002002L,0x04002002L,0x00042002L,0x04042002L, | ||
192 | 0x00000020L,0x04000020L,0x00040020L,0x04040020L, | ||
193 | 0x00000022L,0x04000022L,0x00040022L,0x04040022L, | ||
194 | 0x00002020L,0x04002020L,0x00042020L,0x04042020L, | ||
195 | 0x00002022L,0x04002022L,0x00042022L,0x04042022L, | ||
196 | 0x00000800L,0x04000800L,0x00040800L,0x04040800L, | ||
197 | 0x00000802L,0x04000802L,0x00040802L,0x04040802L, | ||
198 | 0x00002800L,0x04002800L,0x00042800L,0x04042800L, | ||
199 | 0x00002802L,0x04002802L,0x00042802L,0x04042802L, | ||
200 | 0x00000820L,0x04000820L,0x00040820L,0x04040820L, | ||
201 | 0x00000822L,0x04000822L,0x00040822L,0x04040822L, | ||
202 | 0x00002820L,0x04002820L,0x00042820L,0x04042820L, | ||
203 | 0x00002822L,0x04002822L,0x00042822L,0x04042822L, | ||
204 | }}; | ||
diff --git a/src/lib/libcrypto/des/testdes.pl b/src/lib/libcrypto/des/testdes.pl index 01a165a963..e69de29bb2 100644 --- a/src/lib/libcrypto/des/testdes.pl +++ b/src/lib/libcrypto/des/testdes.pl | |||
@@ -1,167 +0,0 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | # des.pl tesing code | ||
4 | |||
5 | require 'des.pl'; | ||
6 | |||
7 | $num_tests=34; | ||
8 | @key_data=( | ||
9 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
10 | 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | ||
11 | 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
12 | 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, | ||
13 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
14 | 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, | ||
15 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
16 | 0xFE,0xDC,0xBA,0x98,0x76,0x54,0x32,0x10, | ||
17 | 0x7C,0xA1,0x10,0x45,0x4A,0x1A,0x6E,0x57, | ||
18 | 0x01,0x31,0xD9,0x61,0x9D,0xC1,0x37,0x6E, | ||
19 | 0x07,0xA1,0x13,0x3E,0x4A,0x0B,0x26,0x86, | ||
20 | 0x38,0x49,0x67,0x4C,0x26,0x02,0x31,0x9E, | ||
21 | 0x04,0xB9,0x15,0xBA,0x43,0xFE,0xB5,0xB6, | ||
22 | 0x01,0x13,0xB9,0x70,0xFD,0x34,0xF2,0xCE, | ||
23 | 0x01,0x70,0xF1,0x75,0x46,0x8F,0xB5,0xE6, | ||
24 | 0x43,0x29,0x7F,0xAD,0x38,0xE3,0x73,0xFE, | ||
25 | 0x07,0xA7,0x13,0x70,0x45,0xDA,0x2A,0x16, | ||
26 | 0x04,0x68,0x91,0x04,0xC2,0xFD,0x3B,0x2F, | ||
27 | 0x37,0xD0,0x6B,0xB5,0x16,0xCB,0x75,0x46, | ||
28 | 0x1F,0x08,0x26,0x0D,0x1A,0xC2,0x46,0x5E, | ||
29 | 0x58,0x40,0x23,0x64,0x1A,0xBA,0x61,0x76, | ||
30 | 0x02,0x58,0x16,0x16,0x46,0x29,0xB0,0x07, | ||
31 | 0x49,0x79,0x3E,0xBC,0x79,0xB3,0x25,0x8F, | ||
32 | 0x4F,0xB0,0x5E,0x15,0x15,0xAB,0x73,0xA7, | ||
33 | 0x49,0xE9,0x5D,0x6D,0x4C,0xA2,0x29,0xBF, | ||
34 | 0x01,0x83,0x10,0xDC,0x40,0x9B,0x26,0xD6, | ||
35 | 0x1C,0x58,0x7F,0x1C,0x13,0x92,0x4F,0xEF, | ||
36 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, | ||
37 | 0x1F,0x1F,0x1F,0x1F,0x0E,0x0E,0x0E,0x0E, | ||
38 | 0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1,0xFE, | ||
39 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
40 | 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | ||
41 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
42 | 0xFE,0xDC,0xBA,0x98,0x76,0x54,0x32,0x10, | ||
43 | ); | ||
44 | |||
45 | @plain_data=( | ||
46 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
47 | 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | ||
48 | 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01, | ||
49 | 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, | ||
50 | 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, | ||
51 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
52 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
53 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
54 | 0x01,0xA1,0xD6,0xD0,0x39,0x77,0x67,0x42, | ||
55 | 0x5C,0xD5,0x4C,0xA8,0x3D,0xEF,0x57,0xDA, | ||
56 | 0x02,0x48,0xD4,0x38,0x06,0xF6,0x71,0x72, | ||
57 | 0x51,0x45,0x4B,0x58,0x2D,0xDF,0x44,0x0A, | ||
58 | 0x42,0xFD,0x44,0x30,0x59,0x57,0x7F,0xA2, | ||
59 | 0x05,0x9B,0x5E,0x08,0x51,0xCF,0x14,0x3A, | ||
60 | 0x07,0x56,0xD8,0xE0,0x77,0x47,0x61,0xD2, | ||
61 | 0x76,0x25,0x14,0xB8,0x29,0xBF,0x48,0x6A, | ||
62 | 0x3B,0xDD,0x11,0x90,0x49,0x37,0x28,0x02, | ||
63 | 0x26,0x95,0x5F,0x68,0x35,0xAF,0x60,0x9A, | ||
64 | 0x16,0x4D,0x5E,0x40,0x4F,0x27,0x52,0x32, | ||
65 | 0x6B,0x05,0x6E,0x18,0x75,0x9F,0x5C,0xCA, | ||
66 | 0x00,0x4B,0xD6,0xEF,0x09,0x17,0x60,0x62, | ||
67 | 0x48,0x0D,0x39,0x00,0x6E,0xE7,0x62,0xF2, | ||
68 | 0x43,0x75,0x40,0xC8,0x69,0x8F,0x3C,0xFA, | ||
69 | 0x07,0x2D,0x43,0xA0,0x77,0x07,0x52,0x92, | ||
70 | 0x02,0xFE,0x55,0x77,0x81,0x17,0xF1,0x2A, | ||
71 | 0x1D,0x9D,0x5C,0x50,0x18,0xF7,0x28,0xC2, | ||
72 | 0x30,0x55,0x32,0x28,0x6D,0x6F,0x29,0x5A, | ||
73 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
74 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
75 | 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF, | ||
76 | 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, | ||
77 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
78 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | ||
79 | 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF); | ||
80 | |||
81 | @cipher_data=( | ||
82 | 0x8C,0xA6,0x4D,0xE9,0xC1,0xB1,0x23,0xA7, | ||
83 | 0x73,0x59,0xB2,0x16,0x3E,0x4E,0xDC,0x58, | ||
84 | 0x95,0x8E,0x6E,0x62,0x7A,0x05,0x55,0x7B, | ||
85 | 0xF4,0x03,0x79,0xAB,0x9E,0x0E,0xC5,0x33, | ||
86 | 0x17,0x66,0x8D,0xFC,0x72,0x92,0x53,0x2D, | ||
87 | 0x8A,0x5A,0xE1,0xF8,0x1A,0xB8,0xF2,0xDD, | ||
88 | 0x8C,0xA6,0x4D,0xE9,0xC1,0xB1,0x23,0xA7, | ||
89 | 0xED,0x39,0xD9,0x50,0xFA,0x74,0xBC,0xC4, | ||
90 | 0x69,0x0F,0x5B,0x0D,0x9A,0x26,0x93,0x9B, | ||
91 | 0x7A,0x38,0x9D,0x10,0x35,0x4B,0xD2,0x71, | ||
92 | 0x86,0x8E,0xBB,0x51,0xCA,0xB4,0x59,0x9A, | ||
93 | 0x71,0x78,0x87,0x6E,0x01,0xF1,0x9B,0x2A, | ||
94 | 0xAF,0x37,0xFB,0x42,0x1F,0x8C,0x40,0x95, | ||
95 | 0x86,0xA5,0x60,0xF1,0x0E,0xC6,0xD8,0x5B, | ||
96 | 0x0C,0xD3,0xDA,0x02,0x00,0x21,0xDC,0x09, | ||
97 | 0xEA,0x67,0x6B,0x2C,0xB7,0xDB,0x2B,0x7A, | ||
98 | 0xDF,0xD6,0x4A,0x81,0x5C,0xAF,0x1A,0x0F, | ||
99 | 0x5C,0x51,0x3C,0x9C,0x48,0x86,0xC0,0x88, | ||
100 | 0x0A,0x2A,0xEE,0xAE,0x3F,0xF4,0xAB,0x77, | ||
101 | 0xEF,0x1B,0xF0,0x3E,0x5D,0xFA,0x57,0x5A, | ||
102 | 0x88,0xBF,0x0D,0xB6,0xD7,0x0D,0xEE,0x56, | ||
103 | 0xA1,0xF9,0x91,0x55,0x41,0x02,0x0B,0x56, | ||
104 | 0x6F,0xBF,0x1C,0xAF,0xCF,0xFD,0x05,0x56, | ||
105 | 0x2F,0x22,0xE4,0x9B,0xAB,0x7C,0xA1,0xAC, | ||
106 | 0x5A,0x6B,0x61,0x2C,0xC2,0x6C,0xCE,0x4A, | ||
107 | 0x5F,0x4C,0x03,0x8E,0xD1,0x2B,0x2E,0x41, | ||
108 | 0x63,0xFA,0xC0,0xD0,0x34,0xD9,0xF7,0x93, | ||
109 | 0x61,0x7B,0x3A,0x0C,0xE8,0xF0,0x71,0x00, | ||
110 | 0xDB,0x95,0x86,0x05,0xF8,0xC8,0xC6,0x06, | ||
111 | 0xED,0xBF,0xD1,0xC6,0x6C,0x29,0xCC,0xC7, | ||
112 | 0x35,0x55,0x50,0xB2,0x15,0x0E,0x24,0x51, | ||
113 | 0xCA,0xAA,0xAF,0x4D,0xEA,0xF1,0xDB,0xAE, | ||
114 | 0xD5,0xD4,0x4F,0xF7,0x20,0x68,0x3D,0x0D, | ||
115 | 0x2A,0x2B,0xB0,0x08,0xDF,0x97,0xC2,0xF2); | ||
116 | |||
117 | print "Doing ecb tests\n"; | ||
118 | for ($i=0; $i<$num_tests; $i++) | ||
119 | { | ||
120 | printf "Doing test $i\n"; | ||
121 | $key =pack("C8",splice(@key_data ,0,8)); | ||
122 | $data=pack("C8",splice(@plain_data ,0,8)); | ||
123 | $res =pack("C8",splice(@cipher_data,0,8)); | ||
124 | |||
125 | @ks= &des_set_key($key); | ||
126 | $out1= &des_ecb_encrypt(*ks,1,$data); | ||
127 | $out2= &des_ecb_encrypt(*ks,0,$out1); | ||
128 | $out3= &des_ecb_encrypt(*ks,0,$res); | ||
129 | &eprint("encryption failure",$res,$out1) | ||
130 | if ($out1 ne $res); | ||
131 | &eprint("encryption/decryption failure",$data,$out2) | ||
132 | if ($out2 ne $data); | ||
133 | &eprint("decryption failure",$data,$out3) | ||
134 | if ($data ne $out3); | ||
135 | } | ||
136 | print "Done\n"; | ||
137 | |||
138 | print "doing speed test over 30 seconds\n"; | ||
139 | $SIG{'ALRM'}='done'; | ||
140 | sub done {$done=1;} | ||
141 | $done=0; | ||
142 | |||
143 | $count=0; | ||
144 | $d=pack("C8",0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef); | ||
145 | @ks= &des_set_key($d); | ||
146 | alarm(30); | ||
147 | $start=(times)[0]; | ||
148 | while (!$done) | ||
149 | { | ||
150 | $count++; | ||
151 | $d=&des_ecb_encrypt(*ks,1,$d); | ||
152 | } | ||
153 | $end=(times)[0]; | ||
154 | $t=$end-$start; | ||
155 | printf "$count DESs in %.2f seconds is %.2f DESs/sec or %.2f bytes/sec\n", | ||
156 | 1.0*$t,1.0*$count/$t,$count*8.0/$t; | ||
157 | |||
158 | sub eprint | ||
159 | { | ||
160 | local($s,$c,$e)=@_; | ||
161 | local(@k); | ||
162 | |||
163 | @k=unpack("C8",$c); | ||
164 | printf "%02x%02x%02x%02x %02x%02x%02x%02x - ",unpack("C8",$c); | ||
165 | printf "%02x%02x%02x%02x %02x%02x%02x%02x :",unpack("C8",$e); | ||
166 | print " $s\n"; | ||
167 | } | ||
diff --git a/src/lib/libcrypto/dh/dh_err.c b/src/lib/libcrypto/dh/dh_err.c index 0348bd24a2..ff2d1684c2 100644 --- a/src/lib/libcrypto/dh/dh_err.c +++ b/src/lib/libcrypto/dh/dh_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod index dca41d8dbc..a8f75bdd9d 100644 --- a/src/lib/libcrypto/doc/DH_set_method.pod +++ b/src/lib/libcrypto/doc/DH_set_method.pod | |||
@@ -56,7 +56,7 @@ the default method is used. | |||
56 | /* compute shared secret */ | 56 | /* compute shared secret */ |
57 | int (*compute_key)(unsigned char *key, BIGNUM *pub_key, DH *dh); | 57 | int (*compute_key)(unsigned char *key, BIGNUM *pub_key, DH *dh); |
58 | 58 | ||
59 | /* compute r = a ^ p mod m. May be NULL */ | 59 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ |
60 | int (*bn_mod_exp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, | 60 | int (*bn_mod_exp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, |
61 | const BIGNUM *m, BN_CTX *ctx, | 61 | const BIGNUM *m, BN_CTX *ctx, |
62 | BN_MONT_CTX *m_ctx); | 62 | BN_MONT_CTX *m_ctx); |
diff --git a/src/lib/libcrypto/doc/DSA_set_method.pod b/src/lib/libcrypto/doc/DSA_set_method.pod index 0b13ec9237..edec46413d 100644 --- a/src/lib/libcrypto/doc/DSA_set_method.pod +++ b/src/lib/libcrypto/doc/DSA_set_method.pod | |||
@@ -62,12 +62,13 @@ struct | |||
62 | int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, | 62 | int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, |
63 | DSA_SIG *sig, DSA *dsa); | 63 | DSA_SIG *sig, DSA *dsa); |
64 | 64 | ||
65 | /* compute rr = a1^p1 * a2^p2 mod m. May be NULL */ | 65 | /* compute rr = a1^p1 * a2^p2 mod m (May be NULL for some |
66 | implementations) */ | ||
66 | int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, | 67 | int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, |
67 | BIGNUM *a2, BIGNUM *p2, BIGNUM *m, | 68 | BIGNUM *a2, BIGNUM *p2, BIGNUM *m, |
68 | BN_CTX *ctx, BN_MONT_CTX *in_mont); | 69 | BN_CTX *ctx, BN_MONT_CTX *in_mont); |
69 | 70 | ||
70 | /* compute r = a ^ p mod m. May be NULL */ | 71 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ |
71 | int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, | 72 | int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, |
72 | const BIGNUM *p, const BIGNUM *m, | 73 | const BIGNUM *p, const BIGNUM *m, |
73 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 74 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
diff --git a/src/lib/libcrypto/doc/EVP_OpenInit.pod b/src/lib/libcrypto/doc/EVP_OpenInit.pod new file mode 100644 index 0000000000..9707a4b399 --- /dev/null +++ b/src/lib/libcrypto/doc/EVP_OpenInit.pod | |||
@@ -0,0 +1,51 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, | ||
12 | int ekl,unsigned char *iv,EVP_PKEY *priv); | ||
13 | void EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
14 | int *outl, unsigned char *in, int inl); | ||
15 | void EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
16 | int *outl); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | The EVP envelope routines are a high level interface to envelope | ||
21 | decryption. They decrypt a public key encrypted symmetric key and | ||
22 | then decrypt data using it. | ||
23 | |||
24 | EVP_OpenInit() initialises a cipher context B<ctx> for decryption | ||
25 | with cipher B<type>. It decrypts the encrypted symmetric key of length | ||
26 | B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. | ||
27 | The IV is supplied in the B<iv> parameter. | ||
28 | |||
29 | EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties | ||
30 | as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as | ||
31 | documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual | ||
32 | page. | ||
33 | |||
34 | =head1 RETURN VALUES | ||
35 | |||
36 | EVP_OpenInit() returns -1 on error or an non zero integer (actually the | ||
37 | recovered secret key size) if successful. | ||
38 | |||
39 | EVP_SealUpdate() does not return a value. | ||
40 | |||
41 | EVP_SealFinal() returns 0 if the decrypt failed or 1 for success. | ||
42 | |||
43 | =head1 SEE ALSO | ||
44 | |||
45 | L<evp(3)|evp(3)>,L<rand(3)|rand(3)> | ||
46 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
47 | L<EVP_SealInit(3)|EVP_SealInit(3)> | ||
48 | |||
49 | =head1 HISTORY | ||
50 | |||
51 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_SealInit.pod b/src/lib/libcrypto/doc/EVP_SealInit.pod new file mode 100644 index 0000000000..1579d110fa --- /dev/null +++ b/src/lib/libcrypto/doc/EVP_SealInit.pod | |||
@@ -0,0 +1,70 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, | ||
12 | int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); | ||
13 | void EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
14 | int *outl, unsigned char *in, int inl); | ||
15 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
16 | int *outl); | ||
17 | |||
18 | =head1 DESCRIPTION | ||
19 | |||
20 | The EVP envelope routines are a high level interface to envelope | ||
21 | encryption. They generate a random key and then "envelope" it by | ||
22 | using public key encryption. Data can then be encrypted using this | ||
23 | key. | ||
24 | |||
25 | EVP_SealInit() initialises a cipher context B<ctx> for encryption | ||
26 | with cipher B<type> using a random secret key and IV supplied in | ||
27 | the B<iv> parameter. B<type> is normally supplied by a function such | ||
28 | as EVP_des_cbc(). The secret key is encrypted using one or more public | ||
29 | keys, this allows the same encrypted data to be decrypted using any | ||
30 | of the corresponding private keys. B<ek> is an array of buffers where | ||
31 | the public key encrypted secret key will be written, each buffer must | ||
32 | contain enough room for the corresponding encrypted key: that is | ||
33 | B<ek[i]> must have room for B<EVP_PKEY_size(pubk[i])> bytes. The actual | ||
34 | size of each encrypted secret key is written to the array B<ekl>. B<pubk> is | ||
35 | an array of B<npubk> public keys. | ||
36 | |||
37 | EVP_SealUpdate() and EVP_SealFinal() have exactly the same properties | ||
38 | as the EVP_EncryptUpdate() and EVP_EncryptFinal() routines, as | ||
39 | documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual | ||
40 | page. | ||
41 | |||
42 | =head1 RETURN VALUES | ||
43 | |||
44 | EVP_SealInit() returns -1 on error or B<npubk> if successful. | ||
45 | |||
46 | EVP_SealUpdate() and EVP_SealFinal() do not return values. | ||
47 | |||
48 | =head1 NOTES | ||
49 | |||
50 | Because a random secret key is generated the random number generator | ||
51 | must be seeded before calling EVP_SealInit(). | ||
52 | |||
53 | The public key must be RSA because it is the only OpenSSL public key | ||
54 | algorithm that supports key transport. | ||
55 | |||
56 | Envelope encryption is the usual method of using public key encryption | ||
57 | on large amounts of data, this is because public key encryption is slow | ||
58 | but symmetric encryption is fast. So symmetric encryption is used for | ||
59 | bulk encryption and the small random symmetric key used is transferred | ||
60 | using public key encryption. | ||
61 | |||
62 | =head1 SEE ALSO | ||
63 | |||
64 | L<evp(3)|evp(3)>,L<rand(3)|rand(3)> | ||
65 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
66 | L<EVP_OpenInit(3)|EVP_OpenInit(3)> | ||
67 | |||
68 | =head1 HISTORY | ||
69 | |||
70 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_SignInit.pod b/src/lib/libcrypto/doc/EVP_SignInit.pod new file mode 100644 index 0000000000..bbc9203c9c --- /dev/null +++ b/src/lib/libcrypto/doc/EVP_SignInit.pod | |||
@@ -0,0 +1,85 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
12 | void EVP_SignUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); | ||
13 | int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *sig,unsigned int *s, EVP_PKEY *pkey); | ||
14 | |||
15 | int EVP_PKEY_size(EVP_PKEY *pkey); | ||
16 | |||
17 | =head1 DESCRIPTION | ||
18 | |||
19 | The EVP signature routines are a high level interface to digital | ||
20 | signatures. | ||
21 | |||
22 | EVP_SignInit() initialises a signing context B<ctx> to using digest | ||
23 | B<type>: this will typically be supplied by a function such as | ||
24 | EVP_sha1(). | ||
25 | |||
26 | EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
27 | signature context B<ctx>. This funtion can be called several times on the | ||
28 | same B<ctx> to include additional data. | ||
29 | |||
30 | EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> | ||
31 | and places the signature in B<sig>. If the B<s> parameter is not NULL | ||
32 | then the number of bytes of data written (i.e. the length of the signature) | ||
33 | will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes | ||
34 | will be written. After calling EVP_SignFinal() no additional calls to | ||
35 | EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialiase | ||
36 | a new signature operation. | ||
37 | |||
38 | EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual | ||
39 | signature returned by EVP_SignFinal() may be smaller. | ||
40 | |||
41 | =head1 RETURN VALUES | ||
42 | |||
43 | EVP_SignInit() and EVP_SignUpdate() do not return values. | ||
44 | |||
45 | EVP_SignFinal() returns 1 for success and 0 for failure. | ||
46 | |||
47 | EVP_PKEY_size() returns the maximum size of a signature in bytes. | ||
48 | |||
49 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
50 | |||
51 | =head1 NOTES | ||
52 | |||
53 | The B<EVP> interface to digital signatures should almost always be used in | ||
54 | preference to the low level interfaces. This is because the code then becomes | ||
55 | transparent to the algorithm used and much more flexible. | ||
56 | |||
57 | Due to the link between message digests and public key algorithms the correct | ||
58 | digest algorithm must be used with the correct public key type. A list of | ||
59 | algorithms and associated public key algorithms appears in | ||
60 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>. | ||
61 | |||
62 | When signing with DSA private keys the random number generator must be seeded | ||
63 | or the operation will fail. The random number generator does not need to be | ||
64 | seeded for RSA signatures. | ||
65 | |||
66 | =head1 BUGS | ||
67 | |||
68 | Several of the functions do not return values: maybe they should. Although the | ||
69 | internal digest operations will never fail some future hardware based operations | ||
70 | might. | ||
71 | |||
72 | =head1 SEE ALSO | ||
73 | |||
74 | L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>, | ||
75 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>, | ||
76 | L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, | ||
77 | L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>, | ||
78 | L<sha(3)|sha(3)>, L<digest(1)|digest(1)> | ||
79 | |||
80 | =head1 HISTORY | ||
81 | |||
82 | EVP_SignInit(), EVP_SignUpdate() and EVP_SignFinal() are | ||
83 | available in all versions of SSLeay and OpenSSL. | ||
84 | |||
85 | =cut | ||
diff --git a/src/lib/libcrypto/doc/EVP_VerifyInit.pod b/src/lib/libcrypto/doc/EVP_VerifyInit.pod new file mode 100644 index 0000000000..3b5e07f4ad --- /dev/null +++ b/src/lib/libcrypto/doc/EVP_VerifyInit.pod | |||
@@ -0,0 +1,71 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature verification functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/evp.h> | ||
10 | |||
11 | void EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
12 | void EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); | ||
13 | int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, unsigned int siglen,EVP_PKEY *pkey); | ||
14 | |||
15 | =head1 DESCRIPTION | ||
16 | |||
17 | The EVP signature verification routines are a high level interface to digital | ||
18 | signatures. | ||
19 | |||
20 | EVP_VerifyInit() initialises a verification context B<ctx> to using digest | ||
21 | B<type>: this will typically be supplied by a function such as EVP_sha1(). | ||
22 | |||
23 | EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the | ||
24 | verification context B<ctx>. This funtion can be called several times on the | ||
25 | same B<ctx> to include additional data. | ||
26 | |||
27 | EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> | ||
28 | and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal() | ||
29 | no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit() | ||
30 | can be called to initialiase a new verification operation. | ||
31 | |||
32 | =head1 RETURN VALUES | ||
33 | |||
34 | EVP_VerifyInit() and EVP_VerifyUpdate() do not return values. | ||
35 | |||
36 | EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some | ||
37 | other error occurred. | ||
38 | |||
39 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
40 | |||
41 | =head1 NOTES | ||
42 | |||
43 | The B<EVP> interface to digital signatures should almost always be used in | ||
44 | preference to the low level interfaces. This is because the code then becomes | ||
45 | transparent to the algorithm used and much more flexible. | ||
46 | |||
47 | Due to the link between message digests and public key algorithms the correct | ||
48 | digest algorithm must be used with the correct public key type. A list of | ||
49 | algorithms and associated public key algorithms appears in | ||
50 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>. | ||
51 | |||
52 | =head1 BUGS | ||
53 | |||
54 | Several of the functions do not return values: maybe they should. Although the | ||
55 | internal digest operations will never fail some future hardware based operations | ||
56 | might. | ||
57 | |||
58 | =head1 SEE ALSO | ||
59 | |||
60 | L<EVP_SignInit(3)|EVP_SignInit(3)>, | ||
61 | L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>, | ||
62 | L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, | ||
63 | L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>, | ||
64 | L<sha(3)|sha(3)>, L<digest(1)|digest(1)> | ||
65 | |||
66 | =head1 HISTORY | ||
67 | |||
68 | EVP_VerifyInit(), EVP_VerifyUpdate() and EVP_VerifyFinal() are | ||
69 | available in all versions of SSLeay and OpenSSL. | ||
70 | |||
71 | =cut | ||
diff --git a/src/lib/libcrypto/doc/RAND_add.pod b/src/lib/libcrypto/doc/RAND_add.pod index 0a13ec2a92..67c66f3e0c 100644 --- a/src/lib/libcrypto/doc/RAND_add.pod +++ b/src/lib/libcrypto/doc/RAND_add.pod | |||
@@ -2,7 +2,8 @@ | |||
2 | 2 | ||
3 | =head1 NAME | 3 | =head1 NAME |
4 | 4 | ||
5 | RAND_add, RAND_seed, RAND_screen - add entropy to the PRNG | 5 | RAND_add, RAND_seed, RAND_status, RAND_event, RAND_screen - add |
6 | entropy to the PRNG | ||
6 | 7 | ||
7 | =head1 SYNOPSIS | 8 | =head1 SYNOPSIS |
8 | 9 | ||
@@ -14,6 +15,7 @@ RAND_add, RAND_seed, RAND_screen - add entropy to the PRNG | |||
14 | 15 | ||
15 | int RAND_status(void); | 16 | int RAND_status(void); |
16 | 17 | ||
18 | int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam); | ||
17 | void RAND_screen(void); | 19 | void RAND_screen(void); |
18 | 20 | ||
19 | =head1 DESCRIPTION | 21 | =head1 DESCRIPTION |
@@ -40,17 +42,24 @@ or L<RAND_load_file(3)|RAND_load_file(3)>. | |||
40 | 42 | ||
41 | RAND_seed() is equivalent to RAND_add() when B<num == entropy>. | 43 | RAND_seed() is equivalent to RAND_add() when B<num == entropy>. |
42 | 44 | ||
45 | RAND_event() collects the entropy from Windows events such as mouse | ||
46 | movements and other user interaction. It should be called with the | ||
47 | B<iMsg>, B<wParam> and B<lParam> arguments of I<all> messages sent to | ||
48 | the window procedure. It will estimate the entropy contained in the | ||
49 | event message (if any), and add it to the PRNG. The program can then | ||
50 | process the messages as usual. | ||
51 | |||
43 | The RAND_screen() function is available for the convenience of Windows | 52 | The RAND_screen() function is available for the convenience of Windows |
44 | programmers. It adds the current contents of the screen to the PRNG. | 53 | programmers. It adds the current contents of the screen to the PRNG. |
45 | For applications that can catch Windows events, seeding the PRNG with | 54 | For applications that can catch Windows events, seeding the PRNG by |
46 | the parameters of B<WM_MOUSEMOVE> events is a significantly better | 55 | calling RAND_event() is a significantly better source of |
47 | source of randomness. It should be noted that both methods cannot be | 56 | randomness. It should be noted that both methods cannot be used on |
48 | used on servers that run without user interaction. | 57 | servers that run without user interaction. |
49 | 58 | ||
50 | =head1 RETURN VALUES | 59 | =head1 RETURN VALUES |
51 | 60 | ||
52 | RAND_status() returns 1 if the PRNG has been seeded with enough data, | 61 | RAND_status() and RAND_event() return 1 if the PRNG has been seeded |
53 | 0 otherwise. | 62 | with enough data, 0 otherwise. |
54 | 63 | ||
55 | The other functions do not return values. | 64 | The other functions do not return values. |
56 | 65 | ||
@@ -63,6 +72,6 @@ L<RAND_load_file(3)|RAND_load_file(3)>, L<RAND_cleanup(3)|RAND_cleanup(3)> | |||
63 | 72 | ||
64 | RAND_seed() and RAND_screen() are available in all versions of SSLeay | 73 | RAND_seed() and RAND_screen() are available in all versions of SSLeay |
65 | and OpenSSL. RAND_add() and RAND_status() have been added in OpenSSL | 74 | and OpenSSL. RAND_add() and RAND_status() have been added in OpenSSL |
66 | 0.9.5. | 75 | 0.9.5, RAND_event() in OpenSSL 0.9.5a. |
67 | 76 | ||
68 | =cut | 77 | =cut |
diff --git a/src/lib/libcrypto/doc/RAND_set_rand_method.pod b/src/lib/libcrypto/doc/RAND_set_rand_method.pod index 466e9b8767..464eba416d 100644 --- a/src/lib/libcrypto/doc/RAND_set_rand_method.pod +++ b/src/lib/libcrypto/doc/RAND_set_rand_method.pod | |||
@@ -34,10 +34,12 @@ RAND_get_rand_method() returns a pointer to the current method. | |||
34 | void (*cleanup)(void); | 34 | void (*cleanup)(void); |
35 | void (*add)(const void *buf, int num, int entropy); | 35 | void (*add)(const void *buf, int num, int entropy); |
36 | int (*pseudorand)(unsigned char *buf, int num); | 36 | int (*pseudorand)(unsigned char *buf, int num); |
37 | int (*status)(void); | ||
37 | } RAND_METHOD; | 38 | } RAND_METHOD; |
38 | 39 | ||
39 | The components point to the implementation of RAND_seed(), | 40 | The components point to the implementation of RAND_seed(), |
40 | RAND_bytes(), RAND_cleanup(), RAND_add() and RAND_pseudo_rand(). | 41 | RAND_bytes(), RAND_cleanup(), RAND_add(), RAND_pseudo_rand() |
42 | and RAND_status(). | ||
41 | Each component may be NULL if the function is not implemented. | 43 | Each component may be NULL if the function is not implemented. |
42 | 44 | ||
43 | =head1 RETURN VALUES | 45 | =head1 RETURN VALUES |
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod index deb1183a23..14b0b4cf35 100644 --- a/src/lib/libcrypto/doc/RSA_set_method.pod +++ b/src/lib/libcrypto/doc/RSA_set_method.pod | |||
@@ -87,10 +87,11 @@ the default method is used. | |||
87 | int (*rsa_priv_dec)(int flen, unsigned char *from, | 87 | int (*rsa_priv_dec)(int flen, unsigned char *from, |
88 | unsigned char *to, RSA *rsa, int padding); | 88 | unsigned char *to, RSA *rsa, int padding); |
89 | 89 | ||
90 | /* compute r0 = r0 ^ I mod rsa->n. May be NULL */ | 90 | /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some |
91 | implementations) */ | ||
91 | int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); | 92 | int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); |
92 | 93 | ||
93 | /* compute r = a ^ p mod m. May be NULL */ | 94 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ |
94 | int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | 95 | int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, |
95 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 96 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
96 | 97 | ||
diff --git a/src/lib/libcrypto/doc/rsa.pod b/src/lib/libcrypto/doc/rsa.pod index 0486c044a6..eb8ba612c4 100644 --- a/src/lib/libcrypto/doc/rsa.pod +++ b/src/lib/libcrypto/doc/rsa.pod | |||
@@ -86,8 +86,9 @@ contain public as well as private RSA keys: | |||
86 | In public keys, the private exponent and the related secret values are | 86 | In public keys, the private exponent and the related secret values are |
87 | B<NULL>. | 87 | B<NULL>. |
88 | 88 | ||
89 | B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private keys, but the | 89 | B<p>, B<q>, B<dmp1>, B<dmq1> and B<iqmp> may be B<NULL> in private |
90 | RSA operations are much faster when these values are available. | 90 | keys, but the RSA operations are much faster when these values are |
91 | available. | ||
91 | 92 | ||
92 | =head1 CONFORMING TO | 93 | =head1 CONFORMING TO |
93 | 94 | ||
diff --git a/src/lib/libcrypto/dsa/dsa_err.c b/src/lib/libcrypto/dsa/dsa_err.c index 38e4af968c..2b3ab3a9ad 100644 --- a/src/lib/libcrypto/dsa/dsa_err.c +++ b/src/lib/libcrypto/dsa/dsa_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c index ab7f38fc7c..5aef2d5fcf 100644 --- a/src/lib/libcrypto/dsa/dsa_key.c +++ b/src/lib/libcrypto/dsa/dsa_key.c | |||
@@ -84,7 +84,8 @@ int DSA_generate_key(DSA *dsa) | |||
84 | i=BN_num_bits(dsa->q); | 84 | i=BN_num_bits(dsa->q); |
85 | for (;;) | 85 | for (;;) |
86 | { | 86 | { |
87 | BN_rand(priv_key,i,1,0); | 87 | if (!BN_rand(priv_key,i,1,0)) |
88 | goto err; | ||
88 | if (BN_cmp(priv_key,dsa->q) >= 0) | 89 | if (BN_cmp(priv_key,dsa->q) >= 0) |
89 | BN_sub(priv_key,priv_key,dsa->q); | 90 | BN_sub(priv_key,priv_key,dsa->q); |
90 | if (!BN_is_zero(priv_key)) break; | 91 | if (!BN_is_zero(priv_key)) break; |
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 93c64cbc4f..eb8c76aa0b 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c | |||
@@ -55,9 +55,63 @@ | |||
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | /* ==================================================================== | ||
59 | * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. | ||
60 | * | ||
61 | * Redistribution and use in source and binary forms, with or without | ||
62 | * modification, are permitted provided that the following conditions | ||
63 | * are met: | ||
64 | * | ||
65 | * 1. Redistributions of source code must retain the above copyright | ||
66 | * notice, this list of conditions and the following disclaimer. | ||
67 | * | ||
68 | * 2. Redistributions in binary form must reproduce the above copyright | ||
69 | * notice, this list of conditions and the following disclaimer in | ||
70 | * the documentation and/or other materials provided with the | ||
71 | * distribution. | ||
72 | * | ||
73 | * 3. All advertising materials mentioning features or use of this | ||
74 | * software must display the following acknowledgment: | ||
75 | * "This product includes software developed by the OpenSSL Project | ||
76 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
77 | * | ||
78 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
79 | * endorse or promote products derived from this software without | ||
80 | * prior written permission. For written permission, please contact | ||
81 | * openssl-core@openssl.org. | ||
82 | * | ||
83 | * 5. Products derived from this software may not be called "OpenSSL" | ||
84 | * nor may "OpenSSL" appear in their names without prior written | ||
85 | * permission of the OpenSSL Project. | ||
86 | * | ||
87 | * 6. Redistributions of any form whatsoever must retain the following | ||
88 | * acknowledgment: | ||
89 | * "This product includes software developed by the OpenSSL Project | ||
90 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
91 | * | ||
92 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
93 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
94 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
95 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
96 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
97 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
98 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
99 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
101 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
102 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
103 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
104 | * ==================================================================== | ||
105 | * | ||
106 | * This product includes cryptographic software written by Eric Young | ||
107 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
108 | * Hudson (tjh@cryptsoft.com). | ||
109 | * | ||
110 | */ | ||
58 | 111 | ||
59 | #include <stdio.h> | 112 | #include <stdio.h> |
60 | #include <stdarg.h> | 113 | #include <stdarg.h> |
114 | #include <string.h> | ||
61 | #include <openssl/lhash.h> | 115 | #include <openssl/lhash.h> |
62 | #include <openssl/crypto.h> | 116 | #include <openssl/crypto.h> |
63 | #include "cryptlib.h" | 117 | #include "cryptlib.h" |
@@ -154,6 +208,54 @@ static ERR_STRING_DATA ERR_str_reasons[]= | |||
154 | 208 | ||
155 | {0,NULL}, | 209 | {0,NULL}, |
156 | }; | 210 | }; |
211 | |||
212 | |||
213 | #define NUM_SYS_STR_REASONS 127 | ||
214 | #define LEN_SYS_STR_REASON 32 | ||
215 | |||
216 | static ERR_STRING_DATA SYS_str_reasons[NUM_SYS_STR_REASONS + 1]; | ||
217 | /* SYS_str_reasons is filled with copies of strerror() results at | ||
218 | * initialization. | ||
219 | * 'errno' values up to 127 should cover all usual errors, | ||
220 | * others will be displayed numerically by ERR_error_string. | ||
221 | * It is crucial that we have something for each reason code | ||
222 | * that occurs in ERR_str_reasons, or bogus reason strings | ||
223 | * will be returned for SYSerr(), which always gets an errno | ||
224 | * value and never one of those 'standard' reason codes. */ | ||
225 | |||
226 | static void build_SYS_str_reasons() | ||
227 | { | ||
228 | /* Malloc cannot be used here, use static storage instead */ | ||
229 | static char strerror_tab[NUM_SYS_STR_REASONS][LEN_SYS_STR_REASON]; | ||
230 | int i; | ||
231 | |||
232 | CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH); | ||
233 | |||
234 | for (i = 1; i <= NUM_SYS_STR_REASONS; i++) | ||
235 | { | ||
236 | ERR_STRING_DATA *str = &SYS_str_reasons[i - 1]; | ||
237 | |||
238 | str->error = (unsigned long)i; | ||
239 | if (str->string == NULL) | ||
240 | { | ||
241 | char (*dest)[LEN_SYS_STR_REASON] = &(strerror_tab[i - 1]); | ||
242 | char *src = strerror(i); | ||
243 | if (src != NULL) | ||
244 | { | ||
245 | strncpy(*dest, src, sizeof *dest); | ||
246 | (*dest)[sizeof *dest - 1] = '\0'; | ||
247 | str->string = *dest; | ||
248 | } | ||
249 | } | ||
250 | if (str->string == NULL) | ||
251 | str->string = "unknown"; | ||
252 | } | ||
253 | |||
254 | /* Now we still have SYS_str_reasons[NUM_SYS_STR_REASONS] = {0, NULL}, | ||
255 | * as required by ERR_load_strings. */ | ||
256 | |||
257 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH); | ||
258 | } | ||
157 | #endif | 259 | #endif |
158 | 260 | ||
159 | #define err_clear_data(p,i) \ | 261 | #define err_clear_data(p,i) \ |
@@ -191,14 +293,16 @@ void ERR_load_ERR_strings(void) | |||
191 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); | 293 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); |
192 | return; | 294 | return; |
193 | } | 295 | } |
194 | init=0; | ||
195 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); | 296 | CRYPTO_w_unlock(CRYPTO_LOCK_ERR); |
196 | 297 | ||
197 | #ifndef NO_ERR | 298 | #ifndef NO_ERR |
198 | ERR_load_strings(0,ERR_str_libraries); | 299 | ERR_load_strings(0,ERR_str_libraries); |
199 | ERR_load_strings(0,ERR_str_reasons); | 300 | ERR_load_strings(0,ERR_str_reasons); |
200 | ERR_load_strings(ERR_LIB_SYS,ERR_str_functs); | 301 | ERR_load_strings(ERR_LIB_SYS,ERR_str_functs); |
302 | build_SYS_str_reasons(); | ||
303 | ERR_load_strings(ERR_LIB_SYS,SYS_str_reasons); | ||
201 | #endif | 304 | #endif |
305 | init=0; | ||
202 | } | 306 | } |
203 | } | 307 | } |
204 | 308 | ||
diff --git a/src/lib/libcrypto/evp/evp_err.c b/src/lib/libcrypto/evp/evp_err.c index 97953a0fc1..fc149cbb1a 100644 --- a/src/lib/libcrypto/evp/evp_err.c +++ b/src/lib/libcrypto/evp/evp_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c index d5e6f5880f..4ab091fa56 100644 --- a/src/lib/libcrypto/evp/evp_pkey.c +++ b/src/lib/libcrypto/evp/evp_pkey.c | |||
@@ -133,7 +133,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
133 | * SEQUENCE {parameters, priv_key} | 133 | * SEQUENCE {parameters, priv_key} |
134 | * SEQUENCE {pub_key, priv_key} | 134 | * SEQUENCE {pub_key, priv_key} |
135 | */ | 135 | */ |
136 | 136 | ||
137 | t1 = (ASN1_TYPE *)sk_value(ndsa, 0); | 137 | t1 = (ASN1_TYPE *)sk_value(ndsa, 0); |
138 | t2 = (ASN1_TYPE *)sk_value(ndsa, 1); | 138 | t2 = (ASN1_TYPE *)sk_value(ndsa, 1); |
139 | if(t1->type == V_ASN1_SEQUENCE) { | 139 | if(t1->type == V_ASN1_SEQUENCE) { |
@@ -152,7 +152,14 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
152 | goto dsaerr; | 152 | goto dsaerr; |
153 | } | 153 | } |
154 | privkey = t2->value.integer; | 154 | privkey = t2->value.integer; |
155 | } else if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) { | 155 | } else { |
156 | if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) { | ||
157 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
158 | goto dsaerr; | ||
159 | } | ||
160 | param = p8->pkeyalg->parameter; | ||
161 | } | ||
162 | if (!param || (param->type != V_ASN1_SEQUENCE)) { | ||
156 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | 163 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); |
157 | goto dsaerr; | 164 | goto dsaerr; |
158 | } | 165 | } |
@@ -186,7 +193,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
186 | 193 | ||
187 | EVP_PKEY_assign_DSA(pkey, dsa); | 194 | EVP_PKEY_assign_DSA(pkey, dsa); |
188 | BN_CTX_free (ctx); | 195 | BN_CTX_free (ctx); |
189 | sk_pop_free(ndsa, ASN1_TYPE_free); | 196 | if(ndsa) sk_pop_free(ndsa, ASN1_TYPE_free); |
197 | else ASN1_INTEGER_free(privkey); | ||
190 | break; | 198 | break; |
191 | dsaerr: | 199 | dsaerr: |
192 | BN_CTX_free (ctx); | 200 | BN_CTX_free (ctx); |
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c index 3e8f460328..620f43feaa 100644 --- a/src/lib/libcrypto/evp/names.c +++ b/src/lib/libcrypto/evp/names.c | |||
@@ -114,5 +114,10 @@ void EVP_cleanup(void) | |||
114 | { | 114 | { |
115 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH); | 115 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH); |
116 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH); | 116 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH); |
117 | /* The above calls will only clean out the contents of the name | ||
118 | hash table, but not the hash table itself. The following line | ||
119 | does that part. -- Richard Levitte */ | ||
120 | OBJ_NAME_cleanup(-1); | ||
121 | |||
117 | EVP_PBE_cleanup(); | 122 | EVP_PBE_cleanup(); |
118 | } | 123 | } |
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c index 23b7c98f8f..e1ec79e093 100644 --- a/src/lib/libcrypto/hmac/hmac.c +++ b/src/lib/libcrypto/hmac/hmac.c | |||
@@ -88,9 +88,11 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, | |||
88 | else | 88 | else |
89 | { | 89 | { |
90 | memcpy(ctx->key,key,len); | 90 | memcpy(ctx->key,key,len); |
91 | memset(&(ctx->key[len]),0,sizeof(ctx->key)-len); | ||
92 | ctx->key_length=len; | 91 | ctx->key_length=len; |
93 | } | 92 | } |
93 | if(ctx->key_length != HMAC_MAX_MD_CBLOCK) | ||
94 | memset(&ctx->key[ctx->key_length], 0, | ||
95 | HMAC_MAX_MD_CBLOCK - ctx->key_length); | ||
94 | } | 96 | } |
95 | 97 | ||
96 | if (reset) | 98 | if (reset) |
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c index 6a340a2403..7eb92a18bc 100644 --- a/src/lib/libcrypto/lhash/lhash.c +++ b/src/lib/libcrypto/lhash/lhash.c | |||
@@ -159,7 +159,7 @@ void lh_free(LHASH *lh) | |||
159 | unsigned int i; | 159 | unsigned int i; |
160 | LHASH_NODE *n,*nn; | 160 | LHASH_NODE *n,*nn; |
161 | 161 | ||
162 | if(lh == NULL) | 162 | if (lh == NULL) |
163 | return; | 163 | return; |
164 | 164 | ||
165 | for (i=0; i<lh->num_nodes; i++) | 165 | for (i=0; i<lh->num_nodes; i++) |
@@ -422,21 +422,6 @@ static LHASH_NODE **getrn(LHASH *lh, void *data, unsigned long *rhash) | |||
422 | return(ret); | 422 | return(ret); |
423 | } | 423 | } |
424 | 424 | ||
425 | /* | ||
426 | unsigned long lh_strhash(char *str) | ||
427 | { | ||
428 | int i,l; | ||
429 | unsigned long ret=0; | ||
430 | unsigned short *s; | ||
431 | |||
432 | if (str == NULL) return(0); | ||
433 | l=(strlen(str)+1)/2; | ||
434 | s=(unsigned short *)str; | ||
435 | for (i=0; i<l; i++) | ||
436 | ret^=(s[i]<<(i&0x0f)); | ||
437 | return(ret); | ||
438 | } */ | ||
439 | |||
440 | /* The following hash seems to work very well on normal text strings | 425 | /* The following hash seems to work very well on normal text strings |
441 | * no collisions on /usr/dict/words and it distributes on %2^n quite | 426 | * no collisions on /usr/dict/words and it distributes on %2^n quite |
442 | * well, not as good as MD5, but still good. | 427 | * well, not as good as MD5, but still good. |
@@ -470,3 +455,7 @@ unsigned long lh_strhash(const char *c) | |||
470 | return((ret>>16)^ret); | 455 | return((ret>>16)^ret); |
471 | } | 456 | } |
472 | 457 | ||
458 | unsigned long lh_num_items(LHASH *lh) | ||
459 | { | ||
460 | return lh ? lh->num_items : 0; | ||
461 | } | ||
diff --git a/src/lib/libcrypto/lhash/lhash.h b/src/lib/libcrypto/lhash/lhash.h index 6f6eeb2698..d315fd9c6d 100644 --- a/src/lib/libcrypto/lhash/lhash.h +++ b/src/lib/libcrypto/lhash/lhash.h | |||
@@ -124,6 +124,7 @@ void *lh_retrieve(LHASH *lh, void *data); | |||
124 | void lh_doall(LHASH *lh, void (*func)(/*void *b*/)); | 124 | void lh_doall(LHASH *lh, void (*func)(/*void *b*/)); |
125 | void lh_doall_arg(LHASH *lh, void (*func)(/*void *a,void *b*/),void *arg); | 125 | void lh_doall_arg(LHASH *lh, void (*func)(/*void *a,void *b*/),void *arg); |
126 | unsigned long lh_strhash(const char *c); | 126 | unsigned long lh_strhash(const char *c); |
127 | unsigned long lh_num_items(LHASH *lh); | ||
127 | 128 | ||
128 | #ifndef NO_FP_API | 129 | #ifndef NO_FP_API |
129 | void lh_stats(LHASH *lh, FILE *out); | 130 | void lh_stats(LHASH *lh, FILE *out); |
diff --git a/src/lib/libcrypto/md5/Makefile.ssl b/src/lib/libcrypto/md5/Makefile.ssl index d50f967be7..45fbd04239 100644 --- a/src/lib/libcrypto/md5/Makefile.ssl +++ b/src/lib/libcrypto/md5/Makefile.ssl | |||
@@ -55,7 +55,7 @@ lib: $(LIBOBJ) | |||
55 | 55 | ||
56 | # elf | 56 | # elf |
57 | asm/mx86-elf.o: asm/mx86unix.cpp | 57 | asm/mx86-elf.o: asm/mx86unix.cpp |
58 | $(CPP) -DELF asm/mx86unix.cpp | as -o asm/mx86-elf.o | 58 | $(CPP) -DELF -x c asm/mx86unix.cpp | as -o asm/mx86-elf.o |
59 | 59 | ||
60 | # solaris | 60 | # solaris |
61 | asm/mx86-sol.o: asm/mx86unix.cpp | 61 | asm/mx86-sol.o: asm/mx86unix.cpp |
@@ -71,7 +71,7 @@ asm/mx86-out.o: asm/mx86unix.cpp | |||
71 | asm/mx86bsdi.o: asm/mx86unix.cpp | 71 | asm/mx86bsdi.o: asm/mx86unix.cpp |
72 | $(CPP) -DBSDI asm/mx86unix.cpp | sed 's/ :/:/' | as -o asm/mx86bsdi.o | 72 | $(CPP) -DBSDI asm/mx86unix.cpp | sed 's/ :/:/' | as -o asm/mx86bsdi.o |
73 | 73 | ||
74 | asm/mx86unix.cpp: asm/md5-586.pl | 74 | asm/mx86unix.cpp: asm/md5-586.pl ../perlasm/x86asm.pl |
75 | (cd asm; $(PERL) md5-586.pl cpp >mx86unix.cpp) | 75 | (cd asm; $(PERL) md5-586.pl cpp >mx86unix.cpp) |
76 | 76 | ||
77 | asm/md5-sparcv8plus.o: asm/md5-sparcv9.S | 77 | asm/md5-sparcv8plus.o: asm/md5-sparcv9.S |
diff --git a/src/lib/libcrypto/md5/Makefile.uni b/src/lib/libcrypto/md5/Makefile.uni index d21c72f3ea..e69de29bb2 100644 --- a/src/lib/libcrypto/md5/Makefile.uni +++ b/src/lib/libcrypto/md5/Makefile.uni | |||
@@ -1,110 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | # make x86-elf - linux-elf etc | ||
6 | # make x86-out - linux-a.out, FreeBSD etc | ||
7 | # make x86-solaris | ||
8 | # make x86-bdsi | ||
9 | |||
10 | DIR= md5 | ||
11 | TOP= . | ||
12 | CC= gcc | ||
13 | CFLAG= -O3 -fomit-frame-pointer | ||
14 | |||
15 | CPP= $(CC) -E | ||
16 | INCLUDES= | ||
17 | INSTALLTOP=/usr/local/lib | ||
18 | MAKE= make | ||
19 | MAKEDEPEND= makedepend | ||
20 | MAKEFILE= Makefile.uni | ||
21 | AR= ar r | ||
22 | RANLIB= ranlib | ||
23 | |||
24 | MD5_ASM_OBJ= | ||
25 | |||
26 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
27 | |||
28 | GENERAL=Makefile | ||
29 | TEST=md5test | ||
30 | APPS=md5 | ||
31 | |||
32 | LIB=libmd5.a | ||
33 | LIBSRC=md5_dgst.c md5_one.c | ||
34 | LIBOBJ=md5_dgst.o md5_one.o $(MD5_ASM_OBJ) | ||
35 | |||
36 | SRC= $(LIBSRC) | ||
37 | |||
38 | EXHEADER= md5.h | ||
39 | HEADER= md5_locl.h $(EXHEADER) | ||
40 | |||
41 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
42 | |||
43 | all: $(LIB) $(TEST) $(APPS) | ||
44 | |||
45 | $(LIB): $(LIBOBJ) | ||
46 | $(AR) $(LIB) $(LIBOBJ) | ||
47 | $(RANLIB) $(LIB) | ||
48 | |||
49 | # elf | ||
50 | asm/mx86-elf.o: asm/mx86unix.cpp | ||
51 | $(CPP) -DELF asm/mx86unix.cpp | as -o asm/mx86-elf.o | ||
52 | |||
53 | # solaris | ||
54 | asm/mx86-sol.o: asm/mx86unix.cpp | ||
55 | $(CC) -E -DSOL asm/mx86unix.cpp | sed 's/^#.*//' > asm/mx86-sol.s | ||
56 | as -o asm/mx86-sol.o asm/mx86-sol.s | ||
57 | rm -f asm/mx86-sol.s | ||
58 | |||
59 | # a.out | ||
60 | asm/mx86-out.o: asm/mx86unix.cpp | ||
61 | $(CPP) -DOUT asm/mx86unix.cpp | as -o asm/mx86-out.o | ||
62 | |||
63 | # bsdi | ||
64 | asm/mx86bsdi.o: asm/mx86unix.cpp | ||
65 | $(CPP) -DBSDI asm/mx86unix.cpp | as -o asm/mx86bsdi.o | ||
66 | |||
67 | asm/mx86unix.cpp: | ||
68 | (cd asm; perl md5-586.pl cpp >mx86unix.cpp) | ||
69 | |||
70 | test: $(TEST) | ||
71 | ./$(TEST) | ||
72 | |||
73 | $(TEST): $(TEST).c $(LIB) | ||
74 | $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB) | ||
75 | |||
76 | $(APPS): $(APPS).c $(LIB) | ||
77 | $(CC) -o $(APPS) $(CFLAGS) $(APPS).c $(LIB) | ||
78 | |||
79 | lint: | ||
80 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
81 | |||
82 | depend: | ||
83 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
84 | |||
85 | dclean: | ||
86 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
87 | mv -f Makefile.new $(MAKEFILE) | ||
88 | |||
89 | clean: | ||
90 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
91 | |||
92 | cc: | ||
93 | $(MAKE) MD5_ASM_OBJ="" CC="cc" CFLAG="-O" all | ||
94 | |||
95 | gcc: | ||
96 | $(MAKE) MD5_ASM_OBJ="" CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
97 | |||
98 | x86-elf: | ||
99 | $(MAKE) MD5_ASM_OBJ="asm/mx86-elf.o" CFLAG="-DELF -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
100 | |||
101 | x86-out: | ||
102 | $(MAKE) MD5_ASM_OBJ="asm/mx86-out.o" CFLAG="-DOUT -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
103 | |||
104 | x86-solaris: | ||
105 | $(MAKE) MD5_ASM_OBJ="asm/mx86-sol.o" CFLAG="-DSOL -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
106 | |||
107 | x86-bdsi: | ||
108 | $(MAKE) MD5_ASM_OBJ="asm/mx86-bdsi.o" CFLAG="-DBDSI -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
109 | |||
110 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/md5/asm/m5-win32.asm b/src/lib/libcrypto/md5/asm/m5-win32.asm index 51f5f17ca3..e69de29bb2 100644 --- a/src/lib/libcrypto/md5/asm/m5-win32.asm +++ b/src/lib/libcrypto/md5/asm/m5-win32.asm | |||
@@ -1,687 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by md5-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE md5-586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _md5_block_asm_host_order | ||
12 | |||
13 | _md5_block_asm_host_order PROC NEAR | ||
14 | push esi | ||
15 | push edi | ||
16 | mov edi, DWORD PTR 12[esp] | ||
17 | mov esi, DWORD PTR 16[esp] | ||
18 | mov ecx, DWORD PTR 20[esp] | ||
19 | push ebp | ||
20 | shl ecx, 6 | ||
21 | push ebx | ||
22 | add ecx, esi | ||
23 | sub ecx, 64 | ||
24 | mov eax, DWORD PTR [edi] | ||
25 | push ecx | ||
26 | mov ebx, DWORD PTR 4[edi] | ||
27 | mov ecx, DWORD PTR 8[edi] | ||
28 | mov edx, DWORD PTR 12[edi] | ||
29 | L000start: | ||
30 | ; | ||
31 | ; R0 section | ||
32 | mov edi, ecx | ||
33 | mov ebp, DWORD PTR [esi] | ||
34 | ; R0 0 | ||
35 | xor edi, edx | ||
36 | and edi, ebx | ||
37 | lea eax, DWORD PTR 3614090360[ebp*1+eax] | ||
38 | xor edi, edx | ||
39 | add eax, edi | ||
40 | mov edi, ebx | ||
41 | rol eax, 7 | ||
42 | mov ebp, DWORD PTR 4[esi] | ||
43 | add eax, ebx | ||
44 | ; R0 1 | ||
45 | xor edi, ecx | ||
46 | and edi, eax | ||
47 | lea edx, DWORD PTR 3905402710[ebp*1+edx] | ||
48 | xor edi, ecx | ||
49 | add edx, edi | ||
50 | mov edi, eax | ||
51 | rol edx, 12 | ||
52 | mov ebp, DWORD PTR 8[esi] | ||
53 | add edx, eax | ||
54 | ; R0 2 | ||
55 | xor edi, ebx | ||
56 | and edi, edx | ||
57 | lea ecx, DWORD PTR 606105819[ebp*1+ecx] | ||
58 | xor edi, ebx | ||
59 | add ecx, edi | ||
60 | mov edi, edx | ||
61 | rol ecx, 17 | ||
62 | mov ebp, DWORD PTR 12[esi] | ||
63 | add ecx, edx | ||
64 | ; R0 3 | ||
65 | xor edi, eax | ||
66 | and edi, ecx | ||
67 | lea ebx, DWORD PTR 3250441966[ebp*1+ebx] | ||
68 | xor edi, eax | ||
69 | add ebx, edi | ||
70 | mov edi, ecx | ||
71 | rol ebx, 22 | ||
72 | mov ebp, DWORD PTR 16[esi] | ||
73 | add ebx, ecx | ||
74 | ; R0 4 | ||
75 | xor edi, edx | ||
76 | and edi, ebx | ||
77 | lea eax, DWORD PTR 4118548399[ebp*1+eax] | ||
78 | xor edi, edx | ||
79 | add eax, edi | ||
80 | mov edi, ebx | ||
81 | rol eax, 7 | ||
82 | mov ebp, DWORD PTR 20[esi] | ||
83 | add eax, ebx | ||
84 | ; R0 5 | ||
85 | xor edi, ecx | ||
86 | and edi, eax | ||
87 | lea edx, DWORD PTR 1200080426[ebp*1+edx] | ||
88 | xor edi, ecx | ||
89 | add edx, edi | ||
90 | mov edi, eax | ||
91 | rol edx, 12 | ||
92 | mov ebp, DWORD PTR 24[esi] | ||
93 | add edx, eax | ||
94 | ; R0 6 | ||
95 | xor edi, ebx | ||
96 | and edi, edx | ||
97 | lea ecx, DWORD PTR 2821735955[ebp*1+ecx] | ||
98 | xor edi, ebx | ||
99 | add ecx, edi | ||
100 | mov edi, edx | ||
101 | rol ecx, 17 | ||
102 | mov ebp, DWORD PTR 28[esi] | ||
103 | add ecx, edx | ||
104 | ; R0 7 | ||
105 | xor edi, eax | ||
106 | and edi, ecx | ||
107 | lea ebx, DWORD PTR 4249261313[ebp*1+ebx] | ||
108 | xor edi, eax | ||
109 | add ebx, edi | ||
110 | mov edi, ecx | ||
111 | rol ebx, 22 | ||
112 | mov ebp, DWORD PTR 32[esi] | ||
113 | add ebx, ecx | ||
114 | ; R0 8 | ||
115 | xor edi, edx | ||
116 | and edi, ebx | ||
117 | lea eax, DWORD PTR 1770035416[ebp*1+eax] | ||
118 | xor edi, edx | ||
119 | add eax, edi | ||
120 | mov edi, ebx | ||
121 | rol eax, 7 | ||
122 | mov ebp, DWORD PTR 36[esi] | ||
123 | add eax, ebx | ||
124 | ; R0 9 | ||
125 | xor edi, ecx | ||
126 | and edi, eax | ||
127 | lea edx, DWORD PTR 2336552879[ebp*1+edx] | ||
128 | xor edi, ecx | ||
129 | add edx, edi | ||
130 | mov edi, eax | ||
131 | rol edx, 12 | ||
132 | mov ebp, DWORD PTR 40[esi] | ||
133 | add edx, eax | ||
134 | ; R0 10 | ||
135 | xor edi, ebx | ||
136 | and edi, edx | ||
137 | lea ecx, DWORD PTR 4294925233[ebp*1+ecx] | ||
138 | xor edi, ebx | ||
139 | add ecx, edi | ||
140 | mov edi, edx | ||
141 | rol ecx, 17 | ||
142 | mov ebp, DWORD PTR 44[esi] | ||
143 | add ecx, edx | ||
144 | ; R0 11 | ||
145 | xor edi, eax | ||
146 | and edi, ecx | ||
147 | lea ebx, DWORD PTR 2304563134[ebp*1+ebx] | ||
148 | xor edi, eax | ||
149 | add ebx, edi | ||
150 | mov edi, ecx | ||
151 | rol ebx, 22 | ||
152 | mov ebp, DWORD PTR 48[esi] | ||
153 | add ebx, ecx | ||
154 | ; R0 12 | ||
155 | xor edi, edx | ||
156 | and edi, ebx | ||
157 | lea eax, DWORD PTR 1804603682[ebp*1+eax] | ||
158 | xor edi, edx | ||
159 | add eax, edi | ||
160 | mov edi, ebx | ||
161 | rol eax, 7 | ||
162 | mov ebp, DWORD PTR 52[esi] | ||
163 | add eax, ebx | ||
164 | ; R0 13 | ||
165 | xor edi, ecx | ||
166 | and edi, eax | ||
167 | lea edx, DWORD PTR 4254626195[ebp*1+edx] | ||
168 | xor edi, ecx | ||
169 | add edx, edi | ||
170 | mov edi, eax | ||
171 | rol edx, 12 | ||
172 | mov ebp, DWORD PTR 56[esi] | ||
173 | add edx, eax | ||
174 | ; R0 14 | ||
175 | xor edi, ebx | ||
176 | and edi, edx | ||
177 | lea ecx, DWORD PTR 2792965006[ebp*1+ecx] | ||
178 | xor edi, ebx | ||
179 | add ecx, edi | ||
180 | mov edi, edx | ||
181 | rol ecx, 17 | ||
182 | mov ebp, DWORD PTR 60[esi] | ||
183 | add ecx, edx | ||
184 | ; R0 15 | ||
185 | xor edi, eax | ||
186 | and edi, ecx | ||
187 | lea ebx, DWORD PTR 1236535329[ebp*1+ebx] | ||
188 | xor edi, eax | ||
189 | add ebx, edi | ||
190 | mov edi, ecx | ||
191 | rol ebx, 22 | ||
192 | mov ebp, DWORD PTR 4[esi] | ||
193 | add ebx, ecx | ||
194 | ; | ||
195 | ; R1 section | ||
196 | ; R1 16 | ||
197 | lea eax, DWORD PTR 4129170786[ebp*1+eax] | ||
198 | xor edi, ebx | ||
199 | and edi, edx | ||
200 | mov ebp, DWORD PTR 24[esi] | ||
201 | xor edi, ecx | ||
202 | add eax, edi | ||
203 | mov edi, ebx | ||
204 | rol eax, 5 | ||
205 | add eax, ebx | ||
206 | ; R1 17 | ||
207 | lea edx, DWORD PTR 3225465664[ebp*1+edx] | ||
208 | xor edi, eax | ||
209 | and edi, ecx | ||
210 | mov ebp, DWORD PTR 44[esi] | ||
211 | xor edi, ebx | ||
212 | add edx, edi | ||
213 | mov edi, eax | ||
214 | rol edx, 9 | ||
215 | add edx, eax | ||
216 | ; R1 18 | ||
217 | lea ecx, DWORD PTR 643717713[ebp*1+ecx] | ||
218 | xor edi, edx | ||
219 | and edi, ebx | ||
220 | mov ebp, DWORD PTR [esi] | ||
221 | xor edi, eax | ||
222 | add ecx, edi | ||
223 | mov edi, edx | ||
224 | rol ecx, 14 | ||
225 | add ecx, edx | ||
226 | ; R1 19 | ||
227 | lea ebx, DWORD PTR 3921069994[ebp*1+ebx] | ||
228 | xor edi, ecx | ||
229 | and edi, eax | ||
230 | mov ebp, DWORD PTR 20[esi] | ||
231 | xor edi, edx | ||
232 | add ebx, edi | ||
233 | mov edi, ecx | ||
234 | rol ebx, 20 | ||
235 | add ebx, ecx | ||
236 | ; R1 20 | ||
237 | lea eax, DWORD PTR 3593408605[ebp*1+eax] | ||
238 | xor edi, ebx | ||
239 | and edi, edx | ||
240 | mov ebp, DWORD PTR 40[esi] | ||
241 | xor edi, ecx | ||
242 | add eax, edi | ||
243 | mov edi, ebx | ||
244 | rol eax, 5 | ||
245 | add eax, ebx | ||
246 | ; R1 21 | ||
247 | lea edx, DWORD PTR 38016083[ebp*1+edx] | ||
248 | xor edi, eax | ||
249 | and edi, ecx | ||
250 | mov ebp, DWORD PTR 60[esi] | ||
251 | xor edi, ebx | ||
252 | add edx, edi | ||
253 | mov edi, eax | ||
254 | rol edx, 9 | ||
255 | add edx, eax | ||
256 | ; R1 22 | ||
257 | lea ecx, DWORD PTR 3634488961[ebp*1+ecx] | ||
258 | xor edi, edx | ||
259 | and edi, ebx | ||
260 | mov ebp, DWORD PTR 16[esi] | ||
261 | xor edi, eax | ||
262 | add ecx, edi | ||
263 | mov edi, edx | ||
264 | rol ecx, 14 | ||
265 | add ecx, edx | ||
266 | ; R1 23 | ||
267 | lea ebx, DWORD PTR 3889429448[ebp*1+ebx] | ||
268 | xor edi, ecx | ||
269 | and edi, eax | ||
270 | mov ebp, DWORD PTR 36[esi] | ||
271 | xor edi, edx | ||
272 | add ebx, edi | ||
273 | mov edi, ecx | ||
274 | rol ebx, 20 | ||
275 | add ebx, ecx | ||
276 | ; R1 24 | ||
277 | lea eax, DWORD PTR 568446438[ebp*1+eax] | ||
278 | xor edi, ebx | ||
279 | and edi, edx | ||
280 | mov ebp, DWORD PTR 56[esi] | ||
281 | xor edi, ecx | ||
282 | add eax, edi | ||
283 | mov edi, ebx | ||
284 | rol eax, 5 | ||
285 | add eax, ebx | ||
286 | ; R1 25 | ||
287 | lea edx, DWORD PTR 3275163606[ebp*1+edx] | ||
288 | xor edi, eax | ||
289 | and edi, ecx | ||
290 | mov ebp, DWORD PTR 12[esi] | ||
291 | xor edi, ebx | ||
292 | add edx, edi | ||
293 | mov edi, eax | ||
294 | rol edx, 9 | ||
295 | add edx, eax | ||
296 | ; R1 26 | ||
297 | lea ecx, DWORD PTR 4107603335[ebp*1+ecx] | ||
298 | xor edi, edx | ||
299 | and edi, ebx | ||
300 | mov ebp, DWORD PTR 32[esi] | ||
301 | xor edi, eax | ||
302 | add ecx, edi | ||
303 | mov edi, edx | ||
304 | rol ecx, 14 | ||
305 | add ecx, edx | ||
306 | ; R1 27 | ||
307 | lea ebx, DWORD PTR 1163531501[ebp*1+ebx] | ||
308 | xor edi, ecx | ||
309 | and edi, eax | ||
310 | mov ebp, DWORD PTR 52[esi] | ||
311 | xor edi, edx | ||
312 | add ebx, edi | ||
313 | mov edi, ecx | ||
314 | rol ebx, 20 | ||
315 | add ebx, ecx | ||
316 | ; R1 28 | ||
317 | lea eax, DWORD PTR 2850285829[ebp*1+eax] | ||
318 | xor edi, ebx | ||
319 | and edi, edx | ||
320 | mov ebp, DWORD PTR 8[esi] | ||
321 | xor edi, ecx | ||
322 | add eax, edi | ||
323 | mov edi, ebx | ||
324 | rol eax, 5 | ||
325 | add eax, ebx | ||
326 | ; R1 29 | ||
327 | lea edx, DWORD PTR 4243563512[ebp*1+edx] | ||
328 | xor edi, eax | ||
329 | and edi, ecx | ||
330 | mov ebp, DWORD PTR 28[esi] | ||
331 | xor edi, ebx | ||
332 | add edx, edi | ||
333 | mov edi, eax | ||
334 | rol edx, 9 | ||
335 | add edx, eax | ||
336 | ; R1 30 | ||
337 | lea ecx, DWORD PTR 1735328473[ebp*1+ecx] | ||
338 | xor edi, edx | ||
339 | and edi, ebx | ||
340 | mov ebp, DWORD PTR 48[esi] | ||
341 | xor edi, eax | ||
342 | add ecx, edi | ||
343 | mov edi, edx | ||
344 | rol ecx, 14 | ||
345 | add ecx, edx | ||
346 | ; R1 31 | ||
347 | lea ebx, DWORD PTR 2368359562[ebp*1+ebx] | ||
348 | xor edi, ecx | ||
349 | and edi, eax | ||
350 | mov ebp, DWORD PTR 20[esi] | ||
351 | xor edi, edx | ||
352 | add ebx, edi | ||
353 | mov edi, ecx | ||
354 | rol ebx, 20 | ||
355 | add ebx, ecx | ||
356 | ; | ||
357 | ; R2 section | ||
358 | ; R2 32 | ||
359 | xor edi, edx | ||
360 | xor edi, ebx | ||
361 | lea eax, DWORD PTR 4294588738[ebp*1+eax] | ||
362 | add eax, edi | ||
363 | rol eax, 4 | ||
364 | mov ebp, DWORD PTR 32[esi] | ||
365 | mov edi, ebx | ||
366 | ; R2 33 | ||
367 | lea edx, DWORD PTR 2272392833[ebp*1+edx] | ||
368 | add eax, ebx | ||
369 | xor edi, ecx | ||
370 | xor edi, eax | ||
371 | mov ebp, DWORD PTR 44[esi] | ||
372 | add edx, edi | ||
373 | mov edi, eax | ||
374 | rol edx, 11 | ||
375 | add edx, eax | ||
376 | ; R2 34 | ||
377 | xor edi, ebx | ||
378 | xor edi, edx | ||
379 | lea ecx, DWORD PTR 1839030562[ebp*1+ecx] | ||
380 | add ecx, edi | ||
381 | rol ecx, 16 | ||
382 | mov ebp, DWORD PTR 56[esi] | ||
383 | mov edi, edx | ||
384 | ; R2 35 | ||
385 | lea ebx, DWORD PTR 4259657740[ebp*1+ebx] | ||
386 | add ecx, edx | ||
387 | xor edi, eax | ||
388 | xor edi, ecx | ||
389 | mov ebp, DWORD PTR 4[esi] | ||
390 | add ebx, edi | ||
391 | mov edi, ecx | ||
392 | rol ebx, 23 | ||
393 | add ebx, ecx | ||
394 | ; R2 36 | ||
395 | xor edi, edx | ||
396 | xor edi, ebx | ||
397 | lea eax, DWORD PTR 2763975236[ebp*1+eax] | ||
398 | add eax, edi | ||
399 | rol eax, 4 | ||
400 | mov ebp, DWORD PTR 16[esi] | ||
401 | mov edi, ebx | ||
402 | ; R2 37 | ||
403 | lea edx, DWORD PTR 1272893353[ebp*1+edx] | ||
404 | add eax, ebx | ||
405 | xor edi, ecx | ||
406 | xor edi, eax | ||
407 | mov ebp, DWORD PTR 28[esi] | ||
408 | add edx, edi | ||
409 | mov edi, eax | ||
410 | rol edx, 11 | ||
411 | add edx, eax | ||
412 | ; R2 38 | ||
413 | xor edi, ebx | ||
414 | xor edi, edx | ||
415 | lea ecx, DWORD PTR 4139469664[ebp*1+ecx] | ||
416 | add ecx, edi | ||
417 | rol ecx, 16 | ||
418 | mov ebp, DWORD PTR 40[esi] | ||
419 | mov edi, edx | ||
420 | ; R2 39 | ||
421 | lea ebx, DWORD PTR 3200236656[ebp*1+ebx] | ||
422 | add ecx, edx | ||
423 | xor edi, eax | ||
424 | xor edi, ecx | ||
425 | mov ebp, DWORD PTR 52[esi] | ||
426 | add ebx, edi | ||
427 | mov edi, ecx | ||
428 | rol ebx, 23 | ||
429 | add ebx, ecx | ||
430 | ; R2 40 | ||
431 | xor edi, edx | ||
432 | xor edi, ebx | ||
433 | lea eax, DWORD PTR 681279174[ebp*1+eax] | ||
434 | add eax, edi | ||
435 | rol eax, 4 | ||
436 | mov ebp, DWORD PTR [esi] | ||
437 | mov edi, ebx | ||
438 | ; R2 41 | ||
439 | lea edx, DWORD PTR 3936430074[ebp*1+edx] | ||
440 | add eax, ebx | ||
441 | xor edi, ecx | ||
442 | xor edi, eax | ||
443 | mov ebp, DWORD PTR 12[esi] | ||
444 | add edx, edi | ||
445 | mov edi, eax | ||
446 | rol edx, 11 | ||
447 | add edx, eax | ||
448 | ; R2 42 | ||
449 | xor edi, ebx | ||
450 | xor edi, edx | ||
451 | lea ecx, DWORD PTR 3572445317[ebp*1+ecx] | ||
452 | add ecx, edi | ||
453 | rol ecx, 16 | ||
454 | mov ebp, DWORD PTR 24[esi] | ||
455 | mov edi, edx | ||
456 | ; R2 43 | ||
457 | lea ebx, DWORD PTR 76029189[ebp*1+ebx] | ||
458 | add ecx, edx | ||
459 | xor edi, eax | ||
460 | xor edi, ecx | ||
461 | mov ebp, DWORD PTR 36[esi] | ||
462 | add ebx, edi | ||
463 | mov edi, ecx | ||
464 | rol ebx, 23 | ||
465 | add ebx, ecx | ||
466 | ; R2 44 | ||
467 | xor edi, edx | ||
468 | xor edi, ebx | ||
469 | lea eax, DWORD PTR 3654602809[ebp*1+eax] | ||
470 | add eax, edi | ||
471 | rol eax, 4 | ||
472 | mov ebp, DWORD PTR 48[esi] | ||
473 | mov edi, ebx | ||
474 | ; R2 45 | ||
475 | lea edx, DWORD PTR 3873151461[ebp*1+edx] | ||
476 | add eax, ebx | ||
477 | xor edi, ecx | ||
478 | xor edi, eax | ||
479 | mov ebp, DWORD PTR 60[esi] | ||
480 | add edx, edi | ||
481 | mov edi, eax | ||
482 | rol edx, 11 | ||
483 | add edx, eax | ||
484 | ; R2 46 | ||
485 | xor edi, ebx | ||
486 | xor edi, edx | ||
487 | lea ecx, DWORD PTR 530742520[ebp*1+ecx] | ||
488 | add ecx, edi | ||
489 | rol ecx, 16 | ||
490 | mov ebp, DWORD PTR 8[esi] | ||
491 | mov edi, edx | ||
492 | ; R2 47 | ||
493 | lea ebx, DWORD PTR 3299628645[ebp*1+ebx] | ||
494 | add ecx, edx | ||
495 | xor edi, eax | ||
496 | xor edi, ecx | ||
497 | mov ebp, DWORD PTR [esi] | ||
498 | add ebx, edi | ||
499 | mov edi, -1 | ||
500 | rol ebx, 23 | ||
501 | add ebx, ecx | ||
502 | ; | ||
503 | ; R3 section | ||
504 | ; R3 48 | ||
505 | xor edi, edx | ||
506 | or edi, ebx | ||
507 | lea eax, DWORD PTR 4096336452[ebp*1+eax] | ||
508 | xor edi, ecx | ||
509 | mov ebp, DWORD PTR 28[esi] | ||
510 | add eax, edi | ||
511 | mov edi, -1 | ||
512 | rol eax, 6 | ||
513 | xor edi, ecx | ||
514 | add eax, ebx | ||
515 | ; R3 49 | ||
516 | or edi, eax | ||
517 | lea edx, DWORD PTR 1126891415[ebp*1+edx] | ||
518 | xor edi, ebx | ||
519 | mov ebp, DWORD PTR 56[esi] | ||
520 | add edx, edi | ||
521 | mov edi, -1 | ||
522 | rol edx, 10 | ||
523 | xor edi, ebx | ||
524 | add edx, eax | ||
525 | ; R3 50 | ||
526 | or edi, edx | ||
527 | lea ecx, DWORD PTR 2878612391[ebp*1+ecx] | ||
528 | xor edi, eax | ||
529 | mov ebp, DWORD PTR 20[esi] | ||
530 | add ecx, edi | ||
531 | mov edi, -1 | ||
532 | rol ecx, 15 | ||
533 | xor edi, eax | ||
534 | add ecx, edx | ||
535 | ; R3 51 | ||
536 | or edi, ecx | ||
537 | lea ebx, DWORD PTR 4237533241[ebp*1+ebx] | ||
538 | xor edi, edx | ||
539 | mov ebp, DWORD PTR 48[esi] | ||
540 | add ebx, edi | ||
541 | mov edi, -1 | ||
542 | rol ebx, 21 | ||
543 | xor edi, edx | ||
544 | add ebx, ecx | ||
545 | ; R3 52 | ||
546 | or edi, ebx | ||
547 | lea eax, DWORD PTR 1700485571[ebp*1+eax] | ||
548 | xor edi, ecx | ||
549 | mov ebp, DWORD PTR 12[esi] | ||
550 | add eax, edi | ||
551 | mov edi, -1 | ||
552 | rol eax, 6 | ||
553 | xor edi, ecx | ||
554 | add eax, ebx | ||
555 | ; R3 53 | ||
556 | or edi, eax | ||
557 | lea edx, DWORD PTR 2399980690[ebp*1+edx] | ||
558 | xor edi, ebx | ||
559 | mov ebp, DWORD PTR 40[esi] | ||
560 | add edx, edi | ||
561 | mov edi, -1 | ||
562 | rol edx, 10 | ||
563 | xor edi, ebx | ||
564 | add edx, eax | ||
565 | ; R3 54 | ||
566 | or edi, edx | ||
567 | lea ecx, DWORD PTR 4293915773[ebp*1+ecx] | ||
568 | xor edi, eax | ||
569 | mov ebp, DWORD PTR 4[esi] | ||
570 | add ecx, edi | ||
571 | mov edi, -1 | ||
572 | rol ecx, 15 | ||
573 | xor edi, eax | ||
574 | add ecx, edx | ||
575 | ; R3 55 | ||
576 | or edi, ecx | ||
577 | lea ebx, DWORD PTR 2240044497[ebp*1+ebx] | ||
578 | xor edi, edx | ||
579 | mov ebp, DWORD PTR 32[esi] | ||
580 | add ebx, edi | ||
581 | mov edi, -1 | ||
582 | rol ebx, 21 | ||
583 | xor edi, edx | ||
584 | add ebx, ecx | ||
585 | ; R3 56 | ||
586 | or edi, ebx | ||
587 | lea eax, DWORD PTR 1873313359[ebp*1+eax] | ||
588 | xor edi, ecx | ||
589 | mov ebp, DWORD PTR 60[esi] | ||
590 | add eax, edi | ||
591 | mov edi, -1 | ||
592 | rol eax, 6 | ||
593 | xor edi, ecx | ||
594 | add eax, ebx | ||
595 | ; R3 57 | ||
596 | or edi, eax | ||
597 | lea edx, DWORD PTR 4264355552[ebp*1+edx] | ||
598 | xor edi, ebx | ||
599 | mov ebp, DWORD PTR 24[esi] | ||
600 | add edx, edi | ||
601 | mov edi, -1 | ||
602 | rol edx, 10 | ||
603 | xor edi, ebx | ||
604 | add edx, eax | ||
605 | ; R3 58 | ||
606 | or edi, edx | ||
607 | lea ecx, DWORD PTR 2734768916[ebp*1+ecx] | ||
608 | xor edi, eax | ||
609 | mov ebp, DWORD PTR 52[esi] | ||
610 | add ecx, edi | ||
611 | mov edi, -1 | ||
612 | rol ecx, 15 | ||
613 | xor edi, eax | ||
614 | add ecx, edx | ||
615 | ; R3 59 | ||
616 | or edi, ecx | ||
617 | lea ebx, DWORD PTR 1309151649[ebp*1+ebx] | ||
618 | xor edi, edx | ||
619 | mov ebp, DWORD PTR 16[esi] | ||
620 | add ebx, edi | ||
621 | mov edi, -1 | ||
622 | rol ebx, 21 | ||
623 | xor edi, edx | ||
624 | add ebx, ecx | ||
625 | ; R3 60 | ||
626 | or edi, ebx | ||
627 | lea eax, DWORD PTR 4149444226[ebp*1+eax] | ||
628 | xor edi, ecx | ||
629 | mov ebp, DWORD PTR 44[esi] | ||
630 | add eax, edi | ||
631 | mov edi, -1 | ||
632 | rol eax, 6 | ||
633 | xor edi, ecx | ||
634 | add eax, ebx | ||
635 | ; R3 61 | ||
636 | or edi, eax | ||
637 | lea edx, DWORD PTR 3174756917[ebp*1+edx] | ||
638 | xor edi, ebx | ||
639 | mov ebp, DWORD PTR 8[esi] | ||
640 | add edx, edi | ||
641 | mov edi, -1 | ||
642 | rol edx, 10 | ||
643 | xor edi, ebx | ||
644 | add edx, eax | ||
645 | ; R3 62 | ||
646 | or edi, edx | ||
647 | lea ecx, DWORD PTR 718787259[ebp*1+ecx] | ||
648 | xor edi, eax | ||
649 | mov ebp, DWORD PTR 36[esi] | ||
650 | add ecx, edi | ||
651 | mov edi, -1 | ||
652 | rol ecx, 15 | ||
653 | xor edi, eax | ||
654 | add ecx, edx | ||
655 | ; R3 63 | ||
656 | or edi, ecx | ||
657 | lea ebx, DWORD PTR 3951481745[ebp*1+ebx] | ||
658 | xor edi, edx | ||
659 | mov ebp, DWORD PTR 24[esp] | ||
660 | add ebx, edi | ||
661 | add esi, 64 | ||
662 | rol ebx, 21 | ||
663 | mov edi, DWORD PTR [ebp] | ||
664 | add ebx, ecx | ||
665 | add eax, edi | ||
666 | mov edi, DWORD PTR 4[ebp] | ||
667 | add ebx, edi | ||
668 | mov edi, DWORD PTR 8[ebp] | ||
669 | add ecx, edi | ||
670 | mov edi, DWORD PTR 12[ebp] | ||
671 | add edx, edi | ||
672 | mov DWORD PTR [ebp],eax | ||
673 | mov DWORD PTR 4[ebp],ebx | ||
674 | mov edi, DWORD PTR [esp] | ||
675 | mov DWORD PTR 8[ebp],ecx | ||
676 | mov DWORD PTR 12[ebp],edx | ||
677 | cmp edi, esi | ||
678 | jge L000start | ||
679 | pop eax | ||
680 | pop ebx | ||
681 | pop ebp | ||
682 | pop edi | ||
683 | pop esi | ||
684 | ret | ||
685 | _md5_block_asm_host_order ENDP | ||
686 | _TEXT ENDS | ||
687 | END | ||
diff --git a/src/lib/libcrypto/md5/md5_locl.h b/src/lib/libcrypto/md5/md5_locl.h index 06af633228..c912484122 100644 --- a/src/lib/libcrypto/md5/md5_locl.h +++ b/src/lib/libcrypto/md5/md5_locl.h | |||
@@ -135,11 +135,7 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num); | |||
135 | */ | 135 | */ |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | #ifndef FLAT_INC | ||
139 | #include "../md32_common.h" | ||
140 | #else | ||
141 | #include "md32_common.h" | 138 | #include "md32_common.h" |
142 | #endif | ||
143 | 139 | ||
144 | /* | 140 | /* |
145 | #define F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) | 141 | #define F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) |
diff --git a/src/lib/libcrypto/mem_dbg.c b/src/lib/libcrypto/mem_dbg.c index 14770c0733..a399485300 100644 --- a/src/lib/libcrypto/mem_dbg.c +++ b/src/lib/libcrypto/mem_dbg.c | |||
@@ -640,19 +640,54 @@ void CRYPTO_mem_leaks(BIO *b) | |||
640 | MEM_LEAK ml; | 640 | MEM_LEAK ml; |
641 | char buf[80]; | 641 | char buf[80]; |
642 | 642 | ||
643 | if (mh == NULL) return; | 643 | if (mh == NULL && amih == NULL) |
644 | return; | ||
644 | ml.bio=b; | 645 | ml.bio=b; |
645 | ml.bytes=0; | 646 | ml.bytes=0; |
646 | ml.chunks=0; | 647 | ml.chunks=0; |
647 | CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2); | 648 | MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */ |
648 | lh_doall_arg(mh,(void (*)())print_leak,(char *)&ml); | 649 | if (mh != NULL) |
649 | CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2); | 650 | lh_doall_arg(mh,(void (*)())print_leak,(char *)&ml); |
650 | if (ml.chunks != 0) | 651 | if (ml.chunks != 0) |
651 | { | 652 | { |
652 | sprintf(buf,"%ld bytes leaked in %d chunks\n", | 653 | sprintf(buf,"%ld bytes leaked in %d chunks\n", |
653 | ml.bytes,ml.chunks); | 654 | ml.bytes,ml.chunks); |
654 | BIO_puts(b,buf); | 655 | BIO_puts(b,buf); |
655 | } | 656 | } |
657 | else | ||
658 | { | ||
659 | /* Make sure that, if we found no leaks, memory-leak debugging itself | ||
660 | * does not introduce memory leaks (which might irritate | ||
661 | * external debugging tools). | ||
662 | * (When someone enables leak checking, but does not call | ||
663 | * this function, we declare it to be their fault.) | ||
664 | * | ||
665 | * XXX This should be in CRYPTO_mem_leaks_cb, | ||
666 | * and CRYPTO_mem_leaks should be implemented by | ||
667 | * using CRYPTO_mem_leaks_cb. | ||
668 | * (Also their should be a variant of lh_doall_arg | ||
669 | * that takes a function pointer instead of a void *; | ||
670 | * this would obviate the ugly and illegal | ||
671 | * void_fn_to_char kludge in CRYPTO_mem_leaks_cb. | ||
672 | * Otherwise the code police will come and get us.) | ||
673 | */ | ||
674 | CRYPTO_w_lock(CRYPTO_LOCK_MALLOC); | ||
675 | if (mh != NULL) | ||
676 | { | ||
677 | lh_free(mh); | ||
678 | mh = NULL; | ||
679 | } | ||
680 | if (amih != NULL) | ||
681 | { | ||
682 | if (lh_num_items(amih) == 0) | ||
683 | { | ||
684 | lh_free(amih); | ||
685 | amih = NULL; | ||
686 | } | ||
687 | } | ||
688 | CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC); | ||
689 | } | ||
690 | MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */ | ||
656 | 691 | ||
657 | #if 0 | 692 | #if 0 |
658 | lh_stats_bio(mh,b); | 693 | lh_stats_bio(mh,b); |
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c index d654eb220e..d9389a5e5a 100644 --- a/src/lib/libcrypto/objects/o_names.c +++ b/src/lib/libcrypto/objects/o_names.c | |||
@@ -22,7 +22,7 @@ typedef struct name_funcs_st | |||
22 | DECLARE_STACK_OF(NAME_FUNCS) | 22 | DECLARE_STACK_OF(NAME_FUNCS) |
23 | IMPLEMENT_STACK_OF(NAME_FUNCS) | 23 | IMPLEMENT_STACK_OF(NAME_FUNCS) |
24 | 24 | ||
25 | STACK_OF(NAME_FUNCS) *name_funcs_stack; | 25 | static STACK_OF(NAME_FUNCS) *name_funcs_stack; |
26 | 26 | ||
27 | static unsigned long obj_name_hash(OBJ_NAME *a); | 27 | static unsigned long obj_name_hash(OBJ_NAME *a); |
28 | static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); | 28 | static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); |
diff --git a/src/lib/libcrypto/objects/obj_err.c b/src/lib/libcrypto/objects/obj_err.c index cef401db27..7aec0ed47a 100644 --- a/src/lib/libcrypto/objects/obj_err.c +++ b/src/lib/libcrypto/objects/obj_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/objects/objects.h b/src/lib/libcrypto/objects/objects.h index d1a5ad2502..95c8a21568 100644 --- a/src/lib/libcrypto/objects/objects.h +++ b/src/lib/libcrypto/objects/objects.h | |||
@@ -949,7 +949,7 @@ extern "C" { | |||
949 | #define NID_ad_ca_issuers 179 | 949 | #define NID_ad_ca_issuers 179 |
950 | #define OBJ_ad_ca_issuers OBJ_id_ad,2L | 950 | #define OBJ_ad_ca_issuers OBJ_id_ad,2L |
951 | 951 | ||
952 | #define SN_OSCP_sign "OCSPSigning" | 952 | #define SN_OCSP_sign "OCSPSigning" |
953 | #define LN_OCSP_sign "OCSP Signing" | 953 | #define LN_OCSP_sign "OCSP Signing" |
954 | #define NID_OCSP_sign 180 | 954 | #define NID_OCSP_sign 180 |
955 | #define OBJ_OCSP_sign OBJ_id_kp,9L | 955 | #define OBJ_OCSP_sign OBJ_id_kp,9L |
diff --git a/src/lib/libcrypto/opensslv.h b/src/lib/libcrypto/opensslv.h index 55d5d06cf5..55ec97389f 100644 --- a/src/lib/libcrypto/opensslv.h +++ b/src/lib/libcrypto/opensslv.h | |||
@@ -2,20 +2,31 @@ | |||
2 | #define HEADER_OPENSSLV_H | 2 | #define HEADER_OPENSSLV_H |
3 | 3 | ||
4 | /* Numeric release version identifier: | 4 | /* Numeric release version identifier: |
5 | * MMNNFFRBB: major minor fix final beta/patch | 5 | * MMNNFFPPS: major minor fix patch status |
6 | * The status nibble has one of the values 0 for development, 1 to e for betas | ||
7 | * 1 to 14, and f for release. The patch level is exactly that. | ||
6 | * For example: | 8 | * For example: |
7 | * 0.9.3-dev 0x00903000 | 9 | * 0.9.3-dev 0x00903000 |
8 | * 0.9.3beta1 0x00903001 | 10 | * 0.9.3-beta1 0x00903001 |
9 | * 0.9.3beta2-dev 0x00903002 | 11 | * 0.9.3-beta2-dev 0x00903002 |
10 | * 0.9.3beta2 0x00903002 (same as ...beta2-dev) | 12 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) |
11 | * 0.9.3 0x00903100 | 13 | * 0.9.3 0x0090300f |
12 | * 0.9.3a 0x00903101 | 14 | * 0.9.3a 0x0090301f |
13 | * 0.9.4 0x00904100 | 15 | * 0.9.4 0x0090400f |
14 | * 1.2.3z 0x1020311a | 16 | * 1.2.3z 0x102031af |
17 | * | ||
18 | * For continuity reasons (because 0.9.5 is already out, and is coded | ||
19 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level | ||
20 | * part is slightly different, by setting the highest bit. This means | ||
21 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start | ||
22 | * with 0x0090600S... | ||
23 | * | ||
15 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) | 24 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) |
25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for | ||
26 | * major minor fix final patch/beta) | ||
16 | */ | 27 | */ |
17 | #define OPENSSL_VERSION_NUMBER 0x00905100L | 28 | #define OPENSSL_VERSION_NUMBER 0x0090581fL |
18 | #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.5 28 Feb 2000" | 29 | #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.5a 1 Apr 2000" |
19 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT | 30 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT |
20 | 31 | ||
21 | #endif /* HEADER_OPENSSLV_H */ | 32 | #endif /* HEADER_OPENSSLV_H */ |
diff --git a/src/lib/libcrypto/pem/pem_err.c b/src/lib/libcrypto/pem/pem_err.c index 642129da20..8b1789b11c 100644 --- a/src/lib/libcrypto/pem/pem_err.c +++ b/src/lib/libcrypto/pem/pem_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c index 072211ba0f..b5e0a650f8 100644 --- a/src/lib/libcrypto/pem/pem_lib.c +++ b/src/lib/libcrypto/pem/pem_lib.c | |||
@@ -373,7 +373,7 @@ int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x, | |||
373 | kstr=(unsigned char *)buf; | 373 | kstr=(unsigned char *)buf; |
374 | } | 374 | } |
375 | RAND_add(data,i,0);/* put in the RSA key. */ | 375 | RAND_add(data,i,0);/* put in the RSA key. */ |
376 | if (RAND_bytes(iv,8) <= 0) /* Generate a salt */ | 376 | if (RAND_pseudo_bytes(iv,8) < 0) /* Generate a salt */ |
377 | goto err; | 377 | goto err; |
378 | /* The 'iv' is used as the iv and as a salt. It is | 378 | /* The 'iv' is used as the iv and as a salt. It is |
379 | * NOT taken from the BytesToKey function */ | 379 | * NOT taken from the BytesToKey function */ |
diff --git a/src/lib/libcrypto/perlasm/x86asm.pl b/src/lib/libcrypto/perlasm/x86asm.pl index 44e330eb8d..81c6e64e87 100644 --- a/src/lib/libcrypto/perlasm/x86asm.pl +++ b/src/lib/libcrypto/perlasm/x86asm.pl | |||
@@ -18,11 +18,13 @@ sub main'asm_init | |||
18 | ($type,$fn,$i386)=@_; | 18 | ($type,$fn,$i386)=@_; |
19 | $filename=$fn; | 19 | $filename=$fn; |
20 | 20 | ||
21 | $cpp=$sol=$aout=$win32=0; | 21 | $cpp=$sol=$aout=$win32=$gaswin=0; |
22 | if ( ($type eq "elf")) | 22 | if ( ($type eq "elf")) |
23 | { require "x86unix.pl"; } | 23 | { require "x86unix.pl"; } |
24 | elsif ( ($type eq "a.out")) | 24 | elsif ( ($type eq "a.out")) |
25 | { $aout=1; require "x86unix.pl"; } | 25 | { $aout=1; require "x86unix.pl"; } |
26 | elsif ( ($type eq "gaswin")) | ||
27 | { $gaswin=1; $aout=1; require "x86unix.pl"; } | ||
26 | elsif ( ($type eq "sol")) | 28 | elsif ( ($type eq "sol")) |
27 | { $sol=1; require "x86unix.pl"; } | 29 | { $sol=1; require "x86unix.pl"; } |
28 | elsif ( ($type eq "cpp")) | 30 | elsif ( ($type eq "cpp")) |
@@ -50,7 +52,7 @@ EOF | |||
50 | &comment("Don't even think of reading this code"); | 52 | &comment("Don't even think of reading this code"); |
51 | &comment("It was automatically generated by $filename"); | 53 | &comment("It was automatically generated by $filename"); |
52 | &comment("Which is a perl program used to generate the x86 assember for"); | 54 | &comment("Which is a perl program used to generate the x86 assember for"); |
53 | &comment("any of elf, a.out, BSDI,Win32, or Solaris"); | 55 | &comment("any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris"); |
54 | &comment("eric <eay\@cryptsoft.com>"); | 56 | &comment("eric <eay\@cryptsoft.com>"); |
55 | &comment(""); | 57 | &comment(""); |
56 | 58 | ||
diff --git a/src/lib/libcrypto/perlasm/x86ms.pl b/src/lib/libcrypto/perlasm/x86ms.pl index 252a57bdb5..206452341d 100644 --- a/src/lib/libcrypto/perlasm/x86ms.pl +++ b/src/lib/libcrypto/perlasm/x86ms.pl | |||
@@ -341,7 +341,7 @@ sub main'set_label | |||
341 | $label{$_[0]}="${label}${_[0]}"; | 341 | $label{$_[0]}="${label}${_[0]}"; |
342 | $label++; | 342 | $label++; |
343 | } | 343 | } |
344 | if((defined $_[1]) && ($_[1] == 1)) | 344 | if((defined $_[2]) && ($_[2] == 1)) |
345 | { | 345 | { |
346 | push(@out,"$label{$_[0]}::\n"); | 346 | push(@out,"$label{$_[0]}::\n"); |
347 | } | 347 | } |
diff --git a/src/lib/libcrypto/perlasm/x86unix.pl b/src/lib/libcrypto/perlasm/x86unix.pl index 60d75f5ce4..309060ea00 100644 --- a/src/lib/libcrypto/perlasm/x86unix.pl +++ b/src/lib/libcrypto/perlasm/x86unix.pl | |||
@@ -292,6 +292,8 @@ EOF | |||
292 | push(@out,$tmp); | 292 | push(@out,$tmp); |
293 | if ($main'cpp) | 293 | if ($main'cpp) |
294 | { $tmp=push(@out,"\tTYPE($func,\@function)\n"); } | 294 | { $tmp=push(@out,"\tTYPE($func,\@function)\n"); } |
295 | elsif ($main'gaswin) | ||
296 | { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } | ||
295 | else { $tmp=push(@out,"\t.type\t$func,\@function\n"); } | 297 | else { $tmp=push(@out,"\t.type\t$func,\@function\n"); } |
296 | push(@out,"$func:\n"); | 298 | push(@out,"$func:\n"); |
297 | $tmp=<<"EOF"; | 299 | $tmp=<<"EOF"; |
@@ -320,6 +322,8 @@ EOF | |||
320 | push(@out,$tmp); | 322 | push(@out,$tmp); |
321 | if ($main'cpp) | 323 | if ($main'cpp) |
322 | { push(@out,"\tTYPE($func,\@function)\n"); } | 324 | { push(@out,"\tTYPE($func,\@function)\n"); } |
325 | elsif ($main'gaswin) | ||
326 | { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } | ||
323 | else { push(@out,"\t.type $func,\@function\n"); } | 327 | else { push(@out,"\t.type $func,\@function\n"); } |
324 | push(@out,"$func:\n"); | 328 | push(@out,"$func:\n"); |
325 | $stack=4; | 329 | $stack=4; |
@@ -342,6 +346,8 @@ EOF | |||
342 | push(@out,$tmp); | 346 | push(@out,$tmp); |
343 | if ($main'cpp) | 347 | if ($main'cpp) |
344 | { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); } | 348 | { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); } |
349 | elsif ($main'gaswin) | ||
350 | { $tmp=push(@out,"\t.align 4\n"); } | ||
345 | else { push(@out,"\t.size\t$func,.${func}_end-$func\n"); } | 351 | else { push(@out,"\t.size\t$func,.${func}_end-$func\n"); } |
346 | push(@out,".ident \"$func\"\n"); | 352 | push(@out,".ident \"$func\"\n"); |
347 | $stack=0; | 353 | $stack=0; |
@@ -371,6 +377,8 @@ sub main'function_end_B | |||
371 | push(@out,".L_${func}_end:\n"); | 377 | push(@out,".L_${func}_end:\n"); |
372 | if ($main'cpp) | 378 | if ($main'cpp) |
373 | { push(@out,"\tSIZE($func,.L_${func}_end-$func)\n"); } | 379 | { push(@out,"\tSIZE($func,.L_${func}_end-$func)\n"); } |
380 | elsif ($main'gaswin) | ||
381 | { push(@out,"\t.align 4\n"); } | ||
374 | else { push(@out,"\t.size\t$func,.L_${func}_end-$func\n"); } | 382 | else { push(@out,"\t.size\t$func,.L_${func}_end-$func\n"); } |
375 | push(@out,".ident \"desasm.pl\"\n"); | 383 | push(@out,".ident \"desasm.pl\"\n"); |
376 | $stack=0; | 384 | $stack=0; |
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c index 56d88b0759..ee8aed54c7 100644 --- a/src/lib/libcrypto/pkcs12/p12_crt.c +++ b/src/lib/libcrypto/pkcs12/p12_crt.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #include <openssl/pkcs12.h> | 61 | #include <openssl/pkcs12.h> |
62 | 62 | ||
63 | PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | 63 | PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, |
64 | STACK *ca, int nid_key, int nid_cert, int iter, int mac_iter, | 64 | STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, |
65 | int keytype) | 65 | int keytype) |
66 | { | 66 | { |
67 | PKCS12 *p12; | 67 | PKCS12 *p12; |
@@ -103,8 +103,8 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | |||
103 | 103 | ||
104 | /* Add all other certificates */ | 104 | /* Add all other certificates */ |
105 | if(ca) { | 105 | if(ca) { |
106 | for(i = 0; i < sk_num(ca); i++) { | 106 | for(i = 0; i < sk_X509_num(ca); i++) { |
107 | tcert = (X509 *)sk_value(ca, i); | 107 | tcert = sk_X509_value(ca, i); |
108 | if(!(bag = M_PKCS12_x5092certbag(tcert))) return NULL; | 108 | if(!(bag = M_PKCS12_x5092certbag(tcert))) return NULL; |
109 | if(!sk_push(bags, (char *)bag)) { | 109 | if(!sk_push(bags, (char *)bag)) { |
110 | PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); | 110 | PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); |
diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c index 02fdd20e2f..b364671ed2 100644 --- a/src/lib/libcrypto/pkcs12/p12_key.c +++ b/src/lib/libcrypto/pkcs12/p12_key.c | |||
@@ -104,6 +104,14 @@ int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt, | |||
104 | #ifdef DEBUG_KEYGEN | 104 | #ifdef DEBUG_KEYGEN |
105 | unsigned char *tmpout = out; | 105 | unsigned char *tmpout = out; |
106 | int tmpn = n; | 106 | int tmpn = n; |
107 | #endif | ||
108 | |||
109 | if (!pass) { | ||
110 | PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_PASSED_NULL_PARAMETER); | ||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | #ifdef DEBUG_KEYGEN | ||
107 | fprintf(stderr, "KEYGEN DEBUG\n"); | 115 | fprintf(stderr, "KEYGEN DEBUG\n"); |
108 | fprintf(stderr, "ID %d, ITER %d\n", id, iter); | 116 | fprintf(stderr, "ID %d, ITER %d\n", id, iter); |
109 | fprintf(stderr, "Password (length %d):\n", passlen); | 117 | fprintf(stderr, "Password (length %d):\n", passlen); |
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c index 08a60556e0..ee257ffbad 100644 --- a/src/lib/libcrypto/pkcs12/p12_kiss.c +++ b/src/lib/libcrypto/pkcs12/p12_kiss.c | |||
@@ -62,9 +62,17 @@ | |||
62 | 62 | ||
63 | /* Simplified PKCS#12 routines */ | 63 | /* Simplified PKCS#12 routines */ |
64 | 64 | ||
65 | static int parse_pk12( PKCS12 *p12, const char *pass, int passlen, EVP_PKEY **pkey, X509 **cert, STACK **ca); | 65 | static int parse_pk12( PKCS12 *p12, const char *pass, int passlen, |
66 | static int parse_bags( STACK *bags, const char *pass, int passlen, EVP_PKEY **pkey, X509 **cert, STACK **ca, ASN1_OCTET_STRING **keyid, char *keymatch); | 66 | EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); |
67 | static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen, EVP_PKEY **pkey, X509 **cert, STACK **ca, ASN1_OCTET_STRING **keyid, char *keymatch); | 67 | |
68 | static int parse_bags( STACK *bags, const char *pass, int passlen, | ||
69 | EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, | ||
70 | ASN1_OCTET_STRING **keyid, char *keymatch); | ||
71 | |||
72 | static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen, | ||
73 | EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, | ||
74 | ASN1_OCTET_STRING **keyid, char *keymatch); | ||
75 | |||
68 | /* Parse and decrypt a PKCS#12 structure returning user key, user cert | 76 | /* Parse and decrypt a PKCS#12 structure returning user key, user cert |
69 | * and other (CA) certs. Note either ca should be NULL, *ca should be NULL, | 77 | * and other (CA) certs. Note either ca should be NULL, *ca should be NULL, |
70 | * or it should point to a valid STACK structure. pkey and cert can be | 78 | * or it should point to a valid STACK structure. pkey and cert can be |
@@ -72,54 +80,59 @@ static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen, EVP_PK | |||
72 | */ | 80 | */ |
73 | 81 | ||
74 | int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | 82 | int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, |
75 | STACK **ca) | 83 | STACK_OF(X509) **ca) |
76 | { | 84 | { |
77 | 85 | ||
78 | /* Check for NULL PKCS12 structure */ | 86 | /* Check for NULL PKCS12 structure */ |
79 | |||
80 | if(!p12) { | ||
81 | PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_INVALID_NULL_PKCS12_POINTER); | ||
82 | return 0; | ||
83 | } | ||
84 | 87 | ||
85 | /* Allocate stack for ca certificates if needed */ | 88 | if(!p12) |
86 | if ((ca != NULL) && (*ca == NULL)) { | 89 | { |
87 | if (!(*ca = sk_new(NULL))) { | 90 | PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_INVALID_NULL_PKCS12_POINTER); |
88 | PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE); | ||
89 | return 0; | 91 | return 0; |
90 | } | 92 | } |
91 | } | 93 | |
94 | /* Allocate stack for ca certificates if needed */ | ||
95 | if ((ca != NULL) && (*ca == NULL)) | ||
96 | { | ||
97 | if (!(*ca = sk_X509_new(NULL))) | ||
98 | { | ||
99 | PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE); | ||
100 | return 0; | ||
101 | } | ||
102 | } | ||
92 | 103 | ||
93 | if(pkey) *pkey = NULL; | 104 | if(pkey) *pkey = NULL; |
94 | if(cert) *cert = NULL; | 105 | if(cert) *cert = NULL; |
95 | 106 | ||
96 | /* Check the mac */ | 107 | /* Check the mac */ |
97 | 108 | ||
98 | if (!PKCS12_verify_mac (p12, pass, -1)) { | 109 | if (!PKCS12_verify_mac (p12, pass, -1)) |
99 | PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_MAC_VERIFY_FAILURE); | 110 | { |
100 | goto err; | 111 | PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_MAC_VERIFY_FAILURE); |
101 | } | 112 | goto err; |
113 | } | ||
102 | 114 | ||
103 | if (!parse_pk12 (p12, pass, -1, pkey, cert, ca)) { | 115 | if (!parse_pk12 (p12, pass, -1, pkey, cert, ca)) |
104 | PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_PARSE_ERROR); | 116 | { |
105 | goto err; | 117 | PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_PARSE_ERROR); |
106 | } | 118 | goto err; |
119 | } | ||
107 | 120 | ||
108 | return 1; | 121 | return 1; |
109 | 122 | ||
110 | err: | 123 | err: |
111 | 124 | ||
112 | if (pkey && *pkey) EVP_PKEY_free (*pkey); | 125 | if (pkey && *pkey) EVP_PKEY_free (*pkey); |
113 | if (cert && *cert) X509_free (*cert); | 126 | if (cert && *cert) X509_free (*cert); |
114 | if (ca) sk_pop_free (*ca, X509_free); | 127 | if (ca) sk_X509_pop_free (*ca, X509_free); |
115 | return 0; | 128 | return 0; |
116 | 129 | ||
117 | } | 130 | } |
118 | 131 | ||
119 | /* Parse the outer PKCS#12 structure */ | 132 | /* Parse the outer PKCS#12 structure */ |
120 | 133 | ||
121 | static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen, | 134 | static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen, |
122 | EVP_PKEY **pkey, X509 **cert, STACK **ca) | 135 | EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca) |
123 | { | 136 | { |
124 | STACK *asafes, *bags; | 137 | STACK *asafes, *bags; |
125 | int i, bagnid; | 138 | int i, bagnid; |
@@ -154,7 +167,7 @@ static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen, | |||
154 | 167 | ||
155 | 168 | ||
156 | static int parse_bags (STACK *bags, const char *pass, int passlen, | 169 | static int parse_bags (STACK *bags, const char *pass, int passlen, |
157 | EVP_PKEY **pkey, X509 **cert, STACK **ca, | 170 | EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, |
158 | ASN1_OCTET_STRING **keyid, char *keymatch) | 171 | ASN1_OCTET_STRING **keyid, char *keymatch) |
159 | { | 172 | { |
160 | int i; | 173 | int i; |
@@ -171,7 +184,7 @@ static int parse_bags (STACK *bags, const char *pass, int passlen, | |||
171 | #define MATCH_ALL 0x3 | 184 | #define MATCH_ALL 0x3 |
172 | 185 | ||
173 | static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, | 186 | static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, |
174 | EVP_PKEY **pkey, X509 **cert, STACK **ca, | 187 | EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, |
175 | ASN1_OCTET_STRING **keyid, | 188 | ASN1_OCTET_STRING **keyid, |
176 | char *keymatch) | 189 | char *keymatch) |
177 | { | 190 | { |
@@ -221,7 +234,10 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, | |||
221 | if (lkey) { | 234 | if (lkey) { |
222 | *keymatch |= MATCH_CERT; | 235 | *keymatch |= MATCH_CERT; |
223 | if (cert) *cert = x509; | 236 | if (cert) *cert = x509; |
224 | } else if (ca) sk_push (*ca, (char *)x509); | 237 | } else { |
238 | if(ca) sk_X509_push (*ca, x509); | ||
239 | else X509_free(x509); | ||
240 | } | ||
225 | break; | 241 | break; |
226 | 242 | ||
227 | case NID_safeContentsBag: | 243 | case NID_safeContentsBag: |
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c index f1094b3840..369257ed4c 100644 --- a/src/lib/libcrypto/pkcs12/p12_mutl.c +++ b/src/lib/libcrypto/pkcs12/p12_mutl.c | |||
@@ -157,7 +157,7 @@ int PKCS12_setup_mac (PKCS12 *p12, int iter, unsigned char *salt, int saltlen, | |||
157 | return 0; | 157 | return 0; |
158 | } | 158 | } |
159 | if (!salt) { | 159 | if (!salt) { |
160 | if (RAND_bytes (p12->mac->salt->data, saltlen) <= 0) | 160 | if (RAND_pseudo_bytes (p12->mac->salt->data, saltlen) < 0) |
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | else memcpy (p12->mac->salt->data, salt, saltlen); | 163 | else memcpy (p12->mac->salt->data, salt, saltlen); |
diff --git a/src/lib/libcrypto/pkcs12/pk12err.c b/src/lib/libcrypto/pkcs12/pk12err.c index 9d8de10e1e..12db54f49e 100644 --- a/src/lib/libcrypto/pkcs12/pk12err.c +++ b/src/lib/libcrypto/pkcs12/pk12err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/pkcs12/pkcs12.h b/src/lib/libcrypto/pkcs12/pkcs12.h index 254000fa12..dad356c00f 100644 --- a/src/lib/libcrypto/pkcs12/pkcs12.h +++ b/src/lib/libcrypto/pkcs12/pkcs12.h | |||
@@ -265,9 +265,9 @@ void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a); | |||
265 | void ERR_load_PKCS12_strings(void); | 265 | void ERR_load_PKCS12_strings(void); |
266 | void PKCS12_PBE_add(void); | 266 | void PKCS12_PBE_add(void); |
267 | int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | 267 | int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, |
268 | STACK **ca); | 268 | STACK_OF(X509) **ca); |
269 | PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | 269 | PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, |
270 | STACK *ca, int nid_key, int nid_cert, int iter, | 270 | STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, |
271 | int mac_iter, int keytype); | 271 | int mac_iter, int keytype); |
272 | int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); | 272 | int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); |
273 | int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); | 273 | int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); |
diff --git a/src/lib/libcrypto/pkcs7/README b/src/lib/libcrypto/pkcs7/README index 27001c6970..e69de29bb2 100644 --- a/src/lib/libcrypto/pkcs7/README +++ b/src/lib/libcrypto/pkcs7/README | |||
@@ -1,5 +0,0 @@ | |||
1 | WARNING | ||
2 | |||
3 | Everything in this directory is experimental and is subject to change. | ||
4 | |||
5 | Do not rely on the stuff in here not changing in the next release | ||
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index 80ac5e34b4..4ab24a86f5 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/pkcs7/pk7_doit.c | |||
@@ -699,6 +699,7 @@ int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, BIO *bio, | |||
699 | if (i <= 0) | 699 | if (i <= 0) |
700 | { | 700 | { |
701 | PKCS7err(PKCS7_F_PKCS7_DATAVERIFY,ERR_R_X509_LIB); | 701 | PKCS7err(PKCS7_F_PKCS7_DATAVERIFY,ERR_R_X509_LIB); |
702 | X509_STORE_CTX_cleanup(ctx); | ||
702 | goto err; | 703 | goto err; |
703 | } | 704 | } |
704 | X509_STORE_CTX_cleanup(ctx); | 705 | X509_STORE_CTX_cleanup(ctx); |
diff --git a/src/lib/libcrypto/pkcs7/pkcs7err.c b/src/lib/libcrypto/pkcs7/pkcs7err.c index 813a8af9ed..8ded8913db 100644 --- a/src/lib/libcrypto/pkcs7/pkcs7err.c +++ b/src/lib/libcrypto/pkcs7/pkcs7err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/rand/md_rand.c b/src/lib/libcrypto/rand/md_rand.c index 6b158f0349..da4258c479 100644 --- a/src/lib/libcrypto/rand/md_rand.c +++ b/src/lib/libcrypto/rand/md_rand.c | |||
@@ -55,6 +55,59 @@ | |||
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | /* ==================================================================== | ||
59 | * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. | ||
60 | * | ||
61 | * Redistribution and use in source and binary forms, with or without | ||
62 | * modification, are permitted provided that the following conditions | ||
63 | * are met: | ||
64 | * | ||
65 | * 1. Redistributions of source code must retain the above copyright | ||
66 | * notice, this list of conditions and the following disclaimer. | ||
67 | * | ||
68 | * 2. Redistributions in binary form must reproduce the above copyright | ||
69 | * notice, this list of conditions and the following disclaimer in | ||
70 | * the documentation and/or other materials provided with the | ||
71 | * distribution. | ||
72 | * | ||
73 | * 3. All advertising materials mentioning features or use of this | ||
74 | * software must display the following acknowledgment: | ||
75 | * "This product includes software developed by the OpenSSL Project | ||
76 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
77 | * | ||
78 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
79 | * endorse or promote products derived from this software without | ||
80 | * prior written permission. For written permission, please contact | ||
81 | * openssl-core@openssl.org. | ||
82 | * | ||
83 | * 5. Products derived from this software may not be called "OpenSSL" | ||
84 | * nor may "OpenSSL" appear in their names without prior written | ||
85 | * permission of the OpenSSL Project. | ||
86 | * | ||
87 | * 6. Redistributions of any form whatsoever must retain the following | ||
88 | * acknowledgment: | ||
89 | * "This product includes software developed by the OpenSSL Project | ||
90 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
91 | * | ||
92 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
93 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
94 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
95 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
96 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
97 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
98 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
99 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
101 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
102 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
103 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
104 | * ==================================================================== | ||
105 | * | ||
106 | * This product includes cryptographic software written by Eric Young | ||
107 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
108 | * Hudson (tjh@cryptsoft.com). | ||
109 | * | ||
110 | */ | ||
58 | 111 | ||
59 | #define ENTROPY_NEEDED 16 /* require 128 bits = 16 bytes of randomness */ | 112 | #define ENTROPY_NEEDED 16 /* require 128 bits = 16 bytes of randomness */ |
60 | 113 | ||
@@ -130,6 +183,10 @@ | |||
130 | 183 | ||
131 | #include <openssl/rand.h> | 184 | #include <openssl/rand.h> |
132 | 185 | ||
186 | #ifdef BN_DEBUG | ||
187 | # define PREDICT | ||
188 | #endif | ||
189 | |||
133 | /* #define NORAND 1 */ | 190 | /* #define NORAND 1 */ |
134 | /* #define PREDICT 1 */ | 191 | /* #define PREDICT 1 */ |
135 | 192 | ||
@@ -141,6 +198,10 @@ static long md_count[2]={0,0}; | |||
141 | static double entropy=0; | 198 | static double entropy=0; |
142 | static int initialized=0; | 199 | static int initialized=0; |
143 | 200 | ||
201 | #ifdef PREDICT | ||
202 | int rand_predictable=0; | ||
203 | #endif | ||
204 | |||
144 | const char *RAND_version="RAND" OPENSSL_VERSION_PTEXT; | 205 | const char *RAND_version="RAND" OPENSSL_VERSION_PTEXT; |
145 | 206 | ||
146 | static void ssleay_rand_cleanup(void); | 207 | static void ssleay_rand_cleanup(void); |
@@ -148,6 +209,7 @@ static void ssleay_rand_seed(const void *buf, int num); | |||
148 | static void ssleay_rand_add(const void *buf, int num, double add_entropy); | 209 | static void ssleay_rand_add(const void *buf, int num, double add_entropy); |
149 | static int ssleay_rand_bytes(unsigned char *buf, int num); | 210 | static int ssleay_rand_bytes(unsigned char *buf, int num); |
150 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num); | 211 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num); |
212 | static int ssleay_rand_status(void); | ||
151 | 213 | ||
152 | RAND_METHOD rand_ssleay_meth={ | 214 | RAND_METHOD rand_ssleay_meth={ |
153 | ssleay_rand_seed, | 215 | ssleay_rand_seed, |
@@ -155,6 +217,7 @@ RAND_METHOD rand_ssleay_meth={ | |||
155 | ssleay_rand_cleanup, | 217 | ssleay_rand_cleanup, |
156 | ssleay_rand_add, | 218 | ssleay_rand_add, |
157 | ssleay_rand_pseudo_bytes, | 219 | ssleay_rand_pseudo_bytes, |
220 | ssleay_rand_status | ||
158 | }; | 221 | }; |
159 | 222 | ||
160 | RAND_METHOD *RAND_SSLeay(void) | 223 | RAND_METHOD *RAND_SSLeay(void) |
@@ -306,6 +369,10 @@ static void ssleay_rand_initialize(void) | |||
306 | FILE *fh; | 369 | FILE *fh; |
307 | #endif | 370 | #endif |
308 | 371 | ||
372 | #ifdef NORAND | ||
373 | return; | ||
374 | #endif | ||
375 | |||
309 | CRYPTO_w_unlock(CRYPTO_LOCK_RAND); | 376 | CRYPTO_w_unlock(CRYPTO_LOCK_RAND); |
310 | /* put in some default random data, we need more than just this */ | 377 | /* put in some default random data, we need more than just this */ |
311 | #ifndef GETPID_IS_MEANINGLESS | 378 | #ifndef GETPID_IS_MEANINGLESS |
@@ -354,13 +421,14 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
354 | #endif | 421 | #endif |
355 | 422 | ||
356 | #ifdef PREDICT | 423 | #ifdef PREDICT |
357 | { | 424 | if (rand_predictable) |
358 | static unsigned char val=0; | 425 | { |
426 | static unsigned char val=0; | ||
359 | 427 | ||
360 | for (i=0; i<num; i++) | 428 | for (i=0; i<num; i++) |
361 | buf[i]=val++; | 429 | buf[i]=val++; |
362 | return(1); | 430 | return(1); |
363 | } | 431 | } |
364 | #endif | 432 | #endif |
365 | 433 | ||
366 | /* | 434 | /* |
@@ -489,17 +557,66 @@ static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) | |||
489 | return (ret); | 557 | return (ret); |
490 | } | 558 | } |
491 | 559 | ||
492 | int RAND_status(void) | 560 | static int ssleay_rand_status(void) |
493 | { | 561 | { |
562 | int ret; | ||
563 | |||
564 | CRYPTO_w_lock(CRYPTO_LOCK_RAND); | ||
565 | |||
494 | if (!initialized) | 566 | if (!initialized) |
495 | ssleay_rand_initialize(); | 567 | ssleay_rand_initialize(); |
496 | return (entropy >= ENTROPY_NEEDED); | 568 | ret = entropy >= ENTROPY_NEEDED; |
569 | |||
570 | CRYPTO_w_unlock(CRYPTO_LOCK_RAND); | ||
571 | |||
572 | return ret; | ||
497 | } | 573 | } |
498 | 574 | ||
499 | #ifdef WINDOWS | 575 | #ifdef WINDOWS |
500 | #include <windows.h> | 576 | #include <windows.h> |
501 | #include <openssl/rand.h> | 577 | #include <openssl/rand.h> |
502 | 578 | ||
579 | int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam) | ||
580 | { | ||
581 | double add_entropy=0; | ||
582 | SYSTEMTIME t; | ||
583 | |||
584 | switch (iMsg) | ||
585 | { | ||
586 | case WM_KEYDOWN: | ||
587 | { | ||
588 | static WPARAM key; | ||
589 | if (key != wParam) | ||
590 | add_entropy = 0.05; | ||
591 | key = wParam; | ||
592 | } | ||
593 | break; | ||
594 | case WM_MOUSEMOVE: | ||
595 | { | ||
596 | static int lastx,lasty,lastdx,lastdy; | ||
597 | int x,y,dx,dy; | ||
598 | |||
599 | x=LOWORD(lParam); | ||
600 | y=HIWORD(lParam); | ||
601 | dx=lastx-x; | ||
602 | dy=lasty-y; | ||
603 | if (dx != 0 && dy != 0 && dx-lastdx != 0 && dy-lastdy != 0) | ||
604 | add_entropy=.2; | ||
605 | lastx=x, lasty=y; | ||
606 | lastdx=dx, lastdy=dy; | ||
607 | } | ||
608 | break; | ||
609 | } | ||
610 | |||
611 | GetSystemTime(&t); | ||
612 | RAND_add(&iMsg, sizeof(iMsg), add_entropy); | ||
613 | RAND_add(&wParam, sizeof(wParam), 0); | ||
614 | RAND_add(&lParam, sizeof(lParam), 0); | ||
615 | RAND_add(&t, sizeof(t), 0); | ||
616 | |||
617 | return (RAND_status()); | ||
618 | } | ||
619 | |||
503 | /***************************************************************************** | 620 | /***************************************************************************** |
504 | * Initialisation function for the SSL random generator. Takes the contents | 621 | * Initialisation function for the SSL random generator. Takes the contents |
505 | * of the screen as random seed. | 622 | * of the screen as random seed. |
diff --git a/src/lib/libcrypto/rand/rand.h b/src/lib/libcrypto/rand/rand.h index 28f45ec052..2973ee90e4 100644 --- a/src/lib/libcrypto/rand/rand.h +++ b/src/lib/libcrypto/rand/rand.h | |||
@@ -70,8 +70,13 @@ typedef struct rand_meth_st | |||
70 | void (*cleanup)(void); | 70 | void (*cleanup)(void); |
71 | void (*add)(const void *buf, int num, double entropy); | 71 | void (*add)(const void *buf, int num, double entropy); |
72 | int (*pseudorand)(unsigned char *buf, int num); | 72 | int (*pseudorand)(unsigned char *buf, int num); |
73 | int (*status)(void); | ||
73 | } RAND_METHOD; | 74 | } RAND_METHOD; |
74 | 75 | ||
76 | #ifdef BN_DEBUG | ||
77 | extern int rand_predictable; | ||
78 | #endif | ||
79 | |||
75 | void RAND_set_rand_method(RAND_METHOD *meth); | 80 | void RAND_set_rand_method(RAND_METHOD *meth); |
76 | RAND_METHOD *RAND_get_rand_method(void ); | 81 | RAND_METHOD *RAND_get_rand_method(void ); |
77 | RAND_METHOD *RAND_SSLeay(void); | 82 | RAND_METHOD *RAND_SSLeay(void); |
@@ -85,8 +90,10 @@ int RAND_write_file(const char *file); | |||
85 | const char *RAND_file_name(char *file,int num); | 90 | const char *RAND_file_name(char *file,int num); |
86 | int RAND_status(void); | 91 | int RAND_status(void); |
87 | int RAND_egd(const char *path); | 92 | int RAND_egd(const char *path); |
88 | #ifdef WINDOWS | 93 | #if defined(WINDOWS) || defined(WIN32) |
94 | #include <windows.h> | ||
89 | void RAND_screen(void); | 95 | void RAND_screen(void); |
96 | int RAND_event(UINT, WPARAM, LPARAM); | ||
90 | #endif | 97 | #endif |
91 | void ERR_load_RAND_strings(void); | 98 | void ERR_load_RAND_strings(void); |
92 | 99 | ||
diff --git a/src/lib/libcrypto/rand/rand_egd.c b/src/lib/libcrypto/rand/rand_egd.c index d834408bd4..380c7828c3 100644 --- a/src/lib/libcrypto/rand/rand_egd.c +++ b/src/lib/libcrypto/rand/rand_egd.c | |||
@@ -97,7 +97,7 @@ int RAND_egd(const char *path) | |||
97 | buf[1] = 255; | 97 | buf[1] = 255; |
98 | write(fd, buf, 2); | 98 | write(fd, buf, 2); |
99 | if (read(fd, buf, 1) != 1) goto err; | 99 | if (read(fd, buf, 1) != 1) goto err; |
100 | if (buf[0] == 0) goto err; | 100 | if (buf[0] == 0) goto err; |
101 | num = read(fd, buf, 255); | 101 | num = read(fd, buf, 255); |
102 | if (num < 1) goto err; | 102 | if (num < 1) goto err; |
103 | RAND_seed(buf, num); | 103 | RAND_seed(buf, num); |
diff --git a/src/lib/libcrypto/rand/rand_err.c b/src/lib/libcrypto/rand/rand_err.c index d1263edf80..1af0aa0b8a 100644 --- a/src/lib/libcrypto/rand/rand_err.c +++ b/src/lib/libcrypto/rand/rand_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
@@ -71,7 +72,7 @@ static ERR_STRING_DATA RAND_str_functs[]= | |||
71 | 72 | ||
72 | static ERR_STRING_DATA RAND_str_reasons[]= | 73 | static ERR_STRING_DATA RAND_str_reasons[]= |
73 | { | 74 | { |
74 | {RAND_R_PRNG_NOT_SEEDED ,"prng not seeded"}, | 75 | {RAND_R_PRNG_NOT_SEEDED ,"PRNG not seeded"}, |
75 | {0,NULL} | 76 | {0,NULL} |
76 | }; | 77 | }; |
77 | 78 | ||
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c index b09a300c46..7da74aab0e 100644 --- a/src/lib/libcrypto/rand/rand_lib.c +++ b/src/lib/libcrypto/rand/rand_lib.c | |||
@@ -108,3 +108,10 @@ int RAND_pseudo_bytes(unsigned char *buf, int num) | |||
108 | return rand_meth->pseudorand(buf,num); | 108 | return rand_meth->pseudorand(buf,num); |
109 | return(-1); | 109 | return(-1); |
110 | } | 110 | } |
111 | |||
112 | int RAND_status(void) | ||
113 | { | ||
114 | if (rand_meth != NULL) | ||
115 | return rand_meth->status(); | ||
116 | return 0; | ||
117 | } | ||
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index 658a8d6b65..9ff3974cc7 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c | |||
@@ -133,35 +133,20 @@ int RAND_write_file(const char *file) | |||
133 | int i,ret=0,err=0; | 133 | int i,ret=0,err=0; |
134 | FILE *out = NULL; | 134 | FILE *out = NULL; |
135 | int n; | 135 | int n; |
136 | 136 | ||
137 | #ifdef VMS | 137 | #if defined(O_CREAT) && defined(O_EXCL) && !defined(WIN32) |
138 | /* Under VMS, fopen(file, "wb") will create a new version of the | 138 | /* For some reason Win32 can't write to files created this way */ |
139 | same file. This is not good, so let's try updating an existing | 139 | |
140 | one, and create file only if it doesn't already exist. */ | 140 | /* chmod(..., 0600) is too late to protect the file, |
141 | /* At the same time, if we just update a file, we also need to | 141 | * permissions should be restrictive from the start */ |
142 | truncate it, and unfortunately, ftruncate() and truncate() do | 142 | int fd = open(file, O_CREAT | O_EXCL, 0600); |
143 | not exist everywhere. All that remains is to delete old versions | 143 | if (fd != -1) |
144 | of the random data file (done at the end). */ | 144 | out = fdopen(fd, "wb"); |
145 | #if 0 | ||
146 | out=fopen(file,"rb+"); | ||
147 | if (out == NULL && errno != ENOENT) | ||
148 | goto err; | ||
149 | #endif | ||
150 | #endif | 145 | #endif |
146 | if (out == NULL) | ||
147 | out = fopen(file,"wb"); | ||
148 | if (out == NULL) goto err; | ||
151 | 149 | ||
152 | if (out == NULL) | ||
153 | { | ||
154 | #if defined O_CREAT && defined O_EXCL | ||
155 | /* chmod(..., 0600) is too late to protect the file, | ||
156 | * permissions should be restrictive from the start */ | ||
157 | int fd = open(file, O_CREAT | O_EXCL, 0600); | ||
158 | if (fd != -1) | ||
159 | out = fdopen(fd, "wb"); | ||
160 | #else | ||
161 | out=fopen(file,"wb"); | ||
162 | #endif | ||
163 | } | ||
164 | if (out == NULL) goto err; | ||
165 | #ifndef NO_CHMOD | 150 | #ifndef NO_CHMOD |
166 | chmod(file,0600); | 151 | chmod(file,0600); |
167 | #endif | 152 | #endif |
@@ -180,14 +165,8 @@ int RAND_write_file(const char *file) | |||
180 | } | 165 | } |
181 | ret+=i; | 166 | ret+=i; |
182 | if (n <= 0) break; | 167 | if (n <= 0) break; |
183 | } | 168 | } |
184 | #ifdef VMS | 169 | #ifdef VMS |
185 | /* We may have updated an existing file using mode "rb+", | ||
186 | * now remove any old extra bytes */ | ||
187 | #if 0 | ||
188 | if (ret > 0) | ||
189 | ftruncate(fileno(out), ret); | ||
190 | #else | ||
191 | /* Try to delete older versions of the file, until there aren't | 170 | /* Try to delete older versions of the file, until there aren't |
192 | any */ | 171 | any */ |
193 | { | 172 | { |
@@ -205,8 +184,7 @@ int RAND_write_file(const char *file) | |||
205 | some point... */ | 184 | some point... */ |
206 | } | 185 | } |
207 | } | 186 | } |
208 | #endif | 187 | #endif /* VMS */ |
209 | #endif | ||
210 | 188 | ||
211 | fclose(out); | 189 | fclose(out); |
212 | memset(buf,0,BUFSIZE); | 190 | memset(buf,0,BUFSIZE); |
diff --git a/src/lib/libcrypto/rc2/Makefile.uni b/src/lib/libcrypto/rc2/Makefile.uni index 4dc20c6fcf..e69de29bb2 100644 --- a/src/lib/libcrypto/rc2/Makefile.uni +++ b/src/lib/libcrypto/rc2/Makefile.uni | |||
@@ -1,73 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | |||
6 | DIR= rc2 | ||
7 | TOP= . | ||
8 | CC= gcc | ||
9 | CFLAG= -O3 -fomit-frame-pointer | ||
10 | |||
11 | CPP= $(CC) -E | ||
12 | INCLUDES= | ||
13 | INSTALLTOP=/usr/local/lib | ||
14 | MAKE= make | ||
15 | MAKEDEPEND= makedepend | ||
16 | MAKEFILE= Makefile.uni | ||
17 | AR= ar r | ||
18 | RANLIB= ranlib | ||
19 | |||
20 | IDEA_ENC=rc2_cbc.o | ||
21 | |||
22 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
23 | |||
24 | GENERAL=Makefile | ||
25 | TEST=rc2test | ||
26 | APPS=rc2speed | ||
27 | |||
28 | LIB=librc2.a | ||
29 | LIBSRC=rc2_skey.c rc2_ecb.c rc2_cbc.c rc2cfb64.c rc2ofb64.c | ||
30 | LIBOBJ=rc2_skey.o rc2_ecb.o $(IDEA_ENC) rc2cfb64.o rc2ofb64.o | ||
31 | |||
32 | SRC= $(LIBSRC) | ||
33 | |||
34 | EXHEADER= rc2.h | ||
35 | HEADER= rc2_locl.h $(EXHEADER) | ||
36 | |||
37 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
38 | |||
39 | all: $(LIB) $(TEST) $(APPS) | ||
40 | |||
41 | $(LIB): $(LIBOBJ) | ||
42 | $(AR) $(LIB) $(LIBOBJ) | ||
43 | $(RANLIB) $(LIB) | ||
44 | |||
45 | test: $(TEST) | ||
46 | ./$(TEST) | ||
47 | |||
48 | $(TEST): $(TEST).c $(LIB) | ||
49 | $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB) | ||
50 | |||
51 | $(APPS): $(APPS).c $(LIB) | ||
52 | $(CC) -o $(APPS) $(CFLAGS) $(APPS).c $(LIB) | ||
53 | |||
54 | lint: | ||
55 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
56 | |||
57 | depend: | ||
58 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
59 | |||
60 | dclean: | ||
61 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
62 | mv -f Makefile.new $(MAKEFILE) | ||
63 | |||
64 | clean: | ||
65 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
66 | |||
67 | cc: | ||
68 | $(MAKE) CC="cc" CFLAG="-O" all | ||
69 | |||
70 | gcc: | ||
71 | $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
72 | |||
73 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/rc4/Makefile.ssl b/src/lib/libcrypto/rc4/Makefile.ssl index 2ea95f0298..8d2a795c22 100644 --- a/src/lib/libcrypto/rc4/Makefile.ssl +++ b/src/lib/libcrypto/rc4/Makefile.ssl | |||
@@ -5,6 +5,7 @@ | |||
5 | DIR= rc4 | 5 | DIR= rc4 |
6 | TOP= ../.. | 6 | TOP= ../.. |
7 | CC= cc | 7 | CC= cc |
8 | CPP= $(CC) -E | ||
8 | INCLUDES= | 9 | INCLUDES= |
9 | CFLAG=-g | 10 | CFLAG=-g |
10 | INSTALL_PREFIX= | 11 | INSTALL_PREFIX= |
@@ -51,7 +52,7 @@ lib: $(LIBOBJ) | |||
51 | 52 | ||
52 | # elf | 53 | # elf |
53 | asm/rx86-elf.o: asm/rx86unix.cpp | 54 | asm/rx86-elf.o: asm/rx86unix.cpp |
54 | $(CPP) -DELF asm/rx86unix.cpp | as -o asm/rx86-elf.o | 55 | $(CPP) -DELF -x c asm/rx86unix.cpp | as -o asm/rx86-elf.o |
55 | 56 | ||
56 | # solaris | 57 | # solaris |
57 | asm/rx86-sol.o: asm/rx86unix.cpp | 58 | asm/rx86-sol.o: asm/rx86unix.cpp |
@@ -67,7 +68,7 @@ asm/rx86-out.o: asm/rx86unix.cpp | |||
67 | asm/rx86bsdi.o: asm/rx86unix.cpp | 68 | asm/rx86bsdi.o: asm/rx86unix.cpp |
68 | $(CPP) -DBSDI asm/rx86unix.cpp | sed 's/ :/:/' | as -o asm/rx86bsdi.o | 69 | $(CPP) -DBSDI asm/rx86unix.cpp | sed 's/ :/:/' | as -o asm/rx86bsdi.o |
69 | 70 | ||
70 | asm/rx86unix.cpp: asm/rc4-586.pl | 71 | asm/rx86unix.cpp: asm/rc4-586.pl ../perlasm/x86asm.pl |
71 | (cd asm; $(PERL) rc4-586.pl cpp >rx86unix.cpp) | 72 | (cd asm; $(PERL) rc4-586.pl cpp >rx86unix.cpp) |
72 | 73 | ||
73 | files: | 74 | files: |
diff --git a/src/lib/libcrypto/rc4/Makefile.uni b/src/lib/libcrypto/rc4/Makefile.uni index 855d9e50f3..e69de29bb2 100644 --- a/src/lib/libcrypto/rc4/Makefile.uni +++ b/src/lib/libcrypto/rc4/Makefile.uni | |||
@@ -1,103 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | # make x86-elf - linux-elf etc | ||
6 | # make x86-out - linux-a.out, FreeBSD etc | ||
7 | # make x86-solaris | ||
8 | # make x86-bdsi | ||
9 | |||
10 | DIR= rc4 | ||
11 | TOP= . | ||
12 | CC= gcc | ||
13 | CFLAG= -O3 -fomit-frame-pointer | ||
14 | |||
15 | CPP= $(CC) -E | ||
16 | INCLUDES= | ||
17 | INSTALLTOP=/usr/local/lib | ||
18 | MAKE= make | ||
19 | MAKEDEPEND= makedepend | ||
20 | MAKEFILE= Makefile.uni | ||
21 | AR= ar r | ||
22 | RANLIB= ranlib | ||
23 | |||
24 | RC4_ENC=rc4_enc.o | ||
25 | # or use | ||
26 | #RC4_ENC=asm/rx86-elf.o | ||
27 | #RC4_ENC=asm/rx86-out.o | ||
28 | #RC4_ENC=asm/rx86-sol.o | ||
29 | #RC4_ENC=asm/rx86bdsi.o | ||
30 | |||
31 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
32 | |||
33 | GENERAL=Makefile | ||
34 | TEST=rc4test | ||
35 | APPS=rc4speed | ||
36 | |||
37 | LIB=librc4.a | ||
38 | LIBSRC=rc4_skey.c rc4_enc.c | ||
39 | LIBOBJ=rc4_skey.o $(RC4_ENC) | ||
40 | |||
41 | SRC= $(LIBSRC) | ||
42 | |||
43 | EXHEADER= rc4.h | ||
44 | HEADER= $(EXHEADER) rc4_locl.h | ||
45 | |||
46 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
47 | |||
48 | all: $(LIB) $(TEST) $(APPS) | ||
49 | |||
50 | $(LIB): $(LIBOBJ) | ||
51 | $(AR) $(LIB) $(LIBOBJ) | ||
52 | $(RANLIB) $(LIB) | ||
53 | |||
54 | # elf | ||
55 | asm/rx86-elf.o: asm/rx86unix.cpp | ||
56 | $(CPP) -DELF asm/rx86unix.cpp | as -o asm/rx86-elf.o | ||
57 | |||
58 | # solaris | ||
59 | asm/rx86-sol.o: asm/rx86unix.cpp | ||
60 | $(CC) -E -DSOL asm/rx86unix.cpp | sed 's/^#.*//' > asm/rx86-sol.s | ||
61 | as -o asm/rx86-sol.o asm/rx86-sol.s | ||
62 | rm -f asm/rx86-sol.s | ||
63 | |||
64 | # a.out | ||
65 | asm/rx86-out.o: asm/rx86unix.cpp | ||
66 | $(CPP) -DOUT asm/rx86unix.cpp | as -o asm/rx86-out.o | ||
67 | |||
68 | # bsdi | ||
69 | asm/rx86bsdi.o: asm/rx86unix.cpp | ||
70 | $(CPP) -DBSDI asm/rx86unix.cpp | as -o asm/rx86bsdi.o | ||
71 | |||
72 | asm/rx86unix.cpp: | ||
73 | (cd asm; perl rc4-586.pl cpp >rx86unix.cpp) | ||
74 | |||
75 | test: $(TEST) | ||
76 | ./$(TEST) | ||
77 | |||
78 | $(TEST): $(TEST).c $(LIB) | ||
79 | $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB) | ||
80 | |||
81 | $(APPS): $(APPS).c $(LIB) | ||
82 | $(CC) -o $(APPS) $(CFLAGS) $(APPS).c $(LIB) | ||
83 | |||
84 | lint: | ||
85 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
86 | |||
87 | depend: | ||
88 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
89 | |||
90 | dclean: | ||
91 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
92 | mv -f Makefile.new $(MAKEFILE) | ||
93 | |||
94 | clean: | ||
95 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
96 | |||
97 | cc: | ||
98 | $(MAKE) CC="cc" CFLAG="-O" all | ||
99 | |||
100 | gcc: | ||
101 | $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
102 | |||
103 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/rc4/asm/r4-win32.asm b/src/lib/libcrypto/rc4/asm/r4-win32.asm index 70b0f7484c..e69de29bb2 100644 --- a/src/lib/libcrypto/rc4/asm/r4-win32.asm +++ b/src/lib/libcrypto/rc4/asm/r4-win32.asm | |||
@@ -1,314 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by rc4-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE rc4-586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _RC4 | ||
12 | |||
13 | _RC4 PROC NEAR | ||
14 | ; | ||
15 | push ebp | ||
16 | push ebx | ||
17 | mov ebp, DWORD PTR 12[esp] | ||
18 | mov ebx, DWORD PTR 16[esp] | ||
19 | push esi | ||
20 | push edi | ||
21 | mov ecx, DWORD PTR [ebp] | ||
22 | mov edx, DWORD PTR 4[ebp] | ||
23 | mov esi, DWORD PTR 28[esp] | ||
24 | inc ecx | ||
25 | sub esp, 12 | ||
26 | add ebp, 8 | ||
27 | and ecx, 255 | ||
28 | lea ebx, DWORD PTR [esi+ebx-8] | ||
29 | mov edi, DWORD PTR 44[esp] | ||
30 | mov DWORD PTR 8[esp],ebx | ||
31 | mov eax, DWORD PTR [ecx*4+ebp] | ||
32 | cmp ebx, esi | ||
33 | jl $L000end | ||
34 | L001start: | ||
35 | add esi, 8 | ||
36 | ; Round 0 | ||
37 | add edx, eax | ||
38 | and edx, 255 | ||
39 | inc ecx | ||
40 | mov ebx, DWORD PTR [edx*4+ebp] | ||
41 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
42 | add ebx, eax | ||
43 | and ecx, 255 | ||
44 | and ebx, 255 | ||
45 | mov DWORD PTR [edx*4+ebp],eax | ||
46 | nop | ||
47 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
48 | mov eax, DWORD PTR [ecx*4+ebp] | ||
49 | mov BYTE PTR [esp], bl | ||
50 | ; Round 1 | ||
51 | add edx, eax | ||
52 | and edx, 255 | ||
53 | inc ecx | ||
54 | mov ebx, DWORD PTR [edx*4+ebp] | ||
55 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
56 | add ebx, eax | ||
57 | and ecx, 255 | ||
58 | and ebx, 255 | ||
59 | mov DWORD PTR [edx*4+ebp],eax | ||
60 | nop | ||
61 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
62 | mov eax, DWORD PTR [ecx*4+ebp] | ||
63 | mov BYTE PTR 1[esp],bl | ||
64 | ; Round 2 | ||
65 | add edx, eax | ||
66 | and edx, 255 | ||
67 | inc ecx | ||
68 | mov ebx, DWORD PTR [edx*4+ebp] | ||
69 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
70 | add ebx, eax | ||
71 | and ecx, 255 | ||
72 | and ebx, 255 | ||
73 | mov DWORD PTR [edx*4+ebp],eax | ||
74 | nop | ||
75 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
76 | mov eax, DWORD PTR [ecx*4+ebp] | ||
77 | mov BYTE PTR 2[esp],bl | ||
78 | ; Round 3 | ||
79 | add edx, eax | ||
80 | and edx, 255 | ||
81 | inc ecx | ||
82 | mov ebx, DWORD PTR [edx*4+ebp] | ||
83 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
84 | add ebx, eax | ||
85 | and ecx, 255 | ||
86 | and ebx, 255 | ||
87 | mov DWORD PTR [edx*4+ebp],eax | ||
88 | nop | ||
89 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
90 | mov eax, DWORD PTR [ecx*4+ebp] | ||
91 | mov BYTE PTR 3[esp],bl | ||
92 | ; Round 4 | ||
93 | add edx, eax | ||
94 | and edx, 255 | ||
95 | inc ecx | ||
96 | mov ebx, DWORD PTR [edx*4+ebp] | ||
97 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
98 | add ebx, eax | ||
99 | and ecx, 255 | ||
100 | and ebx, 255 | ||
101 | mov DWORD PTR [edx*4+ebp],eax | ||
102 | nop | ||
103 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
104 | mov eax, DWORD PTR [ecx*4+ebp] | ||
105 | mov BYTE PTR 4[esp],bl | ||
106 | ; Round 5 | ||
107 | add edx, eax | ||
108 | and edx, 255 | ||
109 | inc ecx | ||
110 | mov ebx, DWORD PTR [edx*4+ebp] | ||
111 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
112 | add ebx, eax | ||
113 | and ecx, 255 | ||
114 | and ebx, 255 | ||
115 | mov DWORD PTR [edx*4+ebp],eax | ||
116 | nop | ||
117 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
118 | mov eax, DWORD PTR [ecx*4+ebp] | ||
119 | mov BYTE PTR 5[esp],bl | ||
120 | ; Round 6 | ||
121 | add edx, eax | ||
122 | and edx, 255 | ||
123 | inc ecx | ||
124 | mov ebx, DWORD PTR [edx*4+ebp] | ||
125 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
126 | add ebx, eax | ||
127 | and ecx, 255 | ||
128 | and ebx, 255 | ||
129 | mov DWORD PTR [edx*4+ebp],eax | ||
130 | nop | ||
131 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
132 | mov eax, DWORD PTR [ecx*4+ebp] | ||
133 | mov BYTE PTR 6[esp],bl | ||
134 | ; Round 7 | ||
135 | add edx, eax | ||
136 | and edx, 255 | ||
137 | inc ecx | ||
138 | mov ebx, DWORD PTR [edx*4+ebp] | ||
139 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
140 | add ebx, eax | ||
141 | and ecx, 255 | ||
142 | and ebx, 255 | ||
143 | mov DWORD PTR [edx*4+ebp],eax | ||
144 | nop | ||
145 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
146 | add edi, 8 | ||
147 | mov BYTE PTR 7[esp],bl | ||
148 | ; apply the cipher text | ||
149 | mov eax, DWORD PTR [esp] | ||
150 | mov ebx, DWORD PTR [esi-8] | ||
151 | xor eax, ebx | ||
152 | mov ebx, DWORD PTR [esi-4] | ||
153 | mov DWORD PTR [edi-8],eax | ||
154 | mov eax, DWORD PTR 4[esp] | ||
155 | xor eax, ebx | ||
156 | mov ebx, DWORD PTR 8[esp] | ||
157 | mov DWORD PTR [edi-4],eax | ||
158 | mov eax, DWORD PTR [ecx*4+ebp] | ||
159 | cmp esi, ebx | ||
160 | jle L001start | ||
161 | $L000end: | ||
162 | ; Round 0 | ||
163 | add ebx, 8 | ||
164 | inc esi | ||
165 | cmp ebx, esi | ||
166 | jl $L002finished | ||
167 | mov DWORD PTR 8[esp],ebx | ||
168 | add edx, eax | ||
169 | and edx, 255 | ||
170 | inc ecx | ||
171 | mov ebx, DWORD PTR [edx*4+ebp] | ||
172 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
173 | add ebx, eax | ||
174 | and ecx, 255 | ||
175 | and ebx, 255 | ||
176 | mov DWORD PTR [edx*4+ebp],eax | ||
177 | nop | ||
178 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
179 | mov eax, DWORD PTR [ecx*4+ebp] | ||
180 | mov bh, BYTE PTR [esi-1] | ||
181 | xor bl, bh | ||
182 | mov BYTE PTR [edi], bl | ||
183 | ; Round 1 | ||
184 | mov ebx, DWORD PTR 8[esp] | ||
185 | cmp ebx, esi | ||
186 | jle $L002finished | ||
187 | inc esi | ||
188 | add edx, eax | ||
189 | and edx, 255 | ||
190 | inc ecx | ||
191 | mov ebx, DWORD PTR [edx*4+ebp] | ||
192 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
193 | add ebx, eax | ||
194 | and ecx, 255 | ||
195 | and ebx, 255 | ||
196 | mov DWORD PTR [edx*4+ebp],eax | ||
197 | nop | ||
198 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
199 | mov eax, DWORD PTR [ecx*4+ebp] | ||
200 | mov bh, BYTE PTR [esi-1] | ||
201 | xor bl, bh | ||
202 | mov BYTE PTR 1[edi],bl | ||
203 | ; Round 2 | ||
204 | mov ebx, DWORD PTR 8[esp] | ||
205 | cmp ebx, esi | ||
206 | jle $L002finished | ||
207 | inc esi | ||
208 | add edx, eax | ||
209 | and edx, 255 | ||
210 | inc ecx | ||
211 | mov ebx, DWORD PTR [edx*4+ebp] | ||
212 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
213 | add ebx, eax | ||
214 | and ecx, 255 | ||
215 | and ebx, 255 | ||
216 | mov DWORD PTR [edx*4+ebp],eax | ||
217 | nop | ||
218 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
219 | mov eax, DWORD PTR [ecx*4+ebp] | ||
220 | mov bh, BYTE PTR [esi-1] | ||
221 | xor bl, bh | ||
222 | mov BYTE PTR 2[edi],bl | ||
223 | ; Round 3 | ||
224 | mov ebx, DWORD PTR 8[esp] | ||
225 | cmp ebx, esi | ||
226 | jle $L002finished | ||
227 | inc esi | ||
228 | add edx, eax | ||
229 | and edx, 255 | ||
230 | inc ecx | ||
231 | mov ebx, DWORD PTR [edx*4+ebp] | ||
232 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
233 | add ebx, eax | ||
234 | and ecx, 255 | ||
235 | and ebx, 255 | ||
236 | mov DWORD PTR [edx*4+ebp],eax | ||
237 | nop | ||
238 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
239 | mov eax, DWORD PTR [ecx*4+ebp] | ||
240 | mov bh, BYTE PTR [esi-1] | ||
241 | xor bl, bh | ||
242 | mov BYTE PTR 3[edi],bl | ||
243 | ; Round 4 | ||
244 | mov ebx, DWORD PTR 8[esp] | ||
245 | cmp ebx, esi | ||
246 | jle $L002finished | ||
247 | inc esi | ||
248 | add edx, eax | ||
249 | and edx, 255 | ||
250 | inc ecx | ||
251 | mov ebx, DWORD PTR [edx*4+ebp] | ||
252 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
253 | add ebx, eax | ||
254 | and ecx, 255 | ||
255 | and ebx, 255 | ||
256 | mov DWORD PTR [edx*4+ebp],eax | ||
257 | nop | ||
258 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
259 | mov eax, DWORD PTR [ecx*4+ebp] | ||
260 | mov bh, BYTE PTR [esi-1] | ||
261 | xor bl, bh | ||
262 | mov BYTE PTR 4[edi],bl | ||
263 | ; Round 5 | ||
264 | mov ebx, DWORD PTR 8[esp] | ||
265 | cmp ebx, esi | ||
266 | jle $L002finished | ||
267 | inc esi | ||
268 | add edx, eax | ||
269 | and edx, 255 | ||
270 | inc ecx | ||
271 | mov ebx, DWORD PTR [edx*4+ebp] | ||
272 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
273 | add ebx, eax | ||
274 | and ecx, 255 | ||
275 | and ebx, 255 | ||
276 | mov DWORD PTR [edx*4+ebp],eax | ||
277 | nop | ||
278 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
279 | mov eax, DWORD PTR [ecx*4+ebp] | ||
280 | mov bh, BYTE PTR [esi-1] | ||
281 | xor bl, bh | ||
282 | mov BYTE PTR 5[edi],bl | ||
283 | ; Round 6 | ||
284 | mov ebx, DWORD PTR 8[esp] | ||
285 | cmp ebx, esi | ||
286 | jle $L002finished | ||
287 | inc esi | ||
288 | add edx, eax | ||
289 | and edx, 255 | ||
290 | inc ecx | ||
291 | mov ebx, DWORD PTR [edx*4+ebp] | ||
292 | mov DWORD PTR [ecx*4+ebp-4],ebx | ||
293 | add ebx, eax | ||
294 | and ecx, 255 | ||
295 | and ebx, 255 | ||
296 | mov DWORD PTR [edx*4+ebp],eax | ||
297 | nop | ||
298 | mov ebx, DWORD PTR [ebx*4+ebp] | ||
299 | mov bh, BYTE PTR [esi-1] | ||
300 | xor bl, bh | ||
301 | mov BYTE PTR 6[edi],bl | ||
302 | $L002finished: | ||
303 | dec ecx | ||
304 | add esp, 12 | ||
305 | mov DWORD PTR [ebp-4],edx | ||
306 | mov BYTE PTR [ebp-8],cl | ||
307 | pop edi | ||
308 | pop esi | ||
309 | pop ebx | ||
310 | pop ebp | ||
311 | ret | ||
312 | _RC4 ENDP | ||
313 | _TEXT ENDS | ||
314 | END | ||
diff --git a/src/lib/libcrypto/rc5/Makefile.ssl b/src/lib/libcrypto/rc5/Makefile.ssl index 35abb9d0d1..5a54a162ba 100644 --- a/src/lib/libcrypto/rc5/Makefile.ssl +++ b/src/lib/libcrypto/rc5/Makefile.ssl | |||
@@ -49,7 +49,7 @@ lib: $(LIBOBJ) | |||
49 | 49 | ||
50 | # elf | 50 | # elf |
51 | asm/r586-elf.o: asm/r586unix.cpp | 51 | asm/r586-elf.o: asm/r586unix.cpp |
52 | $(CPP) -DELF asm/r586unix.cpp | as -o asm/r586-elf.o | 52 | $(CPP) -DELF -x c asm/r586unix.cpp | as -o asm/r586-elf.o |
53 | 53 | ||
54 | # solaris | 54 | # solaris |
55 | asm/r586-sol.o: asm/r586unix.cpp | 55 | asm/r586-sol.o: asm/r586unix.cpp |
@@ -65,7 +65,7 @@ asm/r586-out.o: asm/r586unix.cpp | |||
65 | asm/r586bsdi.o: asm/r586unix.cpp | 65 | asm/r586bsdi.o: asm/r586unix.cpp |
66 | $(CPP) -DBSDI asm/r586unix.cpp | sed 's/ :/:/' | as -o asm/r586bsdi.o | 66 | $(CPP) -DBSDI asm/r586unix.cpp | sed 's/ :/:/' | as -o asm/r586bsdi.o |
67 | 67 | ||
68 | asm/r586unix.cpp: | 68 | asm/r586unix.cpp: asm/rc5-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl |
69 | (cd asm; $(PERL) rc5-586.pl cpp >r586unix.cpp) | 69 | (cd asm; $(PERL) rc5-586.pl cpp >r586unix.cpp) |
70 | 70 | ||
71 | files: | 71 | files: |
diff --git a/src/lib/libcrypto/rc5/Makefile.uni b/src/lib/libcrypto/rc5/Makefile.uni index 4dc20c6fcf..e69de29bb2 100644 --- a/src/lib/libcrypto/rc5/Makefile.uni +++ b/src/lib/libcrypto/rc5/Makefile.uni | |||
@@ -1,73 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | |||
6 | DIR= rc2 | ||
7 | TOP= . | ||
8 | CC= gcc | ||
9 | CFLAG= -O3 -fomit-frame-pointer | ||
10 | |||
11 | CPP= $(CC) -E | ||
12 | INCLUDES= | ||
13 | INSTALLTOP=/usr/local/lib | ||
14 | MAKE= make | ||
15 | MAKEDEPEND= makedepend | ||
16 | MAKEFILE= Makefile.uni | ||
17 | AR= ar r | ||
18 | RANLIB= ranlib | ||
19 | |||
20 | IDEA_ENC=rc2_cbc.o | ||
21 | |||
22 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
23 | |||
24 | GENERAL=Makefile | ||
25 | TEST=rc2test | ||
26 | APPS=rc2speed | ||
27 | |||
28 | LIB=librc2.a | ||
29 | LIBSRC=rc2_skey.c rc2_ecb.c rc2_cbc.c rc2cfb64.c rc2ofb64.c | ||
30 | LIBOBJ=rc2_skey.o rc2_ecb.o $(IDEA_ENC) rc2cfb64.o rc2ofb64.o | ||
31 | |||
32 | SRC= $(LIBSRC) | ||
33 | |||
34 | EXHEADER= rc2.h | ||
35 | HEADER= rc2_locl.h $(EXHEADER) | ||
36 | |||
37 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
38 | |||
39 | all: $(LIB) $(TEST) $(APPS) | ||
40 | |||
41 | $(LIB): $(LIBOBJ) | ||
42 | $(AR) $(LIB) $(LIBOBJ) | ||
43 | $(RANLIB) $(LIB) | ||
44 | |||
45 | test: $(TEST) | ||
46 | ./$(TEST) | ||
47 | |||
48 | $(TEST): $(TEST).c $(LIB) | ||
49 | $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB) | ||
50 | |||
51 | $(APPS): $(APPS).c $(LIB) | ||
52 | $(CC) -o $(APPS) $(CFLAGS) $(APPS).c $(LIB) | ||
53 | |||
54 | lint: | ||
55 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
56 | |||
57 | depend: | ||
58 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
59 | |||
60 | dclean: | ||
61 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
62 | mv -f Makefile.new $(MAKEFILE) | ||
63 | |||
64 | clean: | ||
65 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
66 | |||
67 | cc: | ||
68 | $(MAKE) CC="cc" CFLAG="-O" all | ||
69 | |||
70 | gcc: | ||
71 | $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
72 | |||
73 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/rc5/asm/r5-win32.asm b/src/lib/libcrypto/rc5/asm/r5-win32.asm index f43d3711f0..e69de29bb2 100644 --- a/src/lib/libcrypto/rc5/asm/r5-win32.asm +++ b/src/lib/libcrypto/rc5/asm/r5-win32.asm | |||
@@ -1,574 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by rc5-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE rc5-586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _RC5_32_encrypt | ||
12 | |||
13 | _RC5_32_encrypt PROC NEAR | ||
14 | ; | ||
15 | push ebp | ||
16 | push esi | ||
17 | push edi | ||
18 | mov edx, DWORD PTR 16[esp] | ||
19 | mov ebp, DWORD PTR 20[esp] | ||
20 | ; Load the 2 words | ||
21 | mov edi, DWORD PTR [edx] | ||
22 | mov esi, DWORD PTR 4[edx] | ||
23 | push ebx | ||
24 | mov ebx, DWORD PTR [ebp] | ||
25 | add edi, DWORD PTR 4[ebp] | ||
26 | add esi, DWORD PTR 8[ebp] | ||
27 | xor edi, esi | ||
28 | mov eax, DWORD PTR 12[ebp] | ||
29 | mov ecx, esi | ||
30 | rol edi, cl | ||
31 | add edi, eax | ||
32 | xor esi, edi | ||
33 | mov eax, DWORD PTR 16[ebp] | ||
34 | mov ecx, edi | ||
35 | rol esi, cl | ||
36 | add esi, eax | ||
37 | xor edi, esi | ||
38 | mov eax, DWORD PTR 20[ebp] | ||
39 | mov ecx, esi | ||
40 | rol edi, cl | ||
41 | add edi, eax | ||
42 | xor esi, edi | ||
43 | mov eax, DWORD PTR 24[ebp] | ||
44 | mov ecx, edi | ||
45 | rol esi, cl | ||
46 | add esi, eax | ||
47 | xor edi, esi | ||
48 | mov eax, DWORD PTR 28[ebp] | ||
49 | mov ecx, esi | ||
50 | rol edi, cl | ||
51 | add edi, eax | ||
52 | xor esi, edi | ||
53 | mov eax, DWORD PTR 32[ebp] | ||
54 | mov ecx, edi | ||
55 | rol esi, cl | ||
56 | add esi, eax | ||
57 | xor edi, esi | ||
58 | mov eax, DWORD PTR 36[ebp] | ||
59 | mov ecx, esi | ||
60 | rol edi, cl | ||
61 | add edi, eax | ||
62 | xor esi, edi | ||
63 | mov eax, DWORD PTR 40[ebp] | ||
64 | mov ecx, edi | ||
65 | rol esi, cl | ||
66 | add esi, eax | ||
67 | xor edi, esi | ||
68 | mov eax, DWORD PTR 44[ebp] | ||
69 | mov ecx, esi | ||
70 | rol edi, cl | ||
71 | add edi, eax | ||
72 | xor esi, edi | ||
73 | mov eax, DWORD PTR 48[ebp] | ||
74 | mov ecx, edi | ||
75 | rol esi, cl | ||
76 | add esi, eax | ||
77 | xor edi, esi | ||
78 | mov eax, DWORD PTR 52[ebp] | ||
79 | mov ecx, esi | ||
80 | rol edi, cl | ||
81 | add edi, eax | ||
82 | xor esi, edi | ||
83 | mov eax, DWORD PTR 56[ebp] | ||
84 | mov ecx, edi | ||
85 | rol esi, cl | ||
86 | add esi, eax | ||
87 | xor edi, esi | ||
88 | mov eax, DWORD PTR 60[ebp] | ||
89 | mov ecx, esi | ||
90 | rol edi, cl | ||
91 | add edi, eax | ||
92 | xor esi, edi | ||
93 | mov eax, DWORD PTR 64[ebp] | ||
94 | mov ecx, edi | ||
95 | rol esi, cl | ||
96 | add esi, eax | ||
97 | xor edi, esi | ||
98 | mov eax, DWORD PTR 68[ebp] | ||
99 | mov ecx, esi | ||
100 | rol edi, cl | ||
101 | add edi, eax | ||
102 | xor esi, edi | ||
103 | mov eax, DWORD PTR 72[ebp] | ||
104 | mov ecx, edi | ||
105 | rol esi, cl | ||
106 | add esi, eax | ||
107 | cmp ebx, 8 | ||
108 | je $L000rc5_exit | ||
109 | xor edi, esi | ||
110 | mov eax, DWORD PTR 76[ebp] | ||
111 | mov ecx, esi | ||
112 | rol edi, cl | ||
113 | add edi, eax | ||
114 | xor esi, edi | ||
115 | mov eax, DWORD PTR 80[ebp] | ||
116 | mov ecx, edi | ||
117 | rol esi, cl | ||
118 | add esi, eax | ||
119 | xor edi, esi | ||
120 | mov eax, DWORD PTR 84[ebp] | ||
121 | mov ecx, esi | ||
122 | rol edi, cl | ||
123 | add edi, eax | ||
124 | xor esi, edi | ||
125 | mov eax, DWORD PTR 88[ebp] | ||
126 | mov ecx, edi | ||
127 | rol esi, cl | ||
128 | add esi, eax | ||
129 | xor edi, esi | ||
130 | mov eax, DWORD PTR 92[ebp] | ||
131 | mov ecx, esi | ||
132 | rol edi, cl | ||
133 | add edi, eax | ||
134 | xor esi, edi | ||
135 | mov eax, DWORD PTR 96[ebp] | ||
136 | mov ecx, edi | ||
137 | rol esi, cl | ||
138 | add esi, eax | ||
139 | xor edi, esi | ||
140 | mov eax, DWORD PTR 100[ebp] | ||
141 | mov ecx, esi | ||
142 | rol edi, cl | ||
143 | add edi, eax | ||
144 | xor esi, edi | ||
145 | mov eax, DWORD PTR 104[ebp] | ||
146 | mov ecx, edi | ||
147 | rol esi, cl | ||
148 | add esi, eax | ||
149 | cmp ebx, 12 | ||
150 | je $L000rc5_exit | ||
151 | xor edi, esi | ||
152 | mov eax, DWORD PTR 108[ebp] | ||
153 | mov ecx, esi | ||
154 | rol edi, cl | ||
155 | add edi, eax | ||
156 | xor esi, edi | ||
157 | mov eax, DWORD PTR 112[ebp] | ||
158 | mov ecx, edi | ||
159 | rol esi, cl | ||
160 | add esi, eax | ||
161 | xor edi, esi | ||
162 | mov eax, DWORD PTR 116[ebp] | ||
163 | mov ecx, esi | ||
164 | rol edi, cl | ||
165 | add edi, eax | ||
166 | xor esi, edi | ||
167 | mov eax, DWORD PTR 120[ebp] | ||
168 | mov ecx, edi | ||
169 | rol esi, cl | ||
170 | add esi, eax | ||
171 | xor edi, esi | ||
172 | mov eax, DWORD PTR 124[ebp] | ||
173 | mov ecx, esi | ||
174 | rol edi, cl | ||
175 | add edi, eax | ||
176 | xor esi, edi | ||
177 | mov eax, DWORD PTR 128[ebp] | ||
178 | mov ecx, edi | ||
179 | rol esi, cl | ||
180 | add esi, eax | ||
181 | xor edi, esi | ||
182 | mov eax, DWORD PTR 132[ebp] | ||
183 | mov ecx, esi | ||
184 | rol edi, cl | ||
185 | add edi, eax | ||
186 | xor esi, edi | ||
187 | mov eax, DWORD PTR 136[ebp] | ||
188 | mov ecx, edi | ||
189 | rol esi, cl | ||
190 | add esi, eax | ||
191 | $L000rc5_exit: | ||
192 | mov DWORD PTR [edx],edi | ||
193 | mov DWORD PTR 4[edx],esi | ||
194 | pop ebx | ||
195 | pop edi | ||
196 | pop esi | ||
197 | pop ebp | ||
198 | ret | ||
199 | _RC5_32_encrypt ENDP | ||
200 | _TEXT ENDS | ||
201 | _TEXT SEGMENT | ||
202 | PUBLIC _RC5_32_decrypt | ||
203 | |||
204 | _RC5_32_decrypt PROC NEAR | ||
205 | ; | ||
206 | push ebp | ||
207 | push esi | ||
208 | push edi | ||
209 | mov edx, DWORD PTR 16[esp] | ||
210 | mov ebp, DWORD PTR 20[esp] | ||
211 | ; Load the 2 words | ||
212 | mov edi, DWORD PTR [edx] | ||
213 | mov esi, DWORD PTR 4[edx] | ||
214 | push ebx | ||
215 | mov ebx, DWORD PTR [ebp] | ||
216 | cmp ebx, 12 | ||
217 | je $L001rc5_dec_12 | ||
218 | cmp ebx, 8 | ||
219 | je $L002rc5_dec_8 | ||
220 | mov eax, DWORD PTR 136[ebp] | ||
221 | sub esi, eax | ||
222 | mov ecx, edi | ||
223 | ror esi, cl | ||
224 | xor esi, edi | ||
225 | mov eax, DWORD PTR 132[ebp] | ||
226 | sub edi, eax | ||
227 | mov ecx, esi | ||
228 | ror edi, cl | ||
229 | xor edi, esi | ||
230 | mov eax, DWORD PTR 128[ebp] | ||
231 | sub esi, eax | ||
232 | mov ecx, edi | ||
233 | ror esi, cl | ||
234 | xor esi, edi | ||
235 | mov eax, DWORD PTR 124[ebp] | ||
236 | sub edi, eax | ||
237 | mov ecx, esi | ||
238 | ror edi, cl | ||
239 | xor edi, esi | ||
240 | mov eax, DWORD PTR 120[ebp] | ||
241 | sub esi, eax | ||
242 | mov ecx, edi | ||
243 | ror esi, cl | ||
244 | xor esi, edi | ||
245 | mov eax, DWORD PTR 116[ebp] | ||
246 | sub edi, eax | ||
247 | mov ecx, esi | ||
248 | ror edi, cl | ||
249 | xor edi, esi | ||
250 | mov eax, DWORD PTR 112[ebp] | ||
251 | sub esi, eax | ||
252 | mov ecx, edi | ||
253 | ror esi, cl | ||
254 | xor esi, edi | ||
255 | mov eax, DWORD PTR 108[ebp] | ||
256 | sub edi, eax | ||
257 | mov ecx, esi | ||
258 | ror edi, cl | ||
259 | xor edi, esi | ||
260 | $L001rc5_dec_12: | ||
261 | mov eax, DWORD PTR 104[ebp] | ||
262 | sub esi, eax | ||
263 | mov ecx, edi | ||
264 | ror esi, cl | ||
265 | xor esi, edi | ||
266 | mov eax, DWORD PTR 100[ebp] | ||
267 | sub edi, eax | ||
268 | mov ecx, esi | ||
269 | ror edi, cl | ||
270 | xor edi, esi | ||
271 | mov eax, DWORD PTR 96[ebp] | ||
272 | sub esi, eax | ||
273 | mov ecx, edi | ||
274 | ror esi, cl | ||
275 | xor esi, edi | ||
276 | mov eax, DWORD PTR 92[ebp] | ||
277 | sub edi, eax | ||
278 | mov ecx, esi | ||
279 | ror edi, cl | ||
280 | xor edi, esi | ||
281 | mov eax, DWORD PTR 88[ebp] | ||
282 | sub esi, eax | ||
283 | mov ecx, edi | ||
284 | ror esi, cl | ||
285 | xor esi, edi | ||
286 | mov eax, DWORD PTR 84[ebp] | ||
287 | sub edi, eax | ||
288 | mov ecx, esi | ||
289 | ror edi, cl | ||
290 | xor edi, esi | ||
291 | mov eax, DWORD PTR 80[ebp] | ||
292 | sub esi, eax | ||
293 | mov ecx, edi | ||
294 | ror esi, cl | ||
295 | xor esi, edi | ||
296 | mov eax, DWORD PTR 76[ebp] | ||
297 | sub edi, eax | ||
298 | mov ecx, esi | ||
299 | ror edi, cl | ||
300 | xor edi, esi | ||
301 | $L002rc5_dec_8: | ||
302 | mov eax, DWORD PTR 72[ebp] | ||
303 | sub esi, eax | ||
304 | mov ecx, edi | ||
305 | ror esi, cl | ||
306 | xor esi, edi | ||
307 | mov eax, DWORD PTR 68[ebp] | ||
308 | sub edi, eax | ||
309 | mov ecx, esi | ||
310 | ror edi, cl | ||
311 | xor edi, esi | ||
312 | mov eax, DWORD PTR 64[ebp] | ||
313 | sub esi, eax | ||
314 | mov ecx, edi | ||
315 | ror esi, cl | ||
316 | xor esi, edi | ||
317 | mov eax, DWORD PTR 60[ebp] | ||
318 | sub edi, eax | ||
319 | mov ecx, esi | ||
320 | ror edi, cl | ||
321 | xor edi, esi | ||
322 | mov eax, DWORD PTR 56[ebp] | ||
323 | sub esi, eax | ||
324 | mov ecx, edi | ||
325 | ror esi, cl | ||
326 | xor esi, edi | ||
327 | mov eax, DWORD PTR 52[ebp] | ||
328 | sub edi, eax | ||
329 | mov ecx, esi | ||
330 | ror edi, cl | ||
331 | xor edi, esi | ||
332 | mov eax, DWORD PTR 48[ebp] | ||
333 | sub esi, eax | ||
334 | mov ecx, edi | ||
335 | ror esi, cl | ||
336 | xor esi, edi | ||
337 | mov eax, DWORD PTR 44[ebp] | ||
338 | sub edi, eax | ||
339 | mov ecx, esi | ||
340 | ror edi, cl | ||
341 | xor edi, esi | ||
342 | mov eax, DWORD PTR 40[ebp] | ||
343 | sub esi, eax | ||
344 | mov ecx, edi | ||
345 | ror esi, cl | ||
346 | xor esi, edi | ||
347 | mov eax, DWORD PTR 36[ebp] | ||
348 | sub edi, eax | ||
349 | mov ecx, esi | ||
350 | ror edi, cl | ||
351 | xor edi, esi | ||
352 | mov eax, DWORD PTR 32[ebp] | ||
353 | sub esi, eax | ||
354 | mov ecx, edi | ||
355 | ror esi, cl | ||
356 | xor esi, edi | ||
357 | mov eax, DWORD PTR 28[ebp] | ||
358 | sub edi, eax | ||
359 | mov ecx, esi | ||
360 | ror edi, cl | ||
361 | xor edi, esi | ||
362 | mov eax, DWORD PTR 24[ebp] | ||
363 | sub esi, eax | ||
364 | mov ecx, edi | ||
365 | ror esi, cl | ||
366 | xor esi, edi | ||
367 | mov eax, DWORD PTR 20[ebp] | ||
368 | sub edi, eax | ||
369 | mov ecx, esi | ||
370 | ror edi, cl | ||
371 | xor edi, esi | ||
372 | mov eax, DWORD PTR 16[ebp] | ||
373 | sub esi, eax | ||
374 | mov ecx, edi | ||
375 | ror esi, cl | ||
376 | xor esi, edi | ||
377 | mov eax, DWORD PTR 12[ebp] | ||
378 | sub edi, eax | ||
379 | mov ecx, esi | ||
380 | ror edi, cl | ||
381 | xor edi, esi | ||
382 | sub esi, DWORD PTR 8[ebp] | ||
383 | sub edi, DWORD PTR 4[ebp] | ||
384 | L003rc5_exit: | ||
385 | mov DWORD PTR [edx],edi | ||
386 | mov DWORD PTR 4[edx],esi | ||
387 | pop ebx | ||
388 | pop edi | ||
389 | pop esi | ||
390 | pop ebp | ||
391 | ret | ||
392 | _RC5_32_decrypt ENDP | ||
393 | _TEXT ENDS | ||
394 | _TEXT SEGMENT | ||
395 | PUBLIC _RC5_32_cbc_encrypt | ||
396 | |||
397 | _RC5_32_cbc_encrypt PROC NEAR | ||
398 | ; | ||
399 | push ebp | ||
400 | push ebx | ||
401 | push esi | ||
402 | push edi | ||
403 | mov ebp, DWORD PTR 28[esp] | ||
404 | ; getting iv ptr from parameter 4 | ||
405 | mov ebx, DWORD PTR 36[esp] | ||
406 | mov esi, DWORD PTR [ebx] | ||
407 | mov edi, DWORD PTR 4[ebx] | ||
408 | push edi | ||
409 | push esi | ||
410 | push edi | ||
411 | push esi | ||
412 | mov ebx, esp | ||
413 | mov esi, DWORD PTR 36[esp] | ||
414 | mov edi, DWORD PTR 40[esp] | ||
415 | ; getting encrypt flag from parameter 5 | ||
416 | mov ecx, DWORD PTR 56[esp] | ||
417 | ; get and push parameter 3 | ||
418 | mov eax, DWORD PTR 48[esp] | ||
419 | push eax | ||
420 | push ebx | ||
421 | cmp ecx, 0 | ||
422 | jz $L004decrypt | ||
423 | and ebp, 4294967288 | ||
424 | mov eax, DWORD PTR 8[esp] | ||
425 | mov ebx, DWORD PTR 12[esp] | ||
426 | jz $L005encrypt_finish | ||
427 | L006encrypt_loop: | ||
428 | mov ecx, DWORD PTR [esi] | ||
429 | mov edx, DWORD PTR 4[esi] | ||
430 | xor eax, ecx | ||
431 | xor ebx, edx | ||
432 | mov DWORD PTR 8[esp],eax | ||
433 | mov DWORD PTR 12[esp],ebx | ||
434 | call _RC5_32_encrypt | ||
435 | mov eax, DWORD PTR 8[esp] | ||
436 | mov ebx, DWORD PTR 12[esp] | ||
437 | mov DWORD PTR [edi],eax | ||
438 | mov DWORD PTR 4[edi],ebx | ||
439 | add esi, 8 | ||
440 | add edi, 8 | ||
441 | sub ebp, 8 | ||
442 | jnz L006encrypt_loop | ||
443 | $L005encrypt_finish: | ||
444 | mov ebp, DWORD PTR 52[esp] | ||
445 | and ebp, 7 | ||
446 | jz $L007finish | ||
447 | xor ecx, ecx | ||
448 | xor edx, edx | ||
449 | mov ebp, DWORD PTR $L008cbc_enc_jmp_table[ebp*4] | ||
450 | jmp ebp | ||
451 | L009ej7: | ||
452 | mov dh, BYTE PTR 6[esi] | ||
453 | shl edx, 8 | ||
454 | L010ej6: | ||
455 | mov dh, BYTE PTR 5[esi] | ||
456 | L011ej5: | ||
457 | mov dl, BYTE PTR 4[esi] | ||
458 | L012ej4: | ||
459 | mov ecx, DWORD PTR [esi] | ||
460 | jmp $L013ejend | ||
461 | L014ej3: | ||
462 | mov ch, BYTE PTR 2[esi] | ||
463 | shl ecx, 8 | ||
464 | L015ej2: | ||
465 | mov ch, BYTE PTR 1[esi] | ||
466 | L016ej1: | ||
467 | mov cl, BYTE PTR [esi] | ||
468 | $L013ejend: | ||
469 | xor eax, ecx | ||
470 | xor ebx, edx | ||
471 | mov DWORD PTR 8[esp],eax | ||
472 | mov DWORD PTR 12[esp],ebx | ||
473 | call _RC5_32_encrypt | ||
474 | mov eax, DWORD PTR 8[esp] | ||
475 | mov ebx, DWORD PTR 12[esp] | ||
476 | mov DWORD PTR [edi],eax | ||
477 | mov DWORD PTR 4[edi],ebx | ||
478 | jmp $L007finish | ||
479 | $L004decrypt: | ||
480 | and ebp, 4294967288 | ||
481 | mov eax, DWORD PTR 16[esp] | ||
482 | mov ebx, DWORD PTR 20[esp] | ||
483 | jz $L017decrypt_finish | ||
484 | L018decrypt_loop: | ||
485 | mov eax, DWORD PTR [esi] | ||
486 | mov ebx, DWORD PTR 4[esi] | ||
487 | mov DWORD PTR 8[esp],eax | ||
488 | mov DWORD PTR 12[esp],ebx | ||
489 | call _RC5_32_decrypt | ||
490 | mov eax, DWORD PTR 8[esp] | ||
491 | mov ebx, DWORD PTR 12[esp] | ||
492 | mov ecx, DWORD PTR 16[esp] | ||
493 | mov edx, DWORD PTR 20[esp] | ||
494 | xor ecx, eax | ||
495 | xor edx, ebx | ||
496 | mov eax, DWORD PTR [esi] | ||
497 | mov ebx, DWORD PTR 4[esi] | ||
498 | mov DWORD PTR [edi],ecx | ||
499 | mov DWORD PTR 4[edi],edx | ||
500 | mov DWORD PTR 16[esp],eax | ||
501 | mov DWORD PTR 20[esp],ebx | ||
502 | add esi, 8 | ||
503 | add edi, 8 | ||
504 | sub ebp, 8 | ||
505 | jnz L018decrypt_loop | ||
506 | $L017decrypt_finish: | ||
507 | mov ebp, DWORD PTR 52[esp] | ||
508 | and ebp, 7 | ||
509 | jz $L007finish | ||
510 | mov eax, DWORD PTR [esi] | ||
511 | mov ebx, DWORD PTR 4[esi] | ||
512 | mov DWORD PTR 8[esp],eax | ||
513 | mov DWORD PTR 12[esp],ebx | ||
514 | call _RC5_32_decrypt | ||
515 | mov eax, DWORD PTR 8[esp] | ||
516 | mov ebx, DWORD PTR 12[esp] | ||
517 | mov ecx, DWORD PTR 16[esp] | ||
518 | mov edx, DWORD PTR 20[esp] | ||
519 | xor ecx, eax | ||
520 | xor edx, ebx | ||
521 | mov eax, DWORD PTR [esi] | ||
522 | mov ebx, DWORD PTR 4[esi] | ||
523 | L019dj7: | ||
524 | ror edx, 16 | ||
525 | mov BYTE PTR 6[edi],dl | ||
526 | shr edx, 16 | ||
527 | L020dj6: | ||
528 | mov BYTE PTR 5[edi],dh | ||
529 | L021dj5: | ||
530 | mov BYTE PTR 4[edi],dl | ||
531 | L022dj4: | ||
532 | mov DWORD PTR [edi],ecx | ||
533 | jmp $L023djend | ||
534 | L024dj3: | ||
535 | ror ecx, 16 | ||
536 | mov BYTE PTR 2[edi],cl | ||
537 | shl ecx, 16 | ||
538 | L025dj2: | ||
539 | mov BYTE PTR 1[esi],ch | ||
540 | L026dj1: | ||
541 | mov BYTE PTR [esi], cl | ||
542 | $L023djend: | ||
543 | jmp $L007finish | ||
544 | $L007finish: | ||
545 | mov ecx, DWORD PTR 60[esp] | ||
546 | add esp, 24 | ||
547 | mov DWORD PTR [ecx],eax | ||
548 | mov DWORD PTR 4[ecx],ebx | ||
549 | pop edi | ||
550 | pop esi | ||
551 | pop ebx | ||
552 | pop ebp | ||
553 | ret | ||
554 | $L008cbc_enc_jmp_table: | ||
555 | DD 0 | ||
556 | DD L016ej1 | ||
557 | DD L015ej2 | ||
558 | DD L014ej3 | ||
559 | DD L012ej4 | ||
560 | DD L011ej5 | ||
561 | DD L010ej6 | ||
562 | DD L009ej7 | ||
563 | L027cbc_dec_jmp_table: | ||
564 | DD 0 | ||
565 | DD L026dj1 | ||
566 | DD L025dj2 | ||
567 | DD L024dj3 | ||
568 | DD L022dj4 | ||
569 | DD L021dj5 | ||
570 | DD L020dj6 | ||
571 | DD L019dj7 | ||
572 | _RC5_32_cbc_encrypt ENDP | ||
573 | _TEXT ENDS | ||
574 | END | ||
diff --git a/src/lib/libcrypto/ripemd/Makefile.ssl b/src/lib/libcrypto/ripemd/Makefile.ssl index c6153d4361..6ada9f067b 100644 --- a/src/lib/libcrypto/ripemd/Makefile.ssl +++ b/src/lib/libcrypto/ripemd/Makefile.ssl | |||
@@ -47,7 +47,7 @@ lib: $(LIBOBJ) | |||
47 | 47 | ||
48 | # elf | 48 | # elf |
49 | asm/rm86-elf.o: asm/rm86unix.cpp | 49 | asm/rm86-elf.o: asm/rm86unix.cpp |
50 | $(CPP) -DELF asm/rm86unix.cpp | as -o asm/rm86-elf.o | 50 | $(CPP) -DELF -x c asm/rm86unix.cpp | as -o asm/rm86-elf.o |
51 | 51 | ||
52 | # solaris | 52 | # solaris |
53 | asm/rm86-sol.o: asm/rm86unix.cpp | 53 | asm/rm86-sol.o: asm/rm86unix.cpp |
@@ -63,7 +63,7 @@ asm/rm86-out.o: asm/rm86unix.cpp | |||
63 | asm/rm86bsdi.o: asm/rm86unix.cpp | 63 | asm/rm86bsdi.o: asm/rm86unix.cpp |
64 | $(CPP) -DBSDI asm/rm86unix.cpp | sed 's/ :/:/' | as -o asm/rm86bsdi.o | 64 | $(CPP) -DBSDI asm/rm86unix.cpp | sed 's/ :/:/' | as -o asm/rm86bsdi.o |
65 | 65 | ||
66 | asm/rm86unix.cpp: asm/rmd-586.pl | 66 | asm/rm86unix.cpp: asm/rmd-586.pl ../perlasm/x86asm.pl |
67 | (cd asm; $(PERL) rmd-586.pl cpp >rm86unix.cpp) | 67 | (cd asm; $(PERL) rmd-586.pl cpp >rm86unix.cpp) |
68 | 68 | ||
69 | files: | 69 | files: |
diff --git a/src/lib/libcrypto/ripemd/Makefile.uni b/src/lib/libcrypto/ripemd/Makefile.uni index 5310020eb1..e69de29bb2 100644 --- a/src/lib/libcrypto/ripemd/Makefile.uni +++ b/src/lib/libcrypto/ripemd/Makefile.uni | |||
@@ -1,109 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | # make x86-elf - linux-elf etc | ||
6 | # make x86-out - linux-a.out, FreeBSD etc | ||
7 | # make x86-solaris | ||
8 | # make x86-bdsi | ||
9 | |||
10 | DIR= md5 | ||
11 | TOP= . | ||
12 | CC= gcc | ||
13 | CFLAG= -O3 -fomit-frame-pointer | ||
14 | |||
15 | CPP= $(CC) -E | ||
16 | INCLUDES= | ||
17 | INSTALLTOP=/usr/local/lib | ||
18 | MAKE= make | ||
19 | MAKEDEPEND= makedepend | ||
20 | MAKEFILE= Makefile.uni | ||
21 | AR= ar r | ||
22 | |||
23 | MD5_ASM_OBJ= | ||
24 | |||
25 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
26 | |||
27 | GENERAL=Makefile | ||
28 | TEST=md5test | ||
29 | APPS=md5 | ||
30 | |||
31 | LIB=libmd5.a | ||
32 | LIBSRC=md5_dgst.c md5_one.c | ||
33 | LIBOBJ=md5_dgst.o md5_one.o $(MD5_ASM_OBJ) | ||
34 | |||
35 | SRC= $(LIBSRC) | ||
36 | |||
37 | EXHEADER= md5.h | ||
38 | HEADER= md5_locl.h $(EXHEADER) | ||
39 | |||
40 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
41 | |||
42 | all: $(LIB) $(TEST) $(APPS) | ||
43 | |||
44 | $(LIB): $(LIBOBJ) | ||
45 | $(AR) $(LIB) $(LIBOBJ) | ||
46 | $(RANLIB) $(LIB) | ||
47 | |||
48 | # elf | ||
49 | asm/mx86-elf.o: asm/mx86unix.cpp | ||
50 | $(CPP) -DELF asm/mx86unix.cpp | as -o asm/mx86-elf.o | ||
51 | |||
52 | # solaris | ||
53 | asm/mx86-sol.o: asm/mx86unix.cpp | ||
54 | $(CC) -E -DSOL asm/mx86unix.cpp | sed 's/^#.*//' > asm/mx86-sol.s | ||
55 | as -o asm/mx86-sol.o asm/mx86-sol.s | ||
56 | rm -f asm/mx86-sol.s | ||
57 | |||
58 | # a.out | ||
59 | asm/mx86-out.o: asm/mx86unix.cpp | ||
60 | $(CPP) -DOUT asm/mx86unix.cpp | as -o asm/mx86-out.o | ||
61 | |||
62 | # bsdi | ||
63 | asm/mx86bsdi.o: asm/mx86unix.cpp | ||
64 | $(CPP) -DBSDI asm/mx86unix.cpp | as -o asm/mx86bsdi.o | ||
65 | |||
66 | asm/mx86unix.cpp: | ||
67 | (cd asm; perl md5-586.pl cpp >mx86unix.cpp) | ||
68 | |||
69 | test: $(TEST) | ||
70 | ./$(TEST) | ||
71 | |||
72 | $(TEST): $(TEST).c $(LIB) | ||
73 | $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB) | ||
74 | |||
75 | $(APPS): $(APPS).c $(LIB) | ||
76 | $(CC) -o $(APPS) $(CFLAGS) $(APPS).c $(LIB) | ||
77 | |||
78 | lint: | ||
79 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
80 | |||
81 | depend: | ||
82 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
83 | |||
84 | dclean: | ||
85 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
86 | mv -f Makefile.new $(MAKEFILE) | ||
87 | |||
88 | clean: | ||
89 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
90 | |||
91 | cc: | ||
92 | $(MAKE) MD5_ASM_OBJ="" CC="cc" CFLAG="-O" all | ||
93 | |||
94 | gcc: | ||
95 | $(MAKE) MD5_ASM_OBJ="" CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
96 | |||
97 | x86-elf: | ||
98 | $(MAKE) MD5_ASM_OBJ="asm/mx86-elf.o" CFLAG="-DELF -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
99 | |||
100 | x86-out: | ||
101 | $(MAKE) MD5_ASM_OBJ="asm/mx86-out.o" CFLAG="-DOUT -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
102 | |||
103 | x86-solaris: | ||
104 | $(MAKE) MD5_ASM_OBJ="asm/mx86-sol.o" CFLAG="-DSOL -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
105 | |||
106 | x86-bdsi: | ||
107 | $(MAKE) MD5_ASM_OBJ="asm/mx86-bdsi.o" CFLAG="-DBDSI -DMD5_ASM -DL_ENDIAN $(CFLAGS)" all | ||
108 | |||
109 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/ripemd/asm/rm-win32.asm b/src/lib/libcrypto/ripemd/asm/rm-win32.asm index f07d517857..e69de29bb2 100644 --- a/src/lib/libcrypto/ripemd/asm/rm-win32.asm +++ b/src/lib/libcrypto/ripemd/asm/rm-win32.asm | |||
@@ -1,1973 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by rmd-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE rmd-586.asm | ||
8 | .386 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _ripemd160_block_asm_host_order | ||
12 | |||
13 | _ripemd160_block_asm_host_order PROC NEAR | ||
14 | mov edx, DWORD PTR 4[esp] | ||
15 | mov eax, DWORD PTR 8[esp] | ||
16 | push esi | ||
17 | mov ecx, DWORD PTR [edx] | ||
18 | push edi | ||
19 | mov esi, DWORD PTR 4[edx] | ||
20 | push ebp | ||
21 | mov edi, DWORD PTR 8[edx] | ||
22 | push ebx | ||
23 | sub esp, 108 | ||
24 | L000start: | ||
25 | ; | ||
26 | mov ebx, DWORD PTR [eax] | ||
27 | mov ebp, DWORD PTR 4[eax] | ||
28 | mov DWORD PTR [esp],ebx | ||
29 | mov DWORD PTR 4[esp],ebp | ||
30 | mov ebx, DWORD PTR 8[eax] | ||
31 | mov ebp, DWORD PTR 12[eax] | ||
32 | mov DWORD PTR 8[esp],ebx | ||
33 | mov DWORD PTR 12[esp],ebp | ||
34 | mov ebx, DWORD PTR 16[eax] | ||
35 | mov ebp, DWORD PTR 20[eax] | ||
36 | mov DWORD PTR 16[esp],ebx | ||
37 | mov DWORD PTR 20[esp],ebp | ||
38 | mov ebx, DWORD PTR 24[eax] | ||
39 | mov ebp, DWORD PTR 28[eax] | ||
40 | mov DWORD PTR 24[esp],ebx | ||
41 | mov DWORD PTR 28[esp],ebp | ||
42 | mov ebx, DWORD PTR 32[eax] | ||
43 | mov ebp, DWORD PTR 36[eax] | ||
44 | mov DWORD PTR 32[esp],ebx | ||
45 | mov DWORD PTR 36[esp],ebp | ||
46 | mov ebx, DWORD PTR 40[eax] | ||
47 | mov ebp, DWORD PTR 44[eax] | ||
48 | mov DWORD PTR 40[esp],ebx | ||
49 | mov DWORD PTR 44[esp],ebp | ||
50 | mov ebx, DWORD PTR 48[eax] | ||
51 | mov ebp, DWORD PTR 52[eax] | ||
52 | mov DWORD PTR 48[esp],ebx | ||
53 | mov DWORD PTR 52[esp],ebp | ||
54 | mov ebx, DWORD PTR 56[eax] | ||
55 | mov ebp, DWORD PTR 60[eax] | ||
56 | mov DWORD PTR 56[esp],ebx | ||
57 | mov DWORD PTR 60[esp],ebp | ||
58 | mov eax, edi | ||
59 | mov ebx, DWORD PTR 12[edx] | ||
60 | mov ebp, DWORD PTR 16[edx] | ||
61 | ; 0 | ||
62 | xor eax, ebx | ||
63 | mov edx, DWORD PTR [esp] | ||
64 | xor eax, esi | ||
65 | add ecx, edx | ||
66 | rol edi, 10 | ||
67 | add ecx, eax | ||
68 | mov eax, esi | ||
69 | rol ecx, 11 | ||
70 | add ecx, ebp | ||
71 | ; 1 | ||
72 | xor eax, edi | ||
73 | mov edx, DWORD PTR 4[esp] | ||
74 | xor eax, ecx | ||
75 | add ebp, eax | ||
76 | mov eax, ecx | ||
77 | rol esi, 10 | ||
78 | add ebp, edx | ||
79 | xor eax, esi | ||
80 | rol ebp, 14 | ||
81 | add ebp, ebx | ||
82 | ; 2 | ||
83 | mov edx, DWORD PTR 8[esp] | ||
84 | xor eax, ebp | ||
85 | add ebx, edx | ||
86 | rol ecx, 10 | ||
87 | add ebx, eax | ||
88 | mov eax, ebp | ||
89 | rol ebx, 15 | ||
90 | add ebx, edi | ||
91 | ; 3 | ||
92 | xor eax, ecx | ||
93 | mov edx, DWORD PTR 12[esp] | ||
94 | xor eax, ebx | ||
95 | add edi, eax | ||
96 | mov eax, ebx | ||
97 | rol ebp, 10 | ||
98 | add edi, edx | ||
99 | xor eax, ebp | ||
100 | rol edi, 12 | ||
101 | add edi, esi | ||
102 | ; 4 | ||
103 | mov edx, DWORD PTR 16[esp] | ||
104 | xor eax, edi | ||
105 | add esi, edx | ||
106 | rol ebx, 10 | ||
107 | add esi, eax | ||
108 | mov eax, edi | ||
109 | rol esi, 5 | ||
110 | add esi, ecx | ||
111 | ; 5 | ||
112 | xor eax, ebx | ||
113 | mov edx, DWORD PTR 20[esp] | ||
114 | xor eax, esi | ||
115 | add ecx, eax | ||
116 | mov eax, esi | ||
117 | rol edi, 10 | ||
118 | add ecx, edx | ||
119 | xor eax, edi | ||
120 | rol ecx, 8 | ||
121 | add ecx, ebp | ||
122 | ; 6 | ||
123 | mov edx, DWORD PTR 24[esp] | ||
124 | xor eax, ecx | ||
125 | add ebp, edx | ||
126 | rol esi, 10 | ||
127 | add ebp, eax | ||
128 | mov eax, ecx | ||
129 | rol ebp, 7 | ||
130 | add ebp, ebx | ||
131 | ; 7 | ||
132 | xor eax, esi | ||
133 | mov edx, DWORD PTR 28[esp] | ||
134 | xor eax, ebp | ||
135 | add ebx, eax | ||
136 | mov eax, ebp | ||
137 | rol ecx, 10 | ||
138 | add ebx, edx | ||
139 | xor eax, ecx | ||
140 | rol ebx, 9 | ||
141 | add ebx, edi | ||
142 | ; 8 | ||
143 | mov edx, DWORD PTR 32[esp] | ||
144 | xor eax, ebx | ||
145 | add edi, edx | ||
146 | rol ebp, 10 | ||
147 | add edi, eax | ||
148 | mov eax, ebx | ||
149 | rol edi, 11 | ||
150 | add edi, esi | ||
151 | ; 9 | ||
152 | xor eax, ebp | ||
153 | mov edx, DWORD PTR 36[esp] | ||
154 | xor eax, edi | ||
155 | add esi, eax | ||
156 | mov eax, edi | ||
157 | rol ebx, 10 | ||
158 | add esi, edx | ||
159 | xor eax, ebx | ||
160 | rol esi, 13 | ||
161 | add esi, ecx | ||
162 | ; 10 | ||
163 | mov edx, DWORD PTR 40[esp] | ||
164 | xor eax, esi | ||
165 | add ecx, edx | ||
166 | rol edi, 10 | ||
167 | add ecx, eax | ||
168 | mov eax, esi | ||
169 | rol ecx, 14 | ||
170 | add ecx, ebp | ||
171 | ; 11 | ||
172 | xor eax, edi | ||
173 | mov edx, DWORD PTR 44[esp] | ||
174 | xor eax, ecx | ||
175 | add ebp, eax | ||
176 | mov eax, ecx | ||
177 | rol esi, 10 | ||
178 | add ebp, edx | ||
179 | xor eax, esi | ||
180 | rol ebp, 15 | ||
181 | add ebp, ebx | ||
182 | ; 12 | ||
183 | mov edx, DWORD PTR 48[esp] | ||
184 | xor eax, ebp | ||
185 | add ebx, edx | ||
186 | rol ecx, 10 | ||
187 | add ebx, eax | ||
188 | mov eax, ebp | ||
189 | rol ebx, 6 | ||
190 | add ebx, edi | ||
191 | ; 13 | ||
192 | xor eax, ecx | ||
193 | mov edx, DWORD PTR 52[esp] | ||
194 | xor eax, ebx | ||
195 | add edi, eax | ||
196 | mov eax, ebx | ||
197 | rol ebp, 10 | ||
198 | add edi, edx | ||
199 | xor eax, ebp | ||
200 | rol edi, 7 | ||
201 | add edi, esi | ||
202 | ; 14 | ||
203 | mov edx, DWORD PTR 56[esp] | ||
204 | xor eax, edi | ||
205 | add esi, edx | ||
206 | rol ebx, 10 | ||
207 | add esi, eax | ||
208 | mov eax, edi | ||
209 | rol esi, 9 | ||
210 | add esi, ecx | ||
211 | ; 15 | ||
212 | xor eax, ebx | ||
213 | mov edx, DWORD PTR 60[esp] | ||
214 | xor eax, esi | ||
215 | add ecx, eax | ||
216 | mov eax, -1 | ||
217 | rol edi, 10 | ||
218 | add ecx, edx | ||
219 | mov edx, DWORD PTR 28[esp] | ||
220 | rol ecx, 8 | ||
221 | add ecx, ebp | ||
222 | ; 16 | ||
223 | add ebp, edx | ||
224 | mov edx, esi | ||
225 | sub eax, ecx | ||
226 | and edx, ecx | ||
227 | and eax, edi | ||
228 | or edx, eax | ||
229 | mov eax, DWORD PTR 16[esp] | ||
230 | rol esi, 10 | ||
231 | lea ebp, DWORD PTR 1518500249[edx*1+ebp] | ||
232 | mov edx, -1 | ||
233 | rol ebp, 7 | ||
234 | add ebp, ebx | ||
235 | ; 17 | ||
236 | add ebx, eax | ||
237 | mov eax, ecx | ||
238 | sub edx, ebp | ||
239 | and eax, ebp | ||
240 | and edx, esi | ||
241 | or eax, edx | ||
242 | mov edx, DWORD PTR 52[esp] | ||
243 | rol ecx, 10 | ||
244 | lea ebx, DWORD PTR 1518500249[eax*1+ebx] | ||
245 | mov eax, -1 | ||
246 | rol ebx, 6 | ||
247 | add ebx, edi | ||
248 | ; 18 | ||
249 | add edi, edx | ||
250 | mov edx, ebp | ||
251 | sub eax, ebx | ||
252 | and edx, ebx | ||
253 | and eax, ecx | ||
254 | or edx, eax | ||
255 | mov eax, DWORD PTR 4[esp] | ||
256 | rol ebp, 10 | ||
257 | lea edi, DWORD PTR 1518500249[edx*1+edi] | ||
258 | mov edx, -1 | ||
259 | rol edi, 8 | ||
260 | add edi, esi | ||
261 | ; 19 | ||
262 | add esi, eax | ||
263 | mov eax, ebx | ||
264 | sub edx, edi | ||
265 | and eax, edi | ||
266 | and edx, ebp | ||
267 | or eax, edx | ||
268 | mov edx, DWORD PTR 40[esp] | ||
269 | rol ebx, 10 | ||
270 | lea esi, DWORD PTR 1518500249[eax*1+esi] | ||
271 | mov eax, -1 | ||
272 | rol esi, 13 | ||
273 | add esi, ecx | ||
274 | ; 20 | ||
275 | add ecx, edx | ||
276 | mov edx, edi | ||
277 | sub eax, esi | ||
278 | and edx, esi | ||
279 | and eax, ebx | ||
280 | or edx, eax | ||
281 | mov eax, DWORD PTR 24[esp] | ||
282 | rol edi, 10 | ||
283 | lea ecx, DWORD PTR 1518500249[edx*1+ecx] | ||
284 | mov edx, -1 | ||
285 | rol ecx, 11 | ||
286 | add ecx, ebp | ||
287 | ; 21 | ||
288 | add ebp, eax | ||
289 | mov eax, esi | ||
290 | sub edx, ecx | ||
291 | and eax, ecx | ||
292 | and edx, edi | ||
293 | or eax, edx | ||
294 | mov edx, DWORD PTR 60[esp] | ||
295 | rol esi, 10 | ||
296 | lea ebp, DWORD PTR 1518500249[eax*1+ebp] | ||
297 | mov eax, -1 | ||
298 | rol ebp, 9 | ||
299 | add ebp, ebx | ||
300 | ; 22 | ||
301 | add ebx, edx | ||
302 | mov edx, ecx | ||
303 | sub eax, ebp | ||
304 | and edx, ebp | ||
305 | and eax, esi | ||
306 | or edx, eax | ||
307 | mov eax, DWORD PTR 12[esp] | ||
308 | rol ecx, 10 | ||
309 | lea ebx, DWORD PTR 1518500249[edx*1+ebx] | ||
310 | mov edx, -1 | ||
311 | rol ebx, 7 | ||
312 | add ebx, edi | ||
313 | ; 23 | ||
314 | add edi, eax | ||
315 | mov eax, ebp | ||
316 | sub edx, ebx | ||
317 | and eax, ebx | ||
318 | and edx, ecx | ||
319 | or eax, edx | ||
320 | mov edx, DWORD PTR 48[esp] | ||
321 | rol ebp, 10 | ||
322 | lea edi, DWORD PTR 1518500249[eax*1+edi] | ||
323 | mov eax, -1 | ||
324 | rol edi, 15 | ||
325 | add edi, esi | ||
326 | ; 24 | ||
327 | add esi, edx | ||
328 | mov edx, ebx | ||
329 | sub eax, edi | ||
330 | and edx, edi | ||
331 | and eax, ebp | ||
332 | or edx, eax | ||
333 | mov eax, DWORD PTR [esp] | ||
334 | rol ebx, 10 | ||
335 | lea esi, DWORD PTR 1518500249[edx*1+esi] | ||
336 | mov edx, -1 | ||
337 | rol esi, 7 | ||
338 | add esi, ecx | ||
339 | ; 25 | ||
340 | add ecx, eax | ||
341 | mov eax, edi | ||
342 | sub edx, esi | ||
343 | and eax, esi | ||
344 | and edx, ebx | ||
345 | or eax, edx | ||
346 | mov edx, DWORD PTR 36[esp] | ||
347 | rol edi, 10 | ||
348 | lea ecx, DWORD PTR 1518500249[eax*1+ecx] | ||
349 | mov eax, -1 | ||
350 | rol ecx, 12 | ||
351 | add ecx, ebp | ||
352 | ; 26 | ||
353 | add ebp, edx | ||
354 | mov edx, esi | ||
355 | sub eax, ecx | ||
356 | and edx, ecx | ||
357 | and eax, edi | ||
358 | or edx, eax | ||
359 | mov eax, DWORD PTR 20[esp] | ||
360 | rol esi, 10 | ||
361 | lea ebp, DWORD PTR 1518500249[edx*1+ebp] | ||
362 | mov edx, -1 | ||
363 | rol ebp, 15 | ||
364 | add ebp, ebx | ||
365 | ; 27 | ||
366 | add ebx, eax | ||
367 | mov eax, ecx | ||
368 | sub edx, ebp | ||
369 | and eax, ebp | ||
370 | and edx, esi | ||
371 | or eax, edx | ||
372 | mov edx, DWORD PTR 8[esp] | ||
373 | rol ecx, 10 | ||
374 | lea ebx, DWORD PTR 1518500249[eax*1+ebx] | ||
375 | mov eax, -1 | ||
376 | rol ebx, 9 | ||
377 | add ebx, edi | ||
378 | ; 28 | ||
379 | add edi, edx | ||
380 | mov edx, ebp | ||
381 | sub eax, ebx | ||
382 | and edx, ebx | ||
383 | and eax, ecx | ||
384 | or edx, eax | ||
385 | mov eax, DWORD PTR 56[esp] | ||
386 | rol ebp, 10 | ||
387 | lea edi, DWORD PTR 1518500249[edx*1+edi] | ||
388 | mov edx, -1 | ||
389 | rol edi, 11 | ||
390 | add edi, esi | ||
391 | ; 29 | ||
392 | add esi, eax | ||
393 | mov eax, ebx | ||
394 | sub edx, edi | ||
395 | and eax, edi | ||
396 | and edx, ebp | ||
397 | or eax, edx | ||
398 | mov edx, DWORD PTR 44[esp] | ||
399 | rol ebx, 10 | ||
400 | lea esi, DWORD PTR 1518500249[eax*1+esi] | ||
401 | mov eax, -1 | ||
402 | rol esi, 7 | ||
403 | add esi, ecx | ||
404 | ; 30 | ||
405 | add ecx, edx | ||
406 | mov edx, edi | ||
407 | sub eax, esi | ||
408 | and edx, esi | ||
409 | and eax, ebx | ||
410 | or edx, eax | ||
411 | mov eax, DWORD PTR 32[esp] | ||
412 | rol edi, 10 | ||
413 | lea ecx, DWORD PTR 1518500249[edx*1+ecx] | ||
414 | mov edx, -1 | ||
415 | rol ecx, 13 | ||
416 | add ecx, ebp | ||
417 | ; 31 | ||
418 | add ebp, eax | ||
419 | mov eax, esi | ||
420 | sub edx, ecx | ||
421 | and eax, ecx | ||
422 | and edx, edi | ||
423 | or eax, edx | ||
424 | mov edx, -1 | ||
425 | rol esi, 10 | ||
426 | lea ebp, DWORD PTR 1518500249[eax*1+ebp] | ||
427 | sub edx, ecx | ||
428 | rol ebp, 12 | ||
429 | add ebp, ebx | ||
430 | ; 32 | ||
431 | mov eax, DWORD PTR 12[esp] | ||
432 | or edx, ebp | ||
433 | add ebx, eax | ||
434 | xor edx, esi | ||
435 | mov eax, -1 | ||
436 | rol ecx, 10 | ||
437 | lea ebx, DWORD PTR 1859775393[edx*1+ebx] | ||
438 | sub eax, ebp | ||
439 | rol ebx, 11 | ||
440 | add ebx, edi | ||
441 | ; 33 | ||
442 | mov edx, DWORD PTR 40[esp] | ||
443 | or eax, ebx | ||
444 | add edi, edx | ||
445 | xor eax, ecx | ||
446 | mov edx, -1 | ||
447 | rol ebp, 10 | ||
448 | lea edi, DWORD PTR 1859775393[eax*1+edi] | ||
449 | sub edx, ebx | ||
450 | rol edi, 13 | ||
451 | add edi, esi | ||
452 | ; 34 | ||
453 | mov eax, DWORD PTR 56[esp] | ||
454 | or edx, edi | ||
455 | add esi, eax | ||
456 | xor edx, ebp | ||
457 | mov eax, -1 | ||
458 | rol ebx, 10 | ||
459 | lea esi, DWORD PTR 1859775393[edx*1+esi] | ||
460 | sub eax, edi | ||
461 | rol esi, 6 | ||
462 | add esi, ecx | ||
463 | ; 35 | ||
464 | mov edx, DWORD PTR 16[esp] | ||
465 | or eax, esi | ||
466 | add ecx, edx | ||
467 | xor eax, ebx | ||
468 | mov edx, -1 | ||
469 | rol edi, 10 | ||
470 | lea ecx, DWORD PTR 1859775393[eax*1+ecx] | ||
471 | sub edx, esi | ||
472 | rol ecx, 7 | ||
473 | add ecx, ebp | ||
474 | ; 36 | ||
475 | mov eax, DWORD PTR 36[esp] | ||
476 | or edx, ecx | ||
477 | add ebp, eax | ||
478 | xor edx, edi | ||
479 | mov eax, -1 | ||
480 | rol esi, 10 | ||
481 | lea ebp, DWORD PTR 1859775393[edx*1+ebp] | ||
482 | sub eax, ecx | ||
483 | rol ebp, 14 | ||
484 | add ebp, ebx | ||
485 | ; 37 | ||
486 | mov edx, DWORD PTR 60[esp] | ||
487 | or eax, ebp | ||
488 | add ebx, edx | ||
489 | xor eax, esi | ||
490 | mov edx, -1 | ||
491 | rol ecx, 10 | ||
492 | lea ebx, DWORD PTR 1859775393[eax*1+ebx] | ||
493 | sub edx, ebp | ||
494 | rol ebx, 9 | ||
495 | add ebx, edi | ||
496 | ; 38 | ||
497 | mov eax, DWORD PTR 32[esp] | ||
498 | or edx, ebx | ||
499 | add edi, eax | ||
500 | xor edx, ecx | ||
501 | mov eax, -1 | ||
502 | rol ebp, 10 | ||
503 | lea edi, DWORD PTR 1859775393[edx*1+edi] | ||
504 | sub eax, ebx | ||
505 | rol edi, 13 | ||
506 | add edi, esi | ||
507 | ; 39 | ||
508 | mov edx, DWORD PTR 4[esp] | ||
509 | or eax, edi | ||
510 | add esi, edx | ||
511 | xor eax, ebp | ||
512 | mov edx, -1 | ||
513 | rol ebx, 10 | ||
514 | lea esi, DWORD PTR 1859775393[eax*1+esi] | ||
515 | sub edx, edi | ||
516 | rol esi, 15 | ||
517 | add esi, ecx | ||
518 | ; 40 | ||
519 | mov eax, DWORD PTR 8[esp] | ||
520 | or edx, esi | ||
521 | add ecx, eax | ||
522 | xor edx, ebx | ||
523 | mov eax, -1 | ||
524 | rol edi, 10 | ||
525 | lea ecx, DWORD PTR 1859775393[edx*1+ecx] | ||
526 | sub eax, esi | ||
527 | rol ecx, 14 | ||
528 | add ecx, ebp | ||
529 | ; 41 | ||
530 | mov edx, DWORD PTR 28[esp] | ||
531 | or eax, ecx | ||
532 | add ebp, edx | ||
533 | xor eax, edi | ||
534 | mov edx, -1 | ||
535 | rol esi, 10 | ||
536 | lea ebp, DWORD PTR 1859775393[eax*1+ebp] | ||
537 | sub edx, ecx | ||
538 | rol ebp, 8 | ||
539 | add ebp, ebx | ||
540 | ; 42 | ||
541 | mov eax, DWORD PTR [esp] | ||
542 | or edx, ebp | ||
543 | add ebx, eax | ||
544 | xor edx, esi | ||
545 | mov eax, -1 | ||
546 | rol ecx, 10 | ||
547 | lea ebx, DWORD PTR 1859775393[edx*1+ebx] | ||
548 | sub eax, ebp | ||
549 | rol ebx, 13 | ||
550 | add ebx, edi | ||
551 | ; 43 | ||
552 | mov edx, DWORD PTR 24[esp] | ||
553 | or eax, ebx | ||
554 | add edi, edx | ||
555 | xor eax, ecx | ||
556 | mov edx, -1 | ||
557 | rol ebp, 10 | ||
558 | lea edi, DWORD PTR 1859775393[eax*1+edi] | ||
559 | sub edx, ebx | ||
560 | rol edi, 6 | ||
561 | add edi, esi | ||
562 | ; 44 | ||
563 | mov eax, DWORD PTR 52[esp] | ||
564 | or edx, edi | ||
565 | add esi, eax | ||
566 | xor edx, ebp | ||
567 | mov eax, -1 | ||
568 | rol ebx, 10 | ||
569 | lea esi, DWORD PTR 1859775393[edx*1+esi] | ||
570 | sub eax, edi | ||
571 | rol esi, 5 | ||
572 | add esi, ecx | ||
573 | ; 45 | ||
574 | mov edx, DWORD PTR 44[esp] | ||
575 | or eax, esi | ||
576 | add ecx, edx | ||
577 | xor eax, ebx | ||
578 | mov edx, -1 | ||
579 | rol edi, 10 | ||
580 | lea ecx, DWORD PTR 1859775393[eax*1+ecx] | ||
581 | sub edx, esi | ||
582 | rol ecx, 12 | ||
583 | add ecx, ebp | ||
584 | ; 46 | ||
585 | mov eax, DWORD PTR 20[esp] | ||
586 | or edx, ecx | ||
587 | add ebp, eax | ||
588 | xor edx, edi | ||
589 | mov eax, -1 | ||
590 | rol esi, 10 | ||
591 | lea ebp, DWORD PTR 1859775393[edx*1+ebp] | ||
592 | sub eax, ecx | ||
593 | rol ebp, 7 | ||
594 | add ebp, ebx | ||
595 | ; 47 | ||
596 | mov edx, DWORD PTR 48[esp] | ||
597 | or eax, ebp | ||
598 | add ebx, edx | ||
599 | xor eax, esi | ||
600 | mov edx, -1 | ||
601 | rol ecx, 10 | ||
602 | lea ebx, DWORD PTR 1859775393[eax*1+ebx] | ||
603 | mov eax, ecx | ||
604 | rol ebx, 5 | ||
605 | add ebx, edi | ||
606 | ; 48 | ||
607 | sub edx, ecx | ||
608 | and eax, ebx | ||
609 | and edx, ebp | ||
610 | or edx, eax | ||
611 | mov eax, DWORD PTR 4[esp] | ||
612 | rol ebp, 10 | ||
613 | lea edi, DWORD PTR 2400959708[edx+edi] | ||
614 | mov edx, -1 | ||
615 | add edi, eax | ||
616 | mov eax, ebp | ||
617 | rol edi, 11 | ||
618 | add edi, esi | ||
619 | ; 49 | ||
620 | sub edx, ebp | ||
621 | and eax, edi | ||
622 | and edx, ebx | ||
623 | or edx, eax | ||
624 | mov eax, DWORD PTR 36[esp] | ||
625 | rol ebx, 10 | ||
626 | lea esi, DWORD PTR 2400959708[edx+esi] | ||
627 | mov edx, -1 | ||
628 | add esi, eax | ||
629 | mov eax, ebx | ||
630 | rol esi, 12 | ||
631 | add esi, ecx | ||
632 | ; 50 | ||
633 | sub edx, ebx | ||
634 | and eax, esi | ||
635 | and edx, edi | ||
636 | or edx, eax | ||
637 | mov eax, DWORD PTR 44[esp] | ||
638 | rol edi, 10 | ||
639 | lea ecx, DWORD PTR 2400959708[edx+ecx] | ||
640 | mov edx, -1 | ||
641 | add ecx, eax | ||
642 | mov eax, edi | ||
643 | rol ecx, 14 | ||
644 | add ecx, ebp | ||
645 | ; 51 | ||
646 | sub edx, edi | ||
647 | and eax, ecx | ||
648 | and edx, esi | ||
649 | or edx, eax | ||
650 | mov eax, DWORD PTR 40[esp] | ||
651 | rol esi, 10 | ||
652 | lea ebp, DWORD PTR 2400959708[edx+ebp] | ||
653 | mov edx, -1 | ||
654 | add ebp, eax | ||
655 | mov eax, esi | ||
656 | rol ebp, 15 | ||
657 | add ebp, ebx | ||
658 | ; 52 | ||
659 | sub edx, esi | ||
660 | and eax, ebp | ||
661 | and edx, ecx | ||
662 | or edx, eax | ||
663 | mov eax, DWORD PTR [esp] | ||
664 | rol ecx, 10 | ||
665 | lea ebx, DWORD PTR 2400959708[edx+ebx] | ||
666 | mov edx, -1 | ||
667 | add ebx, eax | ||
668 | mov eax, ecx | ||
669 | rol ebx, 14 | ||
670 | add ebx, edi | ||
671 | ; 53 | ||
672 | sub edx, ecx | ||
673 | and eax, ebx | ||
674 | and edx, ebp | ||
675 | or edx, eax | ||
676 | mov eax, DWORD PTR 32[esp] | ||
677 | rol ebp, 10 | ||
678 | lea edi, DWORD PTR 2400959708[edx+edi] | ||
679 | mov edx, -1 | ||
680 | add edi, eax | ||
681 | mov eax, ebp | ||
682 | rol edi, 15 | ||
683 | add edi, esi | ||
684 | ; 54 | ||
685 | sub edx, ebp | ||
686 | and eax, edi | ||
687 | and edx, ebx | ||
688 | or edx, eax | ||
689 | mov eax, DWORD PTR 48[esp] | ||
690 | rol ebx, 10 | ||
691 | lea esi, DWORD PTR 2400959708[edx+esi] | ||
692 | mov edx, -1 | ||
693 | add esi, eax | ||
694 | mov eax, ebx | ||
695 | rol esi, 9 | ||
696 | add esi, ecx | ||
697 | ; 55 | ||
698 | sub edx, ebx | ||
699 | and eax, esi | ||
700 | and edx, edi | ||
701 | or edx, eax | ||
702 | mov eax, DWORD PTR 16[esp] | ||
703 | rol edi, 10 | ||
704 | lea ecx, DWORD PTR 2400959708[edx+ecx] | ||
705 | mov edx, -1 | ||
706 | add ecx, eax | ||
707 | mov eax, edi | ||
708 | rol ecx, 8 | ||
709 | add ecx, ebp | ||
710 | ; 56 | ||
711 | sub edx, edi | ||
712 | and eax, ecx | ||
713 | and edx, esi | ||
714 | or edx, eax | ||
715 | mov eax, DWORD PTR 52[esp] | ||
716 | rol esi, 10 | ||
717 | lea ebp, DWORD PTR 2400959708[edx+ebp] | ||
718 | mov edx, -1 | ||
719 | add ebp, eax | ||
720 | mov eax, esi | ||
721 | rol ebp, 9 | ||
722 | add ebp, ebx | ||
723 | ; 57 | ||
724 | sub edx, esi | ||
725 | and eax, ebp | ||
726 | and edx, ecx | ||
727 | or edx, eax | ||
728 | mov eax, DWORD PTR 12[esp] | ||
729 | rol ecx, 10 | ||
730 | lea ebx, DWORD PTR 2400959708[edx+ebx] | ||
731 | mov edx, -1 | ||
732 | add ebx, eax | ||
733 | mov eax, ecx | ||
734 | rol ebx, 14 | ||
735 | add ebx, edi | ||
736 | ; 58 | ||
737 | sub edx, ecx | ||
738 | and eax, ebx | ||
739 | and edx, ebp | ||
740 | or edx, eax | ||
741 | mov eax, DWORD PTR 28[esp] | ||
742 | rol ebp, 10 | ||
743 | lea edi, DWORD PTR 2400959708[edx+edi] | ||
744 | mov edx, -1 | ||
745 | add edi, eax | ||
746 | mov eax, ebp | ||
747 | rol edi, 5 | ||
748 | add edi, esi | ||
749 | ; 59 | ||
750 | sub edx, ebp | ||
751 | and eax, edi | ||
752 | and edx, ebx | ||
753 | or edx, eax | ||
754 | mov eax, DWORD PTR 60[esp] | ||
755 | rol ebx, 10 | ||
756 | lea esi, DWORD PTR 2400959708[edx+esi] | ||
757 | mov edx, -1 | ||
758 | add esi, eax | ||
759 | mov eax, ebx | ||
760 | rol esi, 6 | ||
761 | add esi, ecx | ||
762 | ; 60 | ||
763 | sub edx, ebx | ||
764 | and eax, esi | ||
765 | and edx, edi | ||
766 | or edx, eax | ||
767 | mov eax, DWORD PTR 56[esp] | ||
768 | rol edi, 10 | ||
769 | lea ecx, DWORD PTR 2400959708[edx+ecx] | ||
770 | mov edx, -1 | ||
771 | add ecx, eax | ||
772 | mov eax, edi | ||
773 | rol ecx, 8 | ||
774 | add ecx, ebp | ||
775 | ; 61 | ||
776 | sub edx, edi | ||
777 | and eax, ecx | ||
778 | and edx, esi | ||
779 | or edx, eax | ||
780 | mov eax, DWORD PTR 20[esp] | ||
781 | rol esi, 10 | ||
782 | lea ebp, DWORD PTR 2400959708[edx+ebp] | ||
783 | mov edx, -1 | ||
784 | add ebp, eax | ||
785 | mov eax, esi | ||
786 | rol ebp, 6 | ||
787 | add ebp, ebx | ||
788 | ; 62 | ||
789 | sub edx, esi | ||
790 | and eax, ebp | ||
791 | and edx, ecx | ||
792 | or edx, eax | ||
793 | mov eax, DWORD PTR 24[esp] | ||
794 | rol ecx, 10 | ||
795 | lea ebx, DWORD PTR 2400959708[edx+ebx] | ||
796 | mov edx, -1 | ||
797 | add ebx, eax | ||
798 | mov eax, ecx | ||
799 | rol ebx, 5 | ||
800 | add ebx, edi | ||
801 | ; 63 | ||
802 | sub edx, ecx | ||
803 | and eax, ebx | ||
804 | and edx, ebp | ||
805 | or edx, eax | ||
806 | mov eax, DWORD PTR 8[esp] | ||
807 | rol ebp, 10 | ||
808 | lea edi, DWORD PTR 2400959708[edx+edi] | ||
809 | mov edx, -1 | ||
810 | add edi, eax | ||
811 | sub edx, ebp | ||
812 | rol edi, 12 | ||
813 | add edi, esi | ||
814 | ; 64 | ||
815 | mov eax, DWORD PTR 16[esp] | ||
816 | or edx, ebx | ||
817 | add esi, eax | ||
818 | xor edx, edi | ||
819 | mov eax, -1 | ||
820 | rol ebx, 10 | ||
821 | lea esi, DWORD PTR 2840853838[edx*1+esi] | ||
822 | sub eax, ebx | ||
823 | rol esi, 9 | ||
824 | add esi, ecx | ||
825 | ; 65 | ||
826 | mov edx, DWORD PTR [esp] | ||
827 | or eax, edi | ||
828 | add ecx, edx | ||
829 | xor eax, esi | ||
830 | mov edx, -1 | ||
831 | rol edi, 10 | ||
832 | lea ecx, DWORD PTR 2840853838[eax*1+ecx] | ||
833 | sub edx, edi | ||
834 | rol ecx, 15 | ||
835 | add ecx, ebp | ||
836 | ; 66 | ||
837 | mov eax, DWORD PTR 20[esp] | ||
838 | or edx, esi | ||
839 | add ebp, eax | ||
840 | xor edx, ecx | ||
841 | mov eax, -1 | ||
842 | rol esi, 10 | ||
843 | lea ebp, DWORD PTR 2840853838[edx*1+ebp] | ||
844 | sub eax, esi | ||
845 | rol ebp, 5 | ||
846 | add ebp, ebx | ||
847 | ; 67 | ||
848 | mov edx, DWORD PTR 36[esp] | ||
849 | or eax, ecx | ||
850 | add ebx, edx | ||
851 | xor eax, ebp | ||
852 | mov edx, -1 | ||
853 | rol ecx, 10 | ||
854 | lea ebx, DWORD PTR 2840853838[eax*1+ebx] | ||
855 | sub edx, ecx | ||
856 | rol ebx, 11 | ||
857 | add ebx, edi | ||
858 | ; 68 | ||
859 | mov eax, DWORD PTR 28[esp] | ||
860 | or edx, ebp | ||
861 | add edi, eax | ||
862 | xor edx, ebx | ||
863 | mov eax, -1 | ||
864 | rol ebp, 10 | ||
865 | lea edi, DWORD PTR 2840853838[edx*1+edi] | ||
866 | sub eax, ebp | ||
867 | rol edi, 6 | ||
868 | add edi, esi | ||
869 | ; 69 | ||
870 | mov edx, DWORD PTR 48[esp] | ||
871 | or eax, ebx | ||
872 | add esi, edx | ||
873 | xor eax, edi | ||
874 | mov edx, -1 | ||
875 | rol ebx, 10 | ||
876 | lea esi, DWORD PTR 2840853838[eax*1+esi] | ||
877 | sub edx, ebx | ||
878 | rol esi, 8 | ||
879 | add esi, ecx | ||
880 | ; 70 | ||
881 | mov eax, DWORD PTR 8[esp] | ||
882 | or edx, edi | ||
883 | add ecx, eax | ||
884 | xor edx, esi | ||
885 | mov eax, -1 | ||
886 | rol edi, 10 | ||
887 | lea ecx, DWORD PTR 2840853838[edx*1+ecx] | ||
888 | sub eax, edi | ||
889 | rol ecx, 13 | ||
890 | add ecx, ebp | ||
891 | ; 71 | ||
892 | mov edx, DWORD PTR 40[esp] | ||
893 | or eax, esi | ||
894 | add ebp, edx | ||
895 | xor eax, ecx | ||
896 | mov edx, -1 | ||
897 | rol esi, 10 | ||
898 | lea ebp, DWORD PTR 2840853838[eax*1+ebp] | ||
899 | sub edx, esi | ||
900 | rol ebp, 12 | ||
901 | add ebp, ebx | ||
902 | ; 72 | ||
903 | mov eax, DWORD PTR 56[esp] | ||
904 | or edx, ecx | ||
905 | add ebx, eax | ||
906 | xor edx, ebp | ||
907 | mov eax, -1 | ||
908 | rol ecx, 10 | ||
909 | lea ebx, DWORD PTR 2840853838[edx*1+ebx] | ||
910 | sub eax, ecx | ||
911 | rol ebx, 5 | ||
912 | add ebx, edi | ||
913 | ; 73 | ||
914 | mov edx, DWORD PTR 4[esp] | ||
915 | or eax, ebp | ||
916 | add edi, edx | ||
917 | xor eax, ebx | ||
918 | mov edx, -1 | ||
919 | rol ebp, 10 | ||
920 | lea edi, DWORD PTR 2840853838[eax*1+edi] | ||
921 | sub edx, ebp | ||
922 | rol edi, 12 | ||
923 | add edi, esi | ||
924 | ; 74 | ||
925 | mov eax, DWORD PTR 12[esp] | ||
926 | or edx, ebx | ||
927 | add esi, eax | ||
928 | xor edx, edi | ||
929 | mov eax, -1 | ||
930 | rol ebx, 10 | ||
931 | lea esi, DWORD PTR 2840853838[edx*1+esi] | ||
932 | sub eax, ebx | ||
933 | rol esi, 13 | ||
934 | add esi, ecx | ||
935 | ; 75 | ||
936 | mov edx, DWORD PTR 32[esp] | ||
937 | or eax, edi | ||
938 | add ecx, edx | ||
939 | xor eax, esi | ||
940 | mov edx, -1 | ||
941 | rol edi, 10 | ||
942 | lea ecx, DWORD PTR 2840853838[eax*1+ecx] | ||
943 | sub edx, edi | ||
944 | rol ecx, 14 | ||
945 | add ecx, ebp | ||
946 | ; 76 | ||
947 | mov eax, DWORD PTR 44[esp] | ||
948 | or edx, esi | ||
949 | add ebp, eax | ||
950 | xor edx, ecx | ||
951 | mov eax, -1 | ||
952 | rol esi, 10 | ||
953 | lea ebp, DWORD PTR 2840853838[edx*1+ebp] | ||
954 | sub eax, esi | ||
955 | rol ebp, 11 | ||
956 | add ebp, ebx | ||
957 | ; 77 | ||
958 | mov edx, DWORD PTR 24[esp] | ||
959 | or eax, ecx | ||
960 | add ebx, edx | ||
961 | xor eax, ebp | ||
962 | mov edx, -1 | ||
963 | rol ecx, 10 | ||
964 | lea ebx, DWORD PTR 2840853838[eax*1+ebx] | ||
965 | sub edx, ecx | ||
966 | rol ebx, 8 | ||
967 | add ebx, edi | ||
968 | ; 78 | ||
969 | mov eax, DWORD PTR 60[esp] | ||
970 | or edx, ebp | ||
971 | add edi, eax | ||
972 | xor edx, ebx | ||
973 | mov eax, -1 | ||
974 | rol ebp, 10 | ||
975 | lea edi, DWORD PTR 2840853838[edx*1+edi] | ||
976 | sub eax, ebp | ||
977 | rol edi, 5 | ||
978 | add edi, esi | ||
979 | ; 79 | ||
980 | mov edx, DWORD PTR 52[esp] | ||
981 | or eax, ebx | ||
982 | add esi, edx | ||
983 | xor eax, edi | ||
984 | mov edx, DWORD PTR 128[esp] | ||
985 | rol ebx, 10 | ||
986 | lea esi, DWORD PTR 2840853838[eax*1+esi] | ||
987 | mov DWORD PTR 64[esp],ecx | ||
988 | rol esi, 6 | ||
989 | add esi, ecx | ||
990 | mov ecx, DWORD PTR [edx] | ||
991 | mov DWORD PTR 68[esp],esi | ||
992 | mov DWORD PTR 72[esp],edi | ||
993 | mov esi, DWORD PTR 4[edx] | ||
994 | mov DWORD PTR 76[esp],ebx | ||
995 | mov edi, DWORD PTR 8[edx] | ||
996 | mov DWORD PTR 80[esp],ebp | ||
997 | mov ebx, DWORD PTR 12[edx] | ||
998 | mov ebp, DWORD PTR 16[edx] | ||
999 | ; 80 | ||
1000 | mov edx, -1 | ||
1001 | sub edx, ebx | ||
1002 | mov eax, DWORD PTR 20[esp] | ||
1003 | or edx, edi | ||
1004 | add ecx, eax | ||
1005 | xor edx, esi | ||
1006 | mov eax, -1 | ||
1007 | rol edi, 10 | ||
1008 | lea ecx, DWORD PTR 1352829926[edx*1+ecx] | ||
1009 | sub eax, edi | ||
1010 | rol ecx, 8 | ||
1011 | add ecx, ebp | ||
1012 | ; 81 | ||
1013 | mov edx, DWORD PTR 56[esp] | ||
1014 | or eax, esi | ||
1015 | add ebp, edx | ||
1016 | xor eax, ecx | ||
1017 | mov edx, -1 | ||
1018 | rol esi, 10 | ||
1019 | lea ebp, DWORD PTR 1352829926[eax*1+ebp] | ||
1020 | sub edx, esi | ||
1021 | rol ebp, 9 | ||
1022 | add ebp, ebx | ||
1023 | ; 82 | ||
1024 | mov eax, DWORD PTR 28[esp] | ||
1025 | or edx, ecx | ||
1026 | add ebx, eax | ||
1027 | xor edx, ebp | ||
1028 | mov eax, -1 | ||
1029 | rol ecx, 10 | ||
1030 | lea ebx, DWORD PTR 1352829926[edx*1+ebx] | ||
1031 | sub eax, ecx | ||
1032 | rol ebx, 9 | ||
1033 | add ebx, edi | ||
1034 | ; 83 | ||
1035 | mov edx, DWORD PTR [esp] | ||
1036 | or eax, ebp | ||
1037 | add edi, edx | ||
1038 | xor eax, ebx | ||
1039 | mov edx, -1 | ||
1040 | rol ebp, 10 | ||
1041 | lea edi, DWORD PTR 1352829926[eax*1+edi] | ||
1042 | sub edx, ebp | ||
1043 | rol edi, 11 | ||
1044 | add edi, esi | ||
1045 | ; 84 | ||
1046 | mov eax, DWORD PTR 36[esp] | ||
1047 | or edx, ebx | ||
1048 | add esi, eax | ||
1049 | xor edx, edi | ||
1050 | mov eax, -1 | ||
1051 | rol ebx, 10 | ||
1052 | lea esi, DWORD PTR 1352829926[edx*1+esi] | ||
1053 | sub eax, ebx | ||
1054 | rol esi, 13 | ||
1055 | add esi, ecx | ||
1056 | ; 85 | ||
1057 | mov edx, DWORD PTR 8[esp] | ||
1058 | or eax, edi | ||
1059 | add ecx, edx | ||
1060 | xor eax, esi | ||
1061 | mov edx, -1 | ||
1062 | rol edi, 10 | ||
1063 | lea ecx, DWORD PTR 1352829926[eax*1+ecx] | ||
1064 | sub edx, edi | ||
1065 | rol ecx, 15 | ||
1066 | add ecx, ebp | ||
1067 | ; 86 | ||
1068 | mov eax, DWORD PTR 44[esp] | ||
1069 | or edx, esi | ||
1070 | add ebp, eax | ||
1071 | xor edx, ecx | ||
1072 | mov eax, -1 | ||
1073 | rol esi, 10 | ||
1074 | lea ebp, DWORD PTR 1352829926[edx*1+ebp] | ||
1075 | sub eax, esi | ||
1076 | rol ebp, 15 | ||
1077 | add ebp, ebx | ||
1078 | ; 87 | ||
1079 | mov edx, DWORD PTR 16[esp] | ||
1080 | or eax, ecx | ||
1081 | add ebx, edx | ||
1082 | xor eax, ebp | ||
1083 | mov edx, -1 | ||
1084 | rol ecx, 10 | ||
1085 | lea ebx, DWORD PTR 1352829926[eax*1+ebx] | ||
1086 | sub edx, ecx | ||
1087 | rol ebx, 5 | ||
1088 | add ebx, edi | ||
1089 | ; 88 | ||
1090 | mov eax, DWORD PTR 52[esp] | ||
1091 | or edx, ebp | ||
1092 | add edi, eax | ||
1093 | xor edx, ebx | ||
1094 | mov eax, -1 | ||
1095 | rol ebp, 10 | ||
1096 | lea edi, DWORD PTR 1352829926[edx*1+edi] | ||
1097 | sub eax, ebp | ||
1098 | rol edi, 7 | ||
1099 | add edi, esi | ||
1100 | ; 89 | ||
1101 | mov edx, DWORD PTR 24[esp] | ||
1102 | or eax, ebx | ||
1103 | add esi, edx | ||
1104 | xor eax, edi | ||
1105 | mov edx, -1 | ||
1106 | rol ebx, 10 | ||
1107 | lea esi, DWORD PTR 1352829926[eax*1+esi] | ||
1108 | sub edx, ebx | ||
1109 | rol esi, 7 | ||
1110 | add esi, ecx | ||
1111 | ; 90 | ||
1112 | mov eax, DWORD PTR 60[esp] | ||
1113 | or edx, edi | ||
1114 | add ecx, eax | ||
1115 | xor edx, esi | ||
1116 | mov eax, -1 | ||
1117 | rol edi, 10 | ||
1118 | lea ecx, DWORD PTR 1352829926[edx*1+ecx] | ||
1119 | sub eax, edi | ||
1120 | rol ecx, 8 | ||
1121 | add ecx, ebp | ||
1122 | ; 91 | ||
1123 | mov edx, DWORD PTR 32[esp] | ||
1124 | or eax, esi | ||
1125 | add ebp, edx | ||
1126 | xor eax, ecx | ||
1127 | mov edx, -1 | ||
1128 | rol esi, 10 | ||
1129 | lea ebp, DWORD PTR 1352829926[eax*1+ebp] | ||
1130 | sub edx, esi | ||
1131 | rol ebp, 11 | ||
1132 | add ebp, ebx | ||
1133 | ; 92 | ||
1134 | mov eax, DWORD PTR 4[esp] | ||
1135 | or edx, ecx | ||
1136 | add ebx, eax | ||
1137 | xor edx, ebp | ||
1138 | mov eax, -1 | ||
1139 | rol ecx, 10 | ||
1140 | lea ebx, DWORD PTR 1352829926[edx*1+ebx] | ||
1141 | sub eax, ecx | ||
1142 | rol ebx, 14 | ||
1143 | add ebx, edi | ||
1144 | ; 93 | ||
1145 | mov edx, DWORD PTR 40[esp] | ||
1146 | or eax, ebp | ||
1147 | add edi, edx | ||
1148 | xor eax, ebx | ||
1149 | mov edx, -1 | ||
1150 | rol ebp, 10 | ||
1151 | lea edi, DWORD PTR 1352829926[eax*1+edi] | ||
1152 | sub edx, ebp | ||
1153 | rol edi, 14 | ||
1154 | add edi, esi | ||
1155 | ; 94 | ||
1156 | mov eax, DWORD PTR 12[esp] | ||
1157 | or edx, ebx | ||
1158 | add esi, eax | ||
1159 | xor edx, edi | ||
1160 | mov eax, -1 | ||
1161 | rol ebx, 10 | ||
1162 | lea esi, DWORD PTR 1352829926[edx*1+esi] | ||
1163 | sub eax, ebx | ||
1164 | rol esi, 12 | ||
1165 | add esi, ecx | ||
1166 | ; 95 | ||
1167 | mov edx, DWORD PTR 48[esp] | ||
1168 | or eax, edi | ||
1169 | add ecx, edx | ||
1170 | xor eax, esi | ||
1171 | mov edx, -1 | ||
1172 | rol edi, 10 | ||
1173 | lea ecx, DWORD PTR 1352829926[eax*1+ecx] | ||
1174 | mov eax, edi | ||
1175 | rol ecx, 6 | ||
1176 | add ecx, ebp | ||
1177 | ; 96 | ||
1178 | sub edx, edi | ||
1179 | and eax, ecx | ||
1180 | and edx, esi | ||
1181 | or edx, eax | ||
1182 | mov eax, DWORD PTR 24[esp] | ||
1183 | rol esi, 10 | ||
1184 | lea ebp, DWORD PTR 1548603684[edx+ebp] | ||
1185 | mov edx, -1 | ||
1186 | add ebp, eax | ||
1187 | mov eax, esi | ||
1188 | rol ebp, 9 | ||
1189 | add ebp, ebx | ||
1190 | ; 97 | ||
1191 | sub edx, esi | ||
1192 | and eax, ebp | ||
1193 | and edx, ecx | ||
1194 | or edx, eax | ||
1195 | mov eax, DWORD PTR 44[esp] | ||
1196 | rol ecx, 10 | ||
1197 | lea ebx, DWORD PTR 1548603684[edx+ebx] | ||
1198 | mov edx, -1 | ||
1199 | add ebx, eax | ||
1200 | mov eax, ecx | ||
1201 | rol ebx, 13 | ||
1202 | add ebx, edi | ||
1203 | ; 98 | ||
1204 | sub edx, ecx | ||
1205 | and eax, ebx | ||
1206 | and edx, ebp | ||
1207 | or edx, eax | ||
1208 | mov eax, DWORD PTR 12[esp] | ||
1209 | rol ebp, 10 | ||
1210 | lea edi, DWORD PTR 1548603684[edx+edi] | ||
1211 | mov edx, -1 | ||
1212 | add edi, eax | ||
1213 | mov eax, ebp | ||
1214 | rol edi, 15 | ||
1215 | add edi, esi | ||
1216 | ; 99 | ||
1217 | sub edx, ebp | ||
1218 | and eax, edi | ||
1219 | and edx, ebx | ||
1220 | or edx, eax | ||
1221 | mov eax, DWORD PTR 28[esp] | ||
1222 | rol ebx, 10 | ||
1223 | lea esi, DWORD PTR 1548603684[edx+esi] | ||
1224 | mov edx, -1 | ||
1225 | add esi, eax | ||
1226 | mov eax, ebx | ||
1227 | rol esi, 7 | ||
1228 | add esi, ecx | ||
1229 | ; 100 | ||
1230 | sub edx, ebx | ||
1231 | and eax, esi | ||
1232 | and edx, edi | ||
1233 | or edx, eax | ||
1234 | mov eax, DWORD PTR [esp] | ||
1235 | rol edi, 10 | ||
1236 | lea ecx, DWORD PTR 1548603684[edx+ecx] | ||
1237 | mov edx, -1 | ||
1238 | add ecx, eax | ||
1239 | mov eax, edi | ||
1240 | rol ecx, 12 | ||
1241 | add ecx, ebp | ||
1242 | ; 101 | ||
1243 | sub edx, edi | ||
1244 | and eax, ecx | ||
1245 | and edx, esi | ||
1246 | or edx, eax | ||
1247 | mov eax, DWORD PTR 52[esp] | ||
1248 | rol esi, 10 | ||
1249 | lea ebp, DWORD PTR 1548603684[edx+ebp] | ||
1250 | mov edx, -1 | ||
1251 | add ebp, eax | ||
1252 | mov eax, esi | ||
1253 | rol ebp, 8 | ||
1254 | add ebp, ebx | ||
1255 | ; 102 | ||
1256 | sub edx, esi | ||
1257 | and eax, ebp | ||
1258 | and edx, ecx | ||
1259 | or edx, eax | ||
1260 | mov eax, DWORD PTR 20[esp] | ||
1261 | rol ecx, 10 | ||
1262 | lea ebx, DWORD PTR 1548603684[edx+ebx] | ||
1263 | mov edx, -1 | ||
1264 | add ebx, eax | ||
1265 | mov eax, ecx | ||
1266 | rol ebx, 9 | ||
1267 | add ebx, edi | ||
1268 | ; 103 | ||
1269 | sub edx, ecx | ||
1270 | and eax, ebx | ||
1271 | and edx, ebp | ||
1272 | or edx, eax | ||
1273 | mov eax, DWORD PTR 40[esp] | ||
1274 | rol ebp, 10 | ||
1275 | lea edi, DWORD PTR 1548603684[edx+edi] | ||
1276 | mov edx, -1 | ||
1277 | add edi, eax | ||
1278 | mov eax, ebp | ||
1279 | rol edi, 11 | ||
1280 | add edi, esi | ||
1281 | ; 104 | ||
1282 | sub edx, ebp | ||
1283 | and eax, edi | ||
1284 | and edx, ebx | ||
1285 | or edx, eax | ||
1286 | mov eax, DWORD PTR 56[esp] | ||
1287 | rol ebx, 10 | ||
1288 | lea esi, DWORD PTR 1548603684[edx+esi] | ||
1289 | mov edx, -1 | ||
1290 | add esi, eax | ||
1291 | mov eax, ebx | ||
1292 | rol esi, 7 | ||
1293 | add esi, ecx | ||
1294 | ; 105 | ||
1295 | sub edx, ebx | ||
1296 | and eax, esi | ||
1297 | and edx, edi | ||
1298 | or edx, eax | ||
1299 | mov eax, DWORD PTR 60[esp] | ||
1300 | rol edi, 10 | ||
1301 | lea ecx, DWORD PTR 1548603684[edx+ecx] | ||
1302 | mov edx, -1 | ||
1303 | add ecx, eax | ||
1304 | mov eax, edi | ||
1305 | rol ecx, 7 | ||
1306 | add ecx, ebp | ||
1307 | ; 106 | ||
1308 | sub edx, edi | ||
1309 | and eax, ecx | ||
1310 | and edx, esi | ||
1311 | or edx, eax | ||
1312 | mov eax, DWORD PTR 32[esp] | ||
1313 | rol esi, 10 | ||
1314 | lea ebp, DWORD PTR 1548603684[edx+ebp] | ||
1315 | mov edx, -1 | ||
1316 | add ebp, eax | ||
1317 | mov eax, esi | ||
1318 | rol ebp, 12 | ||
1319 | add ebp, ebx | ||
1320 | ; 107 | ||
1321 | sub edx, esi | ||
1322 | and eax, ebp | ||
1323 | and edx, ecx | ||
1324 | or edx, eax | ||
1325 | mov eax, DWORD PTR 48[esp] | ||
1326 | rol ecx, 10 | ||
1327 | lea ebx, DWORD PTR 1548603684[edx+ebx] | ||
1328 | mov edx, -1 | ||
1329 | add ebx, eax | ||
1330 | mov eax, ecx | ||
1331 | rol ebx, 7 | ||
1332 | add ebx, edi | ||
1333 | ; 108 | ||
1334 | sub edx, ecx | ||
1335 | and eax, ebx | ||
1336 | and edx, ebp | ||
1337 | or edx, eax | ||
1338 | mov eax, DWORD PTR 16[esp] | ||
1339 | rol ebp, 10 | ||
1340 | lea edi, DWORD PTR 1548603684[edx+edi] | ||
1341 | mov edx, -1 | ||
1342 | add edi, eax | ||
1343 | mov eax, ebp | ||
1344 | rol edi, 6 | ||
1345 | add edi, esi | ||
1346 | ; 109 | ||
1347 | sub edx, ebp | ||
1348 | and eax, edi | ||
1349 | and edx, ebx | ||
1350 | or edx, eax | ||
1351 | mov eax, DWORD PTR 36[esp] | ||
1352 | rol ebx, 10 | ||
1353 | lea esi, DWORD PTR 1548603684[edx+esi] | ||
1354 | mov edx, -1 | ||
1355 | add esi, eax | ||
1356 | mov eax, ebx | ||
1357 | rol esi, 15 | ||
1358 | add esi, ecx | ||
1359 | ; 110 | ||
1360 | sub edx, ebx | ||
1361 | and eax, esi | ||
1362 | and edx, edi | ||
1363 | or edx, eax | ||
1364 | mov eax, DWORD PTR 4[esp] | ||
1365 | rol edi, 10 | ||
1366 | lea ecx, DWORD PTR 1548603684[edx+ecx] | ||
1367 | mov edx, -1 | ||
1368 | add ecx, eax | ||
1369 | mov eax, edi | ||
1370 | rol ecx, 13 | ||
1371 | add ecx, ebp | ||
1372 | ; 111 | ||
1373 | sub edx, edi | ||
1374 | and eax, ecx | ||
1375 | and edx, esi | ||
1376 | or edx, eax | ||
1377 | mov eax, DWORD PTR 8[esp] | ||
1378 | rol esi, 10 | ||
1379 | lea ebp, DWORD PTR 1548603684[edx+ebp] | ||
1380 | mov edx, -1 | ||
1381 | add ebp, eax | ||
1382 | sub edx, ecx | ||
1383 | rol ebp, 11 | ||
1384 | add ebp, ebx | ||
1385 | ; 112 | ||
1386 | mov eax, DWORD PTR 60[esp] | ||
1387 | or edx, ebp | ||
1388 | add ebx, eax | ||
1389 | xor edx, esi | ||
1390 | mov eax, -1 | ||
1391 | rol ecx, 10 | ||
1392 | lea ebx, DWORD PTR 1836072691[edx*1+ebx] | ||
1393 | sub eax, ebp | ||
1394 | rol ebx, 9 | ||
1395 | add ebx, edi | ||
1396 | ; 113 | ||
1397 | mov edx, DWORD PTR 20[esp] | ||
1398 | or eax, ebx | ||
1399 | add edi, edx | ||
1400 | xor eax, ecx | ||
1401 | mov edx, -1 | ||
1402 | rol ebp, 10 | ||
1403 | lea edi, DWORD PTR 1836072691[eax*1+edi] | ||
1404 | sub edx, ebx | ||
1405 | rol edi, 7 | ||
1406 | add edi, esi | ||
1407 | ; 114 | ||
1408 | mov eax, DWORD PTR 4[esp] | ||
1409 | or edx, edi | ||
1410 | add esi, eax | ||
1411 | xor edx, ebp | ||
1412 | mov eax, -1 | ||
1413 | rol ebx, 10 | ||
1414 | lea esi, DWORD PTR 1836072691[edx*1+esi] | ||
1415 | sub eax, edi | ||
1416 | rol esi, 15 | ||
1417 | add esi, ecx | ||
1418 | ; 115 | ||
1419 | mov edx, DWORD PTR 12[esp] | ||
1420 | or eax, esi | ||
1421 | add ecx, edx | ||
1422 | xor eax, ebx | ||
1423 | mov edx, -1 | ||
1424 | rol edi, 10 | ||
1425 | lea ecx, DWORD PTR 1836072691[eax*1+ecx] | ||
1426 | sub edx, esi | ||
1427 | rol ecx, 11 | ||
1428 | add ecx, ebp | ||
1429 | ; 116 | ||
1430 | mov eax, DWORD PTR 28[esp] | ||
1431 | or edx, ecx | ||
1432 | add ebp, eax | ||
1433 | xor edx, edi | ||
1434 | mov eax, -1 | ||
1435 | rol esi, 10 | ||
1436 | lea ebp, DWORD PTR 1836072691[edx*1+ebp] | ||
1437 | sub eax, ecx | ||
1438 | rol ebp, 8 | ||
1439 | add ebp, ebx | ||
1440 | ; 117 | ||
1441 | mov edx, DWORD PTR 56[esp] | ||
1442 | or eax, ebp | ||
1443 | add ebx, edx | ||
1444 | xor eax, esi | ||
1445 | mov edx, -1 | ||
1446 | rol ecx, 10 | ||
1447 | lea ebx, DWORD PTR 1836072691[eax*1+ebx] | ||
1448 | sub edx, ebp | ||
1449 | rol ebx, 6 | ||
1450 | add ebx, edi | ||
1451 | ; 118 | ||
1452 | mov eax, DWORD PTR 24[esp] | ||
1453 | or edx, ebx | ||
1454 | add edi, eax | ||
1455 | xor edx, ecx | ||
1456 | mov eax, -1 | ||
1457 | rol ebp, 10 | ||
1458 | lea edi, DWORD PTR 1836072691[edx*1+edi] | ||
1459 | sub eax, ebx | ||
1460 | rol edi, 6 | ||
1461 | add edi, esi | ||
1462 | ; 119 | ||
1463 | mov edx, DWORD PTR 36[esp] | ||
1464 | or eax, edi | ||
1465 | add esi, edx | ||
1466 | xor eax, ebp | ||
1467 | mov edx, -1 | ||
1468 | rol ebx, 10 | ||
1469 | lea esi, DWORD PTR 1836072691[eax*1+esi] | ||
1470 | sub edx, edi | ||
1471 | rol esi, 14 | ||
1472 | add esi, ecx | ||
1473 | ; 120 | ||
1474 | mov eax, DWORD PTR 44[esp] | ||
1475 | or edx, esi | ||
1476 | add ecx, eax | ||
1477 | xor edx, ebx | ||
1478 | mov eax, -1 | ||
1479 | rol edi, 10 | ||
1480 | lea ecx, DWORD PTR 1836072691[edx*1+ecx] | ||
1481 | sub eax, esi | ||
1482 | rol ecx, 12 | ||
1483 | add ecx, ebp | ||
1484 | ; 121 | ||
1485 | mov edx, DWORD PTR 32[esp] | ||
1486 | or eax, ecx | ||
1487 | add ebp, edx | ||
1488 | xor eax, edi | ||
1489 | mov edx, -1 | ||
1490 | rol esi, 10 | ||
1491 | lea ebp, DWORD PTR 1836072691[eax*1+ebp] | ||
1492 | sub edx, ecx | ||
1493 | rol ebp, 13 | ||
1494 | add ebp, ebx | ||
1495 | ; 122 | ||
1496 | mov eax, DWORD PTR 48[esp] | ||
1497 | or edx, ebp | ||
1498 | add ebx, eax | ||
1499 | xor edx, esi | ||
1500 | mov eax, -1 | ||
1501 | rol ecx, 10 | ||
1502 | lea ebx, DWORD PTR 1836072691[edx*1+ebx] | ||
1503 | sub eax, ebp | ||
1504 | rol ebx, 5 | ||
1505 | add ebx, edi | ||
1506 | ; 123 | ||
1507 | mov edx, DWORD PTR 8[esp] | ||
1508 | or eax, ebx | ||
1509 | add edi, edx | ||
1510 | xor eax, ecx | ||
1511 | mov edx, -1 | ||
1512 | rol ebp, 10 | ||
1513 | lea edi, DWORD PTR 1836072691[eax*1+edi] | ||
1514 | sub edx, ebx | ||
1515 | rol edi, 14 | ||
1516 | add edi, esi | ||
1517 | ; 124 | ||
1518 | mov eax, DWORD PTR 40[esp] | ||
1519 | or edx, edi | ||
1520 | add esi, eax | ||
1521 | xor edx, ebp | ||
1522 | mov eax, -1 | ||
1523 | rol ebx, 10 | ||
1524 | lea esi, DWORD PTR 1836072691[edx*1+esi] | ||
1525 | sub eax, edi | ||
1526 | rol esi, 13 | ||
1527 | add esi, ecx | ||
1528 | ; 125 | ||
1529 | mov edx, DWORD PTR [esp] | ||
1530 | or eax, esi | ||
1531 | add ecx, edx | ||
1532 | xor eax, ebx | ||
1533 | mov edx, -1 | ||
1534 | rol edi, 10 | ||
1535 | lea ecx, DWORD PTR 1836072691[eax*1+ecx] | ||
1536 | sub edx, esi | ||
1537 | rol ecx, 13 | ||
1538 | add ecx, ebp | ||
1539 | ; 126 | ||
1540 | mov eax, DWORD PTR 16[esp] | ||
1541 | or edx, ecx | ||
1542 | add ebp, eax | ||
1543 | xor edx, edi | ||
1544 | mov eax, -1 | ||
1545 | rol esi, 10 | ||
1546 | lea ebp, DWORD PTR 1836072691[edx*1+ebp] | ||
1547 | sub eax, ecx | ||
1548 | rol ebp, 7 | ||
1549 | add ebp, ebx | ||
1550 | ; 127 | ||
1551 | mov edx, DWORD PTR 52[esp] | ||
1552 | or eax, ebp | ||
1553 | add ebx, edx | ||
1554 | xor eax, esi | ||
1555 | mov edx, DWORD PTR 32[esp] | ||
1556 | rol ecx, 10 | ||
1557 | lea ebx, DWORD PTR 1836072691[eax*1+ebx] | ||
1558 | mov eax, -1 | ||
1559 | rol ebx, 5 | ||
1560 | add ebx, edi | ||
1561 | ; 128 | ||
1562 | add edi, edx | ||
1563 | mov edx, ebp | ||
1564 | sub eax, ebx | ||
1565 | and edx, ebx | ||
1566 | and eax, ecx | ||
1567 | or edx, eax | ||
1568 | mov eax, DWORD PTR 24[esp] | ||
1569 | rol ebp, 10 | ||
1570 | lea edi, DWORD PTR 2053994217[edx*1+edi] | ||
1571 | mov edx, -1 | ||
1572 | rol edi, 15 | ||
1573 | add edi, esi | ||
1574 | ; 129 | ||
1575 | add esi, eax | ||
1576 | mov eax, ebx | ||
1577 | sub edx, edi | ||
1578 | and eax, edi | ||
1579 | and edx, ebp | ||
1580 | or eax, edx | ||
1581 | mov edx, DWORD PTR 16[esp] | ||
1582 | rol ebx, 10 | ||
1583 | lea esi, DWORD PTR 2053994217[eax*1+esi] | ||
1584 | mov eax, -1 | ||
1585 | rol esi, 5 | ||
1586 | add esi, ecx | ||
1587 | ; 130 | ||
1588 | add ecx, edx | ||
1589 | mov edx, edi | ||
1590 | sub eax, esi | ||
1591 | and edx, esi | ||
1592 | and eax, ebx | ||
1593 | or edx, eax | ||
1594 | mov eax, DWORD PTR 4[esp] | ||
1595 | rol edi, 10 | ||
1596 | lea ecx, DWORD PTR 2053994217[edx*1+ecx] | ||
1597 | mov edx, -1 | ||
1598 | rol ecx, 8 | ||
1599 | add ecx, ebp | ||
1600 | ; 131 | ||
1601 | add ebp, eax | ||
1602 | mov eax, esi | ||
1603 | sub edx, ecx | ||
1604 | and eax, ecx | ||
1605 | and edx, edi | ||
1606 | or eax, edx | ||
1607 | mov edx, DWORD PTR 12[esp] | ||
1608 | rol esi, 10 | ||
1609 | lea ebp, DWORD PTR 2053994217[eax*1+ebp] | ||
1610 | mov eax, -1 | ||
1611 | rol ebp, 11 | ||
1612 | add ebp, ebx | ||
1613 | ; 132 | ||
1614 | add ebx, edx | ||
1615 | mov edx, ecx | ||
1616 | sub eax, ebp | ||
1617 | and edx, ebp | ||
1618 | and eax, esi | ||
1619 | or edx, eax | ||
1620 | mov eax, DWORD PTR 44[esp] | ||
1621 | rol ecx, 10 | ||
1622 | lea ebx, DWORD PTR 2053994217[edx*1+ebx] | ||
1623 | mov edx, -1 | ||
1624 | rol ebx, 14 | ||
1625 | add ebx, edi | ||
1626 | ; 133 | ||
1627 | add edi, eax | ||
1628 | mov eax, ebp | ||
1629 | sub edx, ebx | ||
1630 | and eax, ebx | ||
1631 | and edx, ecx | ||
1632 | or eax, edx | ||
1633 | mov edx, DWORD PTR 60[esp] | ||
1634 | rol ebp, 10 | ||
1635 | lea edi, DWORD PTR 2053994217[eax*1+edi] | ||
1636 | mov eax, -1 | ||
1637 | rol edi, 14 | ||
1638 | add edi, esi | ||
1639 | ; 134 | ||
1640 | add esi, edx | ||
1641 | mov edx, ebx | ||
1642 | sub eax, edi | ||
1643 | and edx, edi | ||
1644 | and eax, ebp | ||
1645 | or edx, eax | ||
1646 | mov eax, DWORD PTR [esp] | ||
1647 | rol ebx, 10 | ||
1648 | lea esi, DWORD PTR 2053994217[edx*1+esi] | ||
1649 | mov edx, -1 | ||
1650 | rol esi, 6 | ||
1651 | add esi, ecx | ||
1652 | ; 135 | ||
1653 | add ecx, eax | ||
1654 | mov eax, edi | ||
1655 | sub edx, esi | ||
1656 | and eax, esi | ||
1657 | and edx, ebx | ||
1658 | or eax, edx | ||
1659 | mov edx, DWORD PTR 20[esp] | ||
1660 | rol edi, 10 | ||
1661 | lea ecx, DWORD PTR 2053994217[eax*1+ecx] | ||
1662 | mov eax, -1 | ||
1663 | rol ecx, 14 | ||
1664 | add ecx, ebp | ||
1665 | ; 136 | ||
1666 | add ebp, edx | ||
1667 | mov edx, esi | ||
1668 | sub eax, ecx | ||
1669 | and edx, ecx | ||
1670 | and eax, edi | ||
1671 | or edx, eax | ||
1672 | mov eax, DWORD PTR 48[esp] | ||
1673 | rol esi, 10 | ||
1674 | lea ebp, DWORD PTR 2053994217[edx*1+ebp] | ||
1675 | mov edx, -1 | ||
1676 | rol ebp, 6 | ||
1677 | add ebp, ebx | ||
1678 | ; 137 | ||
1679 | add ebx, eax | ||
1680 | mov eax, ecx | ||
1681 | sub edx, ebp | ||
1682 | and eax, ebp | ||
1683 | and edx, esi | ||
1684 | or eax, edx | ||
1685 | mov edx, DWORD PTR 8[esp] | ||
1686 | rol ecx, 10 | ||
1687 | lea ebx, DWORD PTR 2053994217[eax*1+ebx] | ||
1688 | mov eax, -1 | ||
1689 | rol ebx, 9 | ||
1690 | add ebx, edi | ||
1691 | ; 138 | ||
1692 | add edi, edx | ||
1693 | mov edx, ebp | ||
1694 | sub eax, ebx | ||
1695 | and edx, ebx | ||
1696 | and eax, ecx | ||
1697 | or edx, eax | ||
1698 | mov eax, DWORD PTR 52[esp] | ||
1699 | rol ebp, 10 | ||
1700 | lea edi, DWORD PTR 2053994217[edx*1+edi] | ||
1701 | mov edx, -1 | ||
1702 | rol edi, 12 | ||
1703 | add edi, esi | ||
1704 | ; 139 | ||
1705 | add esi, eax | ||
1706 | mov eax, ebx | ||
1707 | sub edx, edi | ||
1708 | and eax, edi | ||
1709 | and edx, ebp | ||
1710 | or eax, edx | ||
1711 | mov edx, DWORD PTR 36[esp] | ||
1712 | rol ebx, 10 | ||
1713 | lea esi, DWORD PTR 2053994217[eax*1+esi] | ||
1714 | mov eax, -1 | ||
1715 | rol esi, 9 | ||
1716 | add esi, ecx | ||
1717 | ; 140 | ||
1718 | add ecx, edx | ||
1719 | mov edx, edi | ||
1720 | sub eax, esi | ||
1721 | and edx, esi | ||
1722 | and eax, ebx | ||
1723 | or edx, eax | ||
1724 | mov eax, DWORD PTR 28[esp] | ||
1725 | rol edi, 10 | ||
1726 | lea ecx, DWORD PTR 2053994217[edx*1+ecx] | ||
1727 | mov edx, -1 | ||
1728 | rol ecx, 12 | ||
1729 | add ecx, ebp | ||
1730 | ; 141 | ||
1731 | add ebp, eax | ||
1732 | mov eax, esi | ||
1733 | sub edx, ecx | ||
1734 | and eax, ecx | ||
1735 | and edx, edi | ||
1736 | or eax, edx | ||
1737 | mov edx, DWORD PTR 40[esp] | ||
1738 | rol esi, 10 | ||
1739 | lea ebp, DWORD PTR 2053994217[eax*1+ebp] | ||
1740 | mov eax, -1 | ||
1741 | rol ebp, 5 | ||
1742 | add ebp, ebx | ||
1743 | ; 142 | ||
1744 | add ebx, edx | ||
1745 | mov edx, ecx | ||
1746 | sub eax, ebp | ||
1747 | and edx, ebp | ||
1748 | and eax, esi | ||
1749 | or edx, eax | ||
1750 | mov eax, DWORD PTR 56[esp] | ||
1751 | rol ecx, 10 | ||
1752 | lea ebx, DWORD PTR 2053994217[edx*1+ebx] | ||
1753 | mov edx, -1 | ||
1754 | rol ebx, 15 | ||
1755 | add ebx, edi | ||
1756 | ; 143 | ||
1757 | add edi, eax | ||
1758 | mov eax, ebp | ||
1759 | sub edx, ebx | ||
1760 | and eax, ebx | ||
1761 | and edx, ecx | ||
1762 | or edx, eax | ||
1763 | mov eax, ebx | ||
1764 | rol ebp, 10 | ||
1765 | lea edi, DWORD PTR 2053994217[edx*1+edi] | ||
1766 | xor eax, ebp | ||
1767 | rol edi, 8 | ||
1768 | add edi, esi | ||
1769 | ; 144 | ||
1770 | mov edx, DWORD PTR 48[esp] | ||
1771 | xor eax, edi | ||
1772 | add esi, edx | ||
1773 | rol ebx, 10 | ||
1774 | add esi, eax | ||
1775 | mov eax, edi | ||
1776 | rol esi, 8 | ||
1777 | add esi, ecx | ||
1778 | ; 145 | ||
1779 | xor eax, ebx | ||
1780 | mov edx, DWORD PTR 60[esp] | ||
1781 | xor eax, esi | ||
1782 | add ecx, eax | ||
1783 | mov eax, esi | ||
1784 | rol edi, 10 | ||
1785 | add ecx, edx | ||
1786 | xor eax, edi | ||
1787 | rol ecx, 5 | ||
1788 | add ecx, ebp | ||
1789 | ; 146 | ||
1790 | mov edx, DWORD PTR 40[esp] | ||
1791 | xor eax, ecx | ||
1792 | add ebp, edx | ||
1793 | rol esi, 10 | ||
1794 | add ebp, eax | ||
1795 | mov eax, ecx | ||
1796 | rol ebp, 12 | ||
1797 | add ebp, ebx | ||
1798 | ; 147 | ||
1799 | xor eax, esi | ||
1800 | mov edx, DWORD PTR 16[esp] | ||
1801 | xor eax, ebp | ||
1802 | add ebx, eax | ||
1803 | mov eax, ebp | ||
1804 | rol ecx, 10 | ||
1805 | add ebx, edx | ||
1806 | xor eax, ecx | ||
1807 | rol ebx, 9 | ||
1808 | add ebx, edi | ||
1809 | ; 148 | ||
1810 | mov edx, DWORD PTR 4[esp] | ||
1811 | xor eax, ebx | ||
1812 | add edi, edx | ||
1813 | rol ebp, 10 | ||
1814 | add edi, eax | ||
1815 | mov eax, ebx | ||
1816 | rol edi, 12 | ||
1817 | add edi, esi | ||
1818 | ; 149 | ||
1819 | xor eax, ebp | ||
1820 | mov edx, DWORD PTR 20[esp] | ||
1821 | xor eax, edi | ||
1822 | add esi, eax | ||
1823 | mov eax, edi | ||
1824 | rol ebx, 10 | ||
1825 | add esi, edx | ||
1826 | xor eax, ebx | ||
1827 | rol esi, 5 | ||
1828 | add esi, ecx | ||
1829 | ; 150 | ||
1830 | mov edx, DWORD PTR 32[esp] | ||
1831 | xor eax, esi | ||
1832 | add ecx, edx | ||
1833 | rol edi, 10 | ||
1834 | add ecx, eax | ||
1835 | mov eax, esi | ||
1836 | rol ecx, 14 | ||
1837 | add ecx, ebp | ||
1838 | ; 151 | ||
1839 | xor eax, edi | ||
1840 | mov edx, DWORD PTR 28[esp] | ||
1841 | xor eax, ecx | ||
1842 | add ebp, eax | ||
1843 | mov eax, ecx | ||
1844 | rol esi, 10 | ||
1845 | add ebp, edx | ||
1846 | xor eax, esi | ||
1847 | rol ebp, 6 | ||
1848 | add ebp, ebx | ||
1849 | ; 152 | ||
1850 | mov edx, DWORD PTR 24[esp] | ||
1851 | xor eax, ebp | ||
1852 | add ebx, edx | ||
1853 | rol ecx, 10 | ||
1854 | add ebx, eax | ||
1855 | mov eax, ebp | ||
1856 | rol ebx, 8 | ||
1857 | add ebx, edi | ||
1858 | ; 153 | ||
1859 | xor eax, ecx | ||
1860 | mov edx, DWORD PTR 8[esp] | ||
1861 | xor eax, ebx | ||
1862 | add edi, eax | ||
1863 | mov eax, ebx | ||
1864 | rol ebp, 10 | ||
1865 | add edi, edx | ||
1866 | xor eax, ebp | ||
1867 | rol edi, 13 | ||
1868 | add edi, esi | ||
1869 | ; 154 | ||
1870 | mov edx, DWORD PTR 52[esp] | ||
1871 | xor eax, edi | ||
1872 | add esi, edx | ||
1873 | rol ebx, 10 | ||
1874 | add esi, eax | ||
1875 | mov eax, edi | ||
1876 | rol esi, 6 | ||
1877 | add esi, ecx | ||
1878 | ; 155 | ||
1879 | xor eax, ebx | ||
1880 | mov edx, DWORD PTR 56[esp] | ||
1881 | xor eax, esi | ||
1882 | add ecx, eax | ||
1883 | mov eax, esi | ||
1884 | rol edi, 10 | ||
1885 | add ecx, edx | ||
1886 | xor eax, edi | ||
1887 | rol ecx, 5 | ||
1888 | add ecx, ebp | ||
1889 | ; 156 | ||
1890 | mov edx, DWORD PTR [esp] | ||
1891 | xor eax, ecx | ||
1892 | add ebp, edx | ||
1893 | rol esi, 10 | ||
1894 | add ebp, eax | ||
1895 | mov eax, ecx | ||
1896 | rol ebp, 15 | ||
1897 | add ebp, ebx | ||
1898 | ; 157 | ||
1899 | xor eax, esi | ||
1900 | mov edx, DWORD PTR 12[esp] | ||
1901 | xor eax, ebp | ||
1902 | add ebx, eax | ||
1903 | mov eax, ebp | ||
1904 | rol ecx, 10 | ||
1905 | add ebx, edx | ||
1906 | xor eax, ecx | ||
1907 | rol ebx, 13 | ||
1908 | add ebx, edi | ||
1909 | ; 158 | ||
1910 | mov edx, DWORD PTR 36[esp] | ||
1911 | xor eax, ebx | ||
1912 | add edi, edx | ||
1913 | rol ebp, 10 | ||
1914 | add edi, eax | ||
1915 | mov eax, ebx | ||
1916 | rol edi, 11 | ||
1917 | add edi, esi | ||
1918 | ; 159 | ||
1919 | xor eax, ebp | ||
1920 | mov edx, DWORD PTR 44[esp] | ||
1921 | xor eax, edi | ||
1922 | add esi, eax | ||
1923 | rol ebx, 10 | ||
1924 | add esi, edx | ||
1925 | mov edx, DWORD PTR 128[esp] | ||
1926 | rol esi, 11 | ||
1927 | add esi, ecx | ||
1928 | mov eax, DWORD PTR 4[edx] | ||
1929 | add ebx, eax | ||
1930 | mov eax, DWORD PTR 72[esp] | ||
1931 | add ebx, eax | ||
1932 | mov eax, DWORD PTR 8[edx] | ||
1933 | add ebp, eax | ||
1934 | mov eax, DWORD PTR 76[esp] | ||
1935 | add ebp, eax | ||
1936 | mov eax, DWORD PTR 12[edx] | ||
1937 | add ecx, eax | ||
1938 | mov eax, DWORD PTR 80[esp] | ||
1939 | add ecx, eax | ||
1940 | mov eax, DWORD PTR 16[edx] | ||
1941 | add esi, eax | ||
1942 | mov eax, DWORD PTR 64[esp] | ||
1943 | add esi, eax | ||
1944 | mov eax, DWORD PTR [edx] | ||
1945 | add edi, eax | ||
1946 | mov eax, DWORD PTR 68[esp] | ||
1947 | add edi, eax | ||
1948 | mov eax, DWORD PTR 136[esp] | ||
1949 | mov DWORD PTR [edx],ebx | ||
1950 | mov DWORD PTR 4[edx],ebp | ||
1951 | mov DWORD PTR 8[edx],ecx | ||
1952 | sub eax, 1 | ||
1953 | mov DWORD PTR 12[edx],esi | ||
1954 | mov DWORD PTR 16[edx],edi | ||
1955 | jle $L001get_out | ||
1956 | mov DWORD PTR 136[esp],eax | ||
1957 | mov edi, ecx | ||
1958 | mov eax, DWORD PTR 132[esp] | ||
1959 | mov ecx, ebx | ||
1960 | add eax, 64 | ||
1961 | mov esi, ebp | ||
1962 | mov DWORD PTR 132[esp],eax | ||
1963 | jmp L000start | ||
1964 | $L001get_out: | ||
1965 | add esp, 108 | ||
1966 | pop ebx | ||
1967 | pop ebp | ||
1968 | pop edi | ||
1969 | pop esi | ||
1970 | ret | ||
1971 | _ripemd160_block_asm_host_order ENDP | ||
1972 | _TEXT ENDS | ||
1973 | END | ||
diff --git a/src/lib/libcrypto/ripemd/rmd_locl.h b/src/lib/libcrypto/ripemd/rmd_locl.h index 145cf316b9..f537b88867 100644 --- a/src/lib/libcrypto/ripemd/rmd_locl.h +++ b/src/lib/libcrypto/ripemd/rmd_locl.h | |||
@@ -106,11 +106,7 @@ void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,int num); | |||
106 | #define HASH_BLOCK_DATA_ORDER ripemd160_block_data_order | 106 | #define HASH_BLOCK_DATA_ORDER ripemd160_block_data_order |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | #ifndef FLAT_INC | ||
110 | #include "../md32_common.h" | ||
111 | #else | ||
112 | #include "md32_common.h" | 109 | #include "md32_common.h" |
113 | #endif | ||
114 | 110 | ||
115 | #if 0 | 111 | #if 0 |
116 | #define F1(x,y,z) ((x)^(y)^(z)) | 112 | #define F1(x,y,z) ((x)^(y)^(z)) |
diff --git a/src/lib/libcrypto/rsa/rsa_err.c b/src/lib/libcrypto/rsa/rsa_err.c index 5cfbea2b03..1cde7c0da4 100644 --- a/src/lib/libcrypto/rsa/rsa_err.c +++ b/src/lib/libcrypto/rsa/rsa_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/sha/Makefile.ssl b/src/lib/libcrypto/sha/Makefile.ssl index 79ef43aa34..72acd8f046 100644 --- a/src/lib/libcrypto/sha/Makefile.ssl +++ b/src/lib/libcrypto/sha/Makefile.ssl | |||
@@ -5,6 +5,7 @@ | |||
5 | DIR= sha | 5 | DIR= sha |
6 | TOP= ../.. | 6 | TOP= ../.. |
7 | CC= cc | 7 | CC= cc |
8 | CPP= $(CC) -E | ||
8 | INCLUDES= | 9 | INCLUDES= |
9 | CFLAG=-g | 10 | CFLAG=-g |
10 | INSTALL_PREFIX= | 11 | INSTALL_PREFIX= |
@@ -46,7 +47,7 @@ lib: $(LIBOBJ) | |||
46 | 47 | ||
47 | # elf | 48 | # elf |
48 | asm/sx86-elf.o: asm/sx86unix.cpp | 49 | asm/sx86-elf.o: asm/sx86unix.cpp |
49 | $(CPP) -DELF asm/sx86unix.cpp | as -o asm/sx86-elf.o | 50 | $(CPP) -DELF -x c asm/sx86unix.cpp | as -o asm/sx86-elf.o |
50 | 51 | ||
51 | # solaris | 52 | # solaris |
52 | asm/sx86-sol.o: asm/sx86unix.cpp | 53 | asm/sx86-sol.o: asm/sx86unix.cpp |
@@ -62,7 +63,7 @@ asm/sx86-out.o: asm/sx86unix.cpp | |||
62 | asm/sx86bsdi.o: asm/sx86unix.cpp | 63 | asm/sx86bsdi.o: asm/sx86unix.cpp |
63 | $(CPP) -DBSDI asm/sx86unix.cpp | sed 's/ :/:/' | as -o asm/sx86bsdi.o | 64 | $(CPP) -DBSDI asm/sx86unix.cpp | sed 's/ :/:/' | as -o asm/sx86bsdi.o |
64 | 65 | ||
65 | asm/sx86unix.cpp: | 66 | asm/sx86unix.cpp: asm/sha1-586.pl ../perlasm/x86asm.pl |
66 | (cd asm; $(PERL) sha1-586.pl cpp $(PROCESSOR) >sx86unix.cpp) | 67 | (cd asm; $(PERL) sha1-586.pl cpp $(PROCESSOR) >sx86unix.cpp) |
67 | 68 | ||
68 | files: | 69 | files: |
diff --git a/src/lib/libcrypto/sha/Makefile.uni b/src/lib/libcrypto/sha/Makefile.uni index b7ec5caa4e..e69de29bb2 100644 --- a/src/lib/libcrypto/sha/Makefile.uni +++ b/src/lib/libcrypto/sha/Makefile.uni | |||
@@ -1,122 +0,0 @@ | |||
1 | # Targets | ||
2 | # make - twidle the options yourself :-) | ||
3 | # make cc - standard cc options | ||
4 | # make gcc - standard gcc options | ||
5 | # make x86-elf - linux-elf etc | ||
6 | # make x86-out - linux-a.out, FreeBSD etc | ||
7 | # make x86-solaris | ||
8 | # make x86-bdsi | ||
9 | |||
10 | DIR= sha | ||
11 | TOP= . | ||
12 | CC= gcc | ||
13 | CFLAG= -O3 -fomit-frame-pointer | ||
14 | |||
15 | CPP= $(CC) -E | ||
16 | INCLUDES= | ||
17 | INSTALLTOP=/usr/local/lib | ||
18 | MAKE= make | ||
19 | MAKEDEPEND= makedepend | ||
20 | MAKEFILE= Makefile.uni | ||
21 | AR= ar r | ||
22 | |||
23 | SHA_ASM_OBJ= | ||
24 | |||
25 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
26 | |||
27 | GENERAL=Makefile | ||
28 | |||
29 | TEST1=shatest | ||
30 | TEST2=sha1test | ||
31 | APP1=sha | ||
32 | APP2=sha1 | ||
33 | |||
34 | TEST=$(TEST1) $(TEST2) | ||
35 | APPS=$(APP1) $(APP2) | ||
36 | |||
37 | LIB=libsha.a | ||
38 | LIBSRC=sha_dgst.c sha1dgst.c sha_one.c sha1_one.c | ||
39 | LIBOBJ=sha_dgst.o sha1dgst.o sha_one.o sha1_one.o $(SHA_ASM_OBJ) | ||
40 | |||
41 | SRC= $(LIBSRC) | ||
42 | |||
43 | EXHEADER= sha.h | ||
44 | HEADER= sha_locl.h $(EXHEADER) | ||
45 | |||
46 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
47 | |||
48 | all: $(LIB) $(TEST) $(APPS) | ||
49 | |||
50 | $(LIB): $(LIBOBJ) | ||
51 | $(AR) $(LIB) $(LIBOBJ) | ||
52 | $(RANLIB) $(LIB) | ||
53 | |||
54 | # elf | ||
55 | asm/sx86-elf.o: asm/sx86unix.cpp | ||
56 | $(CPP) -DELF asm/sx86unix.cpp | as -o asm/sx86-elf.o | ||
57 | |||
58 | # solaris | ||
59 | asm/sx86-sol.o: asm/sx86unix.cpp | ||
60 | $(CC) -E -DSOL asm/sx86unix.cpp | sed 's/^#.*//' > asm/sx86-sol.s | ||
61 | as -o asm/sx86-sol.o asm/sx86-sol.s | ||
62 | rm -f asm/sx86-sol.s | ||
63 | |||
64 | # a.out | ||
65 | asm/sx86-out.o: asm/sx86unix.cpp | ||
66 | $(CPP) -DOUT asm/sx86unix.cpp | as -o asm/sx86-out.o | ||
67 | |||
68 | # bsdi | ||
69 | asm/sx86bsdi.o: asm/sx86unix.cpp | ||
70 | $(CPP) -DBSDI asm/sx86unix.cpp | as -o asm/sx86bsdi.o | ||
71 | |||
72 | asm/sx86unix.cpp: | ||
73 | (cd asm; perl sha1-586.pl cpp >sx86unix.cpp) | ||
74 | |||
75 | test: $(TEST) | ||
76 | ./$(TEST1) | ||
77 | ./$(TEST2) | ||
78 | |||
79 | $(TEST1): $(TEST1).c $(LIB) | ||
80 | $(CC) -o $(TEST1) $(CFLAGS) $(TEST1).c $(LIB) | ||
81 | |||
82 | $(TEST2): $(TEST2).c $(LIB) | ||
83 | $(CC) -o $(TEST2) $(CFLAGS) $(TEST2).c $(LIB) | ||
84 | |||
85 | $(APP1): $(APP1).c $(LIB) | ||
86 | $(CC) -o $(APP1) $(CFLAGS) $(APP1).c $(LIB) | ||
87 | |||
88 | $(APP2): $(APP2).c $(LIB) | ||
89 | $(CC) -o $(APP2) $(CFLAGS) $(APP2).c $(LIB) | ||
90 | |||
91 | lint: | ||
92 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
93 | |||
94 | depend: | ||
95 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
96 | |||
97 | dclean: | ||
98 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
99 | mv -f Makefile.new $(MAKEFILE) | ||
100 | |||
101 | clean: | ||
102 | /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
103 | |||
104 | cc: | ||
105 | $(MAKE) SHA_ASM_OBJ="" CC="cc" CFLAG="-O" all | ||
106 | |||
107 | gcc: | ||
108 | $(MAKE) SHA_ASM_OBJ="" CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all | ||
109 | |||
110 | x86-elf: | ||
111 | $(MAKE) SHA_ASM_OBJ="asm/sx86-elf.o" CFLAG="-DELF -DSHA1_ASM -DL_ENDIAN $(CFLAGS)" all | ||
112 | |||
113 | x86-out: | ||
114 | $(MAKE) SHA_ASM_OBJ="asm/sx86-out.o" CFLAG="-DOUT -DSHA1_ASM -DL_ENDIAN $(CFLAGS)" all | ||
115 | |||
116 | x86-solaris: | ||
117 | $(MAKE) SHA_ASM_OBJ="asm/sx86-sol.o" CFLAG="-DSOL -DSHA1_ASM -DL_ENDIAN $(CFLAGS)" all | ||
118 | |||
119 | x86-bdsi: | ||
120 | $(MAKE) SHA_ASM_OBJ="asm/sx86-bdsi.o" CFLAG="-DBDSI -DSHA1_ASM -DL_ENDIAN $(CFLAGS)" all | ||
121 | |||
122 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
diff --git a/src/lib/libcrypto/sha/asm/s1-win32.asm b/src/lib/libcrypto/sha/asm/s1-win32.asm index 699afdb022..e69de29bb2 100644 --- a/src/lib/libcrypto/sha/asm/s1-win32.asm +++ b/src/lib/libcrypto/sha/asm/s1-win32.asm | |||
@@ -1,1716 +0,0 @@ | |||
1 | ; Don't even think of reading this code | ||
2 | ; It was automatically generated by sha1-586.pl | ||
3 | ; Which is a perl program used to generate the x86 assember for | ||
4 | ; any of elf, a.out, BSDI,Win32, or Solaris | ||
5 | ; eric <eay@cryptsoft.com> | ||
6 | ; | ||
7 | TITLE sha1-586.asm | ||
8 | .486 | ||
9 | .model FLAT | ||
10 | _TEXT SEGMENT | ||
11 | PUBLIC _sha1_block_asm_data_order | ||
12 | |||
13 | _sha1_block_asm_data_order PROC NEAR | ||
14 | mov ecx, DWORD PTR 12[esp] | ||
15 | push esi | ||
16 | shl ecx, 6 | ||
17 | mov esi, DWORD PTR 12[esp] | ||
18 | push ebp | ||
19 | add ecx, esi | ||
20 | push ebx | ||
21 | mov ebp, DWORD PTR 16[esp] | ||
22 | push edi | ||
23 | mov edx, DWORD PTR 12[ebp] | ||
24 | sub esp, 108 | ||
25 | mov edi, DWORD PTR 16[ebp] | ||
26 | mov ebx, DWORD PTR 8[ebp] | ||
27 | mov DWORD PTR 68[esp],ecx | ||
28 | ; First we need to setup the X array | ||
29 | L000start: | ||
30 | ; First, load the words onto the stack in network byte order | ||
31 | mov eax, DWORD PTR [esi] | ||
32 | mov ecx, DWORD PTR 4[esi] | ||
33 | bswap eax | ||
34 | bswap ecx | ||
35 | mov DWORD PTR [esp],eax | ||
36 | mov DWORD PTR 4[esp],ecx | ||
37 | mov eax, DWORD PTR 8[esi] | ||
38 | mov ecx, DWORD PTR 12[esi] | ||
39 | bswap eax | ||
40 | bswap ecx | ||
41 | mov DWORD PTR 8[esp],eax | ||
42 | mov DWORD PTR 12[esp],ecx | ||
43 | mov eax, DWORD PTR 16[esi] | ||
44 | mov ecx, DWORD PTR 20[esi] | ||
45 | bswap eax | ||
46 | bswap ecx | ||
47 | mov DWORD PTR 16[esp],eax | ||
48 | mov DWORD PTR 20[esp],ecx | ||
49 | mov eax, DWORD PTR 24[esi] | ||
50 | mov ecx, DWORD PTR 28[esi] | ||
51 | bswap eax | ||
52 | bswap ecx | ||
53 | mov DWORD PTR 24[esp],eax | ||
54 | mov DWORD PTR 28[esp],ecx | ||
55 | mov eax, DWORD PTR 32[esi] | ||
56 | mov ecx, DWORD PTR 36[esi] | ||
57 | bswap eax | ||
58 | bswap ecx | ||
59 | mov DWORD PTR 32[esp],eax | ||
60 | mov DWORD PTR 36[esp],ecx | ||
61 | mov eax, DWORD PTR 40[esi] | ||
62 | mov ecx, DWORD PTR 44[esi] | ||
63 | bswap eax | ||
64 | bswap ecx | ||
65 | mov DWORD PTR 40[esp],eax | ||
66 | mov DWORD PTR 44[esp],ecx | ||
67 | mov eax, DWORD PTR 48[esi] | ||
68 | mov ecx, DWORD PTR 52[esi] | ||
69 | bswap eax | ||
70 | bswap ecx | ||
71 | mov DWORD PTR 48[esp],eax | ||
72 | mov DWORD PTR 52[esp],ecx | ||
73 | mov eax, DWORD PTR 56[esi] | ||
74 | mov ecx, DWORD PTR 60[esi] | ||
75 | bswap eax | ||
76 | bswap ecx | ||
77 | mov DWORD PTR 56[esp],eax | ||
78 | mov DWORD PTR 60[esp],ecx | ||
79 | ; We now have the X array on the stack | ||
80 | ; starting at sp-4 | ||
81 | mov DWORD PTR 132[esp],esi | ||
82 | L001shortcut: | ||
83 | ; | ||
84 | ; Start processing | ||
85 | mov eax, DWORD PTR [ebp] | ||
86 | mov ecx, DWORD PTR 4[ebp] | ||
87 | ; 00_15 0 | ||
88 | mov esi, ebx | ||
89 | mov ebp, eax | ||
90 | xor esi, edx | ||
91 | rol ebp, 5 | ||
92 | and esi, ecx | ||
93 | add ebp, edi | ||
94 | ror ecx, 1 | ||
95 | mov edi, DWORD PTR [esp] | ||
96 | ror ecx, 1 | ||
97 | xor esi, edx | ||
98 | lea ebp, DWORD PTR 1518500249[edi*1+ebp] | ||
99 | mov edi, ecx | ||
100 | add esi, ebp | ||
101 | xor edi, ebx | ||
102 | mov ebp, esi | ||
103 | and edi, eax | ||
104 | rol ebp, 5 | ||
105 | add ebp, edx | ||
106 | mov edx, DWORD PTR 4[esp] | ||
107 | ror eax, 1 | ||
108 | xor edi, ebx | ||
109 | ror eax, 1 | ||
110 | lea ebp, DWORD PTR 1518500249[edx*1+ebp] | ||
111 | add edi, ebp | ||
112 | ; 00_15 2 | ||
113 | mov edx, eax | ||
114 | mov ebp, edi | ||
115 | xor edx, ecx | ||
116 | rol ebp, 5 | ||
117 | and edx, esi | ||
118 | add ebp, ebx | ||
119 | ror esi, 1 | ||
120 | mov ebx, DWORD PTR 8[esp] | ||
121 | ror esi, 1 | ||
122 | xor edx, ecx | ||
123 | lea ebp, DWORD PTR 1518500249[ebx*1+ebp] | ||
124 | mov ebx, esi | ||
125 | add edx, ebp | ||
126 | xor ebx, eax | ||
127 | mov ebp, edx | ||
128 | and ebx, edi | ||
129 | rol ebp, 5 | ||
130 | add ebp, ecx | ||
131 | mov ecx, DWORD PTR 12[esp] | ||
132 | ror edi, 1 | ||
133 | xor ebx, eax | ||
134 | ror edi, 1 | ||
135 | lea ebp, DWORD PTR 1518500249[ecx*1+ebp] | ||
136 | add ebx, ebp | ||
137 | ; 00_15 4 | ||
138 | mov ecx, edi | ||
139 | mov ebp, ebx | ||
140 | xor ecx, esi | ||
141 | rol ebp, 5 | ||
142 | and ecx, edx | ||
143 | add ebp, eax | ||
144 | ror edx, 1 | ||
145 | mov eax, DWORD PTR 16[esp] | ||
146 | ror edx, 1 | ||
147 | xor ecx, esi | ||
148 | lea ebp, DWORD PTR 1518500249[eax*1+ebp] | ||
149 | mov eax, edx | ||
150 | add ecx, ebp | ||
151 | xor eax, edi | ||
152 | mov ebp, ecx | ||
153 | and eax, ebx | ||
154 | rol ebp, 5 | ||
155 | add ebp, esi | ||
156 | mov esi, DWORD PTR 20[esp] | ||
157 | ror ebx, 1 | ||
158 | xor eax, edi | ||
159 | ror ebx, 1 | ||
160 | lea ebp, DWORD PTR 1518500249[esi*1+ebp] | ||
161 | add eax, ebp | ||
162 | ; 00_15 6 | ||
163 | mov esi, ebx | ||
164 | mov ebp, eax | ||
165 | xor esi, edx | ||
166 | rol ebp, 5 | ||
167 | and esi, ecx | ||
168 | add ebp, edi | ||
169 | ror ecx, 1 | ||
170 | mov edi, DWORD PTR 24[esp] | ||
171 | ror ecx, 1 | ||
172 | xor esi, edx | ||
173 | lea ebp, DWORD PTR 1518500249[edi*1+ebp] | ||
174 | mov edi, ecx | ||
175 | add esi, ebp | ||
176 | xor edi, ebx | ||
177 | mov ebp, esi | ||
178 | and edi, eax | ||
179 | rol ebp, 5 | ||
180 | add ebp, edx | ||
181 | mov edx, DWORD PTR 28[esp] | ||
182 | ror eax, 1 | ||
183 | xor edi, ebx | ||
184 | ror eax, 1 | ||
185 | lea ebp, DWORD PTR 1518500249[edx*1+ebp] | ||
186 | add edi, ebp | ||
187 | ; 00_15 8 | ||
188 | mov edx, eax | ||
189 | mov ebp, edi | ||
190 | xor edx, ecx | ||
191 | rol ebp, 5 | ||
192 | and edx, esi | ||
193 | add ebp, ebx | ||
194 | ror esi, 1 | ||
195 | mov ebx, DWORD PTR 32[esp] | ||
196 | ror esi, 1 | ||
197 | xor edx, ecx | ||
198 | lea ebp, DWORD PTR 1518500249[ebx*1+ebp] | ||
199 | mov ebx, esi | ||
200 | add edx, ebp | ||
201 | xor ebx, eax | ||
202 | mov ebp, edx | ||
203 | and ebx, edi | ||
204 | rol ebp, 5 | ||
205 | add ebp, ecx | ||
206 | mov ecx, DWORD PTR 36[esp] | ||
207 | ror edi, 1 | ||
208 | xor ebx, eax | ||
209 | ror edi, 1 | ||
210 | lea ebp, DWORD PTR 1518500249[ecx*1+ebp] | ||
211 | add ebx, ebp | ||
212 | ; 00_15 10 | ||
213 | mov ecx, edi | ||
214 | mov ebp, ebx | ||
215 | xor ecx, esi | ||
216 | rol ebp, 5 | ||
217 | and ecx, edx | ||
218 | add ebp, eax | ||
219 | ror edx, 1 | ||
220 | mov eax, DWORD PTR 40[esp] | ||
221 | ror edx, 1 | ||
222 | xor ecx, esi | ||
223 | lea ebp, DWORD PTR 1518500249[eax*1+ebp] | ||
224 | mov eax, edx | ||
225 | add ecx, ebp | ||
226 | xor eax, edi | ||
227 | mov ebp, ecx | ||
228 | and eax, ebx | ||
229 | rol ebp, 5 | ||
230 | add ebp, esi | ||
231 | mov esi, DWORD PTR 44[esp] | ||
232 | ror ebx, 1 | ||
233 | xor eax, edi | ||
234 | ror ebx, 1 | ||
235 | lea ebp, DWORD PTR 1518500249[esi*1+ebp] | ||
236 | add eax, ebp | ||
237 | ; 00_15 12 | ||
238 | mov esi, ebx | ||
239 | mov ebp, eax | ||
240 | xor esi, edx | ||
241 | rol ebp, 5 | ||
242 | and esi, ecx | ||
243 | add ebp, edi | ||
244 | ror ecx, 1 | ||
245 | mov edi, DWORD PTR 48[esp] | ||
246 | ror ecx, 1 | ||
247 | xor esi, edx | ||
248 | lea ebp, DWORD PTR 1518500249[edi*1+ebp] | ||
249 | mov edi, ecx | ||
250 | add esi, ebp | ||
251 | xor edi, ebx | ||
252 | mov ebp, esi | ||
253 | and edi, eax | ||
254 | rol ebp, 5 | ||
255 | add ebp, edx | ||
256 | mov edx, DWORD PTR 52[esp] | ||
257 | ror eax, 1 | ||
258 | xor edi, ebx | ||
259 | ror eax, 1 | ||
260 | lea ebp, DWORD PTR 1518500249[edx*1+ebp] | ||
261 | add edi, ebp | ||
262 | ; 00_15 14 | ||
263 | mov edx, eax | ||
264 | mov ebp, edi | ||
265 | xor edx, ecx | ||
266 | rol ebp, 5 | ||
267 | and edx, esi | ||
268 | add ebp, ebx | ||
269 | ror esi, 1 | ||
270 | mov ebx, DWORD PTR 56[esp] | ||
271 | ror esi, 1 | ||
272 | xor edx, ecx | ||
273 | lea ebp, DWORD PTR 1518500249[ebx*1+ebp] | ||
274 | mov ebx, esi | ||
275 | add edx, ebp | ||
276 | xor ebx, eax | ||
277 | mov ebp, edx | ||
278 | and ebx, edi | ||
279 | rol ebp, 5 | ||
280 | add ebp, ecx | ||
281 | mov ecx, DWORD PTR 60[esp] | ||
282 | ror edi, 1 | ||
283 | xor ebx, eax | ||
284 | ror edi, 1 | ||
285 | lea ebp, DWORD PTR 1518500249[ecx*1+ebp] | ||
286 | add ebx, ebp | ||
287 | ; 16_19 16 | ||
288 | nop | ||
289 | mov ebp, DWORD PTR [esp] | ||
290 | mov ecx, DWORD PTR 8[esp] | ||
291 | xor ecx, ebp | ||
292 | mov ebp, DWORD PTR 32[esp] | ||
293 | xor ecx, ebp | ||
294 | mov ebp, DWORD PTR 52[esp] | ||
295 | xor ecx, ebp | ||
296 | mov ebp, edi | ||
297 | rol ecx, 1 | ||
298 | xor ebp, esi | ||
299 | mov DWORD PTR [esp],ecx | ||
300 | and ebp, edx | ||
301 | lea ecx, DWORD PTR 1518500249[eax*1+ecx] | ||
302 | xor ebp, esi | ||
303 | mov eax, ebx | ||
304 | add ecx, ebp | ||
305 | rol eax, 5 | ||
306 | ror edx, 1 | ||
307 | add ecx, eax | ||
308 | mov eax, DWORD PTR 4[esp] | ||
309 | mov ebp, DWORD PTR 12[esp] | ||
310 | xor eax, ebp | ||
311 | mov ebp, DWORD PTR 36[esp] | ||
312 | xor eax, ebp | ||
313 | mov ebp, DWORD PTR 56[esp] | ||
314 | ror edx, 1 | ||
315 | xor eax, ebp | ||
316 | rol eax, 1 | ||
317 | mov ebp, edx | ||
318 | xor ebp, edi | ||
319 | mov DWORD PTR 4[esp],eax | ||
320 | and ebp, ebx | ||
321 | lea eax, DWORD PTR 1518500249[esi*1+eax] | ||
322 | xor ebp, edi | ||
323 | mov esi, ecx | ||
324 | rol esi, 5 | ||
325 | ror ebx, 1 | ||
326 | add eax, esi | ||
327 | ror ebx, 1 | ||
328 | add eax, ebp | ||
329 | ; 16_19 18 | ||
330 | mov ebp, DWORD PTR 8[esp] | ||
331 | mov esi, DWORD PTR 16[esp] | ||
332 | xor esi, ebp | ||
333 | mov ebp, DWORD PTR 40[esp] | ||
334 | xor esi, ebp | ||
335 | mov ebp, DWORD PTR 60[esp] | ||
336 | xor esi, ebp | ||
337 | mov ebp, ebx | ||
338 | rol esi, 1 | ||
339 | xor ebp, edx | ||
340 | mov DWORD PTR 8[esp],esi | ||
341 | and ebp, ecx | ||
342 | lea esi, DWORD PTR 1518500249[edi*1+esi] | ||
343 | xor ebp, edx | ||
344 | mov edi, eax | ||
345 | add esi, ebp | ||
346 | rol edi, 5 | ||
347 | ror ecx, 1 | ||
348 | add esi, edi | ||
349 | mov edi, DWORD PTR 12[esp] | ||
350 | mov ebp, DWORD PTR 20[esp] | ||
351 | xor edi, ebp | ||
352 | mov ebp, DWORD PTR 44[esp] | ||
353 | xor edi, ebp | ||
354 | mov ebp, DWORD PTR [esp] | ||
355 | ror ecx, 1 | ||
356 | xor edi, ebp | ||
357 | rol edi, 1 | ||
358 | mov ebp, ecx | ||
359 | xor ebp, ebx | ||
360 | mov DWORD PTR 12[esp],edi | ||
361 | and ebp, eax | ||
362 | lea edi, DWORD PTR 1518500249[edx*1+edi] | ||
363 | xor ebp, ebx | ||
364 | mov edx, esi | ||
365 | rol edx, 5 | ||
366 | ror eax, 1 | ||
367 | add edi, edx | ||
368 | ror eax, 1 | ||
369 | add edi, ebp | ||
370 | ; 20_39 20 | ||
371 | mov edx, DWORD PTR 16[esp] | ||
372 | mov ebp, DWORD PTR 24[esp] | ||
373 | xor edx, ebp | ||
374 | mov ebp, DWORD PTR 48[esp] | ||
375 | xor edx, ebp | ||
376 | mov ebp, DWORD PTR 4[esp] | ||
377 | xor edx, ebp | ||
378 | mov ebp, esi | ||
379 | rol edx, 1 | ||
380 | xor ebp, eax | ||
381 | mov DWORD PTR 16[esp],edx | ||
382 | xor ebp, ecx | ||
383 | lea edx, DWORD PTR 1859775393[ebx*1+edx] | ||
384 | mov ebx, edi | ||
385 | rol ebx, 5 | ||
386 | ror esi, 1 | ||
387 | add ebx, ebp | ||
388 | ror esi, 1 | ||
389 | add edx, ebx | ||
390 | ; 20_39 21 | ||
391 | mov ebx, DWORD PTR 20[esp] | ||
392 | mov ebp, DWORD PTR 28[esp] | ||
393 | xor ebx, ebp | ||
394 | mov ebp, DWORD PTR 52[esp] | ||
395 | xor ebx, ebp | ||
396 | mov ebp, DWORD PTR 8[esp] | ||
397 | xor ebx, ebp | ||
398 | mov ebp, edi | ||
399 | rol ebx, 1 | ||
400 | xor ebp, esi | ||
401 | mov DWORD PTR 20[esp],ebx | ||
402 | xor ebp, eax | ||
403 | lea ebx, DWORD PTR 1859775393[ecx*1+ebx] | ||
404 | mov ecx, edx | ||
405 | rol ecx, 5 | ||
406 | ror edi, 1 | ||
407 | add ecx, ebp | ||
408 | ror edi, 1 | ||
409 | add ebx, ecx | ||
410 | ; 20_39 22 | ||
411 | mov ecx, DWORD PTR 24[esp] | ||
412 | mov ebp, DWORD PTR 32[esp] | ||
413 | xor ecx, ebp | ||
414 | mov ebp, DWORD PTR 56[esp] | ||
415 | xor ecx, ebp | ||
416 | mov ebp, DWORD PTR 12[esp] | ||
417 | xor ecx, ebp | ||
418 | mov ebp, edx | ||
419 | rol ecx, 1 | ||
420 | xor ebp, edi | ||
421 | mov DWORD PTR 24[esp],ecx | ||
422 | xor ebp, esi | ||
423 | lea ecx, DWORD PTR 1859775393[eax*1+ecx] | ||
424 | mov eax, ebx | ||
425 | rol eax, 5 | ||
426 | ror edx, 1 | ||
427 | add eax, ebp | ||
428 | ror edx, 1 | ||
429 | add ecx, eax | ||
430 | ; 20_39 23 | ||
431 | mov eax, DWORD PTR 28[esp] | ||
432 | mov ebp, DWORD PTR 36[esp] | ||
433 | xor eax, ebp | ||
434 | mov ebp, DWORD PTR 60[esp] | ||
435 | xor eax, ebp | ||
436 | mov ebp, DWORD PTR 16[esp] | ||
437 | xor eax, ebp | ||
438 | mov ebp, ebx | ||
439 | rol eax, 1 | ||
440 | xor ebp, edx | ||
441 | mov DWORD PTR 28[esp],eax | ||
442 | xor ebp, edi | ||
443 | lea eax, DWORD PTR 1859775393[esi*1+eax] | ||
444 | mov esi, ecx | ||
445 | rol esi, 5 | ||
446 | ror ebx, 1 | ||
447 | add esi, ebp | ||
448 | ror ebx, 1 | ||
449 | add eax, esi | ||
450 | ; 20_39 24 | ||
451 | mov esi, DWORD PTR 32[esp] | ||
452 | mov ebp, DWORD PTR 40[esp] | ||
453 | xor esi, ebp | ||
454 | mov ebp, DWORD PTR [esp] | ||
455 | xor esi, ebp | ||
456 | mov ebp, DWORD PTR 20[esp] | ||
457 | xor esi, ebp | ||
458 | mov ebp, ecx | ||
459 | rol esi, 1 | ||
460 | xor ebp, ebx | ||
461 | mov DWORD PTR 32[esp],esi | ||
462 | xor ebp, edx | ||
463 | lea esi, DWORD PTR 1859775393[edi*1+esi] | ||
464 | mov edi, eax | ||
465 | rol edi, 5 | ||
466 | ror ecx, 1 | ||
467 | add edi, ebp | ||
468 | ror ecx, 1 | ||
469 | add esi, edi | ||
470 | ; 20_39 25 | ||
471 | mov edi, DWORD PTR 36[esp] | ||
472 | mov ebp, DWORD PTR 44[esp] | ||
473 | xor edi, ebp | ||
474 | mov ebp, DWORD PTR 4[esp] | ||
475 | xor edi, ebp | ||
476 | mov ebp, DWORD PTR 24[esp] | ||
477 | xor edi, ebp | ||
478 | mov ebp, eax | ||
479 | rol edi, 1 | ||
480 | xor ebp, ecx | ||
481 | mov DWORD PTR 36[esp],edi | ||
482 | xor ebp, ebx | ||
483 | lea edi, DWORD PTR 1859775393[edx*1+edi] | ||
484 | mov edx, esi | ||
485 | rol edx, 5 | ||
486 | ror eax, 1 | ||
487 | add edx, ebp | ||
488 | ror eax, 1 | ||
489 | add edi, edx | ||
490 | ; 20_39 26 | ||
491 | mov edx, DWORD PTR 40[esp] | ||
492 | mov ebp, DWORD PTR 48[esp] | ||
493 | xor edx, ebp | ||
494 | mov ebp, DWORD PTR 8[esp] | ||
495 | xor edx, ebp | ||
496 | mov ebp, DWORD PTR 28[esp] | ||
497 | xor edx, ebp | ||
498 | mov ebp, esi | ||
499 | rol edx, 1 | ||
500 | xor ebp, eax | ||
501 | mov DWORD PTR 40[esp],edx | ||
502 | xor ebp, ecx | ||
503 | lea edx, DWORD PTR 1859775393[ebx*1+edx] | ||
504 | mov ebx, edi | ||
505 | rol ebx, 5 | ||
506 | ror esi, 1 | ||
507 | add ebx, ebp | ||
508 | ror esi, 1 | ||
509 | add edx, ebx | ||
510 | ; 20_39 27 | ||
511 | mov ebx, DWORD PTR 44[esp] | ||
512 | mov ebp, DWORD PTR 52[esp] | ||
513 | xor ebx, ebp | ||
514 | mov ebp, DWORD PTR 12[esp] | ||
515 | xor ebx, ebp | ||
516 | mov ebp, DWORD PTR 32[esp] | ||
517 | xor ebx, ebp | ||
518 | mov ebp, edi | ||
519 | rol ebx, 1 | ||
520 | xor ebp, esi | ||
521 | mov DWORD PTR 44[esp],ebx | ||
522 | xor ebp, eax | ||
523 | lea ebx, DWORD PTR 1859775393[ecx*1+ebx] | ||
524 | mov ecx, edx | ||
525 | rol ecx, 5 | ||
526 | ror edi, 1 | ||
527 | add ecx, ebp | ||
528 | ror edi, 1 | ||
529 | add ebx, ecx | ||
530 | ; 20_39 28 | ||
531 | mov ecx, DWORD PTR 48[esp] | ||
532 | mov ebp, DWORD PTR 56[esp] | ||
533 | xor ecx, ebp | ||
534 | mov ebp, DWORD PTR 16[esp] | ||
535 | xor ecx, ebp | ||
536 | mov ebp, DWORD PTR 36[esp] | ||
537 | xor ecx, ebp | ||
538 | mov ebp, edx | ||
539 | rol ecx, 1 | ||
540 | xor ebp, edi | ||
541 | mov DWORD PTR 48[esp],ecx | ||
542 | xor ebp, esi | ||
543 | lea ecx, DWORD PTR 1859775393[eax*1+ecx] | ||
544 | mov eax, ebx | ||
545 | rol eax, 5 | ||
546 | ror edx, 1 | ||
547 | add eax, ebp | ||
548 | ror edx, 1 | ||
549 | add ecx, eax | ||
550 | ; 20_39 29 | ||
551 | mov eax, DWORD PTR 52[esp] | ||
552 | mov ebp, DWORD PTR 60[esp] | ||
553 | xor eax, ebp | ||
554 | mov ebp, DWORD PTR 20[esp] | ||
555 | xor eax, ebp | ||
556 | mov ebp, DWORD PTR 40[esp] | ||
557 | xor eax, ebp | ||
558 | mov ebp, ebx | ||
559 | rol eax, 1 | ||
560 | xor ebp, edx | ||
561 | mov DWORD PTR 52[esp],eax | ||
562 | xor ebp, edi | ||
563 | lea eax, DWORD PTR 1859775393[esi*1+eax] | ||
564 | mov esi, ecx | ||
565 | rol esi, 5 | ||
566 | ror ebx, 1 | ||
567 | add esi, ebp | ||
568 | ror ebx, 1 | ||
569 | add eax, esi | ||
570 | ; 20_39 30 | ||
571 | mov esi, DWORD PTR 56[esp] | ||
572 | mov ebp, DWORD PTR [esp] | ||
573 | xor esi, ebp | ||
574 | mov ebp, DWORD PTR 24[esp] | ||
575 | xor esi, ebp | ||
576 | mov ebp, DWORD PTR 44[esp] | ||
577 | xor esi, ebp | ||
578 | mov ebp, ecx | ||
579 | rol esi, 1 | ||
580 | xor ebp, ebx | ||
581 | mov DWORD PTR 56[esp],esi | ||
582 | xor ebp, edx | ||
583 | lea esi, DWORD PTR 1859775393[edi*1+esi] | ||
584 | mov edi, eax | ||
585 | rol edi, 5 | ||
586 | ror ecx, 1 | ||
587 | add edi, ebp | ||
588 | ror ecx, 1 | ||
589 | add esi, edi | ||
590 | ; 20_39 31 | ||
591 | mov edi, DWORD PTR 60[esp] | ||
592 | mov ebp, DWORD PTR 4[esp] | ||
593 | xor edi, ebp | ||
594 | mov ebp, DWORD PTR 28[esp] | ||
595 | xor edi, ebp | ||
596 | mov ebp, DWORD PTR 48[esp] | ||
597 | xor edi, ebp | ||
598 | mov ebp, eax | ||
599 | rol edi, 1 | ||
600 | xor ebp, ecx | ||
601 | mov DWORD PTR 60[esp],edi | ||
602 | xor ebp, ebx | ||
603 | lea edi, DWORD PTR 1859775393[edx*1+edi] | ||
604 | mov edx, esi | ||
605 | rol edx, 5 | ||
606 | ror eax, 1 | ||
607 | add edx, ebp | ||
608 | ror eax, 1 | ||
609 | add edi, edx | ||
610 | ; 20_39 32 | ||
611 | mov edx, DWORD PTR [esp] | ||
612 | mov ebp, DWORD PTR 8[esp] | ||
613 | xor edx, ebp | ||
614 | mov ebp, DWORD PTR 32[esp] | ||
615 | xor edx, ebp | ||
616 | mov ebp, DWORD PTR 52[esp] | ||
617 | xor edx, ebp | ||
618 | mov ebp, esi | ||
619 | rol edx, 1 | ||
620 | xor ebp, eax | ||
621 | mov DWORD PTR [esp],edx | ||
622 | xor ebp, ecx | ||
623 | lea edx, DWORD PTR 1859775393[ebx*1+edx] | ||
624 | mov ebx, edi | ||
625 | rol ebx, 5 | ||
626 | ror esi, 1 | ||
627 | add ebx, ebp | ||
628 | ror esi, 1 | ||
629 | add edx, ebx | ||
630 | ; 20_39 33 | ||
631 | mov ebx, DWORD PTR 4[esp] | ||
632 | mov ebp, DWORD PTR 12[esp] | ||
633 | xor ebx, ebp | ||
634 | mov ebp, DWORD PTR 36[esp] | ||
635 | xor ebx, ebp | ||
636 | mov ebp, DWORD PTR 56[esp] | ||
637 | xor ebx, ebp | ||
638 | mov ebp, edi | ||
639 | rol ebx, 1 | ||
640 | xor ebp, esi | ||
641 | mov DWORD PTR 4[esp],ebx | ||
642 | xor ebp, eax | ||
643 | lea ebx, DWORD PTR 1859775393[ecx*1+ebx] | ||
644 | mov ecx, edx | ||
645 | rol ecx, 5 | ||
646 | ror edi, 1 | ||
647 | add ecx, ebp | ||
648 | ror edi, 1 | ||
649 | add ebx, ecx | ||
650 | ; 20_39 34 | ||
651 | mov ecx, DWORD PTR 8[esp] | ||
652 | mov ebp, DWORD PTR 16[esp] | ||
653 | xor ecx, ebp | ||
654 | mov ebp, DWORD PTR 40[esp] | ||
655 | xor ecx, ebp | ||
656 | mov ebp, DWORD PTR 60[esp] | ||
657 | xor ecx, ebp | ||
658 | mov ebp, edx | ||
659 | rol ecx, 1 | ||
660 | xor ebp, edi | ||
661 | mov DWORD PTR 8[esp],ecx | ||
662 | xor ebp, esi | ||
663 | lea ecx, DWORD PTR 1859775393[eax*1+ecx] | ||
664 | mov eax, ebx | ||
665 | rol eax, 5 | ||
666 | ror edx, 1 | ||
667 | add eax, ebp | ||
668 | ror edx, 1 | ||
669 | add ecx, eax | ||
670 | ; 20_39 35 | ||
671 | mov eax, DWORD PTR 12[esp] | ||
672 | mov ebp, DWORD PTR 20[esp] | ||
673 | xor eax, ebp | ||
674 | mov ebp, DWORD PTR 44[esp] | ||
675 | xor eax, ebp | ||
676 | mov ebp, DWORD PTR [esp] | ||
677 | xor eax, ebp | ||
678 | mov ebp, ebx | ||
679 | rol eax, 1 | ||
680 | xor ebp, edx | ||
681 | mov DWORD PTR 12[esp],eax | ||
682 | xor ebp, edi | ||
683 | lea eax, DWORD PTR 1859775393[esi*1+eax] | ||
684 | mov esi, ecx | ||
685 | rol esi, 5 | ||
686 | ror ebx, 1 | ||
687 | add esi, ebp | ||
688 | ror ebx, 1 | ||
689 | add eax, esi | ||
690 | ; 20_39 36 | ||
691 | mov esi, DWORD PTR 16[esp] | ||
692 | mov ebp, DWORD PTR 24[esp] | ||
693 | xor esi, ebp | ||
694 | mov ebp, DWORD PTR 48[esp] | ||
695 | xor esi, ebp | ||
696 | mov ebp, DWORD PTR 4[esp] | ||
697 | xor esi, ebp | ||
698 | mov ebp, ecx | ||
699 | rol esi, 1 | ||
700 | xor ebp, ebx | ||
701 | mov DWORD PTR 16[esp],esi | ||
702 | xor ebp, edx | ||
703 | lea esi, DWORD PTR 1859775393[edi*1+esi] | ||
704 | mov edi, eax | ||
705 | rol edi, 5 | ||
706 | ror ecx, 1 | ||
707 | add edi, ebp | ||
708 | ror ecx, 1 | ||
709 | add esi, edi | ||
710 | ; 20_39 37 | ||
711 | mov edi, DWORD PTR 20[esp] | ||
712 | mov ebp, DWORD PTR 28[esp] | ||
713 | xor edi, ebp | ||
714 | mov ebp, DWORD PTR 52[esp] | ||
715 | xor edi, ebp | ||
716 | mov ebp, DWORD PTR 8[esp] | ||
717 | xor edi, ebp | ||
718 | mov ebp, eax | ||
719 | rol edi, 1 | ||
720 | xor ebp, ecx | ||
721 | mov DWORD PTR 20[esp],edi | ||
722 | xor ebp, ebx | ||
723 | lea edi, DWORD PTR 1859775393[edx*1+edi] | ||
724 | mov edx, esi | ||
725 | rol edx, 5 | ||
726 | ror eax, 1 | ||
727 | add edx, ebp | ||
728 | ror eax, 1 | ||
729 | add edi, edx | ||
730 | ; 20_39 38 | ||
731 | mov edx, DWORD PTR 24[esp] | ||
732 | mov ebp, DWORD PTR 32[esp] | ||
733 | xor edx, ebp | ||
734 | mov ebp, DWORD PTR 56[esp] | ||
735 | xor edx, ebp | ||
736 | mov ebp, DWORD PTR 12[esp] | ||
737 | xor edx, ebp | ||
738 | mov ebp, esi | ||
739 | rol edx, 1 | ||
740 | xor ebp, eax | ||
741 | mov DWORD PTR 24[esp],edx | ||
742 | xor ebp, ecx | ||
743 | lea edx, DWORD PTR 1859775393[ebx*1+edx] | ||
744 | mov ebx, edi | ||
745 | rol ebx, 5 | ||
746 | ror esi, 1 | ||
747 | add ebx, ebp | ||
748 | ror esi, 1 | ||
749 | add edx, ebx | ||
750 | ; 20_39 39 | ||
751 | mov ebx, DWORD PTR 28[esp] | ||
752 | mov ebp, DWORD PTR 36[esp] | ||
753 | xor ebx, ebp | ||
754 | mov ebp, DWORD PTR 60[esp] | ||
755 | xor ebx, ebp | ||
756 | mov ebp, DWORD PTR 16[esp] | ||
757 | xor ebx, ebp | ||
758 | mov ebp, edi | ||
759 | rol ebx, 1 | ||
760 | xor ebp, esi | ||
761 | mov DWORD PTR 28[esp],ebx | ||
762 | xor ebp, eax | ||
763 | lea ebx, DWORD PTR 1859775393[ecx*1+ebx] | ||
764 | mov ecx, edx | ||
765 | rol ecx, 5 | ||
766 | ror edi, 1 | ||
767 | add ecx, ebp | ||
768 | ror edi, 1 | ||
769 | add ebx, ecx | ||
770 | ; 40_59 40 | ||
771 | mov ecx, DWORD PTR 32[esp] | ||
772 | mov ebp, DWORD PTR 40[esp] | ||
773 | xor ecx, ebp | ||
774 | mov ebp, DWORD PTR [esp] | ||
775 | xor ecx, ebp | ||
776 | mov ebp, DWORD PTR 20[esp] | ||
777 | xor ecx, ebp | ||
778 | mov ebp, edx | ||
779 | rol ecx, 1 | ||
780 | or ebp, edi | ||
781 | mov DWORD PTR 32[esp],ecx | ||
782 | and ebp, esi | ||
783 | lea ecx, DWORD PTR 2400959708[eax*1+ecx] | ||
784 | mov eax, edx | ||
785 | ror edx, 1 | ||
786 | and eax, edi | ||
787 | or ebp, eax | ||
788 | mov eax, ebx | ||
789 | rol eax, 5 | ||
790 | add ebp, eax | ||
791 | mov eax, DWORD PTR 36[esp] | ||
792 | add ecx, ebp | ||
793 | mov ebp, DWORD PTR 44[esp] | ||
794 | xor eax, ebp | ||
795 | mov ebp, DWORD PTR 4[esp] | ||
796 | xor eax, ebp | ||
797 | mov ebp, DWORD PTR 24[esp] | ||
798 | ror edx, 1 | ||
799 | xor eax, ebp | ||
800 | rol eax, 1 | ||
801 | mov ebp, ebx | ||
802 | mov DWORD PTR 36[esp],eax | ||
803 | or ebp, edx | ||
804 | lea eax, DWORD PTR 2400959708[esi*1+eax] | ||
805 | mov esi, ebx | ||
806 | and ebp, edi | ||
807 | and esi, edx | ||
808 | or ebp, esi | ||
809 | mov esi, ecx | ||
810 | rol esi, 5 | ||
811 | ror ebx, 1 | ||
812 | add ebp, esi | ||
813 | ror ebx, 1 | ||
814 | add eax, ebp | ||
815 | ; 40_59 41 | ||
816 | ; 40_59 42 | ||
817 | mov esi, DWORD PTR 40[esp] | ||
818 | mov ebp, DWORD PTR 48[esp] | ||
819 | xor esi, ebp | ||
820 | mov ebp, DWORD PTR 8[esp] | ||
821 | xor esi, ebp | ||
822 | mov ebp, DWORD PTR 28[esp] | ||
823 | xor esi, ebp | ||
824 | mov ebp, ecx | ||
825 | rol esi, 1 | ||
826 | or ebp, ebx | ||
827 | mov DWORD PTR 40[esp],esi | ||
828 | and ebp, edx | ||
829 | lea esi, DWORD PTR 2400959708[edi*1+esi] | ||
830 | mov edi, ecx | ||
831 | ror ecx, 1 | ||
832 | and edi, ebx | ||
833 | or ebp, edi | ||
834 | mov edi, eax | ||
835 | rol edi, 5 | ||
836 | add ebp, edi | ||
837 | mov edi, DWORD PTR 44[esp] | ||
838 | add esi, ebp | ||
839 | mov ebp, DWORD PTR 52[esp] | ||
840 | xor edi, ebp | ||
841 | mov ebp, DWORD PTR 12[esp] | ||
842 | xor edi, ebp | ||
843 | mov ebp, DWORD PTR 32[esp] | ||
844 | ror ecx, 1 | ||
845 | xor edi, ebp | ||
846 | rol edi, 1 | ||
847 | mov ebp, eax | ||
848 | mov DWORD PTR 44[esp],edi | ||
849 | or ebp, ecx | ||
850 | lea edi, DWORD PTR 2400959708[edx*1+edi] | ||
851 | mov edx, eax | ||
852 | and ebp, ebx | ||
853 | and edx, ecx | ||
854 | or ebp, edx | ||
855 | mov edx, esi | ||
856 | rol edx, 5 | ||
857 | ror eax, 1 | ||
858 | add ebp, edx | ||
859 | ror eax, 1 | ||
860 | add edi, ebp | ||
861 | ; 40_59 43 | ||
862 | ; 40_59 44 | ||
863 | mov edx, DWORD PTR 48[esp] | ||
864 | mov ebp, DWORD PTR 56[esp] | ||
865 | xor edx, ebp | ||
866 | mov ebp, DWORD PTR 16[esp] | ||
867 | xor edx, ebp | ||
868 | mov ebp, DWORD PTR 36[esp] | ||
869 | xor edx, ebp | ||
870 | mov ebp, esi | ||
871 | rol edx, 1 | ||
872 | or ebp, eax | ||
873 | mov DWORD PTR 48[esp],edx | ||
874 | and ebp, ecx | ||
875 | lea edx, DWORD PTR 2400959708[ebx*1+edx] | ||
876 | mov ebx, esi | ||
877 | ror esi, 1 | ||
878 | and ebx, eax | ||
879 | or ebp, ebx | ||
880 | mov ebx, edi | ||
881 | rol ebx, 5 | ||
882 | add ebp, ebx | ||
883 | mov ebx, DWORD PTR 52[esp] | ||
884 | add edx, ebp | ||
885 | mov ebp, DWORD PTR 60[esp] | ||
886 | xor ebx, ebp | ||
887 | mov ebp, DWORD PTR 20[esp] | ||
888 | xor ebx, ebp | ||
889 | mov ebp, DWORD PTR 40[esp] | ||
890 | ror esi, 1 | ||
891 | xor ebx, ebp | ||
892 | rol ebx, 1 | ||
893 | mov ebp, edi | ||
894 | mov DWORD PTR 52[esp],ebx | ||
895 | or ebp, esi | ||
896 | lea ebx, DWORD PTR 2400959708[ecx*1+ebx] | ||
897 | mov ecx, edi | ||
898 | and ebp, eax | ||
899 | and ecx, esi | ||
900 | or ebp, ecx | ||
901 | mov ecx, edx | ||
902 | rol ecx, 5 | ||
903 | ror edi, 1 | ||
904 | add ebp, ecx | ||
905 | ror edi, 1 | ||
906 | add ebx, ebp | ||
907 | ; 40_59 45 | ||
908 | ; 40_59 46 | ||
909 | mov ecx, DWORD PTR 56[esp] | ||
910 | mov ebp, DWORD PTR [esp] | ||
911 | xor ecx, ebp | ||
912 | mov ebp, DWORD PTR 24[esp] | ||
913 | xor ecx, ebp | ||
914 | mov ebp, DWORD PTR 44[esp] | ||
915 | xor ecx, ebp | ||
916 | mov ebp, edx | ||
917 | rol ecx, 1 | ||
918 | or ebp, edi | ||
919 | mov DWORD PTR 56[esp],ecx | ||
920 | and ebp, esi | ||
921 | lea ecx, DWORD PTR 2400959708[eax*1+ecx] | ||
922 | mov eax, edx | ||
923 | ror edx, 1 | ||
924 | and eax, edi | ||
925 | or ebp, eax | ||
926 | mov eax, ebx | ||
927 | rol eax, 5 | ||
928 | add ebp, eax | ||
929 | mov eax, DWORD PTR 60[esp] | ||
930 | add ecx, ebp | ||
931 | mov ebp, DWORD PTR 4[esp] | ||
932 | xor eax, ebp | ||
933 | mov ebp, DWORD PTR 28[esp] | ||
934 | xor eax, ebp | ||
935 | mov ebp, DWORD PTR 48[esp] | ||
936 | ror edx, 1 | ||
937 | xor eax, ebp | ||
938 | rol eax, 1 | ||
939 | mov ebp, ebx | ||
940 | mov DWORD PTR 60[esp],eax | ||
941 | or ebp, edx | ||
942 | lea eax, DWORD PTR 2400959708[esi*1+eax] | ||
943 | mov esi, ebx | ||
944 | and ebp, edi | ||
945 | and esi, edx | ||
946 | or ebp, esi | ||
947 | mov esi, ecx | ||
948 | rol esi, 5 | ||
949 | ror ebx, 1 | ||
950 | add ebp, esi | ||
951 | ror ebx, 1 | ||
952 | add eax, ebp | ||
953 | ; 40_59 47 | ||
954 | ; 40_59 48 | ||
955 | mov esi, DWORD PTR [esp] | ||
956 | mov ebp, DWORD PTR 8[esp] | ||
957 | xor esi, ebp | ||
958 | mov ebp, DWORD PTR 32[esp] | ||
959 | xor esi, ebp | ||
960 | mov ebp, DWORD PTR 52[esp] | ||
961 | xor esi, ebp | ||
962 | mov ebp, ecx | ||
963 | rol esi, 1 | ||
964 | or ebp, ebx | ||
965 | mov DWORD PTR [esp],esi | ||
966 | and ebp, edx | ||
967 | lea esi, DWORD PTR 2400959708[edi*1+esi] | ||
968 | mov edi, ecx | ||
969 | ror ecx, 1 | ||
970 | and edi, ebx | ||
971 | or ebp, edi | ||
972 | mov edi, eax | ||
973 | rol edi, 5 | ||
974 | add ebp, edi | ||
975 | mov edi, DWORD PTR 4[esp] | ||
976 | add esi, ebp | ||
977 | mov ebp, DWORD PTR 12[esp] | ||
978 | xor edi, ebp | ||
979 | mov ebp, DWORD PTR 36[esp] | ||
980 | xor edi, ebp | ||
981 | mov ebp, DWORD PTR 56[esp] | ||
982 | ror ecx, 1 | ||
983 | xor edi, ebp | ||
984 | rol edi, 1 | ||
985 | mov ebp, eax | ||
986 | mov DWORD PTR 4[esp],edi | ||
987 | or ebp, ecx | ||
988 | lea edi, DWORD PTR 2400959708[edx*1+edi] | ||
989 | mov edx, eax | ||
990 | and ebp, ebx | ||
991 | and edx, ecx | ||
992 | or ebp, edx | ||
993 | mov edx, esi | ||
994 | rol edx, 5 | ||
995 | ror eax, 1 | ||
996 | add ebp, edx | ||
997 | ror eax, 1 | ||
998 | add edi, ebp | ||
999 | ; 40_59 49 | ||
1000 | ; 40_59 50 | ||
1001 | mov edx, DWORD PTR 8[esp] | ||
1002 | mov ebp, DWORD PTR 16[esp] | ||
1003 | xor edx, ebp | ||
1004 | mov ebp, DWORD PTR 40[esp] | ||
1005 | xor edx, ebp | ||
1006 | mov ebp, DWORD PTR 60[esp] | ||
1007 | xor edx, ebp | ||
1008 | mov ebp, esi | ||
1009 | rol edx, 1 | ||
1010 | or ebp, eax | ||
1011 | mov DWORD PTR 8[esp],edx | ||
1012 | and ebp, ecx | ||
1013 | lea edx, DWORD PTR 2400959708[ebx*1+edx] | ||
1014 | mov ebx, esi | ||
1015 | ror esi, 1 | ||
1016 | and ebx, eax | ||
1017 | or ebp, ebx | ||
1018 | mov ebx, edi | ||
1019 | rol ebx, 5 | ||
1020 | add ebp, ebx | ||
1021 | mov ebx, DWORD PTR 12[esp] | ||
1022 | add edx, ebp | ||
1023 | mov ebp, DWORD PTR 20[esp] | ||
1024 | xor ebx, ebp | ||
1025 | mov ebp, DWORD PTR 44[esp] | ||
1026 | xor ebx, ebp | ||
1027 | mov ebp, DWORD PTR [esp] | ||
1028 | ror esi, 1 | ||
1029 | xor ebx, ebp | ||
1030 | rol ebx, 1 | ||
1031 | mov ebp, edi | ||
1032 | mov DWORD PTR 12[esp],ebx | ||
1033 | or ebp, esi | ||
1034 | lea ebx, DWORD PTR 2400959708[ecx*1+ebx] | ||
1035 | mov ecx, edi | ||
1036 | and ebp, eax | ||
1037 | and ecx, esi | ||
1038 | or ebp, ecx | ||
1039 | mov ecx, edx | ||
1040 | rol ecx, 5 | ||
1041 | ror edi, 1 | ||
1042 | add ebp, ecx | ||
1043 | ror edi, 1 | ||
1044 | add ebx, ebp | ||
1045 | ; 40_59 51 | ||
1046 | ; 40_59 52 | ||
1047 | mov ecx, DWORD PTR 16[esp] | ||
1048 | mov ebp, DWORD PTR 24[esp] | ||
1049 | xor ecx, ebp | ||
1050 | mov ebp, DWORD PTR 48[esp] | ||
1051 | xor ecx, ebp | ||
1052 | mov ebp, DWORD PTR 4[esp] | ||
1053 | xor ecx, ebp | ||
1054 | mov ebp, edx | ||
1055 | rol ecx, 1 | ||
1056 | or ebp, edi | ||
1057 | mov DWORD PTR 16[esp],ecx | ||
1058 | and ebp, esi | ||
1059 | lea ecx, DWORD PTR 2400959708[eax*1+ecx] | ||
1060 | mov eax, edx | ||
1061 | ror edx, 1 | ||
1062 | and eax, edi | ||
1063 | or ebp, eax | ||
1064 | mov eax, ebx | ||
1065 | rol eax, 5 | ||
1066 | add ebp, eax | ||
1067 | mov eax, DWORD PTR 20[esp] | ||
1068 | add ecx, ebp | ||
1069 | mov ebp, DWORD PTR 28[esp] | ||
1070 | xor eax, ebp | ||
1071 | mov ebp, DWORD PTR 52[esp] | ||
1072 | xor eax, ebp | ||
1073 | mov ebp, DWORD PTR 8[esp] | ||
1074 | ror edx, 1 | ||
1075 | xor eax, ebp | ||
1076 | rol eax, 1 | ||
1077 | mov ebp, ebx | ||
1078 | mov DWORD PTR 20[esp],eax | ||
1079 | or ebp, edx | ||
1080 | lea eax, DWORD PTR 2400959708[esi*1+eax] | ||
1081 | mov esi, ebx | ||
1082 | and ebp, edi | ||
1083 | and esi, edx | ||
1084 | or ebp, esi | ||
1085 | mov esi, ecx | ||
1086 | rol esi, 5 | ||
1087 | ror ebx, 1 | ||
1088 | add ebp, esi | ||
1089 | ror ebx, 1 | ||
1090 | add eax, ebp | ||
1091 | ; 40_59 53 | ||
1092 | ; 40_59 54 | ||
1093 | mov esi, DWORD PTR 24[esp] | ||
1094 | mov ebp, DWORD PTR 32[esp] | ||
1095 | xor esi, ebp | ||
1096 | mov ebp, DWORD PTR 56[esp] | ||
1097 | xor esi, ebp | ||
1098 | mov ebp, DWORD PTR 12[esp] | ||
1099 | xor esi, ebp | ||
1100 | mov ebp, ecx | ||
1101 | rol esi, 1 | ||
1102 | or ebp, ebx | ||
1103 | mov DWORD PTR 24[esp],esi | ||
1104 | and ebp, edx | ||
1105 | lea esi, DWORD PTR 2400959708[edi*1+esi] | ||
1106 | mov edi, ecx | ||
1107 | ror ecx, 1 | ||
1108 | and edi, ebx | ||
1109 | or ebp, edi | ||
1110 | mov edi, eax | ||
1111 | rol edi, 5 | ||
1112 | add ebp, edi | ||
1113 | mov edi, DWORD PTR 28[esp] | ||
1114 | add esi, ebp | ||
1115 | mov ebp, DWORD PTR 36[esp] | ||
1116 | xor edi, ebp | ||
1117 | mov ebp, DWORD PTR 60[esp] | ||
1118 | xor edi, ebp | ||
1119 | mov ebp, DWORD PTR 16[esp] | ||
1120 | ror ecx, 1 | ||
1121 | xor edi, ebp | ||
1122 | rol edi, 1 | ||
1123 | mov ebp, eax | ||
1124 | mov DWORD PTR 28[esp],edi | ||
1125 | or ebp, ecx | ||
1126 | lea edi, DWORD PTR 2400959708[edx*1+edi] | ||
1127 | mov edx, eax | ||
1128 | and ebp, ebx | ||
1129 | and edx, ecx | ||
1130 | or ebp, edx | ||
1131 | mov edx, esi | ||
1132 | rol edx, 5 | ||
1133 | ror eax, 1 | ||
1134 | add ebp, edx | ||
1135 | ror eax, 1 | ||
1136 | add edi, ebp | ||
1137 | ; 40_59 55 | ||
1138 | ; 40_59 56 | ||
1139 | mov edx, DWORD PTR 32[esp] | ||
1140 | mov ebp, DWORD PTR 40[esp] | ||
1141 | xor edx, ebp | ||
1142 | mov ebp, DWORD PTR [esp] | ||
1143 | xor edx, ebp | ||
1144 | mov ebp, DWORD PTR 20[esp] | ||
1145 | xor edx, ebp | ||
1146 | mov ebp, esi | ||
1147 | rol edx, 1 | ||
1148 | or ebp, eax | ||
1149 | mov DWORD PTR 32[esp],edx | ||
1150 | and ebp, ecx | ||
1151 | lea edx, DWORD PTR 2400959708[ebx*1+edx] | ||
1152 | mov ebx, esi | ||
1153 | ror esi, 1 | ||
1154 | and ebx, eax | ||
1155 | or ebp, ebx | ||
1156 | mov ebx, edi | ||
1157 | rol ebx, 5 | ||
1158 | add ebp, ebx | ||
1159 | mov ebx, DWORD PTR 36[esp] | ||
1160 | add edx, ebp | ||
1161 | mov ebp, DWORD PTR 44[esp] | ||
1162 | xor ebx, ebp | ||
1163 | mov ebp, DWORD PTR 4[esp] | ||
1164 | xor ebx, ebp | ||
1165 | mov ebp, DWORD PTR 24[esp] | ||
1166 | ror esi, 1 | ||
1167 | xor ebx, ebp | ||
1168 | rol ebx, 1 | ||
1169 | mov ebp, edi | ||
1170 | mov DWORD PTR 36[esp],ebx | ||
1171 | or ebp, esi | ||
1172 | lea ebx, DWORD PTR 2400959708[ecx*1+ebx] | ||
1173 | mov ecx, edi | ||
1174 | and ebp, eax | ||
1175 | and ecx, esi | ||
1176 | or ebp, ecx | ||
1177 | mov ecx, edx | ||
1178 | rol ecx, 5 | ||
1179 | ror edi, 1 | ||
1180 | add ebp, ecx | ||
1181 | ror edi, 1 | ||
1182 | add ebx, ebp | ||
1183 | ; 40_59 57 | ||
1184 | ; 40_59 58 | ||
1185 | mov ecx, DWORD PTR 40[esp] | ||
1186 | mov ebp, DWORD PTR 48[esp] | ||
1187 | xor ecx, ebp | ||
1188 | mov ebp, DWORD PTR 8[esp] | ||
1189 | xor ecx, ebp | ||
1190 | mov ebp, DWORD PTR 28[esp] | ||
1191 | xor ecx, ebp | ||
1192 | mov ebp, edx | ||
1193 | rol ecx, 1 | ||
1194 | or ebp, edi | ||
1195 | mov DWORD PTR 40[esp],ecx | ||
1196 | and ebp, esi | ||
1197 | lea ecx, DWORD PTR 2400959708[eax*1+ecx] | ||
1198 | mov eax, edx | ||
1199 | ror edx, 1 | ||
1200 | and eax, edi | ||
1201 | or ebp, eax | ||
1202 | mov eax, ebx | ||
1203 | rol eax, 5 | ||
1204 | add ebp, eax | ||
1205 | mov eax, DWORD PTR 44[esp] | ||
1206 | add ecx, ebp | ||
1207 | mov ebp, DWORD PTR 52[esp] | ||
1208 | xor eax, ebp | ||
1209 | mov ebp, DWORD PTR 12[esp] | ||
1210 | xor eax, ebp | ||
1211 | mov ebp, DWORD PTR 32[esp] | ||
1212 | ror edx, 1 | ||
1213 | xor eax, ebp | ||
1214 | rol eax, 1 | ||
1215 | mov ebp, ebx | ||
1216 | mov DWORD PTR 44[esp],eax | ||
1217 | or ebp, edx | ||
1218 | lea eax, DWORD PTR 2400959708[esi*1+eax] | ||
1219 | mov esi, ebx | ||
1220 | and ebp, edi | ||
1221 | and esi, edx | ||
1222 | or ebp, esi | ||
1223 | mov esi, ecx | ||
1224 | rol esi, 5 | ||
1225 | ror ebx, 1 | ||
1226 | add ebp, esi | ||
1227 | ror ebx, 1 | ||
1228 | add eax, ebp | ||
1229 | ; 40_59 59 | ||
1230 | ; 20_39 60 | ||
1231 | mov esi, DWORD PTR 48[esp] | ||
1232 | mov ebp, DWORD PTR 56[esp] | ||
1233 | xor esi, ebp | ||
1234 | mov ebp, DWORD PTR 16[esp] | ||
1235 | xor esi, ebp | ||
1236 | mov ebp, DWORD PTR 36[esp] | ||
1237 | xor esi, ebp | ||
1238 | mov ebp, ecx | ||
1239 | rol esi, 1 | ||
1240 | xor ebp, ebx | ||
1241 | mov DWORD PTR 48[esp],esi | ||
1242 | xor ebp, edx | ||
1243 | lea esi, DWORD PTR 3395469782[edi*1+esi] | ||
1244 | mov edi, eax | ||
1245 | rol edi, 5 | ||
1246 | ror ecx, 1 | ||
1247 | add edi, ebp | ||
1248 | ror ecx, 1 | ||
1249 | add esi, edi | ||
1250 | ; 20_39 61 | ||
1251 | mov edi, DWORD PTR 52[esp] | ||
1252 | mov ebp, DWORD PTR 60[esp] | ||
1253 | xor edi, ebp | ||
1254 | mov ebp, DWORD PTR 20[esp] | ||
1255 | xor edi, ebp | ||
1256 | mov ebp, DWORD PTR 40[esp] | ||
1257 | xor edi, ebp | ||
1258 | mov ebp, eax | ||
1259 | rol edi, 1 | ||
1260 | xor ebp, ecx | ||
1261 | mov DWORD PTR 52[esp],edi | ||
1262 | xor ebp, ebx | ||
1263 | lea edi, DWORD PTR 3395469782[edx*1+edi] | ||
1264 | mov edx, esi | ||
1265 | rol edx, 5 | ||
1266 | ror eax, 1 | ||
1267 | add edx, ebp | ||
1268 | ror eax, 1 | ||
1269 | add edi, edx | ||
1270 | ; 20_39 62 | ||
1271 | mov edx, DWORD PTR 56[esp] | ||
1272 | mov ebp, DWORD PTR [esp] | ||
1273 | xor edx, ebp | ||
1274 | mov ebp, DWORD PTR 24[esp] | ||
1275 | xor edx, ebp | ||
1276 | mov ebp, DWORD PTR 44[esp] | ||
1277 | xor edx, ebp | ||
1278 | mov ebp, esi | ||
1279 | rol edx, 1 | ||
1280 | xor ebp, eax | ||
1281 | mov DWORD PTR 56[esp],edx | ||
1282 | xor ebp, ecx | ||
1283 | lea edx, DWORD PTR 3395469782[ebx*1+edx] | ||
1284 | mov ebx, edi | ||
1285 | rol ebx, 5 | ||
1286 | ror esi, 1 | ||
1287 | add ebx, ebp | ||
1288 | ror esi, 1 | ||
1289 | add edx, ebx | ||
1290 | ; 20_39 63 | ||
1291 | mov ebx, DWORD PTR 60[esp] | ||
1292 | mov ebp, DWORD PTR 4[esp] | ||
1293 | xor ebx, ebp | ||
1294 | mov ebp, DWORD PTR 28[esp] | ||
1295 | xor ebx, ebp | ||
1296 | mov ebp, DWORD PTR 48[esp] | ||
1297 | xor ebx, ebp | ||
1298 | mov ebp, edi | ||
1299 | rol ebx, 1 | ||
1300 | xor ebp, esi | ||
1301 | mov DWORD PTR 60[esp],ebx | ||
1302 | xor ebp, eax | ||
1303 | lea ebx, DWORD PTR 3395469782[ecx*1+ebx] | ||
1304 | mov ecx, edx | ||
1305 | rol ecx, 5 | ||
1306 | ror edi, 1 | ||
1307 | add ecx, ebp | ||
1308 | ror edi, 1 | ||
1309 | add ebx, ecx | ||
1310 | ; 20_39 64 | ||
1311 | mov ecx, DWORD PTR [esp] | ||
1312 | mov ebp, DWORD PTR 8[esp] | ||
1313 | xor ecx, ebp | ||
1314 | mov ebp, DWORD PTR 32[esp] | ||
1315 | xor ecx, ebp | ||
1316 | mov ebp, DWORD PTR 52[esp] | ||
1317 | xor ecx, ebp | ||
1318 | mov ebp, edx | ||
1319 | rol ecx, 1 | ||
1320 | xor ebp, edi | ||
1321 | mov DWORD PTR [esp],ecx | ||
1322 | xor ebp, esi | ||
1323 | lea ecx, DWORD PTR 3395469782[eax*1+ecx] | ||
1324 | mov eax, ebx | ||
1325 | rol eax, 5 | ||
1326 | ror edx, 1 | ||
1327 | add eax, ebp | ||
1328 | ror edx, 1 | ||
1329 | add ecx, eax | ||
1330 | ; 20_39 65 | ||
1331 | mov eax, DWORD PTR 4[esp] | ||
1332 | mov ebp, DWORD PTR 12[esp] | ||
1333 | xor eax, ebp | ||
1334 | mov ebp, DWORD PTR 36[esp] | ||
1335 | xor eax, ebp | ||
1336 | mov ebp, DWORD PTR 56[esp] | ||
1337 | xor eax, ebp | ||
1338 | mov ebp, ebx | ||
1339 | rol eax, 1 | ||
1340 | xor ebp, edx | ||
1341 | mov DWORD PTR 4[esp],eax | ||
1342 | xor ebp, edi | ||
1343 | lea eax, DWORD PTR 3395469782[esi*1+eax] | ||
1344 | mov esi, ecx | ||
1345 | rol esi, 5 | ||
1346 | ror ebx, 1 | ||
1347 | add esi, ebp | ||
1348 | ror ebx, 1 | ||
1349 | add eax, esi | ||
1350 | ; 20_39 66 | ||
1351 | mov esi, DWORD PTR 8[esp] | ||
1352 | mov ebp, DWORD PTR 16[esp] | ||
1353 | xor esi, ebp | ||
1354 | mov ebp, DWORD PTR 40[esp] | ||
1355 | xor esi, ebp | ||
1356 | mov ebp, DWORD PTR 60[esp] | ||
1357 | xor esi, ebp | ||
1358 | mov ebp, ecx | ||
1359 | rol esi, 1 | ||
1360 | xor ebp, ebx | ||
1361 | mov DWORD PTR 8[esp],esi | ||
1362 | xor ebp, edx | ||
1363 | lea esi, DWORD PTR 3395469782[edi*1+esi] | ||
1364 | mov edi, eax | ||
1365 | rol edi, 5 | ||
1366 | ror ecx, 1 | ||
1367 | add edi, ebp | ||
1368 | ror ecx, 1 | ||
1369 | add esi, edi | ||
1370 | ; 20_39 67 | ||
1371 | mov edi, DWORD PTR 12[esp] | ||
1372 | mov ebp, DWORD PTR 20[esp] | ||
1373 | xor edi, ebp | ||
1374 | mov ebp, DWORD PTR 44[esp] | ||
1375 | xor edi, ebp | ||
1376 | mov ebp, DWORD PTR [esp] | ||
1377 | xor edi, ebp | ||
1378 | mov ebp, eax | ||
1379 | rol edi, 1 | ||
1380 | xor ebp, ecx | ||
1381 | mov DWORD PTR 12[esp],edi | ||
1382 | xor ebp, ebx | ||
1383 | lea edi, DWORD PTR 3395469782[edx*1+edi] | ||
1384 | mov edx, esi | ||
1385 | rol edx, 5 | ||
1386 | ror eax, 1 | ||
1387 | add edx, ebp | ||
1388 | ror eax, 1 | ||
1389 | add edi, edx | ||
1390 | ; 20_39 68 | ||
1391 | mov edx, DWORD PTR 16[esp] | ||
1392 | mov ebp, DWORD PTR 24[esp] | ||
1393 | xor edx, ebp | ||
1394 | mov ebp, DWORD PTR 48[esp] | ||
1395 | xor edx, ebp | ||
1396 | mov ebp, DWORD PTR 4[esp] | ||
1397 | xor edx, ebp | ||
1398 | mov ebp, esi | ||
1399 | rol edx, 1 | ||
1400 | xor ebp, eax | ||
1401 | mov DWORD PTR 16[esp],edx | ||
1402 | xor ebp, ecx | ||
1403 | lea edx, DWORD PTR 3395469782[ebx*1+edx] | ||
1404 | mov ebx, edi | ||
1405 | rol ebx, 5 | ||
1406 | ror esi, 1 | ||
1407 | add ebx, ebp | ||
1408 | ror esi, 1 | ||
1409 | add edx, ebx | ||
1410 | ; 20_39 69 | ||
1411 | mov ebx, DWORD PTR 20[esp] | ||
1412 | mov ebp, DWORD PTR 28[esp] | ||
1413 | xor ebx, ebp | ||
1414 | mov ebp, DWORD PTR 52[esp] | ||
1415 | xor ebx, ebp | ||
1416 | mov ebp, DWORD PTR 8[esp] | ||
1417 | xor ebx, ebp | ||
1418 | mov ebp, edi | ||
1419 | rol ebx, 1 | ||
1420 | xor ebp, esi | ||
1421 | mov DWORD PTR 20[esp],ebx | ||
1422 | xor ebp, eax | ||
1423 | lea ebx, DWORD PTR 3395469782[ecx*1+ebx] | ||
1424 | mov ecx, edx | ||
1425 | rol ecx, 5 | ||
1426 | ror edi, 1 | ||
1427 | add ecx, ebp | ||
1428 | ror edi, 1 | ||
1429 | add ebx, ecx | ||
1430 | ; 20_39 70 | ||
1431 | mov ecx, DWORD PTR 24[esp] | ||
1432 | mov ebp, DWORD PTR 32[esp] | ||
1433 | xor ecx, ebp | ||
1434 | mov ebp, DWORD PTR 56[esp] | ||
1435 | xor ecx, ebp | ||
1436 | mov ebp, DWORD PTR 12[esp] | ||
1437 | xor ecx, ebp | ||
1438 | mov ebp, edx | ||
1439 | rol ecx, 1 | ||
1440 | xor ebp, edi | ||
1441 | mov DWORD PTR 24[esp],ecx | ||
1442 | xor ebp, esi | ||
1443 | lea ecx, DWORD PTR 3395469782[eax*1+ecx] | ||
1444 | mov eax, ebx | ||
1445 | rol eax, 5 | ||
1446 | ror edx, 1 | ||
1447 | add eax, ebp | ||
1448 | ror edx, 1 | ||
1449 | add ecx, eax | ||
1450 | ; 20_39 71 | ||
1451 | mov eax, DWORD PTR 28[esp] | ||
1452 | mov ebp, DWORD PTR 36[esp] | ||
1453 | xor eax, ebp | ||
1454 | mov ebp, DWORD PTR 60[esp] | ||
1455 | xor eax, ebp | ||
1456 | mov ebp, DWORD PTR 16[esp] | ||
1457 | xor eax, ebp | ||
1458 | mov ebp, ebx | ||
1459 | rol eax, 1 | ||
1460 | xor ebp, edx | ||
1461 | mov DWORD PTR 28[esp],eax | ||
1462 | xor ebp, edi | ||
1463 | lea eax, DWORD PTR 3395469782[esi*1+eax] | ||
1464 | mov esi, ecx | ||
1465 | rol esi, 5 | ||
1466 | ror ebx, 1 | ||
1467 | add esi, ebp | ||
1468 | ror ebx, 1 | ||
1469 | add eax, esi | ||
1470 | ; 20_39 72 | ||
1471 | mov esi, DWORD PTR 32[esp] | ||
1472 | mov ebp, DWORD PTR 40[esp] | ||
1473 | xor esi, ebp | ||
1474 | mov ebp, DWORD PTR [esp] | ||
1475 | xor esi, ebp | ||
1476 | mov ebp, DWORD PTR 20[esp] | ||
1477 | xor esi, ebp | ||
1478 | mov ebp, ecx | ||
1479 | rol esi, 1 | ||
1480 | xor ebp, ebx | ||
1481 | mov DWORD PTR 32[esp],esi | ||
1482 | xor ebp, edx | ||
1483 | lea esi, DWORD PTR 3395469782[edi*1+esi] | ||
1484 | mov edi, eax | ||
1485 | rol edi, 5 | ||
1486 | ror ecx, 1 | ||
1487 | add edi, ebp | ||
1488 | ror ecx, 1 | ||
1489 | add esi, edi | ||
1490 | ; 20_39 73 | ||
1491 | mov edi, DWORD PTR 36[esp] | ||
1492 | mov ebp, DWORD PTR 44[esp] | ||
1493 | xor edi, ebp | ||
1494 | mov ebp, DWORD PTR 4[esp] | ||
1495 | xor edi, ebp | ||
1496 | mov ebp, DWORD PTR 24[esp] | ||
1497 | xor edi, ebp | ||
1498 | mov ebp, eax | ||
1499 | rol edi, 1 | ||
1500 | xor ebp, ecx | ||
1501 | mov DWORD PTR 36[esp],edi | ||
1502 | xor ebp, ebx | ||
1503 | lea edi, DWORD PTR 3395469782[edx*1+edi] | ||
1504 | mov edx, esi | ||
1505 | rol edx, 5 | ||
1506 | ror eax, 1 | ||
1507 | add edx, ebp | ||
1508 | ror eax, 1 | ||
1509 | add edi, edx | ||
1510 | ; 20_39 74 | ||
1511 | mov edx, DWORD PTR 40[esp] | ||
1512 | mov ebp, DWORD PTR 48[esp] | ||
1513 | xor edx, ebp | ||
1514 | mov ebp, DWORD PTR 8[esp] | ||
1515 | xor edx, ebp | ||
1516 | mov ebp, DWORD PTR 28[esp] | ||
1517 | xor edx, ebp | ||
1518 | mov ebp, esi | ||
1519 | rol edx, 1 | ||
1520 | xor ebp, eax | ||
1521 | mov DWORD PTR 40[esp],edx | ||
1522 | xor ebp, ecx | ||
1523 | lea edx, DWORD PTR 3395469782[ebx*1+edx] | ||
1524 | mov ebx, edi | ||
1525 | rol ebx, 5 | ||
1526 | ror esi, 1 | ||
1527 | add ebx, ebp | ||
1528 | ror esi, 1 | ||
1529 | add edx, ebx | ||
1530 | ; 20_39 75 | ||
1531 | mov ebx, DWORD PTR 44[esp] | ||
1532 | mov ebp, DWORD PTR 52[esp] | ||
1533 | xor ebx, ebp | ||
1534 | mov ebp, DWORD PTR 12[esp] | ||
1535 | xor ebx, ebp | ||
1536 | mov ebp, DWORD PTR 32[esp] | ||
1537 | xor ebx, ebp | ||
1538 | mov ebp, edi | ||
1539 | rol ebx, 1 | ||
1540 | xor ebp, esi | ||
1541 | mov DWORD PTR 44[esp],ebx | ||
1542 | xor ebp, eax | ||
1543 | lea ebx, DWORD PTR 3395469782[ecx*1+ebx] | ||
1544 | mov ecx, edx | ||
1545 | rol ecx, 5 | ||
1546 | ror edi, 1 | ||
1547 | add ecx, ebp | ||
1548 | ror edi, 1 | ||
1549 | add ebx, ecx | ||
1550 | ; 20_39 76 | ||
1551 | mov ecx, DWORD PTR 48[esp] | ||
1552 | mov ebp, DWORD PTR 56[esp] | ||
1553 | xor ecx, ebp | ||
1554 | mov ebp, DWORD PTR 16[esp] | ||
1555 | xor ecx, ebp | ||
1556 | mov ebp, DWORD PTR 36[esp] | ||
1557 | xor ecx, ebp | ||
1558 | mov ebp, edx | ||
1559 | rol ecx, 1 | ||
1560 | xor ebp, edi | ||
1561 | mov DWORD PTR 48[esp],ecx | ||
1562 | xor ebp, esi | ||
1563 | lea ecx, DWORD PTR 3395469782[eax*1+ecx] | ||
1564 | mov eax, ebx | ||
1565 | rol eax, 5 | ||
1566 | ror edx, 1 | ||
1567 | add eax, ebp | ||
1568 | ror edx, 1 | ||
1569 | add ecx, eax | ||
1570 | ; 20_39 77 | ||
1571 | mov eax, DWORD PTR 52[esp] | ||
1572 | mov ebp, DWORD PTR 60[esp] | ||
1573 | xor eax, ebp | ||
1574 | mov ebp, DWORD PTR 20[esp] | ||
1575 | xor eax, ebp | ||
1576 | mov ebp, DWORD PTR 40[esp] | ||
1577 | xor eax, ebp | ||
1578 | mov ebp, ebx | ||
1579 | rol eax, 1 | ||
1580 | xor ebp, edx | ||
1581 | mov DWORD PTR 52[esp],eax | ||
1582 | xor ebp, edi | ||
1583 | lea eax, DWORD PTR 3395469782[esi*1+eax] | ||
1584 | mov esi, ecx | ||
1585 | rol esi, 5 | ||
1586 | ror ebx, 1 | ||
1587 | add esi, ebp | ||
1588 | ror ebx, 1 | ||
1589 | add eax, esi | ||
1590 | ; 20_39 78 | ||
1591 | mov esi, DWORD PTR 56[esp] | ||
1592 | mov ebp, DWORD PTR [esp] | ||
1593 | xor esi, ebp | ||
1594 | mov ebp, DWORD PTR 24[esp] | ||
1595 | xor esi, ebp | ||
1596 | mov ebp, DWORD PTR 44[esp] | ||
1597 | xor esi, ebp | ||
1598 | mov ebp, ecx | ||
1599 | rol esi, 1 | ||
1600 | xor ebp, ebx | ||
1601 | mov DWORD PTR 56[esp],esi | ||
1602 | xor ebp, edx | ||
1603 | lea esi, DWORD PTR 3395469782[edi*1+esi] | ||
1604 | mov edi, eax | ||
1605 | rol edi, 5 | ||
1606 | ror ecx, 1 | ||
1607 | add edi, ebp | ||
1608 | ror ecx, 1 | ||
1609 | add esi, edi | ||
1610 | ; 20_39 79 | ||
1611 | mov edi, DWORD PTR 60[esp] | ||
1612 | mov ebp, DWORD PTR 4[esp] | ||
1613 | xor edi, ebp | ||
1614 | mov ebp, DWORD PTR 28[esp] | ||
1615 | xor edi, ebp | ||
1616 | mov ebp, DWORD PTR 48[esp] | ||
1617 | xor edi, ebp | ||
1618 | mov ebp, eax | ||
1619 | rol edi, 1 | ||
1620 | xor ebp, ecx | ||
1621 | mov DWORD PTR 60[esp],edi | ||
1622 | xor ebp, ebx | ||
1623 | lea edi, DWORD PTR 3395469782[edx*1+edi] | ||
1624 | mov edx, esi | ||
1625 | rol edx, 5 | ||
1626 | add edx, ebp | ||
1627 | mov ebp, DWORD PTR 128[esp] | ||
1628 | ror eax, 1 | ||
1629 | add edi, edx | ||
1630 | ror eax, 1 | ||
1631 | ; End processing | ||
1632 | ; | ||
1633 | mov edx, DWORD PTR 12[ebp] | ||
1634 | add edx, ecx | ||
1635 | mov ecx, DWORD PTR 4[ebp] | ||
1636 | add ecx, esi | ||
1637 | mov esi, eax | ||
1638 | mov eax, DWORD PTR [ebp] | ||
1639 | mov DWORD PTR 12[ebp],edx | ||
1640 | add eax, edi | ||
1641 | mov edi, DWORD PTR 16[ebp] | ||
1642 | add edi, ebx | ||
1643 | mov ebx, DWORD PTR 8[ebp] | ||
1644 | add ebx, esi | ||
1645 | mov DWORD PTR [ebp],eax | ||
1646 | mov esi, DWORD PTR 132[esp] | ||
1647 | mov DWORD PTR 8[ebp],ebx | ||
1648 | add esi, 64 | ||
1649 | mov eax, DWORD PTR 68[esp] | ||
1650 | mov DWORD PTR 16[ebp],edi | ||
1651 | cmp esi, eax | ||
1652 | mov DWORD PTR 4[ebp],ecx | ||
1653 | jl L000start | ||
1654 | add esp, 108 | ||
1655 | pop edi | ||
1656 | pop ebx | ||
1657 | pop ebp | ||
1658 | pop esi | ||
1659 | ret | ||
1660 | _TEXT SEGMENT | ||
1661 | PUBLIC _sha1_block_asm_host_order | ||
1662 | |||
1663 | _sha1_block_asm_host_order PROC NEAR | ||
1664 | mov ecx, DWORD PTR 12[esp] | ||
1665 | push esi | ||
1666 | shl ecx, 6 | ||
1667 | mov esi, DWORD PTR 12[esp] | ||
1668 | push ebp | ||
1669 | add ecx, esi | ||
1670 | push ebx | ||
1671 | mov ebp, DWORD PTR 16[esp] | ||
1672 | push edi | ||
1673 | mov edx, DWORD PTR 12[ebp] | ||
1674 | sub esp, 108 | ||
1675 | mov edi, DWORD PTR 16[ebp] | ||
1676 | mov ebx, DWORD PTR 8[ebp] | ||
1677 | mov DWORD PTR 68[esp],ecx | ||
1678 | ; First we need to setup the X array | ||
1679 | mov eax, DWORD PTR [esi] | ||
1680 | mov ecx, DWORD PTR 4[esi] | ||
1681 | mov DWORD PTR [esp],eax | ||
1682 | mov DWORD PTR 4[esp],ecx | ||
1683 | mov eax, DWORD PTR 8[esi] | ||
1684 | mov ecx, DWORD PTR 12[esi] | ||
1685 | mov DWORD PTR 8[esp],eax | ||
1686 | mov DWORD PTR 12[esp],ecx | ||
1687 | mov eax, DWORD PTR 16[esi] | ||
1688 | mov ecx, DWORD PTR 20[esi] | ||
1689 | mov DWORD PTR 16[esp],eax | ||
1690 | mov DWORD PTR 20[esp],ecx | ||
1691 | mov eax, DWORD PTR 24[esi] | ||
1692 | mov ecx, DWORD PTR 28[esi] | ||
1693 | mov DWORD PTR 24[esp],eax | ||
1694 | mov DWORD PTR 28[esp],ecx | ||
1695 | mov eax, DWORD PTR 32[esi] | ||
1696 | mov ecx, DWORD PTR 36[esi] | ||
1697 | mov DWORD PTR 32[esp],eax | ||
1698 | mov DWORD PTR 36[esp],ecx | ||
1699 | mov eax, DWORD PTR 40[esi] | ||
1700 | mov ecx, DWORD PTR 44[esi] | ||
1701 | mov DWORD PTR 40[esp],eax | ||
1702 | mov DWORD PTR 44[esp],ecx | ||
1703 | mov eax, DWORD PTR 48[esi] | ||
1704 | mov ecx, DWORD PTR 52[esi] | ||
1705 | mov DWORD PTR 48[esp],eax | ||
1706 | mov DWORD PTR 52[esp],ecx | ||
1707 | mov eax, DWORD PTR 56[esi] | ||
1708 | mov ecx, DWORD PTR 60[esi] | ||
1709 | mov DWORD PTR 56[esp],eax | ||
1710 | mov DWORD PTR 60[esp],ecx | ||
1711 | jmp L001shortcut | ||
1712 | _sha1_block_asm_host_order ENDP | ||
1713 | _TEXT ENDS | ||
1714 | _sha1_block_asm_data_order ENDP | ||
1715 | _TEXT ENDS | ||
1716 | END | ||
diff --git a/src/lib/libcrypto/sha/asm/sha1-586.pl b/src/lib/libcrypto/sha/asm/sha1-586.pl index 48d9192a4e..09df993ecd 100644 --- a/src/lib/libcrypto/sha/asm/sha1-586.pl +++ b/src/lib/libcrypto/sha/asm/sha1-586.pl | |||
@@ -392,7 +392,7 @@ sub sha1_block_data | |||
392 | &X_expand("esi"); | 392 | &X_expand("esi"); |
393 | &mov(&wparam(1),"esi"); | 393 | &mov(&wparam(1),"esi"); |
394 | 394 | ||
395 | &set_label("shortcut", 1); | 395 | &set_label("shortcut", 0, 1); |
396 | &comment(""); | 396 | &comment(""); |
397 | &comment("Start processing"); | 397 | &comment("Start processing"); |
398 | 398 | ||
diff --git a/src/lib/libcrypto/sha/sha_locl.h b/src/lib/libcrypto/sha/sha_locl.h index 3e6f489b87..2f8aef83f3 100644 --- a/src/lib/libcrypto/sha/sha_locl.h +++ b/src/lib/libcrypto/sha/sha_locl.h | |||
@@ -130,11 +130,7 @@ | |||
130 | # error "Either SHA_0 or SHA_1 must be defined." | 130 | # error "Either SHA_0 or SHA_1 must be defined." |
131 | #endif | 131 | #endif |
132 | 132 | ||
133 | #ifndef FLAT_INC | ||
134 | #include "../md32_common.h" | ||
135 | #else | ||
136 | #include "md32_common.h" | 133 | #include "md32_common.h" |
137 | #endif | ||
138 | 134 | ||
139 | #define INIT_DATA_h0 0x67452301UL | 135 | #define INIT_DATA_h0 0x67452301UL |
140 | #define INIT_DATA_h1 0xefcdab89UL | 136 | #define INIT_DATA_h1 0xefcdab89UL |
diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num index e3818ef6e4..f611d6b283 100644 --- a/src/lib/libcrypto/util/libeay.num +++ b/src/lib/libcrypto/util/libeay.num | |||
@@ -2227,3 +2227,6 @@ BIO_callback_ctrl 2252 | |||
2227 | RAND_egd 2253 | 2227 | RAND_egd 2253 |
2228 | RAND_status 2254 | 2228 | RAND_status 2254 |
2229 | bn_dump1 2255 | 2229 | bn_dump1 2255 |
2230 | des_check_key_parity 2256 | ||
2231 | lh_num_items 2257 | ||
2232 | RAND_event 2258 | ||
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl index 6fbf3ceca6..100d76f279 100644 --- a/src/lib/libcrypto/util/mk1mf.pl +++ b/src/lib/libcrypto/util/mk1mf.pl | |||
@@ -8,6 +8,7 @@ | |||
8 | $INSTALLTOP="/usr/local/ssl"; | 8 | $INSTALLTOP="/usr/local/ssl"; |
9 | $OPTIONS=""; | 9 | $OPTIONS=""; |
10 | $ssl_version=""; | 10 | $ssl_version=""; |
11 | $banner="\t\@echo Building OpenSSL"; | ||
11 | 12 | ||
12 | open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n"; | 13 | open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n"; |
13 | while(<IN>) { | 14 | while(<IN>) { |
@@ -59,6 +60,7 @@ and [options] can be one of | |||
59 | just-ssl - remove all non-ssl keys/digest | 60 | just-ssl - remove all non-ssl keys/digest |
60 | no-asm - No x86 asm | 61 | no-asm - No x86 asm |
61 | nasm - Use NASM for x86 asm | 62 | nasm - Use NASM for x86 asm |
63 | gaswin - Use GNU as with Mingw32 | ||
62 | no-socks - No socket code | 64 | no-socks - No socket code |
63 | no-err - No error strings | 65 | no-err - No error strings |
64 | dll/shlib - Build shared libraries (MS) | 66 | dll/shlib - Build shared libraries (MS) |
@@ -850,6 +852,7 @@ sub read_options | |||
850 | elsif (/^no-hmac$/) { $no_hmac=1; } | 852 | elsif (/^no-hmac$/) { $no_hmac=1; } |
851 | elsif (/^no-asm$/) { $no_asm=1; } | 853 | elsif (/^no-asm$/) { $no_asm=1; } |
852 | elsif (/^nasm$/) { $nasm=1; } | 854 | elsif (/^nasm$/) { $nasm=1; } |
855 | elsif (/^gaswin$/) { $gaswin=1; } | ||
853 | elsif (/^no-ssl2$/) { $no_ssl2=1; } | 856 | elsif (/^no-ssl2$/) { $no_ssl2=1; } |
854 | elsif (/^no-ssl3$/) { $no_ssl3=1; } | 857 | elsif (/^no-ssl3$/) { $no_ssl3=1; } |
855 | elsif (/^no-err$/) { $no_err=1; } | 858 | elsif (/^no-err$/) { $no_err=1; } |
diff --git a/src/lib/libcrypto/util/mkerr.pl b/src/lib/libcrypto/util/mkerr.pl index ebc059ef22..8e18f3c2df 100644 --- a/src/lib/libcrypto/util/mkerr.pl +++ b/src/lib/libcrypto/util/mkerr.pl | |||
@@ -284,6 +284,17 @@ EOF | |||
284 | 284 | ||
285 | # Rewrite the C source file containing the error details. | 285 | # Rewrite the C source file containing the error details. |
286 | 286 | ||
287 | # First, read any existing reason string definitions: | ||
288 | my %err_reason_strings; | ||
289 | if (open(IN,"<$cfile")) { | ||
290 | while (<IN>) { | ||
291 | if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) { | ||
292 | $err_reason_strings{$1} = $2; | ||
293 | } | ||
294 | } | ||
295 | close(IN); | ||
296 | } | ||
297 | |||
287 | my $hincf; | 298 | my $hincf; |
288 | if($static) { | 299 | if($static) { |
289 | $hfile =~ /([^\/]+)$/; | 300 | $hfile =~ /([^\/]+)$/; |
@@ -352,7 +363,8 @@ EOF | |||
352 | */ | 363 | */ |
353 | 364 | ||
354 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 365 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
355 | * made to it will be overwritten when the script next updates this file. | 366 | * made to it will be overwritten when the script next updates this file, |
367 | * only reason strings will be preserved. | ||
356 | */ | 368 | */ |
357 | 369 | ||
358 | #include <stdio.h> | 370 | #include <stdio.h> |
@@ -385,9 +397,13 @@ EOF | |||
385 | foreach $i (@reasons) { | 397 | foreach $i (@reasons) { |
386 | my $rn; | 398 | my $rn; |
387 | my $nspc = 0; | 399 | my $nspc = 0; |
388 | $i =~ /^${lib}_R_(\S+)$/; | 400 | if (exists $err_reason_strings{$i}) { |
389 | $rn = $1; | 401 | $rn = $err_reason_strings{$i}; |
390 | $rn =~ tr/_[A-Z]/ [a-z]/; | 402 | } else { |
403 | $i =~ /^${lib}_R_(\S+)$/; | ||
404 | $rn = $1; | ||
405 | $rn =~ tr/_[A-Z]/ [a-z]/; | ||
406 | } | ||
391 | $nspc = 40 - length($i) unless length($i) > 40; | 407 | $nspc = 40 - length($i) unless length($i) > 40; |
392 | $nspc = " " x $nspc; | 408 | $nspc = " " x $nspc; |
393 | print OUT "{${i}${nspc},\"$rn\"},\n"; | 409 | print OUT "{${i}${nspc},\"$rn\"},\n"; |
@@ -465,7 +481,7 @@ EOF | |||
465 | } | 481 | } |
466 | 482 | ||
467 | close OUT; | 483 | close OUT; |
468 | 484 | undef %err_reason_strings; | |
469 | } | 485 | } |
470 | 486 | ||
471 | if($debug && defined(%notrans)) { | 487 | if($debug && defined(%notrans)) { |
diff --git a/src/lib/libcrypto/util/pl/BC-32.pl b/src/lib/libcrypto/util/pl/BC-32.pl index df6e2c742e..7f57809a16 100644 --- a/src/lib/libcrypto/util/pl/BC-32.pl +++ b/src/lib/libcrypto/util/pl/BC-32.pl | |||
@@ -109,7 +109,7 @@ sub do_lib_rule | |||
109 | { | 109 | { |
110 | # $ret.="\t\$(RM) \$(O_$Name)\n"; | 110 | # $ret.="\t\$(RM) \$(O_$Name)\n"; |
111 | $ret.="\techo LIB $<\n"; | 111 | $ret.="\techo LIB $<\n"; |
112 | $ret.="\t\$(MKLIB) $lfile$target \$(addprefix +, $objs)\n"; | 112 | $ret.="\t&\$(MKLIB) $lfile$target -+\$**\n"; |
113 | } | 113 | } |
114 | else | 114 | else |
115 | { | 115 | { |
diff --git a/src/lib/libcrypto/util/pl/Mingw32.pl b/src/lib/libcrypto/util/pl/Mingw32.pl index 585cacd820..c687d9b118 100644 --- a/src/lib/libcrypto/util/pl/Mingw32.pl +++ b/src/lib/libcrypto/util/pl/Mingw32.pl | |||
@@ -21,6 +21,30 @@ if ($debug) | |||
21 | else | 21 | else |
22 | { $cflags="-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall"; } | 22 | { $cflags="-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall"; } |
23 | 23 | ||
24 | if ($gaswin and !$no_asm) | ||
25 | { | ||
26 | $bn_asm_obj='$(OBJ_D)/bn-win32.o'; | ||
27 | $bn_asm_src='crypto/bn/asm/bn-win32.s'; | ||
28 | $des_enc_obj='$(OBJ_D)/d-win32.o $(OBJ_D)/y-win32.o'; | ||
29 | $des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s'; | ||
30 | $bf_enc_obj='$(OBJ_D)/b-win32.o'; | ||
31 | $bf_enc_src='crypto/bf/asm/b-win32.s'; | ||
32 | # $cast_enc_obj='$(OBJ_D)/c-win32.o'; | ||
33 | # $cast_enc_src='crypto/cast/asm/c-win32.s'; | ||
34 | $rc4_enc_obj='$(OBJ_D)/r4-win32.o'; | ||
35 | $rc4_enc_src='crypto/rc4/asm/r4-win32.s'; | ||
36 | $rc5_enc_obj='$(OBJ_D)/r5-win32.o'; | ||
37 | $rc5_enc_src='crypto/rc5/asm/r5-win32.s'; | ||
38 | $md5_asm_obj='$(OBJ_D)/m5-win32.o'; | ||
39 | $md5_asm_src='crypto/md5/asm/m5-win32.s'; | ||
40 | $rmd160_asm_obj='$(OBJ_D)/rm-win32.o'; | ||
41 | $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s'; | ||
42 | $sha1_asm_obj='$(OBJ_D)/s1-win32.o'; | ||
43 | $sha1_asm_src='crypto/sha/asm/s1-win32.s'; | ||
44 | $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM"; | ||
45 | } | ||
46 | |||
47 | |||
24 | $obj='.o'; | 48 | $obj='.o'; |
25 | $ofile='-o '; | 49 | $ofile='-o '; |
26 | 50 | ||
@@ -76,4 +100,3 @@ sub do_link_rule | |||
76 | return($ret); | 100 | return($ret); |
77 | } | 101 | } |
78 | 1; | 102 | 1; |
79 | |||
diff --git a/src/lib/libcrypto/util/selftest.pl b/src/lib/libcrypto/util/selftest.pl index 91e962a312..04b4425d7e 100644 --- a/src/lib/libcrypto/util/selftest.pl +++ b/src/lib/libcrypto/util/selftest.pl | |||
@@ -25,7 +25,7 @@ open(OUT,">$report") or die; | |||
25 | print OUT "OpenSSL self-test report:\n\n"; | 25 | print OUT "OpenSSL self-test report:\n\n"; |
26 | 26 | ||
27 | $uname=`uname -a`; | 27 | $uname=`uname -a`; |
28 | $uname="??" if $uname eq ""; | 28 | $uname="??\n" if $uname eq ""; |
29 | 29 | ||
30 | $c=`sh config -t`; | 30 | $c=`sh config -t`; |
31 | foreach $_ (split("\n",$c)) { | 31 | foreach $_ (split("\n",$c)) { |
@@ -83,6 +83,11 @@ if (open(TEST,">cctest.c")) { | |||
83 | print OUT "Compiler doesn't work.\n"; | 83 | print OUT "Compiler doesn't work.\n"; |
84 | goto err; | 84 | goto err; |
85 | } | 85 | } |
86 | system("ar r cctest.a /dev/null"); | ||
87 | if (not -f "cctest.a") { | ||
88 | print OUT "Check your archive tool (ar).\n"; | ||
89 | goto err; | ||
90 | } | ||
86 | } else { | 91 | } else { |
87 | print OUT "Can't create cctest.c\n"; | 92 | print OUT "Can't create cctest.c\n"; |
88 | } | 93 | } |
@@ -129,14 +134,14 @@ if (/no-/) | |||
129 | } | 134 | } |
130 | 135 | ||
131 | print "Running make test...\n"; | 136 | print "Running make test...\n"; |
132 | if (system("make test 2>&1 | tee make.log") > 255) | 137 | if (system("make test 2>&1 | tee maketest.log") > 255) |
133 | { | 138 | { |
134 | print OUT "make test failed!\n"; | 139 | print OUT "make test failed!\n"; |
135 | } else { | 140 | } else { |
136 | $ok=1; | 141 | $ok=1; |
137 | } | 142 | } |
138 | 143 | ||
139 | if ($ok and open(IN,"<make.log")) { | 144 | if ($ok and open(IN,"<maketest.log")) { |
140 | while (<IN>) { | 145 | while (<IN>) { |
141 | $ok=2 if /^platform: $platform/; | 146 | $ok=2 if /^platform: $platform/; |
142 | } | 147 | } |
@@ -155,6 +160,15 @@ if ($ok != 2) { | |||
155 | } else { | 160 | } else { |
156 | print OUT "make.log not found!\n"; | 161 | print OUT "make.log not found!\n"; |
157 | } | 162 | } |
163 | if (open(IN,"<maketest.log")) { | ||
164 | while (<IN>) { | ||
165 | print OUT; | ||
166 | } | ||
167 | close(IN); | ||
168 | print OUT $sep; | ||
169 | } else { | ||
170 | print OUT "maketest.log not found!\n"; | ||
171 | } | ||
158 | } else { | 172 | } else { |
159 | print OUT "Test passed.\n"; | 173 | print OUT "Test passed.\n"; |
160 | } | 174 | } |
diff --git a/src/lib/libcrypto/util/sep_lib.sh b/src/lib/libcrypto/util/sep_lib.sh index 34c2c9f8ba..e69de29bb2 100644 --- a/src/lib/libcrypto/util/sep_lib.sh +++ b/src/lib/libcrypto/util/sep_lib.sh | |||
@@ -1,34 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | cwd=`pwd` | ||
4 | /bin/rm -fr tmp/* | ||
5 | |||
6 | cd crypto/des | ||
7 | make -f Makefile.uni tar | ||
8 | make -f Makefile.uni tar_lit | ||
9 | /bin/mv libdes.tgz $cwd/tmp | ||
10 | /bin/mv libdes-l.tgz $cwd/tmp | ||
11 | cd $cwd | ||
12 | |||
13 | for name in md5 sha cast bf idea rc4 rc2 | ||
14 | do | ||
15 | echo doing $name | ||
16 | (cd crypto; tar cfh - $name)|(cd tmp; tar xf -) | ||
17 | cd tmp/$name | ||
18 | /bin/rm -f Makefile | ||
19 | /bin/rm -f Makefile.ssl | ||
20 | /bin/rm -f Makefile.ssl.orig | ||
21 | /bin/rm -f *.old | ||
22 | /bin/mv Makefile.uni Makefile | ||
23 | |||
24 | if [ -d asm ]; then | ||
25 | mkdir asm/perlasm | ||
26 | cp $cwd/crypto/perlasm/*.pl asm/perlasm | ||
27 | fi | ||
28 | cd .. | ||
29 | tar cf - $name|gzip >$name.tgz | ||
30 | # /bin/rm -fr $name | ||
31 | cd $cwd | ||
32 | done | ||
33 | |||
34 | |||
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index d3336d9ceb..0192272e7c 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -284,7 +284,9 @@ DECLARE_STACK_OF(X509_TRUST) | |||
284 | 284 | ||
285 | /* standard trust ids */ | 285 | /* standard trust ids */ |
286 | 286 | ||
287 | #define X509_TRUST_ANY 1 | 287 | #define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */ |
288 | |||
289 | #define X509_TRUST_COMPAT 1 | ||
288 | #define X509_TRUST_SSL_CLIENT 2 | 290 | #define X509_TRUST_SSL_CLIENT 2 |
289 | #define X509_TRUST_SSL_SERVER 3 | 291 | #define X509_TRUST_SSL_SERVER 3 |
290 | #define X509_TRUST_EMAIL 4 | 292 | #define X509_TRUST_EMAIL 4 |
diff --git a/src/lib/libcrypto/x509/x509_err.c b/src/lib/libcrypto/x509/x509_err.c index fdedbdac34..848add56e9 100644 --- a/src/lib/libcrypto/x509/x509_err.c +++ b/src/lib/libcrypto/x509/x509_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index 9f7d67952d..c779aaf94d 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c | |||
@@ -65,7 +65,7 @@ static int tr_cmp(X509_TRUST **a, X509_TRUST **b); | |||
65 | static void trtable_free(X509_TRUST *p); | 65 | static void trtable_free(X509_TRUST *p); |
66 | 66 | ||
67 | static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); | 67 | static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); |
68 | static int trust_any(X509_TRUST *trust, X509 *x, int flags); | 68 | static int trust_compat(X509_TRUST *trust, X509 *x, int flags); |
69 | 69 | ||
70 | static int obj_trust(int id, X509 *x, int flags); | 70 | static int obj_trust(int id, X509 *x, int flags); |
71 | static int (*default_trust)(int id, X509 *x, int flags) = obj_trust; | 71 | static int (*default_trust)(int id, X509 *x, int flags) = obj_trust; |
@@ -76,7 +76,7 @@ static int (*default_trust)(int id, X509 *x, int flags) = obj_trust; | |||
76 | */ | 76 | */ |
77 | 77 | ||
78 | static X509_TRUST trstandard[] = { | 78 | static X509_TRUST trstandard[] = { |
79 | {X509_TRUST_ANY, 0, trust_any, "Any", 0, NULL}, | 79 | {X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL}, |
80 | {X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL}, | 80 | {X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL}, |
81 | {X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Client", NID_server_auth, NULL}, | 81 | {X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Client", NID_server_auth, NULL}, |
82 | {X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL}, | 82 | {X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL}, |
@@ -107,8 +107,8 @@ int X509_check_trust(X509 *x, int id, int flags) | |||
107 | X509_TRUST *pt; | 107 | X509_TRUST *pt; |
108 | int idx; | 108 | int idx; |
109 | if(id == -1) return 1; | 109 | if(id == -1) return 1; |
110 | if(!(idx = X509_TRUST_get_by_id(id))) | 110 | idx = X509_TRUST_get_by_id(id); |
111 | return default_trust(id, x, flags); | 111 | if(idx == -1) return default_trust(id, x, flags); |
112 | pt = X509_TRUST_get0(idx); | 112 | pt = X509_TRUST_get0(idx); |
113 | return pt->check_trust(pt, x, flags); | 113 | return pt->check_trust(pt, x, flags); |
114 | } | 114 | } |
@@ -230,6 +230,11 @@ static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags) | |||
230 | /* we don't have any trust settings: for compatibility | 230 | /* we don't have any trust settings: for compatibility |
231 | * we return trusted if it is self signed | 231 | * we return trusted if it is self signed |
232 | */ | 232 | */ |
233 | return trust_compat(trust, x, flags); | ||
234 | } | ||
235 | |||
236 | static int trust_compat(X509_TRUST *trust, X509 *x, int flags) | ||
237 | { | ||
233 | X509_check_purpose(x, -1, 0); | 238 | X509_check_purpose(x, -1, 0); |
234 | if(x->ex_flags & EXFLAG_SS) return X509_TRUST_TRUSTED; | 239 | if(x->ex_flags & EXFLAG_SS) return X509_TRUST_TRUSTED; |
235 | else return X509_TRUST_UNTRUSTED; | 240 | else return X509_TRUST_UNTRUSTED; |
@@ -257,7 +262,3 @@ static int obj_trust(int id, X509 *x, int flags) | |||
257 | return X509_TRUST_UNTRUSTED; | 262 | return X509_TRUST_UNTRUSTED; |
258 | } | 263 | } |
259 | 264 | ||
260 | static int trust_any(X509_TRUST *trust, X509 *x, int flags) | ||
261 | { | ||
262 | return X509_TRUST_TRUSTED; | ||
263 | } | ||
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 4fdff54124..3ddb2303d3 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
@@ -436,11 +436,14 @@ static int internal_verify(X509_STORE_CTX *ctx) | |||
436 | } | 436 | } |
437 | if (X509_verify(xs,pkey) <= 0) | 437 | if (X509_verify(xs,pkey) <= 0) |
438 | { | 438 | { |
439 | EVP_PKEY_free(pkey); | ||
440 | ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE; | 439 | ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE; |
441 | ctx->current_cert=xs; | 440 | ctx->current_cert=xs; |
442 | ok=(*cb)(0,ctx); | 441 | ok=(*cb)(0,ctx); |
443 | if (!ok) goto end; | 442 | if (!ok) |
443 | { | ||
444 | EVP_PKEY_free(pkey); | ||
445 | goto end; | ||
446 | } | ||
444 | } | 447 | } |
445 | EVP_PKEY_free(pkey); | 448 | EVP_PKEY_free(pkey); |
446 | pkey=NULL; | 449 | pkey=NULL; |
@@ -768,18 +771,25 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, | |||
768 | if(!purpose) purpose = def_purpose; | 771 | if(!purpose) purpose = def_purpose; |
769 | /* If we have a purpose then check it is valid */ | 772 | /* If we have a purpose then check it is valid */ |
770 | if(purpose) { | 773 | if(purpose) { |
774 | X509_PURPOSE *ptmp; | ||
771 | idx = X509_PURPOSE_get_by_id(purpose); | 775 | idx = X509_PURPOSE_get_by_id(purpose); |
772 | if(idx == -1) { | 776 | if(idx == -1) { |
773 | X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT, | 777 | X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT, |
774 | X509_R_UNKNOWN_PURPOSE_ID); | 778 | X509_R_UNKNOWN_PURPOSE_ID); |
775 | return 0; | 779 | return 0; |
776 | } | 780 | } |
777 | /* If trust not set then get from purpose default */ | 781 | ptmp = X509_PURPOSE_get0(idx); |
778 | if(!trust) { | 782 | if(ptmp->trust == X509_TRUST_DEFAULT) { |
779 | X509_PURPOSE *ptmp; | 783 | idx = X509_PURPOSE_get_by_id(def_purpose); |
784 | if(idx == -1) { | ||
785 | X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT, | ||
786 | X509_R_UNKNOWN_PURPOSE_ID); | ||
787 | return 0; | ||
788 | } | ||
780 | ptmp = X509_PURPOSE_get0(idx); | 789 | ptmp = X509_PURPOSE_get0(idx); |
781 | trust = ptmp->trust; | ||
782 | } | 790 | } |
791 | /* If trust not set then get from purpose default */ | ||
792 | if(!trust) trust = ptmp->trust; | ||
783 | } | 793 | } |
784 | if(trust) { | 794 | if(trust) { |
785 | idx = X509_TRUST_get_by_id(trust); | 795 | idx = X509_TRUST_get_by_id(trust); |
diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c index cf2382d42c..4c20e03ece 100644 --- a/src/lib/libcrypto/x509/x509name.c +++ b/src/lib/libcrypto/x509/x509name.c | |||
@@ -352,7 +352,7 @@ int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, | |||
352 | int i; | 352 | int i; |
353 | 353 | ||
354 | if ((ne == NULL) || ((bytes == NULL) && (len != 0))) return(0); | 354 | if ((ne == NULL) || ((bytes == NULL) && (len != 0))) return(0); |
355 | if(type & MBSTRING_FLAG) | 355 | if((type > 0) && (type & MBSTRING_FLAG)) |
356 | return ASN1_STRING_set_by_NID(&ne->value, bytes, | 356 | return ASN1_STRING_set_by_NID(&ne->value, bytes, |
357 | len, type, | 357 | len, type, |
358 | OBJ_obj2nid(ne->object)) ? 1 : 0; | 358 | OBJ_obj2nid(ne->object)) ? 1 : 0; |
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c index b7494ebcd5..5594a1d64f 100644 --- a/src/lib/libcrypto/x509v3/v3_purp.c +++ b/src/lib/libcrypto/x509v3/v3_purp.c | |||
@@ -71,6 +71,7 @@ static int purpose_smime(X509 *x, int ca); | |||
71 | static int check_purpose_smime_sign(X509_PURPOSE *xp, X509 *x, int ca); | 71 | static int check_purpose_smime_sign(X509_PURPOSE *xp, X509 *x, int ca); |
72 | static int check_purpose_smime_encrypt(X509_PURPOSE *xp, X509 *x, int ca); | 72 | static int check_purpose_smime_encrypt(X509_PURPOSE *xp, X509 *x, int ca); |
73 | static int check_purpose_crl_sign(X509_PURPOSE *xp, X509 *x, int ca); | 73 | static int check_purpose_crl_sign(X509_PURPOSE *xp, X509 *x, int ca); |
74 | static int no_check(X509_PURPOSE *xp, X509 *x, int ca); | ||
74 | 75 | ||
75 | static int xp_cmp(X509_PURPOSE **a, X509_PURPOSE **b); | 76 | static int xp_cmp(X509_PURPOSE **a, X509_PURPOSE **b); |
76 | static void xptable_free(X509_PURPOSE *p); | 77 | static void xptable_free(X509_PURPOSE *p); |
@@ -81,7 +82,8 @@ static X509_PURPOSE xstandard[] = { | |||
81 | {X509_PURPOSE_NS_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, check_purpose_ns_ssl_server, "Netscape SSL server", "nssslserver", NULL}, | 82 | {X509_PURPOSE_NS_SSL_SERVER, X509_TRUST_SSL_SERVER, 0, check_purpose_ns_ssl_server, "Netscape SSL server", "nssslserver", NULL}, |
82 | {X509_PURPOSE_SMIME_SIGN, X509_TRUST_EMAIL, 0, check_purpose_smime_sign, "S/MIME signing", "smimesign", NULL}, | 83 | {X509_PURPOSE_SMIME_SIGN, X509_TRUST_EMAIL, 0, check_purpose_smime_sign, "S/MIME signing", "smimesign", NULL}, |
83 | {X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, check_purpose_smime_encrypt, "S/MIME encryption", "smimeencrypt", NULL}, | 84 | {X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, check_purpose_smime_encrypt, "S/MIME encryption", "smimeencrypt", NULL}, |
84 | {X509_PURPOSE_CRL_SIGN, X509_TRUST_ANY, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL}, | 85 | {X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL}, |
86 | {X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, "Any Purpose", "any", NULL}, | ||
85 | }; | 87 | }; |
86 | 88 | ||
87 | #define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) | 89 | #define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) |
@@ -454,3 +456,8 @@ static int check_purpose_crl_sign(X509_PURPOSE *xp, X509 *x, int ca) | |||
454 | if(ku_reject(x, KU_CRL_SIGN)) return 0; | 456 | if(ku_reject(x, KU_CRL_SIGN)) return 0; |
455 | return 1; | 457 | return 1; |
456 | } | 458 | } |
459 | |||
460 | static int no_check(X509_PURPOSE *xp, X509 *x, int ca) | ||
461 | { | ||
462 | return 1; | ||
463 | } | ||
diff --git a/src/lib/libcrypto/x509v3/v3err.c b/src/lib/libcrypto/x509v3/v3err.c index b7d4e350c4..aa4a605dc4 100644 --- a/src/lib/libcrypto/x509v3/v3err.c +++ b/src/lib/libcrypto/x509v3/v3err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h index fe01755797..96ceb7c4fb 100644 --- a/src/lib/libcrypto/x509v3/x509v3.h +++ b/src/lib/libcrypto/x509v3/x509v3.h | |||
@@ -179,8 +179,8 @@ union { | |||
179 | } GENERAL_NAME; | 179 | } GENERAL_NAME; |
180 | 180 | ||
181 | typedef struct ACCESS_DESCRIPTION_st { | 181 | typedef struct ACCESS_DESCRIPTION_st { |
182 | ASN1_OBJECT *method; | 182 | ASN1_OBJECT *method; |
183 | GENERAL_NAME *location; | 183 | GENERAL_NAME *location; |
184 | } ACCESS_DESCRIPTION; | 184 | } ACCESS_DESCRIPTION; |
185 | 185 | ||
186 | DECLARE_STACK_OF(GENERAL_NAME) | 186 | DECLARE_STACK_OF(GENERAL_NAME) |
@@ -344,9 +344,10 @@ typedef struct x509_purpose_st { | |||
344 | #define X509_PURPOSE_SMIME_SIGN 4 | 344 | #define X509_PURPOSE_SMIME_SIGN 4 |
345 | #define X509_PURPOSE_SMIME_ENCRYPT 5 | 345 | #define X509_PURPOSE_SMIME_ENCRYPT 5 |
346 | #define X509_PURPOSE_CRL_SIGN 6 | 346 | #define X509_PURPOSE_CRL_SIGN 6 |
347 | #define X509_PURPOSE_ANY 7 | ||
347 | 348 | ||
348 | #define X509_PURPOSE_MIN 1 | 349 | #define X509_PURPOSE_MIN 1 |
349 | #define X509_PURPOSE_MAX 6 | 350 | #define X509_PURPOSE_MAX 7 |
350 | 351 | ||
351 | DECLARE_STACK_OF(X509_PURPOSE) | 352 | DECLARE_STACK_OF(X509_PURPOSE) |
352 | 353 | ||