aboutsummaryrefslogtreecommitdiff
path: root/openssl/ms/do_fips.bat
blob: 8d27eb05bdfe3494a156c0387981de432551fa70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
@echo off

SET ASM=%1

if NOT X%PROCESSOR_ARCHITECTURE% == X goto defined 

echo Processor Architecture Undefined: defaulting to X86

goto X86

:defined

if %PROCESSOR_ARCHITECTURE% == x86 goto X86

if %PROCESSOR_ARCHITECTURE% == IA64 goto IA64

if %PROCESSOR_ARCHITECTURE% == AMD64 goto AMD64

echo Processor Architecture Unrecognized: defaulting to X86

:X86
echo Auto Configuring for X86

SET TARGET=VC-WIN32

if x%ASM% == xno-asm goto compile
echo Generating x86 for NASM assember
SET ASM=nasm
SET ASMOPTS=-DOPENSSL_IA32_SSE2

echo Bignum
cd crypto\bn\asm
perl bn-586.pl win32n %ASMOPTS% > bn_win32.asm
if ERRORLEVEL 1 goto error
perl co-586.pl win32n %ASMOPTS% > co_win32.asm
if ERRORLEVEL 1 goto error
perl mo-586.pl win32n %ASMOPTS% > mt_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo AES
cd crypto\aes\asm
perl aes-586.pl win32n %ASMOPTS% > a_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo DES
cd crypto\des\asm
perl des-586.pl win32n %ASMOPTS% > d_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo "crypt(3)"

cd crypto\des\asm
perl crypt586.pl win32n %ASMOPTS% > y_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo Blowfish

cd crypto\bf\asm
perl bf-586.pl win32n %ASMOPTS% > b_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo CAST5
cd crypto\cast\asm
perl cast-586.pl win32n %ASMOPTS% > c_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo RC4
cd crypto\rc4\asm
perl rc4-586.pl win32n %ASMOPTS% > r4_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo MD5
cd crypto\md5\asm
perl md5-586.pl win32n %ASMOPTS% > m5_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo SHA1
cd crypto\sha\asm
perl sha1-586.pl win32n %ASMOPTS% > s1_win32.asm
if ERRORLEVEL 1 goto error
perl sha512-sse2.pl win32n %ASMOPTS% > sha512-sse2.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo RIPEMD160
cd crypto\ripemd\asm
perl rmd-586.pl win32n %ASMOPTS% > rm_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo RC5\32
cd crypto\rc5\asm
perl rc5-586.pl win32n %ASMOPTS% > r5_win32.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo CPU-ID
cd crypto
perl x86cpuid.pl win32n %ASMOPTS% > cpu_win32.asm
if ERRORLEVEL 1 goto error
cd ..

goto compile

:IA64

echo Auto Configuring for IA64
SET TARGET=VC-WIN64I
perl ms\uplink.pl win64i > ms\uptable.asm
if ERRORLEVEL 1 goto error
ias -o ms\uptable.obj ms\uptable.asm
if ERRORLEVEL 1 goto error

goto compile

:AMD64

echo Auto Configuring for AMD64
SET TARGET=VC-WIN64A
perl ms\uplink.pl win64a > ms\uptable.asm
if ERRORLEVEL 1 goto error
ml64 -c -Foms\uptable.obj ms\uptable.asm
if ERRORLEVEL 1 goto error

if x%ASM% == xno-asm goto compile
echo Generating x86_64 for ML64 assember
SET ASM=ml64

echo Bignum
cd crypto\bn\asm
perl x86_64-mont.pl x86_64-mont.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo AES
cd crypto\aes\asm
perl aes-x86_64.pl aes-x86_64.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo SHA
cd crypto\sha\asm
perl sha1-x86_64.pl sha1-x86_64.asm
if ERRORLEVEL 1 goto error
perl sha512-x86_64.pl sha256-x86_64.asm
if ERRORLEVEL 1 goto error
perl sha512-x86_64.pl sha512-x86_64.asm
if ERRORLEVEL 1 goto error
cd ..\..\..

echo CPU-ID
cd crypto
perl x86_64cpuid.pl cpuid-x86_64.asm
if ERRORLEVEL 1 goto error
cd ..

:compile

perl Configure %TARGET% fipscanisterbuild
pause

echo on

perl util\mkfiles.pl >MINFO
@if ERRORLEVEL 1 goto error
perl util\mk1mf.pl dll %ASM% %TARGET% >ms\ntdll.mak
@if ERRORLEVEL 1 goto error

perl util\mkdef.pl 32 libeay > ms\libeay32.def
@if ERRORLEVEL 1 goto error
perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
@if ERRORLEVEL 1 goto error

nmake -f ms\ntdll.mak clean
nmake -f ms\ntdll.mak
@if ERRORLEVEL 1 goto error

@echo.
@echo.
@echo.
@echo ***************************
@echo ****FIPS BUILD SUCCESS*****
@echo ***************************

@goto end

:error

@echo.
@echo.
@echo.
@echo ***************************
@echo ****FIPS BUILD FAILURE*****
@echo ***************************

:end