summaryrefslogtreecommitdiffstats
path: root/package/openssl/openssl-0.9.8j-avr32-asm-optimizations.patch.avr32
blob: b9fa2ae01d99a002555b0ae9aa65efc73e1920ae (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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
Index: openssl-0.9.8g/apps/ca.c
===================================================================
--- openssl-0.9.8g.orig/apps/ca.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/apps/ca.c	2008-09-24 11:01:01.000000000 +0200
@@ -834,7 +834,7 @@
 			BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n");
 			goto err;
 			}
-#ifndef OPENSSL_SYS_VMS
+#if !(defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_NEWLIB))
 	    /* outdir is a directory spec, but access() for VMS demands a
 	       filename.  In any case, stat(), below, will catch the problem
 	       if outdir is not a directory spec, and the fopen() or open()
Index: openssl-0.9.8g/apps/Makefile
===================================================================
--- openssl-0.9.8g.orig/apps/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/apps/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -313,18 +313,19 @@
 dsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 dsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 dsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-dsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
-dsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
-dsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
-dsa.o: ../include/openssl/err.h ../include/openssl/evp.h
-dsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-dsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-dsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-dsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
-dsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
-dsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
-dsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
-dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h dsa.c
+dsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h
+dsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+dsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+dsa.o: ../include/openssl/engine.h ../include/openssl/err.h
+dsa.o: ../include/openssl/evp.h ../include/openssl/lhash.h
+dsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+dsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+dsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
+dsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
+dsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
+dsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+dsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
+dsa.o: ../include/openssl/x509_vfy.h apps.h dsa.c
 dsaparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 dsaparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h
@@ -337,11 +338,9 @@
 dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 dsaparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
 dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
-dsaparam.o: ../include/openssl/rand.h ../include/openssl/rsa.h
 dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-dsaparam.o: ../include/openssl/stack.h ../include/openssl/store.h
-dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
-dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h
+dsaparam.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
 dsaparam.o: ../include/openssl/x509_vfy.h apps.h dsaparam.c
 ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h
@@ -430,41 +429,38 @@
 gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-gendh.o: ../include/openssl/dh.h ../include/openssl/dsa.h
-gendh.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
-gendh.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
-gendh.o: ../include/openssl/engine.h ../include/openssl/err.h
-gendh.o: ../include/openssl/evp.h ../include/openssl/lhash.h
-gendh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-gendh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-gendh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
-gendh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
-gendh.o: ../include/openssl/rand.h ../include/openssl/rsa.h
+gendh.o: ../include/openssl/dh.h ../include/openssl/e_os2.h
+gendh.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
+gendh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
+gendh.o: ../include/openssl/err.h ../include/openssl/evp.h
+gendh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
+gendh.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+gendh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h
+gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
 gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-gendh.o: ../include/openssl/stack.h ../include/openssl/store.h
-gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
-gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h
+gendh.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+gendh.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
 gendh.o: ../include/openssl/x509_vfy.h apps.h gendh.c
 gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-gendsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
-gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
-gendsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
-gendsa.o: ../include/openssl/err.h ../include/openssl/evp.h
-gendsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-gendsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-gendsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-gendsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
-gendsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
-gendsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
-gendsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
-gendsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
-gendsa.o: gendsa.c
+gendsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h
+gendsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+gendsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+gendsa.o: ../include/openssl/engine.h ../include/openssl/err.h
+gendsa.o: ../include/openssl/evp.h ../include/openssl/lhash.h
+gendsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+gendsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+gendsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
+gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
+gendsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
+gendsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+gendsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
+gendsa.o: ../include/openssl/x509_vfy.h apps.h gendsa.c
 genrsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 genrsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 genrsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-genrsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h
 genrsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
 genrsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
 genrsa.o: ../include/openssl/engine.h ../include/openssl/err.h
@@ -475,9 +471,8 @@
 genrsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
 genrsa.o: ../include/openssl/rand.h ../include/openssl/rsa.h
 genrsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-genrsa.o: ../include/openssl/stack.h ../include/openssl/store.h
-genrsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
-genrsa.o: ../include/openssl/ui.h ../include/openssl/x509.h
+genrsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+genrsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
 genrsa.o: ../include/openssl/x509_vfy.h apps.h genrsa.c
 nseq.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 nseq.o: ../include/openssl/buffer.h ../include/openssl/conf.h
@@ -634,12 +629,11 @@
 req.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 req.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
 req.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
-req.o: ../include/openssl/rand.h ../include/openssl/rsa.h
-req.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-req.o: ../include/openssl/stack.h ../include/openssl/store.h
+req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+req.o: ../include/openssl/sha.h ../include/openssl/stack.h
 req.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
-req.o: ../include/openssl/ui.h ../include/openssl/x509.h
-req.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h req.c
+req.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
+req.o: ../include/openssl/x509v3.h apps.h req.c
 rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 rsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 rsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
@@ -656,20 +650,21 @@
 rsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
 rsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h rsa.c
 rsautl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-rsautl.o: ../include/openssl/buffer.h ../include/openssl/conf.h
-rsautl.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-rsautl.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
-rsautl.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
-rsautl.o: ../include/openssl/err.h ../include/openssl/evp.h
-rsautl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-rsautl.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-rsautl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-rsautl.o: ../include/openssl/pem.h ../include/openssl/pem2.h
-rsautl.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h
-rsautl.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-rsautl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-rsautl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
-rsautl.o: ../include/openssl/x509_vfy.h apps.h rsautl.c
+rsautl.o: ../include/openssl/bn.h ../include/openssl/buffer.h
+rsautl.o: ../include/openssl/conf.h ../include/openssl/crypto.h
+rsautl.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+rsautl.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+rsautl.o: ../include/openssl/engine.h ../include/openssl/err.h
+rsautl.o: ../include/openssl/evp.h ../include/openssl/lhash.h
+rsautl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+rsautl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+rsautl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
+rsautl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
+rsautl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+rsautl.o: ../include/openssl/sha.h ../include/openssl/stack.h
+rsautl.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
+rsautl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
+rsautl.o: rsautl.c
 s_cb.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 s_cb.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 s_cb.o: ../include/openssl/comp.h ../include/openssl/conf.h
@@ -711,29 +706,8 @@
 s_client.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
 s_client.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
 s_client.o: s_apps.h s_client.c timeouts.h
-s_server.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-s_server.o: ../include/openssl/bn.h ../include/openssl/buffer.h
-s_server.o: ../include/openssl/comp.h ../include/openssl/conf.h
-s_server.o: ../include/openssl/crypto.h ../include/openssl/dh.h
-s_server.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h
-s_server.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
-s_server.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
-s_server.o: ../include/openssl/engine.h ../include/openssl/err.h
-s_server.o: ../include/openssl/evp.h ../include/openssl/kssl.h
-s_server.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-s_server.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-s_server.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-s_server.o: ../include/openssl/pem.h ../include/openssl/pem2.h
-s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h
-s_server.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
-s_server.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
-s_server.o: ../include/openssl/sha.h ../include/openssl/ssl.h
-s_server.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
-s_server.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
-s_server.o: ../include/openssl/store.h ../include/openssl/symhacks.h
-s_server.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
-s_server.o: ../include/openssl/ui.h ../include/openssl/x509.h
-s_server.o: ../include/openssl/x509_vfy.h apps.h s_apps.h s_server.c timeouts.h
+s_server.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
+s_server.o: s_server.c
 s_socket.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 s_socket.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 s_socket.o: ../include/openssl/comp.h ../include/openssl/conf.h
@@ -814,24 +788,25 @@
 speed.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 speed.o: ../include/openssl/cast.h ../include/openssl/conf.h
 speed.o: ../include/openssl/crypto.h ../include/openssl/des.h
-speed.o: ../include/openssl/des_old.h ../include/openssl/dsa.h
-speed.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
-speed.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
-speed.o: ../include/openssl/engine.h ../include/openssl/err.h
-speed.o: ../include/openssl/evp.h ../include/openssl/hmac.h
-speed.o: ../include/openssl/idea.h ../include/openssl/lhash.h
-speed.o: ../include/openssl/md2.h ../include/openssl/md4.h
-speed.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
-speed.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
-speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
-speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
-speed.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-speed.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
-speed.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
-speed.o: ../include/openssl/x509_vfy.h apps.h speed.c testdsa.h testrsa.h
+speed.o: ../include/openssl/des_old.h ../include/openssl/dh.h
+speed.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
+speed.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
+speed.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
+speed.o: ../include/openssl/err.h ../include/openssl/evp.h
+speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
+speed.o: ../include/openssl/lhash.h ../include/openssl/md2.h
+speed.o: ../include/openssl/md4.h ../include/openssl/md5.h
+speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+speed.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
+speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h
+speed.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
+speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
+speed.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
+speed.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
+speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h speed.c
+speed.o: testdsa.h testrsa.h
 spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h
 spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
@@ -882,16 +857,17 @@
 x509.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 x509.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 x509.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-x509.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
-x509.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
-x509.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
-x509.o: ../include/openssl/err.h ../include/openssl/evp.h
-x509.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-x509.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-x509.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-x509.o: ../include/openssl/pem.h ../include/openssl/pem2.h
-x509.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h
-x509.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-x509.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-x509.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
-x509.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h x509.c
+x509.o: ../include/openssl/dh.h ../include/openssl/dsa.h
+x509.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+x509.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+x509.o: ../include/openssl/engine.h ../include/openssl/err.h
+x509.o: ../include/openssl/evp.h ../include/openssl/lhash.h
+x509.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+x509.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+x509.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
+x509.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
+x509.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+x509.o: ../include/openssl/sha.h ../include/openssl/stack.h
+x509.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
+x509.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
+x509.o: ../include/openssl/x509v3.h apps.h x509.c
Index: openssl-0.9.8g/apps/s_client.c
===================================================================
--- openssl-0.9.8g.orig/apps/s_client.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/apps/s_client.c	2008-09-24 11:01:01.000000000 +0200
@@ -137,6 +137,8 @@
 #include "s_apps.h"
 #include "timeouts.h"
 
+#ifndef OPENSSL_SYS_NEWLIB
+
 #ifdef OPENSSL_SYS_WINCE
 /* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
 #ifdef fileno
@@ -1430,3 +1432,4 @@
 	(void)BIO_flush(bio);
 	}
 
+#endif
Index: openssl-0.9.8g/apps/speed.c
===================================================================
--- openssl-0.9.8g.orig/apps/speed.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/apps/speed.c	2008-09-24 11:01:01.000000000 +0200
@@ -237,6 +237,11 @@
  */
 
 /* The following if from times(3) man page.  It may need to be changed */
+#ifdef OPENSSL_SYS_NEWLIB
+#define HZ 1000000.0
+#endif
+
+
 #ifndef HZ
 # if defined(_SC_CLK_TCK) \
      && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
@@ -254,7 +259,7 @@
 # endif
 #endif
 
-#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
+# if !defined(OPENSSL_SYS_NEWLIB) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
 # define HAVE_FORK 1
 #endif
 
@@ -307,6 +312,10 @@
 static int rnd_fake = 0;
 #endif
 
+#ifdef OPENSSL_SYS_NEWLIB
+#undef SIGALRM
+#endif
+
 #ifdef SIGALRM
 #if defined(__STDC__) || defined(sgi) || defined(_AIX)
 #define SIGRETTYPE void
@@ -2675,6 +2684,10 @@
 	OPENSSL_EXIT(mret);
 	}
 
+#ifdef OPENSSL_SYS_NEWLIB
+#undef SIGALRM
+#endif
+
 static void print_message(const char *s, long num, int length)
 	{
 #ifdef SIGALRM
Index: openssl-0.9.8g/apps/s_server.c
===================================================================
--- openssl-0.9.8g.orig/apps/s_server.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/apps/s_server.c	2008-09-24 11:01:01.000000000 +0200
@@ -127,6 +127,7 @@
 
 #include <sys/stat.h>
 #include <openssl/e_os2.h>
+#ifndef OPENSSL_SYS_NEWLIB
 #ifdef OPENSSL_NO_STDIO
 #define APPS_WIN16
 #endif
@@ -2287,3 +2288,5 @@
 		return 0;
 	return 1;
 	}
+
+#endif
Index: openssl-0.9.8g/apps/s_time.c
===================================================================
--- openssl-0.9.8g.orig/apps/s_time.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/apps/s_time.c	2008-09-24 11:01:01.000000000 +0200
@@ -117,6 +117,8 @@
 
 /* The following if from times(3) man page.  It may need to be changed
 */
+#ifndef OPENSSL_SYS_NEWLIB
+
 #ifndef HZ
 # ifdef _SC_CLK_TCK
 #  define HZ ((double)sysconf(_SC_CLK_TCK))
@@ -732,4 +734,5 @@
 	return serverCon;
 	}
 
+#endif
 
Index: openssl-0.9.8g/bench/dummy_rand.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8g/bench/dummy_rand.c	2008-09-24 11:01:01.000000000 +0200
@@ -0,0 +1,55 @@
+#include <openssl/rand.h>
+#include <stdlib.h>
+
+static void dummy_rand_cleanup(void);
+static void dummy_rand_seed(const void *buf, int num);
+static void dummy_rand_add(const void *buf, int num, double add_entropy);
+static int dummy_rand_bytes(unsigned char *buf, int num);
+static int dummy_rand_pseudo_bytes(unsigned char *buf, int num);
+static int dummy_rand_status(void);
+
+RAND_METHOD rand_dummy_meth={
+	dummy_rand_seed,
+	dummy_rand_bytes,
+	dummy_rand_cleanup,
+	dummy_rand_add,
+	dummy_rand_pseudo_bytes,
+	dummy_rand_status
+	}; 
+
+RAND_METHOD *RAND_dummy(void)
+{
+  return(&rand_dummy_meth);
+}
+
+static void dummy_rand_cleanup(void)
+{
+}
+
+static void dummy_rand_add(const void *buf, int num, double add)
+{
+}
+
+static void dummy_rand_seed(const void *buf, int num)
+{
+}
+
+static int dummy_rand_bytes(unsigned char *buf, int num)
+{
+  int i;
+  for (i=0; i < num; i++)
+    buf[i] = (unsigned char)rand();
+  return 1;
+}
+
+/* pseudo-random bytes that are guaranteed to be unique but not
+   unpredictable */
+static int dummy_rand_pseudo_bytes(unsigned char *buf, int num) 
+{
+  return dummy_rand_bytes(buf, num);
+}
+
+static int dummy_rand_status(void)
+{
+  return 1;
+}
Index: openssl-0.9.8g/bench/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8g/bench/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -0,0 +1,139 @@
+#
+#  bench/Makefile
+#
+
+DIR=		bench
+TOP=		..
+CC=		cc
+INCLUDES=	-I$(TOP) -I../include -I../apps
+CFLAG=		-g -static
+MAKEFILE=	Makefile
+PERL=		perl
+RM=		rm -f
+
+PEX_LIBS=
+EX_LIBS= 
+EXE_EXT= 
+
+SHLIB_TARGET=
+
+CFLAGS= -DMONOLITH $(INCLUDES) $(CFLAG)
+
+GENERAL=Makefile
+
+DLIBCRYPTO=../libcrypto.a
+LIBCRYPTO=-L.. -lcrypto
+
+
+EXE= speed-avr32
+
+E_EXE=	speed-avr32
+
+
+E_OBJ=	speed-avr32.o dummy_rand.o
+
+E_SRC=	speed-avr32.c dummy_rand.c
+
+SRC=$(E_SRC)
+
+HEADER=
+
+ALL=    $(GENERAL) $(SRC) $(HEADER)
+
+top:
+	@(cd ..; $(MAKE) DIRS=$(DIR) all)
+
+all:	exe
+
+exe:	$(EXE)
+
+
+files:
+	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
+
+install:
+
+tags:
+	ctags $(SRC)
+
+tests:
+
+links:
+
+lint:
+	lint -DLINT $(INCLUDES) $(SRC)>fluff
+
+depend:
+	@if [ -z "$(THIS)" ]; then \
+	    $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
+	else \
+	    $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(SRC); \
+	fi
+
+dclean:
+	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
+	mv -f Makefile.new $(MAKEFILE)
+
+clean:
+	rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE)
+
+
+$(DLIBCRYPTO):
+	(cd ..; $(MAKE) DIRS=crypto all)
+
+$(EXE): $(E_OBJ) $(DLIBCRYPTO) Makefile
+	$(RM) $(EXE)
+	shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
+		shlib_target="$(SHLIB_TARGET)"; \
+	fi; \
+	LIBRARIES="$(LIBKRB5) $(LIBCRYPTO)" ; \
+	$(MAKE) -f $(TOP)/Makefile.shared -e \
+		APPNAME=$(EXE) OBJECTS="$(E_OBJ)" \
+		LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
+		link_app.$${shlib_target}
+
+
+
+CFLAGS  += -D__FLASH_WS__
+CFLAGS  += -D__SETUP_OSC__
+CFLAGS += -DHZ=66000000
+CFLAGS += -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4
+CFLAGS += -DOPENSSL_NO_MD5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_SHA
+CFLAGS += -DOPENSSL_NO_RIPEMD  -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_HMAC
+CFLAGS += -DOPENSSL_NO_SHA -DOPENSSL_NO_RC4 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RC2
+CFLAGS += -DOPENSSL_NO_IDEA -DOPENSSL_NO_SEED -DOPENSSL_NO_BF
+CFLAGS += -DOPENSSL_NO_CAST -DOPENSSL_NO_DSA -DOPENSSL_NO_ECDSA
+CFLAGS += -DOPENSSL_NO_ENGINE -DRSA_NULL
+CFLAGS += -DOPENSSL_NO_ECDH -DOPENSSL_NO_EC
+#CFLAGS += -DOPENSSL_NO_DES
+#CFLAGS += -DOPENSSL_NO_AES
+#CFLAGS += -DOPENSSL_NO_RSA
+
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+dummy_rand.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
+dummy_rand.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
+dummy_rand.o: dummy_rand.c
+speed-avr32.o: ../apps/./testdsa.h ../apps/./testrsa.h ../include/openssl/aes.h
+speed-avr32.o: ../include/openssl/asn1.h ../include/openssl/bio.h
+speed-avr32.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
+speed-avr32.o: ../include/openssl/buffer.h ../include/openssl/cast.h
+speed-avr32.o: ../include/openssl/crypto.h ../include/openssl/des.h
+speed-avr32.o: ../include/openssl/des_old.h ../include/openssl/dsa.h
+speed-avr32.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+speed-avr32.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+speed-avr32.o: ../include/openssl/err.h ../include/openssl/evp.h
+speed-avr32.o: ../include/openssl/hmac.h ../include/openssl/idea.h
+speed-avr32.o: ../include/openssl/lhash.h ../include/openssl/md2.h
+speed-avr32.o: ../include/openssl/md4.h ../include/openssl/md5.h
+speed-avr32.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+speed-avr32.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+speed-avr32.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
+speed-avr32.o: ../include/openssl/rand.h ../include/openssl/rc2.h
+speed-avr32.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
+speed-avr32.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+speed-avr32.o: ../include/openssl/sha.h ../include/openssl/stack.h
+speed-avr32.o: ../include/openssl/symhacks.h ../include/openssl/ui.h
+speed-avr32.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
+speed-avr32.o: ../include/openssl/x509_vfy.h speed-avr32.c
Index: openssl-0.9.8g/bench/speed-avr32.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8g/bench/speed-avr32.c	2008-09-24 11:01:01.000000000 +0200
@@ -0,0 +1,2966 @@
+/* apps/speed.c -*- mode:C; c-file-style: "eay" -*- */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the OpenSSL open source
+ * license provided above.
+ *
+ * The ECDH and ECDSA speed test software is originally written by
+ * Sumit Gupta of Sun Microsystems Laboratories.
+ *
+ */
+
+/* most of this code has been pilfered from my libdes speed.c program */
+
+
+#undef SECONDS
+#define SECONDS		3
+#define RSA_SECONDS	10
+#define DSA_SECONDS	10
+#define ECDSA_SECONDS   10
+#define ECDH_SECONDS    10
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <string.h>
+#include <math.h>
+//#include "apps.h"
+#define MAIN main
+#ifdef OPENSSL_NO_STDIO
+#define APPS_WIN16
+#endif
+#include <openssl/crypto.h>
+#include <openssl/rand.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#if !defined(OPENSSL_SYS_MSDOS)
+#include OPENSSL_UNISTD
+#endif
+
+#ifndef OPENSSL_SYS_NETWARE
+#include <signal.h>
+#endif
+
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
+# define USE_TOD
+#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
+# define TIMES
+#endif
+#if !defined(OPENSSL_SYS_NEWLIB) && !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) /* FIXME */
+# define TIMEB
+#endif
+
+#if defined(OPENSSL_SYS_NETWARE)
+#undef TIMES
+#undef TIMEB
+#include <time.h>
+#endif
+
+#ifndef _IRIX
+# include <time.h>
+#endif
+#ifdef TIMES
+# include <sys/types.h>
+# include <sys/times.h>
+#endif
+#ifdef USE_TOD
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif
+
+/* Depending on the VMS version, the tms structure is perhaps defined.
+   The __TMS macro will show if it was.  If it wasn't defined, we should
+   undefine TIMES, since that tells the rest of the program how things
+   should be handled.				-- Richard Levitte */
+#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS)
+#undef TIMES
+#endif
+
+#ifdef TIMEB
+#include <sys/timeb.h>
+#endif
+
+#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
+#error "It seems neither struct tms nor struct timeb is supported in this platform!"
+#endif
+
+#if defined(sun) || defined(__ultrix)
+#define _POSIX_SOURCE
+#include <limits.h>
+#include <sys/param.h>
+#endif
+
+#include <openssl/bn.h>
+#ifndef OPENSSL_NO_DES
+#include <openssl/des.h>
+#endif
+#ifndef OPENSSL_NO_AES
+#include <openssl/aes.h>
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+#include <openssl/camellia.h>
+#endif
+#ifndef OPENSSL_NO_MD2
+#include <openssl/md2.h>
+#endif
+#ifndef OPENSSL_NO_MDC2
+#include <openssl/mdc2.h>
+#endif
+#ifndef OPENSSL_NO_MD4
+#include <openssl/md4.h>
+#endif
+#ifndef OPENSSL_NO_MD5
+#include <openssl/md5.h>
+#endif
+#ifndef OPENSSL_NO_HMAC
+#include <openssl/hmac.h>
+#endif
+#include <openssl/evp.h>
+#ifndef OPENSSL_NO_SHA
+#include <openssl/sha.h>
+#endif
+#ifndef OPENSSL_NO_RIPEMD
+#include <openssl/ripemd.h>
+#endif
+#ifndef OPENSSL_NO_RC4
+#include <openssl/rc4.h>
+#endif
+#ifndef OPENSSL_NO_RC5
+#include <openssl/rc5.h>
+#endif
+#ifndef OPENSSL_NO_RC2
+#include <openssl/rc2.h>
+#endif
+#ifndef OPENSSL_NO_IDEA
+#include <openssl/idea.h>
+#endif
+#ifndef OPENSSL_NO_SEED
+#include <openssl/seed.h>
+#endif
+#ifndef OPENSSL_NO_BF
+#include <openssl/blowfish.h>
+#endif
+#ifndef OPENSSL_NO_CAST
+#include <openssl/cast.h>
+#endif
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#include "./testrsa.h"
+#endif
+#include <openssl/x509.h>
+#ifndef OPENSSL_NO_DSA
+#include <openssl/dsa.h>
+#include "./testdsa.h"
+#endif
+#ifndef OPENSSL_NO_ECDSA
+#include <openssl/ecdsa.h>
+#endif
+#ifndef OPENSSL_NO_ECDH
+#include <openssl/ecdh.h>
+#endif
+
+/*
+ * The following "HZ" timing stuff should be sync'd up with the code in
+ * crypto/tmdiff.[ch]. That appears to try to do the same job, though I think
+ * this code is more up to date than libcrypto's so there may be features to
+ * migrate over first. This is used in two places further down AFAICS.
+ * The point is that nothing in openssl actually *uses* that tmdiff stuff, so
+ * either speed.c should be using it or it should go because it's obviously not
+ * useful enough. Anyone want to do a janitorial job on this?
+ */
+
+/* The following if from times(3) man page.  It may need to be changed */
+
+#undef BIO_flush
+#undef BIO_printf
+#define BIO_flush fflush
+#define BIO_printf fprintf
+#define bio_err stderr
+
+//#define fprintf(...) /* */
+//#define printf(...) /* */
+
+#ifndef HZ
+# if defined(_SC_CLK_TCK) \
+     && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
+#  define HZ sysconf(_SC_CLK_TCK)
+# else
+#  ifndef CLK_TCK
+#   ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
+#    define HZ	100.0
+#   else /* _BSD_CLK_TCK_ */
+#    define HZ ((double)_BSD_CLK_TCK_)
+#   endif
+#  else /* CLK_TCK */
+#   define HZ ((double)CLK_TCK)
+#  endif
+# endif
+#endif
+
+# if !defined(OPENSSL_SYS_NEWLIB) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
+# define HAVE_FORK 1
+#endif
+
+#undef BUFSIZE
+#define BUFSIZE	((long)1024*8+1)
+int run=0;
+
+static char ftime_used = 0, times_used = 0, gettimeofday_used = 0, getrusage_used = 0;
+static int mr=0;
+static int usertime=1;
+
+static double Time_F(int s);
+static void print_message(const char *s,long num,int length);
+static void pkey_print_message(const char *str, const char *str2,
+	long num, int bits, int sec);
+static void print_result(int alg,int run_no,int count,double time_used);
+#ifdef HAVE_FORK
+static int do_multi(int multi);
+#endif
+
+#define ALGOR_NUM	28
+#define SIZE_NUM	5
+#define RSA_NUM		4
+#define DSA_NUM		3
+
+#define EC_NUM       16
+#define MAX_ECDH_SIZE 256
+
+static const char *names[ALGOR_NUM]={
+  "md2","mdc2","md4","md5","hmac(md5)","sha1","rmd160","rc4",
+  "des cbc","des ede3","idea cbc","seed cbc",
+  "rc2 cbc","rc5-32/12 cbc","blowfish cbc","cast cbc",
+  "aes-128 cbc","aes-192 cbc","aes-256 cbc",
+  "camellia-128 cbc","camellia-192 cbc","camellia-256 cbc",
+  "evp","sha256","sha512",
+  "aes-128 ige","aes-192 ige","aes-256 ige"};
+static double results[ALGOR_NUM][SIZE_NUM];
+static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
+static double rsa_results[RSA_NUM][2];
+static double dsa_results[DSA_NUM][2];
+#ifndef OPENSSL_NO_ECDSA
+static double ecdsa_results[EC_NUM][2];
+#endif
+#ifndef OPENSSL_NO_ECDH
+static double ecdh_results[EC_NUM][1];
+#endif
+
+#if 1 /*defined(OPENSSL_NO_DSA) && !(defined(OPENSSL_NO_ECDSA) && defined(OPENSSL_NO_ECDH))*/
+static const char rnd_seed[] = "string to make the random number generator think it has entropy";
+static int rnd_fake = 0;
+#endif
+
+#ifdef OPENSSL_SYS_NEWLIB
+#undef SIGALRM
+#endif
+
+#ifdef SIGALRM
+#if defined(__STDC__) || defined(sgi) || defined(_AIX)
+#define SIGRETTYPE void
+#else
+#define SIGRETTYPE int
+#endif
+
+static SIGRETTYPE sig_done(int sig);
+static SIGRETTYPE sig_done(int sig)
+	{
+	signal(SIGALRM,sig_done);
+	run=0;
+#ifdef LINT
+	sig=sig;
+#endif
+	}
+#endif
+
+#define START	0
+#define STOP	1
+
+#if defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_NEWLIB)
+
+   /* for NetWare the best we can do is use clock() which returns the
+    * time, in hundredths of a second, since the NLM began executing
+   */
+static double Time_F(int s)
+	{
+	double ret;
+
+   static clock_t tstart,tend;
+
+   if (s == START)
+   {
+      tstart=clock();
+      return(0);
+   }
+   else
+   {
+      tend=clock();
+      ret=(double)((double)(tend)-(double)(tstart))/(double)HZ;
+      return((ret < 0.001)?0.001:ret);
+   }
+   }
+
+#else
+
+static double Time_F(int s)
+	{
+	double ret;
+
+#ifdef USE_TOD
+	if(usertime)
+		{
+		static struct rusage tstart,tend;
+
+		getrusage_used = 1;
+		if (s == START)
+			{
+			getrusage(RUSAGE_SELF,&tstart);
+			return(0);
+			}
+		else
+			{
+			long i;
+
+			getrusage(RUSAGE_SELF,&tend);
+			i=(long)tend.ru_utime.tv_usec-(long)tstart.ru_utime.tv_usec;
+			ret=((double)(tend.ru_utime.tv_sec-tstart.ru_utime.tv_sec))
+			  +((double)i)/1000000.0;
+			return((ret < 0.001)?0.001:ret);
+			}
+		}
+	else
+		{
+		static struct timeval tstart,tend;
+		long i;
+
+		gettimeofday_used = 1;
+		if (s == START)
+			{
+			gettimeofday(&tstart,NULL);
+			return(0);
+			}
+		else
+			{
+			gettimeofday(&tend,NULL);
+			i=(long)tend.tv_usec-(long)tstart.tv_usec;
+			ret=((double)(tend.tv_sec-tstart.tv_sec))+((double)i)/1000000.0;
+			return((ret < 0.001)?0.001:ret);
+			}
+		}
+#else  /* ndef USE_TOD */
+
+# ifdef TIMES
+	if (usertime)
+		{
+		static struct tms tstart,tend;
+
+		times_used = 1;
+		if (s == START)
+			{
+			times(&tstart);
+			return(0);
+			}
+		else
+			{
+			times(&tend);
+			ret = HZ;
+			ret=(double)(tend.tms_utime-tstart.tms_utime) / ret;
+			return((ret < 1e-3)?1e-3:ret);
+			}
+		}
+# endif /* times() */
+# if defined(TIMES) && defined(TIMEB)
+	else
+# endif
+# ifdef OPENSSL_SYS_VXWORKS
+                {
+		static unsigned long tick_start, tick_end;
+
+		if( s == START )
+			{
+			tick_start = tickGet();
+			return 0;
+			}
+		else
+			{
+			tick_end = tickGet();
+			ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
+			return((ret < 0.001)?0.001:ret);
+			}
+                }
+# elif defined(TIMEB)
+		{
+		static struct timeb tstart,tend;
+		long i;
+
+		ftime_used = 1;
+		if (s == START)
+			{
+			ftime(&tstart);
+			return(0);
+			}
+		else
+			{
+			ftime(&tend);
+			i=(long)tend.millitm-(long)tstart.millitm;
+			ret=((double)(tend.time-tstart.time))+((double)i)/1000.0;
+			return((ret < 0.001)?0.001:ret);
+			}
+		}
+# endif
+#endif
+	}
+#endif /* if defined(OPENSSL_SYS_NETWARE) */
+
+
+#ifndef OPENSSL_NO_ECDH
+static const int KDF1_SHA1_len = 20;
+static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen)
+	{
+#ifndef OPENSSL_NO_SHA
+	if (*outlen < SHA_DIGEST_LENGTH)
+		return NULL;
+	else
+		*outlen = SHA_DIGEST_LENGTH;
+	return SHA1(in, inlen, out);
+#else
+	return NULL;
+#endif	/* OPENSSL_NO_SHA */
+	}
+#endif	/* OPENSSL_NO_ECDH */
+
+extern RAND_METHOD rand_dummy_meth;
+
+int MAIN(int, char **);
+
+int MAIN(int argc, char **argv)
+	{
+#ifndef OPENSSL_NO_ENGINE
+	ENGINE *e = NULL;
+#endif
+	unsigned char *buf=NULL,*buf2=NULL;
+	int mret=1;
+	long count=5000,save_count=0;
+	int i,j,k;
+#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA)
+	long rsa_count;
+#endif
+#ifndef OPENSSL_NO_RSA
+	unsigned rsa_num;
+#endif
+	unsigned char md[EVP_MAX_MD_SIZE];
+#ifndef OPENSSL_NO_MD2
+	unsigned char md2[MD2_DIGEST_LENGTH];
+#endif
+#ifndef OPENSSL_NO_MDC2
+	unsigned char mdc2[MDC2_DIGEST_LENGTH];
+#endif
+#ifndef OPENSSL_NO_MD4
+	unsigned char md4[MD4_DIGEST_LENGTH];
+#endif
+#ifndef OPENSSL_NO_MD5
+	unsigned char md5[MD5_DIGEST_LENGTH];
+	unsigned char hmac[MD5_DIGEST_LENGTH];
+#endif
+#ifndef OPENSSL_NO_SHA
+	unsigned char sha[SHA_DIGEST_LENGTH];
+#ifndef OPENSSL_NO_SHA256
+	unsigned char sha256[SHA256_DIGEST_LENGTH];
+#endif
+#ifndef OPENSSL_NO_SHA512
+	unsigned char sha512[SHA512_DIGEST_LENGTH];
+#endif
+#endif
+#ifndef OPENSSL_NO_RIPEMD
+	unsigned char rmd160[RIPEMD160_DIGEST_LENGTH];
+#endif
+#ifndef OPENSSL_NO_RC4
+	RC4_KEY rc4_ks;
+#endif
+#ifndef OPENSSL_NO_RC5
+	RC5_32_KEY rc5_ks;
+#endif
+#ifndef OPENSSL_NO_RC2
+	RC2_KEY rc2_ks;
+#endif
+#ifndef OPENSSL_NO_IDEA
+	IDEA_KEY_SCHEDULE idea_ks;
+#endif
+#ifndef OPENSSL_NO_SEED
+	SEED_KEY_SCHEDULE seed_ks;
+#endif
+#ifndef OPENSSL_NO_BF
+	BF_KEY bf_ks;
+#endif
+#ifndef OPENSSL_NO_CAST
+	CAST_KEY cast_ks;
+#endif
+	static const unsigned char key16[16]=
+		{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
+		 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
+#ifndef OPENSSL_NO_AES
+	static const unsigned char key24[24]=
+		{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
+		 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
+		 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
+	static const unsigned char key32[32]=
+		{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
+		 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
+		 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,
+		 0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56};
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+	static const unsigned char ckey24[24]=
+		{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
+		 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
+		 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
+	static const unsigned char ckey32[32]=
+		{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
+		 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
+		 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,
+		 0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56};
+#endif
+#ifndef OPENSSL_NO_AES
+#define MAX_BLOCK_SIZE 128
+#else
+#define MAX_BLOCK_SIZE 64
+#endif
+	unsigned char DES_iv[8];
+	unsigned char iv[MAX_BLOCK_SIZE/8];
+#ifndef OPENSSL_NO_DES
+	DES_cblock *buf_as_des_cblock = NULL;
+	static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
+	static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
+	static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
+	DES_key_schedule sch;
+	DES_key_schedule sch2;
+	DES_key_schedule sch3;
+#endif
+#ifndef OPENSSL_NO_AES
+	AES_KEY aes_ks1, aes_ks2, aes_ks3;
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+	CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3;
+#endif
+#define	D_MD2		0
+#define	D_MDC2		1
+#define	D_MD4		2
+#define	D_MD5		3
+#define	D_HMAC		4
+#define	D_SHA1		5
+#define D_RMD160	6
+#define	D_RC4		7
+#define	D_CBC_DES	8
+#define	D_EDE3_DES	9
+#define	D_CBC_IDEA	10
+#define	D_CBC_SEED	11
+#define	D_CBC_RC2	12
+#define	D_CBC_RC5	13
+#define	D_CBC_BF	14
+#define	D_CBC_CAST	15
+#define D_CBC_128_AES	16
+#define D_CBC_192_AES	17
+#define D_CBC_256_AES	18
+#define D_CBC_128_CML   19
+#define D_CBC_192_CML   20
+#define D_CBC_256_CML   21
+#define D_EVP		22
+#define D_SHA256	23
+#define D_SHA512	24
+#define D_IGE_128_AES   25
+#define D_IGE_192_AES   26
+#define D_IGE_256_AES   27
+	double d=0.0;
+	long c[ALGOR_NUM][SIZE_NUM];
+#define	R_DSA_512	0
+#define	R_DSA_1024	1
+#define	R_DSA_2048	2
+#define	R_RSA_512	0
+#define	R_RSA_1024	1
+#define	R_RSA_2048	2
+#define	R_RSA_4096	3
+
+#define R_EC_P160    0
+#define R_EC_P192    1
+#define R_EC_P224    2
+#define R_EC_P256    3
+#define R_EC_P384    4
+#define R_EC_P521    5
+#define R_EC_K163    6
+#define R_EC_K233    7
+#define R_EC_K283    8
+#define R_EC_K409    9
+#define R_EC_K571    10
+#define R_EC_B163    11
+#define R_EC_B233    12
+#define R_EC_B283    13
+#define R_EC_B409    14
+#define R_EC_B571    15
+
+#ifndef OPENSSL_NO_RSA
+	RSA *rsa_key[RSA_NUM];
+	long rsa_c[RSA_NUM][2];
+	static unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096};
+	static unsigned char *rsa_data[RSA_NUM] =
+            {test512,test1024,test2048,0/*test4096*/};
+	static int rsa_data_length[RSA_NUM]={
+		sizeof(test512),sizeof(test1024),
+		sizeof(test2048),sizeof(test4096)};
+#endif
+#ifndef OPENSSL_NO_DSA
+	DSA *dsa_key[DSA_NUM];
+	long dsa_c[DSA_NUM][2];
+	static unsigned int dsa_bits[DSA_NUM]={512,1024,2048};
+#endif
+#ifndef OPENSSL_NO_EC
+	/* We only test over the following curves as they are representative,
+	 * To add tests over more curves, simply add the curve NID
+	 * and curve name to the following arrays and increase the
+	 * EC_NUM value accordingly.
+	 */
+	static unsigned int test_curves[EC_NUM] =
+	{
+	/* Prime Curves */
+	NID_secp160r1,
+	NID_X9_62_prime192v1,
+	NID_secp224r1,
+	NID_X9_62_prime256v1,
+	NID_secp384r1,
+	NID_secp521r1,
+	/* Binary Curves */
+	NID_sect163k1,
+	NID_sect233k1,
+	NID_sect283k1,
+	NID_sect409k1,
+	NID_sect571k1,
+	NID_sect163r2,
+	NID_sect233r1,
+	NID_sect283r1,
+	NID_sect409r1,
+	NID_sect571r1
+	};
+	static const char * test_curves_names[EC_NUM] =
+	{
+	/* Prime Curves */
+	"secp160r1",
+	"nistp192",
+	"nistp224",
+	"nistp256",
+	"nistp384",
+	"nistp521",
+	/* Binary Curves */
+	"nistk163",
+	"nistk233",
+	"nistk283",
+	"nistk409",
+	"nistk571",
+	"nistb163",
+	"nistb233",
+	"nistb283",
+	"nistb409",
+	"nistb571"
+	};
+	static int test_curves_bits[EC_NUM] =
+        {
+        160, 192, 224, 256, 384, 521,
+        163, 233, 283, 409, 571,
+        163, 233, 283, 409, 571
+        };
+
+#endif
+
+#ifndef OPENSSL_NO_ECDSA
+	unsigned char ecdsasig[256];
+	unsigned int ecdsasiglen;
+	EC_KEY *ecdsa[EC_NUM];
+	long ecdsa_c[EC_NUM][2];
+#endif
+
+#ifndef OPENSSL_NO_ECDH
+	EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];
+	unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];
+	int secret_size_a, secret_size_b;
+	int ecdh_checks = 0;
+	int secret_idx = 0;
+	long ecdh_c[EC_NUM][2];
+#endif
+
+	int rsa_doit[RSA_NUM];
+	int dsa_doit[DSA_NUM];
+#ifndef OPENSSL_NO_ECDSA
+	int ecdsa_doit[EC_NUM];
+#endif
+#ifndef OPENSSL_NO_ECDH
+        int ecdh_doit[EC_NUM];
+#endif
+	int doit[ALGOR_NUM];
+	int pr_header=0;
+	const EVP_CIPHER *evp_cipher=NULL;
+	const EVP_MD *evp_md=NULL;
+	int decrypt=0;
+#ifdef HAVE_FORK
+	int multi=0;
+#endif
+
+#ifndef TIMES
+	usertime=-1;
+#endif
+
+	//apps_startup();
+	memset(results, 0, sizeof(results));
+#ifndef OPENSSL_NO_DSA
+	memset(dsa_key,0,sizeof(dsa_key));
+#endif
+#ifndef OPENSSL_NO_ECDSA
+	for (i=0; i<EC_NUM; i++) ecdsa[i] = NULL;
+#endif
+#ifndef OPENSSL_NO_ECDH
+	for (i=0; i<EC_NUM; i++)
+		{
+		ecdh_a[i] = NULL;
+		ecdh_b[i] = NULL;
+		}
+#endif
+
+
+	//if (bio_err == NULL)
+	//	if ((bio_err=BIO_new(BIO_s_file())) != NULL)
+	//		BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
+
+	//if (!load_config(bio_err, NULL))
+	//	goto end;
+
+#ifndef OPENSSL_NO_RSA
+	memset(rsa_key,0,sizeof(rsa_key));
+	for (i=0; i<RSA_NUM; i++)
+		rsa_key[i]=NULL;
+#endif
+
+
+	if ((buf=(unsigned char *)/*OPENSSL_*/malloc((int)BUFSIZE)) == NULL)
+		{
+                    fprintf(stderr, "out of memory");
+                    //BIO_printf(bio_err,"out of memory\n");
+                    goto end;
+		}
+#ifndef OPENSSL_NO_DES
+	buf_as_des_cblock = (DES_cblock *)buf;
+#endif
+	if ((buf2=(unsigned char *)/*OPENSSL_*/malloc((int)BUFSIZE)) == NULL)
+		{
+                    fprintf(stderr, "out of memory");
+                    //BIO_printf(bio_err,"out of memory\n");
+                    goto end;
+		}
+
+	memset(c,0,sizeof(c));
+	memset(DES_iv,0,sizeof(DES_iv));
+	memset(iv,0,sizeof(iv));
+
+	for (i=0; i<ALGOR_NUM; i++)
+		doit[i]=0;
+	for (i=0; i<RSA_NUM; i++)
+		rsa_doit[i]=0;
+	for (i=0; i<DSA_NUM; i++)
+		dsa_doit[i]=0;
+#ifndef OPENSSL_NO_ECDSA
+	for (i=0; i<EC_NUM; i++)
+		ecdsa_doit[i]=0;
+#endif
+#ifndef OPENSSL_NO_ECDH
+	for (i=0; i<EC_NUM; i++)
+		ecdh_doit[i]=0;
+#endif
+
+
+	j=0;
+	argc--;
+	argv++;
+	while (argc)
+		{
+		if	((argc > 0) && (strcmp(*argv,"-elapsed") == 0))
+			{
+			usertime = 0;
+			j--;	/* Otherwise, -elapsed gets confused with
+				   an algorithm. */
+			}
+		else /*if	((argc > 0) && (strcmp(*argv,"-evp") == 0))
+			{
+			argc--;
+			argv++;
+			if(argc == 0)
+				{
+				BIO_printf(bio_err,"no EVP given\n");
+				goto end;
+				}
+			evp_cipher=EVP_get_cipherbyname(*argv);
+			if(!evp_cipher)
+				{
+				evp_md=EVP_get_digestbyname(*argv);
+				}
+			if(!evp_cipher && !evp_md)
+				{
+				BIO_printf(bio_err,"%s is an unknown cipher or digest\n",*argv);
+				goto end;
+				}
+			doit[D_EVP]=1;
+			}
+                        else */if (argc > 0 && !strcmp(*argv,"-decrypt"))
+			{
+			decrypt=1;
+			j--;	/* Otherwise, -elapsed gets confused with
+				   an algorithm. */
+			}
+#ifndef OPENSSL_NO_ENGINE
+		else if	((argc > 0) && (strcmp(*argv,"-engine") == 0))
+			{
+			argc--;
+			argv++;
+			if(argc == 0)
+				{
+				BIO_printf(bio_err,"no engine given\n");
+				goto end;
+				}
+                        e = setup_engine(bio_err, *argv, 0);
+			/* j will be increased again further down.  We just
+			   don't want speed to confuse an engine with an
+			   algorithm, especially when none is given (which
+			   means all of them should be run) */
+			j--;
+			}
+#endif
+#ifdef HAVE_FORK
+		else if	((argc > 0) && (strcmp(*argv,"-multi") == 0))
+			{
+			argc--;
+			argv++;
+			if(argc == 0)
+				{
+				BIO_printf(bio_err,"no multi count given\n");
+				goto end;
+				}
+			multi=atoi(argv[0]);
+			if(multi <= 0)
+			    {
+				BIO_printf(bio_err,"bad multi count\n");
+				goto end;
+				}
+			j--;	/* Otherwise, -mr gets confused with
+				   an algorithm. */
+			}
+#endif
+		else if (argc > 0 && !strcmp(*argv,"-mr"))
+			{
+			mr=1;
+			j--;	/* Otherwise, -mr gets confused with
+				   an algorithm. */
+			}
+		else
+#ifndef OPENSSL_NO_MD2
+		if	(strcmp(*argv,"md2") == 0) doit[D_MD2]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_MDC2
+			if (strcmp(*argv,"mdc2") == 0) doit[D_MDC2]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_MD4
+			if (strcmp(*argv,"md4") == 0) doit[D_MD4]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_MD5
+			if (strcmp(*argv,"md5") == 0) doit[D_MD5]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_MD5
+			if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_SHA
+			if (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1;
+		else
+			if (strcmp(*argv,"sha") == 0)	doit[D_SHA1]=1,
+							doit[D_SHA256]=1,
+							doit[D_SHA512]=1;
+		else
+#ifndef OPENSSL_NO_SHA256
+			if (strcmp(*argv,"sha256") == 0) doit[D_SHA256]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_SHA512
+			if (strcmp(*argv,"sha512") == 0) doit[D_SHA512]=1;
+		else
+#endif
+#endif
+#ifndef OPENSSL_NO_RIPEMD
+			if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1;
+		else
+			if (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1;
+		else
+			if (strcmp(*argv,"ripemd160") == 0) doit[D_RMD160]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_RC4
+			if (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_DES
+			if (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1;
+		else	if (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_AES
+			if (strcmp(*argv,"aes-128-cbc") == 0) doit[D_CBC_128_AES]=1;
+		else	if (strcmp(*argv,"aes-192-cbc") == 0) doit[D_CBC_192_AES]=1;
+		else	if (strcmp(*argv,"aes-256-cbc") == 0) doit[D_CBC_256_AES]=1;
+		else    if (strcmp(*argv,"aes-128-ige") == 0) doit[D_IGE_128_AES]=1;
+		else	if (strcmp(*argv,"aes-192-ige") == 0) doit[D_IGE_192_AES]=1;
+		else	if (strcmp(*argv,"aes-256-ige") == 0) doit[D_IGE_256_AES]=1;
+                else
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+			if (strcmp(*argv,"camellia-128-cbc") == 0) doit[D_CBC_128_CML]=1;
+		else    if (strcmp(*argv,"camellia-192-cbc") == 0) doit[D_CBC_192_CML]=1;
+		else    if (strcmp(*argv,"camellia-256-cbc") == 0) doit[D_CBC_256_CML]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_RSA
+#if 0 /* was: #ifdef RSAref */
+			if (strcmp(*argv,"rsaref") == 0)
+			{
+			RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
+			j--;
+			}
+		else
+#endif
+#ifndef RSA_NULL
+			if (strcmp(*argv,"openssl") == 0)
+			{
+			RSA_set_default_method(RSA_PKCS1_SSLeay());
+			j--;
+			}
+		else
+#endif
+#endif /* !OPENSSL_NO_RSA */
+		     if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2;
+		else if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2;
+		else if (strcmp(*argv,"dsa2048") == 0) dsa_doit[R_DSA_2048]=2;
+		else if (strcmp(*argv,"rsa512") == 0) rsa_doit[R_RSA_512]=2;
+		else if (strcmp(*argv,"rsa1024") == 0) rsa_doit[R_RSA_1024]=2;
+		else if (strcmp(*argv,"rsa2048") == 0) rsa_doit[R_RSA_2048]=2;
+		else if (strcmp(*argv,"rsa4096") == 0) rsa_doit[R_RSA_4096]=2;
+		else
+#ifndef OPENSSL_NO_RC2
+		     if (strcmp(*argv,"rc2-cbc") == 0) doit[D_CBC_RC2]=1;
+		else if (strcmp(*argv,"rc2") == 0) doit[D_CBC_RC2]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_RC5
+		     if (strcmp(*argv,"rc5-cbc") == 0) doit[D_CBC_RC5]=1;
+		else if (strcmp(*argv,"rc5") == 0) doit[D_CBC_RC5]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_IDEA
+		     if (strcmp(*argv,"idea-cbc") == 0) doit[D_CBC_IDEA]=1;
+		else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_SEED
+		     if (strcmp(*argv,"seed-cbc") == 0) doit[D_CBC_SEED]=1;
+		else if (strcmp(*argv,"seed") == 0) doit[D_CBC_SEED]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_BF
+		     if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1;
+		else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1;
+		else if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_CAST
+		     if (strcmp(*argv,"cast-cbc") == 0) doit[D_CBC_CAST]=1;
+		else if (strcmp(*argv,"cast") == 0) doit[D_CBC_CAST]=1;
+		else if (strcmp(*argv,"cast5") == 0) doit[D_CBC_CAST]=1;
+		else
+#endif
+#ifndef OPENSSL_NO_DES
+			if (strcmp(*argv,"des") == 0)
+			{
+			doit[D_CBC_DES]=1;
+			doit[D_EDE3_DES]=1;
+			}
+		else
+#endif
+#ifndef OPENSSL_NO_AES
+			if (strcmp(*argv,"aes") == 0)
+			{
+			doit[D_CBC_128_AES]=1;
+			doit[D_CBC_192_AES]=1;
+			doit[D_CBC_256_AES]=1;
+			doit[D_IGE_128_AES]=1;
+			doit[D_IGE_192_AES]=1;
+			doit[D_IGE_256_AES]=1;
+			}
+		else
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+			if (strcmp(*argv,"camellia") == 0)
+			{
+			doit[D_CBC_128_CML]=1;
+			doit[D_CBC_192_CML]=1;
+			doit[D_CBC_256_CML]=1;
+			}
+		else
+#endif
+#ifndef OPENSSL_NO_RSA
+			if (strcmp(*argv,"rsa") == 0)
+			{
+			rsa_doit[R_RSA_512]=1;
+			rsa_doit[R_RSA_1024]=1;
+			rsa_doit[R_RSA_2048]=1;
+			rsa_doit[R_RSA_4096]=1;
+			}
+		else
+#endif
+#ifndef OPENSSL_NO_DSA
+			if (strcmp(*argv,"dsa") == 0)
+			{
+			dsa_doit[R_DSA_512]=1;
+			dsa_doit[R_DSA_1024]=1;
+			dsa_doit[R_DSA_2048]=1;
+			}
+		else
+#endif
+#ifndef OPENSSL_NO_ECDSA
+		     if (strcmp(*argv,"ecdsap160") == 0) ecdsa_doit[R_EC_P160]=2;
+		else if (strcmp(*argv,"ecdsap192") == 0) ecdsa_doit[R_EC_P192]=2;
+		else if (strcmp(*argv,"ecdsap224") == 0) ecdsa_doit[R_EC_P224]=2;
+		else if (strcmp(*argv,"ecdsap256") == 0) ecdsa_doit[R_EC_P256]=2;
+		else if (strcmp(*argv,"ecdsap384") == 0) ecdsa_doit[R_EC_P384]=2;
+		else if (strcmp(*argv,"ecdsap521") == 0) ecdsa_doit[R_EC_P521]=2;
+		else if (strcmp(*argv,"ecdsak163") == 0) ecdsa_doit[R_EC_K163]=2;
+		else if (strcmp(*argv,"ecdsak233") == 0) ecdsa_doit[R_EC_K233]=2;
+		else if (strcmp(*argv,"ecdsak283") == 0) ecdsa_doit[R_EC_K283]=2;
+		else if (strcmp(*argv,"ecdsak409") == 0) ecdsa_doit[R_EC_K409]=2;
+		else if (strcmp(*argv,"ecdsak571") == 0) ecdsa_doit[R_EC_K571]=2;
+		else if (strcmp(*argv,"ecdsab163") == 0) ecdsa_doit[R_EC_B163]=2;
+		else if (strcmp(*argv,"ecdsab233") == 0) ecdsa_doit[R_EC_B233]=2;
+		else if (strcmp(*argv,"ecdsab283") == 0) ecdsa_doit[R_EC_B283]=2;
+		else if (strcmp(*argv,"ecdsab409") == 0) ecdsa_doit[R_EC_B409]=2;
+		else if (strcmp(*argv,"ecdsab571") == 0) ecdsa_doit[R_EC_B571]=2;
+		else if (strcmp(*argv,"ecdsa") == 0)
+			{
+			for (i=0; i < EC_NUM; i++)
+				ecdsa_doit[i]=1;
+			}
+		else
+#endif
+#ifndef OPENSSL_NO_ECDH
+		     if (strcmp(*argv,"ecdhp160") == 0) ecdh_doit[R_EC_P160]=2;
+		else if (strcmp(*argv,"ecdhp192") == 0) ecdh_doit[R_EC_P192]=2;
+		else if (strcmp(*argv,"ecdhp224") == 0) ecdh_doit[R_EC_P224]=2;
+		else if (strcmp(*argv,"ecdhp256") == 0) ecdh_doit[R_EC_P256]=2;
+		else if (strcmp(*argv,"ecdhp384") == 0) ecdh_doit[R_EC_P384]=2;
+		else if (strcmp(*argv,"ecdhp521") == 0) ecdh_doit[R_EC_P521]=2;
+		else if (strcmp(*argv,"ecdhk163") == 0) ecdh_doit[R_EC_K163]=2;
+		else if (strcmp(*argv,"ecdhk233") == 0) ecdh_doit[R_EC_K233]=2;
+		else if (strcmp(*argv,"ecdhk283") == 0) ecdh_doit[R_EC_K283]=2;
+		else if (strcmp(*argv,"ecdhk409") == 0) ecdh_doit[R_EC_K409]=2;
+		else if (strcmp(*argv,"ecdhk571") == 0) ecdh_doit[R_EC_K571]=2;
+		else if (strcmp(*argv,"ecdhb163") == 0) ecdh_doit[R_EC_B163]=2;
+		else if (strcmp(*argv,"ecdhb233") == 0) ecdh_doit[R_EC_B233]=2;
+		else if (strcmp(*argv,"ecdhb283") == 0) ecdh_doit[R_EC_B283]=2;
+		else if (strcmp(*argv,"ecdhb409") == 0) ecdh_doit[R_EC_B409]=2;
+		else if (strcmp(*argv,"ecdhb571") == 0) ecdh_doit[R_EC_B571]=2;
+		else if (strcmp(*argv,"ecdh") == 0)
+			{
+			for (i=0; i < EC_NUM; i++)
+				ecdh_doit[i]=1;
+			}
+		else
+#endif
+			{
+                        BIO_printf(bio_err,"Error: bad option or value\n");
+			BIO_printf(bio_err,"\n");
+			BIO_printf(bio_err,"Available values:\n");
+#ifndef OPENSSL_NO_MD2
+			BIO_printf(bio_err,"md2      ");
+#endif
+#ifndef OPENSSL_NO_MDC2
+			BIO_printf(bio_err,"mdc2     ");
+#endif
+#ifndef OPENSSL_NO_MD4
+			BIO_printf(bio_err,"md4      ");
+#endif
+#ifndef OPENSSL_NO_MD5
+			BIO_printf(bio_err,"md5      ");
+#ifndef OPENSSL_NO_HMAC
+			BIO_printf(bio_err,"hmac     ");
+#endif
+#endif
+#ifndef OPENSSL_NO_SHA1
+			BIO_printf(bio_err,"sha1     ");
+#endif
+#ifndef OPENSSL_NO_SHA256
+			BIO_printf(bio_err,"sha256   ");
+#endif
+#ifndef OPENSSL_NO_SHA512
+			BIO_printf(bio_err,"sha512   ");
+#endif
+#ifndef OPENSSL_NO_RIPEMD160
+			BIO_printf(bio_err,"rmd160");
+#endif
+#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \
+    !defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \
+    !defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160)
+			BIO_printf(bio_err,"\n");
+#endif
+
+#ifndef OPENSSL_NO_IDEA
+			BIO_printf(bio_err,"idea-cbc ");
+#endif
+#ifndef OPENSSL_NO_SEED
+			BIO_printf(bio_err,"seed-cbc ");
+#endif
+#ifndef OPENSSL_NO_RC2
+			BIO_printf(bio_err,"rc2-cbc  ");
+#endif
+#ifndef OPENSSL_NO_RC5
+			BIO_printf(bio_err,"rc5-cbc  ");
+#endif
+#ifndef OPENSSL_NO_BF
+			BIO_printf(bio_err,"bf-cbc");
+#endif
+#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || !defined(OPENSSL_NO_RC2) || \
+    !defined(OPENSSL_NO_BF) || !defined(OPENSSL_NO_RC5)
+			BIO_printf(bio_err,"\n");
+#endif
+#ifndef OPENSSL_NO_DES
+			BIO_printf(bio_err,"des-cbc  des-ede3 ");
+#endif
+#ifndef OPENSSL_NO_AES
+			BIO_printf(bio_err,"aes-128-cbc aes-192-cbc aes-256-cbc ");
+			BIO_printf(bio_err,"aes-128-ige aes-192-ige aes-256-ige ");
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+			BIO_printf(bio_err,"\n");
+			BIO_printf(bio_err,"camellia-128-cbc camellia-192-cbc camellia-256-cbc ");
+#endif
+#ifndef OPENSSL_NO_RC4
+			BIO_printf(bio_err,"rc4");
+#endif
+			BIO_printf(bio_err,"\n");
+
+#ifndef OPENSSL_NO_RSA
+			BIO_printf(bio_err,"rsa512   rsa1024  rsa2048  rsa4096\n");
+#endif
+
+#ifndef OPENSSL_NO_DSA
+			BIO_printf(bio_err,"dsa512   dsa1024  dsa2048\n");
+#endif
+#ifndef OPENSSL_NO_ECDSA
+			BIO_printf(bio_err,"ecdsap160 ecdsap192 ecdsap224 ecdsap256 ecdsap384 ecdsap521\n");
+			BIO_printf(bio_err,"ecdsak163 ecdsak233 ecdsak283 ecdsak409 ecdsak571\n");
+			BIO_printf(bio_err,"ecdsab163 ecdsab233 ecdsab283 ecdsab409 ecdsab571\n");
+			BIO_printf(bio_err,"ecdsa\n");
+#endif
+#ifndef OPENSSL_NO_ECDH
+			BIO_printf(bio_err,"ecdhp160  ecdhp192  ecdhp224  ecdhp256  ecdhp384  ecdhp521\n");
+			BIO_printf(bio_err,"ecdhk163  ecdhk233  ecdhk283  ecdhk409  ecdhk571\n");
+			BIO_printf(bio_err,"ecdhb163  ecdhb233  ecdhb283  ecdhb409  ecdhb571\n");
+			BIO_printf(bio_err,"ecdh\n");
+#endif
+
+#ifndef OPENSSL_NO_IDEA
+			BIO_printf(bio_err,"idea     ");
+#endif
+#ifndef OPENSSL_NO_SEED
+			BIO_printf(bio_err,"seed     ");
+#endif
+#ifndef OPENSSL_NO_RC2
+			BIO_printf(bio_err,"rc2      ");
+#endif
+#ifndef OPENSSL_NO_DES
+			BIO_printf(bio_err,"des      ");
+#endif
+#ifndef OPENSSL_NO_AES
+			BIO_printf(bio_err,"aes      ");
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+			BIO_printf(bio_err,"camellia ");
+#endif
+#ifndef OPENSSL_NO_RSA
+			BIO_printf(bio_err,"rsa      ");
+#endif
+#ifndef OPENSSL_NO_BF
+			BIO_printf(bio_err,"blowfish");
+#endif
+#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || \
+    !defined(OPENSSL_NO_RC2) || !defined(OPENSSL_NO_DES) || \
+    !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_BF) || \
+    !defined(OPENSSL_NO_AES) || !defined(OPENSSL_NO_CAMELLIA)
+			BIO_printf(bio_err,"\n");
+#endif
+
+			BIO_printf(bio_err,"\n");
+			BIO_printf(bio_err,"Available options:\n");
+#if defined(TIMES) || defined(USE_TOD)
+			BIO_printf(bio_err,"-elapsed        measure time in real time instead of CPU user time.\n");
+#endif
+#ifndef OPENSSL_NO_ENGINE
+			BIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\n");
+#endif
+			BIO_printf(bio_err,"-evp e          use EVP e.\n");
+			BIO_printf(bio_err,"-decrypt        time decryption instead of encryption (only EVP).\n");
+			BIO_printf(bio_err,"-mr             produce machine readable output.\n");
+#ifdef HAVE_FORK
+			BIO_printf(bio_err,"-multi n        run n benchmarks in parallel.\n");
+#endif
+			goto end;
+			}
+		argc--;
+		argv++;
+		j++;
+		}
+
+#ifdef HAVE_FORK
+	if(multi && do_multi(multi))
+		goto show_res;
+#endif
+
+	if (j == 0)
+		{
+		for (i=0; i<ALGOR_NUM; i++)
+			{
+			if (i != D_EVP)
+				doit[i]=1;
+			}
+		for (i=0; i<RSA_NUM; i++)
+			rsa_doit[i]=1;
+		for (i=0; i<DSA_NUM; i++)
+			dsa_doit[i]=1;
+		}
+	for (i=0; i<ALGOR_NUM; i++)
+		if (doit[i]) pr_header++;
+
+	if (usertime == 0 && !mr)
+                BIO_printf(bio_err,"You have chosen to measure elapsed time instead of user CPU time.\n");
+	if (usertime <= 0 && !mr)
+		{
+		BIO_printf(bio_err,"To get the most accurate results, try to run this\n");
+		BIO_printf(bio_err,"program when this computer is idle.\n");
+		}
+
+
+#ifndef OPENSSL_NO_DSA
+	dsa_key[0]=get_dsa512();
+	dsa_key[1]=get_dsa1024();
+	dsa_key[2]=get_dsa2048();
+#endif
+
+#ifndef OPENSSL_NO_DES
+	DES_set_key_unchecked(&key,&sch);
+	DES_set_key_unchecked(&key2,&sch2);
+	DES_set_key_unchecked(&key3,&sch3);
+#endif
+#ifndef OPENSSL_NO_AES
+	AES_set_encrypt_key(key16,128,&aes_ks1);
+	AES_set_encrypt_key(key24,192,&aes_ks2);
+	AES_set_encrypt_key(key32,256,&aes_ks3);
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+	Camellia_set_key(key16,128,&camellia_ks1);
+	Camellia_set_key(ckey24,192,&camellia_ks2);
+	Camellia_set_key(ckey32,256,&camellia_ks3);
+#endif
+#ifndef OPENSSL_NO_IDEA
+	idea_set_encrypt_key(key16,&idea_ks);
+#endif
+#ifndef OPENSSL_NO_SEED
+	SEED_set_key(key16,&seed_ks);
+#endif
+#ifndef OPENSSL_NO_RC4
+	RC4_set_key(&rc4_ks,16,key16);
+#endif
+#ifndef OPENSSL_NO_RC2
+	RC2_set_key(&rc2_ks,16,key16,128);
+#endif
+#ifndef OPENSSL_NO_RC5
+	RC5_32_set_key(&rc5_ks,16,key16,12);
+#endif
+#ifndef OPENSSL_NO_BF
+	BF_set_key(&bf_ks,16,key16);
+#endif
+#ifndef OPENSSL_NO_CAST
+	CAST_set_key(&cast_ks,16,key16);
+#endif
+#ifndef OPENSSL_NO_RSA
+	memset(rsa_c,0,sizeof(rsa_c));
+#endif
+#ifndef SIGALRM
+//#ifndef OPENSSL_NO_DES
+//	BIO_printf(bio_err,"First we calculate the approximate speed ...\n");
+//	count=10;
+//	do	{
+//		long it;
+//		count*=2;
+//		Time_F(START);
+//		for (it=count; it; it--)
+//			DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock,
+//				&sch,DES_ENCRYPT);
+//		d=Time_F(STOP);
+//		} while (d <3);
+	save_count=count;
+	c[D_MD2][0]=count/10;
+	c[D_MDC2][0]=count/10;
+	c[D_MD4][0]=count;
+	c[D_MD5][0]=count;
+	c[D_HMAC][0]=count;
+	c[D_SHA1][0]=count;
+	c[D_RMD160][0]=count;
+	c[D_RC4][0]=count*5;
+	c[D_CBC_DES][0]=count;
+	c[D_EDE3_DES][0]=count/3;
+	c[D_CBC_IDEA][0]=count;
+	c[D_CBC_SEED][0]=count;
+	c[D_CBC_RC2][0]=count;
+	c[D_CBC_RC5][0]=count;
+	c[D_CBC_BF][0]=count;
+	c[D_CBC_CAST][0]=count;
+	c[D_CBC_128_AES][0]=count;
+	c[D_CBC_192_AES][0]=count;
+	c[D_CBC_256_AES][0]=count;
+	c[D_CBC_128_CML][0]=count;
+	c[D_CBC_192_CML][0]=count;
+	c[D_CBC_256_CML][0]=count;
+	c[D_SHA256][0]=count;
+	c[D_SHA512][0]=count;
+	c[D_IGE_128_AES][0]=count;
+	c[D_IGE_192_AES][0]=count;
+	c[D_IGE_256_AES][0]=count;
+
+	for (i=1; i<SIZE_NUM; i++)
+		{
+		c[D_MD2][i]=c[D_MD2][0]*4*lengths[0]/lengths[i];
+		c[D_MDC2][i]=c[D_MDC2][0]*4*lengths[0]/lengths[i];
+		c[D_MD4][i]=c[D_MD4][0]*4*lengths[0]/lengths[i];
+		c[D_MD5][i]=c[D_MD5][0]*4*lengths[0]/lengths[i];
+		c[D_HMAC][i]=c[D_HMAC][0]*4*lengths[0]/lengths[i];
+		c[D_SHA1][i]=c[D_SHA1][0]*4*lengths[0]/lengths[i];
+		c[D_RMD160][i]=c[D_RMD160][0]*4*lengths[0]/lengths[i];
+		c[D_SHA256][i]=c[D_SHA256][0]*4*lengths[0]/lengths[i];
+		c[D_SHA512][i]=c[D_SHA512][0]*4*lengths[0]/lengths[i];
+		}
+	for (i=1; i<SIZE_NUM; i++)
+		{
+		long l0,l1;
+
+		l0=(long)lengths[i-1];
+		l1=(long)lengths[i];
+		c[D_RC4][i]=c[D_RC4][i-1]*l0/l1;
+		c[D_CBC_DES][i]=c[D_CBC_DES][i-1]*l0/l1;
+		c[D_EDE3_DES][i]=c[D_EDE3_DES][i-1]*l0/l1;
+		c[D_CBC_IDEA][i]=c[D_CBC_IDEA][i-1]*l0/l1;
+		c[D_CBC_SEED][i]=c[D_CBC_SEED][i-1]*l0/l1;
+		c[D_CBC_RC2][i]=c[D_CBC_RC2][i-1]*l0/l1;
+		c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
+		c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
+		c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
+		c[D_CBC_128_AES][i]=c[D_CBC_128_AES][i-1]*l0/l1;
+		c[D_CBC_192_AES][i]=c[D_CBC_192_AES][i-1]*l0/l1;
+		c[D_CBC_256_AES][i]=c[D_CBC_256_AES][i-1]*l0/l1;
+		c[D_CBC_128_CML][i]=c[D_CBC_128_CML][i-1]*l0/l1;
+		c[D_CBC_192_CML][i]=c[D_CBC_192_CML][i-1]*l0/l1;
+		c[D_CBC_256_CML][i]=c[D_CBC_256_CML][i-1]*l0/l1;
+		c[D_IGE_128_AES][i]=c[D_IGE_128_AES][i-1]*l0/l1;
+		c[D_IGE_192_AES][i]=c[D_IGE_192_AES][i-1]*l0/l1;
+		c[D_IGE_256_AES][i]=c[D_IGE_256_AES][i-1]*l0/l1;
+		}
+#ifndef OPENSSL_NO_RSA
+	rsa_c[R_RSA_512][0]=count/2000;
+	rsa_c[R_RSA_512][1]=count/400;
+	for (i=1; i<RSA_NUM; i++)
+		{
+		rsa_c[i][0]=rsa_c[i-1][0]/8;
+		rsa_c[i][1]=rsa_c[i-1][1]/4;
+		/*if ((rsa_doit[i] <= 1) && (rsa_c[i][0] == 0))
+			rsa_doit[i]=0;
+		else
+                {*/
+			if (rsa_c[i][0] == 0)
+				{
+				rsa_c[i][0]=1;
+				rsa_c[i][1]=20;
+				}
+                }
+                /*}*/
+#endif
+
+#ifndef OPENSSL_NO_DSA
+	dsa_c[R_DSA_512][0]=count/1000;
+	dsa_c[R_DSA_512][1]=count/1000/2;
+	for (i=1; i<DSA_NUM; i++)
+		{
+		dsa_c[i][0]=dsa_c[i-1][0]/4;
+		dsa_c[i][1]=dsa_c[i-1][1]/4;
+		if ((dsa_doit[i] <= 1) && (dsa_c[i][0] == 0))
+			dsa_doit[i]=0;
+		else
+			{
+			if (dsa_c[i] == 0)
+				{
+				dsa_c[i][0]=1;
+				dsa_c[i][1]=1;
+				}
+			}
+		}
+#endif
+
+#ifndef OPENSSL_NO_ECDSA
+	ecdsa_c[R_EC_P160][0]=count/1000;
+	ecdsa_c[R_EC_P160][1]=count/1000/2;
+	for (i=R_EC_P192; i<=R_EC_P521; i++)
+		{
+		ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
+		ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
+		if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
+			ecdsa_doit[i]=0;
+		else
+			{
+			if (ecdsa_c[i] == 0)
+				{
+				ecdsa_c[i][0]=1;
+				ecdsa_c[i][1]=1;
+				}
+			}
+		}
+	ecdsa_c[R_EC_K163][0]=count/1000;
+	ecdsa_c[R_EC_K163][1]=count/1000/2;
+	for (i=R_EC_K233; i<=R_EC_K571; i++)
+		{
+		ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
+		ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
+		if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
+			ecdsa_doit[i]=0;
+		else
+			{
+			if (ecdsa_c[i] == 0)
+				{
+				ecdsa_c[i][0]=1;
+				ecdsa_c[i][1]=1;
+				}
+			}
+		}
+	ecdsa_c[R_EC_B163][0]=count/1000;
+	ecdsa_c[R_EC_B163][1]=count/1000/2;
+	for (i=R_EC_B233; i<=R_EC_B571; i++)
+		{
+		ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
+		ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
+		if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
+			ecdsa_doit[i]=0;
+		else
+			{
+			if (ecdsa_c[i] == 0)
+				{
+				ecdsa_c[i][0]=1;
+				ecdsa_c[i][1]=1;
+				}
+			}
+		}
+#endif
+
+#ifndef OPENSSL_NO_ECDH
+	ecdh_c[R_EC_P160][0]=count/1000;
+	ecdh_c[R_EC_P160][1]=count/1000;
+	for (i=R_EC_P192; i<=R_EC_P521; i++)
+		{
+		ecdh_c[i][0]=ecdh_c[i-1][0]/2;
+		ecdh_c[i][1]=ecdh_c[i-1][1]/2;
+		if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
+			ecdh_doit[i]=0;
+		else
+			{
+			if (ecdh_c[i] == 0)
+				{
+				ecdh_c[i][0]=1;
+				ecdh_c[i][1]=1;
+				}
+			}
+		}
+	ecdh_c[R_EC_K163][0]=count/1000;
+	ecdh_c[R_EC_K163][1]=count/1000;
+	for (i=R_EC_K233; i<=R_EC_K571; i++)
+		{
+		ecdh_c[i][0]=ecdh_c[i-1][0]/2;
+		ecdh_c[i][1]=ecdh_c[i-1][1]/2;
+		if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
+			ecdh_doit[i]=0;
+		else
+			{
+			if (ecdh_c[i] == 0)
+				{
+				ecdh_c[i][0]=1;
+				ecdh_c[i][1]=1;
+				}
+			}
+		}
+	ecdh_c[R_EC_B163][0]=count/1000;
+	ecdh_c[R_EC_B163][1]=count/1000;
+	for (i=R_EC_B233; i<=R_EC_B571; i++)
+		{
+		ecdh_c[i][0]=ecdh_c[i-1][0]/2;
+		ecdh_c[i][1]=ecdh_c[i-1][1]/2;
+		if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
+			ecdh_doit[i]=0;
+		else
+			{
+			if (ecdh_c[i] == 0)
+				{
+				ecdh_c[i][0]=1;
+				ecdh_c[i][1]=1;
+				}
+			}
+		}
+#endif
+
+#define COND(d)	(count < (d))
+#define COUNT(d) (d)
+//#else
+///* not worth fixing */
+//# error "You cannot disable DES on systems without SIGALRM."
+//#endif /* OPENSSL_NO_DES */
+#else
+#define COND(c)	(run)
+#define COUNT(d) (count)
+	signal(SIGALRM,sig_done);
+#endif /* SIGALRM */
+
+#ifndef OPENSSL_NO_MD2
+	if (doit[D_MD2])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_MD2],c[D_MD2][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_MD2][j]); count++)
+				EVP_Digest(buf,(unsigned long)lengths[j],&(md2[0]),NULL,EVP_md2(),NULL);
+			d=Time_F(STOP);
+			print_result(D_MD2,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_MDC2
+	if (doit[D_MDC2])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_MDC2],c[D_MDC2][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_MDC2][j]); count++)
+				EVP_Digest(buf,(unsigned long)lengths[j],&(mdc2[0]),NULL,EVP_mdc2(),NULL);
+			d=Time_F(STOP);
+			print_result(D_MDC2,j,count,d);
+			}
+		}
+#endif
+
+#ifndef OPENSSL_NO_MD4
+	if (doit[D_MD4])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_MD4],c[D_MD4][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_MD4][j]); count++)
+				EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md4[0]),NULL,EVP_md4(),NULL);
+			d=Time_F(STOP);
+			print_result(D_MD4,j,count,d);
+			}
+		}
+#endif
+
+#ifndef OPENSSL_NO_MD5
+	if (doit[D_MD5])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_MD5],c[D_MD5][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_MD5][j]); count++)
+				EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,EVP_get_digestbyname("md5"),NULL);
+			d=Time_F(STOP);
+			print_result(D_MD5,j,count,d);
+			}
+		}
+#endif
+
+#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_HMAC)
+	if (doit[D_HMAC])
+		{
+		HMAC_CTX hctx;
+
+		HMAC_CTX_init(&hctx);
+		HMAC_Init_ex(&hctx,(unsigned char *)"This is a key...",
+			16,EVP_md5(), NULL);
+
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_HMAC],c[D_HMAC][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_HMAC][j]); count++)
+				{
+				HMAC_Init_ex(&hctx,NULL,0,NULL,NULL);
+				HMAC_Update(&hctx,buf,lengths[j]);
+				HMAC_Final(&hctx,&(hmac[0]),NULL);
+				}
+			d=Time_F(STOP);
+			print_result(D_HMAC,j,count,d);
+			}
+		HMAC_CTX_cleanup(&hctx);
+		}
+#endif
+#ifndef OPENSSL_NO_SHA
+	if (doit[D_SHA1])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_SHA1],c[D_SHA1][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_SHA1][j]); count++)
+				EVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1(),NULL);
+			d=Time_F(STOP);
+			print_result(D_SHA1,j,count,d);
+			}
+		}
+
+#ifndef OPENSSL_NO_SHA256
+	if (doit[D_SHA256])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_SHA256],c[D_SHA256][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_SHA256][j]); count++)
+				SHA256(buf,lengths[j],sha256);
+			d=Time_F(STOP);
+			print_result(D_SHA256,j,count,d);
+			}
+		}
+#endif
+
+#ifndef OPENSSL_NO_SHA512
+	if (doit[D_SHA512])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_SHA512],c[D_SHA512][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_SHA512][j]); count++)
+				SHA512(buf,lengths[j],sha512);
+			d=Time_F(STOP);
+			print_result(D_SHA512,j,count,d);
+			}
+		}
+#endif
+
+#endif
+#ifndef OPENSSL_NO_RIPEMD
+	if (doit[D_RMD160])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_RMD160],c[D_RMD160][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_RMD160][j]); count++)
+				EVP_Digest(buf,(unsigned long)lengths[j],&(rmd160[0]),NULL,EVP_ripemd160(),NULL);
+			d=Time_F(STOP);
+			print_result(D_RMD160,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_RC4
+	if (doit[D_RC4])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_RC4],c[D_RC4][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_RC4][j]); count++)
+				RC4(&rc4_ks,(unsigned int)lengths[j],
+					buf,buf);
+			d=Time_F(STOP);
+			print_result(D_RC4,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_DES
+	if (doit[D_CBC_DES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_DES],c[D_CBC_DES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_DES][j]); count++)
+				DES_ncbc_encrypt(buf,buf,lengths[j],&sch,
+						 &DES_iv,DES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_DES,j,count,d);
+			}
+		}
+
+	if (doit[D_EDE3_DES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_EDE3_DES],c[D_EDE3_DES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_EDE3_DES][j]); count++)
+				DES_ede3_cbc_encrypt(buf,buf,lengths[j],
+						     &sch,&sch2,&sch3,
+						     &DES_iv,DES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_EDE3_DES,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_AES
+	if (doit[D_CBC_128_AES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_128_AES],c[D_CBC_128_AES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_128_AES][j]); count++)
+				AES_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&aes_ks1,
+					iv,AES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_128_AES,j,count,d);
+			}
+		}
+	if (doit[D_CBC_192_AES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_192_AES],c[D_CBC_192_AES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_192_AES][j]); count++)
+				AES_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&aes_ks2,
+					iv,AES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_192_AES,j,count,d);
+			}
+		}
+	if (doit[D_CBC_256_AES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_256_AES],c[D_CBC_256_AES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_256_AES][j]); count++)
+				AES_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&aes_ks3,
+					iv,AES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_256_AES,j,count,d);
+			}
+		}
+
+	if (doit[D_IGE_128_AES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_IGE_128_AES],c[D_IGE_128_AES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_IGE_128_AES][j]); count++)
+				AES_ige_encrypt(buf,buf2,
+					(unsigned long)lengths[j],&aes_ks1,
+					iv,AES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_IGE_128_AES,j,count,d);
+			}
+		}
+	if (doit[D_IGE_192_AES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_IGE_192_AES],c[D_IGE_192_AES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_IGE_192_AES][j]); count++)
+				AES_ige_encrypt(buf,buf2,
+					(unsigned long)lengths[j],&aes_ks2,
+					iv,AES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_IGE_192_AES,j,count,d);
+			}
+		}
+	if (doit[D_IGE_256_AES])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_IGE_256_AES],c[D_IGE_256_AES][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_IGE_256_AES][j]); count++)
+				AES_ige_encrypt(buf,buf2,
+					(unsigned long)lengths[j],&aes_ks3,
+					iv,AES_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_IGE_256_AES,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_CAMELLIA
+	if (doit[D_CBC_128_CML])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_128_CML],c[D_CBC_128_CML][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_128_CML][j]); count++)
+				Camellia_cbc_encrypt(buf,buf,
+				        (unsigned long)lengths[j],&camellia_ks1,
+				        iv,CAMELLIA_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_128_CML,j,count,d);
+			}
+		}
+	if (doit[D_CBC_192_CML])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_192_CML],c[D_CBC_192_CML][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_192_CML][j]); count++)
+				Camellia_cbc_encrypt(buf,buf,
+				        (unsigned long)lengths[j],&camellia_ks2,
+				        iv,CAMELLIA_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_192_CML,j,count,d);
+			}
+		}
+	if (doit[D_CBC_256_CML])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_256_CML],c[D_CBC_256_CML][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_256_CML][j]); count++)
+				Camellia_cbc_encrypt(buf,buf,
+				        (unsigned long)lengths[j],&camellia_ks3,
+				        iv,CAMELLIA_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_256_CML,j,count,d);
+			}
+		}
+
+#endif
+#ifndef OPENSSL_NO_IDEA
+	if (doit[D_CBC_IDEA])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_IDEA],c[D_CBC_IDEA][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_IDEA][j]); count++)
+				idea_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&idea_ks,
+					iv,IDEA_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_IDEA,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_SEED
+	if (doit[D_CBC_SEED])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_SEED],c[D_CBC_SEED][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_SEED][j]); count++)
+				SEED_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&seed_ks,iv,1);
+			d=Time_F(STOP);
+			print_result(D_CBC_SEED,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_RC2
+	if (doit[D_CBC_RC2])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_RC2],c[D_CBC_RC2][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_RC2][j]); count++)
+				RC2_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&rc2_ks,
+					iv,RC2_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_RC2,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_RC5
+	if (doit[D_CBC_RC5])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_RC5],c[D_CBC_RC5][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_RC5][j]); count++)
+				RC5_32_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&rc5_ks,
+					iv,RC5_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_RC5,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_BF
+	if (doit[D_CBC_BF])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_BF],c[D_CBC_BF][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_BF][j]); count++)
+				BF_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&bf_ks,
+					iv,BF_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_BF,j,count,d);
+			}
+		}
+#endif
+#ifndef OPENSSL_NO_CAST
+	if (doit[D_CBC_CAST])
+		{
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			print_message(names[D_CBC_CAST],c[D_CBC_CAST][j],lengths[j]);
+			Time_F(START);
+			for (count=0,run=1; COND(c[D_CBC_CAST][j]); count++)
+				CAST_cbc_encrypt(buf,buf,
+					(unsigned long)lengths[j],&cast_ks,
+					iv,CAST_ENCRYPT);
+			d=Time_F(STOP);
+			print_result(D_CBC_CAST,j,count,d);
+			}
+		}
+#endif
+
+
+//	if (doit[D_EVP])
+//		{
+//		for (j=0; j<SIZE_NUM; j++)
+//			{
+//			if (evp_cipher)
+//				{
+//				EVP_CIPHER_CTX ctx;
+//				int outl;
+//
+//				names[D_EVP]=OBJ_nid2ln(evp_cipher->nid);
+//				/* -O3 -fschedule-insns messes up an
+//				 * optimization here!  names[D_EVP]
+//				 * somehow becomes NULL */
+//				print_message(names[D_EVP],save_count,
+//					lengths[j]);
+//
+//				EVP_CIPHER_CTX_init(&ctx);
+//				if(decrypt)
+//					EVP_DecryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);
+//				else
+//					EVP_EncryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);
+//				EVP_CIPHER_CTX_set_padding(&ctx, 0);
+//
+//				Time_F(START);
+//				if(decrypt)
+//					for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
+//						EVP_DecryptUpdate(&ctx,buf,&outl,buf,lengths[j]);
+//				else
+//					for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
+//						EVP_EncryptUpdate(&ctx,buf,&outl,buf,lengths[j]);
+//				if(decrypt)
+//					EVP_DecryptFinal_ex(&ctx,buf,&outl);
+//				else
+//					EVP_EncryptFinal_ex(&ctx,buf,&outl);
+//				d=Time_F(STOP);
+//				EVP_CIPHER_CTX_cleanup(&ctx);
+//				}
+//			if (evp_md)
+//				{
+//				names[D_EVP]=OBJ_nid2ln(evp_md->type);
+//				print_message(names[D_EVP],save_count,
+//					lengths[j]);
+//
+//				Time_F(START);
+//				for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
+//					EVP_Digest(buf,lengths[j],&(md[0]),NULL,evp_md,NULL);
+//
+//				d=Time_F(STOP);
+//				}
+//			print_result(D_EVP,j,count,d);
+//			}
+//		}
+
+        RAND_set_rand_method(&rand_dummy_meth);
+
+        RAND_seed(rnd_seed, sizeof rnd_seed);
+	RAND_pseudo_bytes(buf,36);
+#ifndef OPENSSL_NO_RSA
+	for (j=0; j<RSA_NUM; j++)
+		{
+		int ret;
+		const unsigned char *p;
+
+		if (!rsa_doit[j]) continue;
+
+		p=rsa_data[j];
+		rsa_key[j]=d2i_RSAPrivateKey(NULL,&p,rsa_data_length[j]);
+                rsa_key[j]->flags |= (RSA_FLAG_NO_CONSTTIME | RSA_FLAG_NO_BLINDING);
+		if (rsa_key[j] == NULL)
+			{
+                            BIO_printf(bio_err,"internal error loading RSA key number %d\n",j);
+                            goto end;
+			}
+		ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]);
+		if (ret == 0)
+			{
+			BIO_printf(bio_err,"RSA sign failure.  No RSA sign will be done.\n");
+			//ERR_print_errors(bio_err);
+			rsa_count=1;
+			}
+		else
+			{
+			pkey_print_message("private","rsa",
+				rsa_c[j][0],rsa_bits[j],
+				RSA_SECONDS);
+/*			RSA_blinding_on(rsa_key[j],NULL); */
+			Time_F(START);
+			for (count=0,run=1; COND(rsa_c[j][0]); count++)
+				{
+				ret=RSA_sign(NID_md5_sha1, buf,36, buf2,
+					&rsa_num, rsa_key[j]);
+				if (ret == 0)
+					{
+					BIO_printf(bio_err,
+						"RSA sign failure\n");
+					//ERR_print_errors(bio_err);
+					count=1;
+					break;
+					}
+				}
+			d=Time_F(STOP);
+			BIO_printf(bio_err,mr ? "+R1:%ld:%d:%.2f\n"
+				   : "%ld %d bit private RSA's in %.2fs\n",
+				   count,rsa_bits[j],d);
+			rsa_results[j][0]=d/(double)count;
+			rsa_count=count;
+			}
+
+#if 1
+		ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]);
+		if (ret <= 0)
+			{
+			BIO_printf(bio_err,"RSA verify failure.  No RSA verify will be done.\n");
+			//ERR_print_errors(bio_err);
+			rsa_doit[j] = 0;
+			}
+		else
+			{
+			pkey_print_message("public","rsa",
+				rsa_c[j][1],rsa_bits[j],
+				RSA_SECONDS);
+			Time_F(START);
+			for (count=0,run=1; COND(rsa_c[j][1]); count++)
+				{
+				ret=RSA_verify(NID_md5_sha1, buf,36, buf2,
+					rsa_num, rsa_key[j]);
+				if (ret == 0)
+					{
+					BIO_printf(bio_err,
+						"RSA verify failure\n");
+					//ERR_print_errors(bio_err);
+					count=1;
+					break;
+					}
+				}
+			d=Time_F(STOP);
+			BIO_printf(bio_err,mr ? "+R2:%ld:%d:%.2f\n"
+				   : "%ld %d bit public RSA's in %.2fs\n",
+				   count,rsa_bits[j],d);
+			rsa_results[j][1]=d/(double)count;
+			}
+#endif
+
+//		if (rsa_count </*=*/ 1)
+//			{
+//			/* if longer than 10s, don't do any more */
+//			for (j++; j<RSA_NUM; j++)
+//				rsa_doit[j]=0;
+//			}
+		if (rsa_key[j] != NULL)
+                    RSA_free(rsa_key[j]);
+
+		}
+#endif
+
+	RAND_pseudo_bytes(buf,20);
+#ifndef OPENSSL_NO_DSA
+	if (RAND_status() != 1)
+		{
+		RAND_seed(rnd_seed, sizeof rnd_seed);
+		rnd_fake = 1;
+		}
+	for (j=0; j<DSA_NUM; j++)
+		{
+		unsigned int kk;
+		int ret;
+
+		if (!dsa_doit[j]) continue;
+/*		DSA_generate_key(dsa_key[j]); */
+/*		DSA_sign_setup(dsa_key[j],NULL); */
+		ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,
+			&kk,dsa_key[j]);
+		if (ret == 0)
+			{
+			BIO_printf(bio_err,"DSA sign failure.  No DSA sign will be done.\n");
+			ERR_print_errors(bio_err);
+			rsa_count=1;
+			}
+		else
+			{
+			pkey_print_message("sign","dsa",
+				dsa_c[j][0],dsa_bits[j],
+				DSA_SECONDS);
+			Time_F(START);
+			for (count=0,run=1; COND(dsa_c[j][0]); count++)
+				{
+				ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,
+					&kk,dsa_key[j]);
+				if (ret == 0)
+					{
+					BIO_printf(bio_err,
+						"DSA sign failure\n");
+					ERR_print_errors(bio_err);
+					count=1;
+					break;
+					}
+				}
+			d=Time_F(STOP);
+			BIO_printf(bio_err,mr ? "+R3:%ld:%d:%.2f\n"
+				   : "%ld %d bit DSA signs in %.2fs\n",
+				   count,dsa_bits[j],d);
+			dsa_results[j][0]=d/(double)count;
+			rsa_count=count;
+			}
+
+		ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,
+			kk,dsa_key[j]);
+		if (ret <= 0)
+			{
+			BIO_printf(bio_err,"DSA verify failure.  No DSA verify will be done.\n");
+			ERR_print_errors(bio_err);
+			dsa_doit[j] = 0;
+			}
+		else
+			{
+			pkey_print_message("verify","dsa",
+				dsa_c[j][1],dsa_bits[j],
+				DSA_SECONDS);
+			Time_F(START);
+			for (count=0,run=1; COND(dsa_c[j][1]); count++)
+				{
+				ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,
+					kk,dsa_key[j]);
+				if (ret <= 0)
+					{
+					BIO_printf(bio_err,
+						"DSA verify failure\n");
+					ERR_print_errors(bio_err);
+					count=1;
+					break;
+					}
+				}
+			d=Time_F(STOP);
+			BIO_printf(bio_err,mr ? "+R4:%ld:%d:%.2f\n"
+				   : "%ld %d bit DSA verify in %.2fs\n",
+				   count,dsa_bits[j],d);
+			dsa_results[j][1]=d/(double)count;
+			}
+
+		if (rsa_count <= 1)
+			{
+			/* if longer than 10s, don't do any more */
+			for (j++; j<DSA_NUM; j++)
+				dsa_doit[j]=0;
+			}
+		}
+	if (rnd_fake) RAND_cleanup();
+#endif
+
+#ifndef OPENSSL_NO_ECDSA
+	if (RAND_status() != 1)
+		{
+		RAND_seed(rnd_seed, sizeof rnd_seed);
+		rnd_fake = 1;
+		}
+	for (j=0; j<EC_NUM; j++)
+		{
+		int ret;
+
+		if (!ecdsa_doit[j]) continue; /* Ignore Curve */
+		ecdsa[j] = EC_KEY_new_by_curve_name(test_curves[j]);
+		if (ecdsa[j] == NULL)
+			{
+			BIO_printf(bio_err,"ECDSA failure.\n");
+			ERR_print_errors(bio_err);
+			rsa_count=1;
+			}
+		else
+			{
+#if 1
+			EC_KEY_precompute_mult(ecdsa[j], NULL);
+#endif
+			/* Perform ECDSA signature test */
+			EC_KEY_generate_key(ecdsa[j]);
+			ret = ECDSA_sign(0, buf, 20, ecdsasig,
+				&ecdsasiglen, ecdsa[j]);
+			if (ret == 0)
+				{
+				BIO_printf(bio_err,"ECDSA sign failure.  No ECDSA sign will be done.\n");
+				ERR_print_errors(bio_err);
+				rsa_count=1;
+				}
+			else
+				{
+				pkey_print_message("sign","ecdsa",
+					ecdsa_c[j][0],
+					test_curves_bits[j],
+					ECDSA_SECONDS);
+
+				Time_F(START);
+				for (count=0,run=1; COND(ecdsa_c[j][0]);
+					count++)
+					{
+					ret=ECDSA_sign(0, buf, 20,
+						ecdsasig, &ecdsasiglen,
+						ecdsa[j]);
+					if (ret == 0)
+						{
+						BIO_printf(bio_err, "ECDSA sign failure\n");
+						ERR_print_errors(bio_err);
+						count=1;
+						break;
+						}
+					}
+				d=Time_F(STOP);
+
+				BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
+					"%ld %d bit ECDSA signs in %.2fs \n",
+					count, test_curves_bits[j], d);
+				ecdsa_results[j][0]=d/(double)count;
+				rsa_count=count;
+				}
+
+			/* Perform ECDSA verification test */
+			ret=ECDSA_verify(0, buf, 20, ecdsasig,
+				ecdsasiglen, ecdsa[j]);
+			if (ret != 1)
+				{
+				BIO_printf(bio_err,"ECDSA verify failure.  No ECDSA verify will be done.\n");
+				ERR_print_errors(bio_err);
+				ecdsa_doit[j] = 0;
+				}
+			else
+				{
+				pkey_print_message("verify","ecdsa",
+				ecdsa_c[j][1],
+				test_curves_bits[j],
+				ECDSA_SECONDS);
+				Time_F(START);
+				for (count=0,run=1; COND(ecdsa_c[j][1]); count++)
+					{
+					ret=ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]);
+					if (ret != 1)
+						{
+						BIO_printf(bio_err, "ECDSA verify failure\n");
+						ERR_print_errors(bio_err);
+						count=1;
+						break;
+						}
+					}
+				d=Time_F(STOP);
+				BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
+						: "%ld %d bit ECDSA verify in %.2fs\n",
+				count, test_curves_bits[j], d);
+				ecdsa_results[j][1]=d/(double)count;
+				}
+
+			if (rsa_count <= 1)
+				{
+				/* if longer than 10s, don't do any more */
+				for (j++; j<EC_NUM; j++)
+				ecdsa_doit[j]=0;
+				}
+			}
+		}
+	if (rnd_fake) RAND_cleanup();
+#endif
+
+#ifndef OPENSSL_NO_ECDH
+	if (RAND_status() != 1)
+		{
+		RAND_seed(rnd_seed, sizeof rnd_seed);
+		rnd_fake = 1;
+		}
+	for (j=0; j<EC_NUM; j++)
+		{
+		if (!ecdh_doit[j]) continue;
+		ecdh_a[j] = EC_KEY_new_by_curve_name(test_curves[j]);
+		ecdh_b[j] = EC_KEY_new_by_curve_name(test_curves[j]);
+		if ((ecdh_a[j] == NULL) || (ecdh_b[j] == NULL))
+			{
+			BIO_printf(bio_err,"ECDH failure.\n");
+			//ERR_print_errors(bio_err);
+			rsa_count=1;
+			}
+		else
+			{
+			/* generate two ECDH key pairs */
+			if (!EC_KEY_generate_key(ecdh_a[j]) ||
+				!EC_KEY_generate_key(ecdh_b[j]))
+				{
+				BIO_printf(bio_err,"ECDH key generation failure.\n");
+				//ERR_print_errors(bio_err);
+				rsa_count=1;
+				}
+			else
+				{
+				/* If field size is not more than 24 octets, then use SHA-1 hash of result;
+				 * otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
+				 */
+				int field_size, outlen;
+				void *(*kdf)(const void *in, size_t inlen, void *out, size_t *xoutlen);
+				field_size = EC_GROUP_get_degree(EC_KEY_get0_group(ecdh_a[j]));
+				if (field_size <= 24 * 8)
+					{
+					outlen = KDF1_SHA1_len;
+					kdf = KDF1_SHA1;
+					}
+				else
+					{
+					outlen = (field_size+7)/8;
+					kdf = NULL;
+					}
+				secret_size_a = ECDH_compute_key(secret_a, outlen,
+					EC_KEY_get0_public_key(ecdh_b[j]),
+					ecdh_a[j], kdf);
+				secret_size_b = ECDH_compute_key(secret_b, outlen,
+					EC_KEY_get0_public_key(ecdh_a[j]),
+					ecdh_b[j], kdf);
+				if (secret_size_a != secret_size_b)
+					ecdh_checks = 0;
+				else
+					ecdh_checks = 1;
+
+				for (secret_idx = 0;
+				    (secret_idx < secret_size_a)
+					&& (ecdh_checks == 1);
+				    secret_idx++)
+					{
+					if (secret_a[secret_idx] != secret_b[secret_idx])
+					ecdh_checks = 0;
+					}
+
+				if (ecdh_checks == 0)
+					{
+					BIO_printf(bio_err,"ECDH computations don't match.\n");
+					//ERR_print_errors(bio_err);
+					rsa_count=1;
+					}
+
+				pkey_print_message("","ecdh",
+				ecdh_c[j][0],
+				test_curves_bits[j],
+				ECDH_SECONDS);
+				Time_F(START);
+				for (count=0,run=1; COND(ecdh_c[j][0]); count++)
+					{
+					ECDH_compute_key(secret_a, outlen,
+					EC_KEY_get0_public_key(ecdh_b[j]),
+					ecdh_a[j], kdf);
+					}
+				d=Time_F(STOP);
+				BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
+				count, test_curves_bits[j], d);
+				ecdh_results[j][0]=d/(double)count;
+				rsa_count=count;
+				}
+			}
+
+
+		if (rsa_count </*=*/ 1)
+			{
+			/* if longer than 10s, don't do any more */
+			for (j++; j<EC_NUM; j++)
+			ecdh_doit[j]=0;
+			}
+		}
+	if (rnd_fake) RAND_cleanup();
+#endif
+#ifdef HAVE_FORK
+show_res:
+#endif
+	if(!mr)
+		{
+		fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION));
+        fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_BUILT_ON));
+		printf("options:");
+		printf("%s ",BN_options());
+#ifndef OPENSSL_NO_MD2
+		printf("%s ",MD2_options());
+#endif
+#ifndef OPENSSL_NO_RC4
+		printf("%s ",RC4_options());
+#endif
+#ifndef OPENSSL_NO_DES
+		printf("%s ",DES_options());
+#endif
+#ifndef OPENSSL_NO_AES
+		printf("%s ",AES_options());
+#endif
+#ifndef OPENSSL_NO_IDEA
+		printf("%s ",idea_options());
+#endif
+#ifndef OPENSSL_NO_BF
+		printf("%s ",BF_options());
+#endif
+		fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS));
+		printf("available timing options: ");
+#ifdef TIMES
+		printf("TIMES ");
+#endif
+#ifdef TIMEB
+		printf("TIMEB ");
+#endif
+#ifdef USE_TOD
+		printf("USE_TOD ");
+#endif
+#ifdef HZ
+#define as_string(s) (#s)
+		{
+		double dbl = HZ;
+		printf("HZ=%g", dbl);
+		}
+# ifdef _SC_CLK_TCK
+		printf(" [sysconf value]");
+# endif
+#endif
+		printf("\n");
+		printf("timing function used: %s%s%s%s%s%s%s\n",
+		       (ftime_used ? "ftime" : ""),
+		       (ftime_used + times_used > 1 ? "," : ""),
+		       (times_used ? "times" : ""),
+		       (ftime_used + times_used + gettimeofday_used > 1 ? "," : ""),
+		       (gettimeofday_used ? "gettimeofday" : ""),
+		       (ftime_used + times_used + gettimeofday_used + getrusage_used > 1 ? "," : ""),
+		       (getrusage_used ? "getrusage" : ""));
+		}
+
+	if (pr_header)
+		{
+		if(mr)
+			fprintf(stdout,"+H");
+		else
+			{
+			fprintf(stdout,"The 'numbers' are in 1000s of bytes per second processed.\n");
+			fprintf(stdout,"type        ");
+			}
+		for (j=0;  j<SIZE_NUM; j++)
+			fprintf(stdout,mr ? ":%d" : "%7d bytes",lengths[j]);
+		fprintf(stdout,"\n");
+		}
+
+	for (k=0; k<ALGOR_NUM; k++)
+		{
+		if (!doit[k]) continue;
+		if(mr)
+			fprintf(stdout,"+F:%d:%s",k,names[k]);
+		else
+			fprintf(stdout,"%-13s",names[k]);
+		for (j=0; j<SIZE_NUM; j++)
+			{
+			if (results[k][j] > 10000 && !mr)
+				fprintf(stdout," %11.2fk",results[k][j]/1e3);
+			else
+				fprintf(stdout,mr ? ":%.2f" : " %11.2f ",results[k][j]);
+			}
+		fprintf(stdout,"\n");
+		}
+#ifndef OPENSSL_NO_RSA
+	j=1;
+	for (k=0; k<RSA_NUM; k++)
+		{
+		if (!rsa_doit[k]) continue;
+		if (j && !mr)
+			{
+			printf("%18ssign    verify    sign/s verify/s\n"," ");
+			j=0;
+			}
+		if(mr)
+			fprintf(stdout,"+F2:%u:%u:%f:%f\n",
+				k,rsa_bits[k],rsa_results[k][0],
+				rsa_results[k][1]);
+		else
+			fprintf(stdout,"rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
+				rsa_bits[k],rsa_results[k][0],rsa_results[k][1],
+				1.0/rsa_results[k][0],1.0/rsa_results[k][1]);
+		}
+#endif
+#ifndef OPENSSL_NO_DSA
+	j=1;
+	for (k=0; k<DSA_NUM; k++)
+		{
+		if (!dsa_doit[k]) continue;
+		if (j && !mr)
+			{
+			printf("%18ssign    verify    sign/s verify/s\n"," ");
+			j=0;
+			}
+		if(mr)
+			fprintf(stdout,"+F3:%u:%u:%f:%f\n",
+				k,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]);
+		else
+			fprintf(stdout,"dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
+				dsa_bits[k],dsa_results[k][0],dsa_results[k][1],
+				1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
+		}
+#endif
+#ifndef OPENSSL_NO_ECDSA
+	j=1;
+	for (k=0; k<EC_NUM; k++)
+		{
+		if (!ecdsa_doit[k]) continue;
+		if (j && !mr)
+			{
+			printf("%30ssign    verify    sign/s verify/s\n"," ");
+			j=0;
+			}
+
+		if (mr)
+			fprintf(stdout,"+F4:%u:%u:%f:%f\n",
+				k, test_curves_bits[k],
+				ecdsa_results[k][0],ecdsa_results[k][1]);
+		else
+			fprintf(stdout,
+				"%4u bit ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
+				test_curves_bits[k],
+				test_curves_names[k],
+				ecdsa_results[k][0],ecdsa_results[k][1],
+				1.0/ecdsa_results[k][0],1.0/ecdsa_results[k][1]);
+		}
+#endif
+
+
+#ifndef OPENSSL_NO_ECDH
+	j=1;
+	for (k=0; k<EC_NUM; k++)
+		{
+		if (!ecdh_doit[k]) continue;
+		if (j && !mr)
+			{
+			printf("%30sop      op/s\n"," ");
+			j=0;
+			}
+		if (mr)
+			fprintf(stdout,"+F5:%u:%u:%f:%f\n",
+				k, test_curves_bits[k],
+				ecdh_results[k][0], 1.0/ecdh_results[k][0]);
+
+		else
+			fprintf(stdout,"%4u bit ecdh (%s) %8.4fs %8.1f\n",
+				test_curves_bits[k],
+				test_curves_names[k],
+				ecdh_results[k][0], 1.0/ecdh_results[k][0]);
+		}
+#endif
+
+	mret=0;
+
+end:
+	//ERR_print_errors(bio_err);
+	if (buf != NULL) /*OPENSSL_*/free(buf);
+	if (buf2 != NULL) /*OPENSSL_*/free(buf2);
+#ifndef OPENSSL_NO_DSA
+	for (i=0; i<DSA_NUM; i++)
+		if (dsa_key[i] != NULL)
+			DSA_free(dsa_key[i]);
+#endif
+
+#ifndef OPENSSL_NO_ECDSA
+	for (i=0; i<EC_NUM; i++)
+		if (ecdsa[i] != NULL)
+			EC_KEY_free(ecdsa[i]);
+#endif
+#ifndef OPENSSL_NO_ECDH
+	for (i=0; i<EC_NUM; i++)
+	{
+		if (ecdh_a[i] != NULL)
+			EC_KEY_free(ecdh_a[i]);
+		if (ecdh_b[i] != NULL)
+			EC_KEY_free(ecdh_b[i]);
+	}
+#endif
+
+	//apps_shutdown();
+	//OPENSSL_EXIT(mret);
+	}
+
+#ifdef OPENSSL_SYS_NEWLIB
+#undef SIGALRM
+#endif
+
+static void print_message(const char *s, long num, int length)
+	{
+#ifdef SIGALRM
+	BIO_printf(bio_err,mr ? "+DT:%s:%d:%d\n"
+		   : "Doing %s for %ds on %d size blocks: ",s,SECONDS,length);
+	(void)BIO_flush(bio_err);
+	alarm(SECONDS);
+#else
+	BIO_printf(bio_err,mr ? "+DN:%s:%ld:%d\n"
+		   : "Doing %s %ld times on %d size blocks: ",s,num,length);
+	(void)BIO_flush(bio_err);
+#endif
+#ifdef LINT
+	num=num;
+#endif
+	}
+
+static void pkey_print_message(const char *str, const char *str2, long num,
+	int bits, int tm)
+	{
+#ifdef SIGALRM
+	BIO_printf(bio_err,mr ? "+DTP:%d:%s:%s:%d\n"
+			   : "Doing %d bit %s %s's for %ds: ",bits,str,str2,tm);
+	(void)BIO_flush(bio_err);
+	alarm(RSA_SECONDS);
+#else
+	BIO_printf(bio_err,mr ? "+DNP:%ld:%d:%s:%s\n"
+			   : "Doing %ld %d bit %s %s's: ",num,bits,str,str2);
+	(void)BIO_flush(bio_err);
+#endif
+#ifdef LINT
+	num=num;
+#endif
+	}
+
+static void print_result(int alg,int run_no,int count,double time_used)
+	{
+	BIO_printf(bio_err,mr ? "+R:%d:%s:%f\n"
+		   : "%d %s's in %.2fs\n",count,names[alg],time_used);
+	results[alg][run_no]=((double)count)/time_used*lengths[run_no];
+	}
+
+#ifdef HAVE_FORK
+static char *sstrsep(char **string, const char *delim)
+    {
+    char isdelim[256];
+    char *token = *string;
+
+    if (**string == 0)
+        return NULL;
+
+    memset(isdelim, 0, sizeof isdelim);
+    isdelim[0] = 1;
+
+    while (*delim)
+        {
+        isdelim[(unsigned char)(*delim)] = 1;
+        delim++;
+        }
+
+    while (!isdelim[(unsigned char)(**string)])
+        {
+        (*string)++;
+        }
+
+    if (**string)
+        {
+        **string = 0;
+        (*string)++;
+        }
+
+    return token;
+    }
+
+static int do_multi(int multi)
+	{
+	int n;
+	int fd[2];
+	int *fds;
+	static char sep[]=":";
+
+	fds=malloc(multi*sizeof *fds);
+	for(n=0 ; n < multi ; ++n)
+		{
+		pipe(fd);
+		if(fork())
+			{
+			close(fd[1]);
+			fds[n]=fd[0];
+			}
+		else
+			{
+			close(fd[0]);
+			close(1);
+			dup(fd[1]);
+			close(fd[1]);
+			mr=1;
+			usertime=0;
+			return 0;
+			}
+		printf("Forked child %d\n",n);
+		}
+
+	/* for now, assume the pipe is long enough to take all the output */
+	for(n=0 ; n < multi ; ++n)
+		{
+		FILE *f;
+		char buf[1024];
+		char *p;
+
+		f=fdopen(fds[n],"r");
+		while(fgets(buf,sizeof buf,f))
+			{
+			p=strchr(buf,'\n');
+			if(p)
+				*p='\0';
+			if(buf[0] != '+')
+				{
+				fprintf(stderr,"Don't understand line '%s' from child %d\n",
+						buf,n);
+				continue;
+				}
+			printf("Got: %s from %d\n",buf,n);
+			if(!strncmp(buf,"+F:",3))
+				{
+				int alg;
+				int j;
+
+				p=buf+3;
+				alg=atoi(sstrsep(&p,sep));
+				sstrsep(&p,sep);
+				for(j=0 ; j < SIZE_NUM ; ++j)
+					results[alg][j]+=atof(sstrsep(&p,sep));
+				}
+			else if(!strncmp(buf,"+F2:",4))
+				{
+				int k;
+				double d;
+
+				p=buf+4;
+				k=atoi(sstrsep(&p,sep));
+				sstrsep(&p,sep);
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
+				else
+					rsa_results[k][0]=d;
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
+				else
+					rsa_results[k][1]=d;
+				}
+			else if(!strncmp(buf,"+F2:",4))
+				{
+				int k;
+				double d;
+
+				p=buf+4;
+				k=atoi(sstrsep(&p,sep));
+				sstrsep(&p,sep);
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
+				else
+					rsa_results[k][0]=d;
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
+				else
+					rsa_results[k][1]=d;
+				}
+			else if(!strncmp(buf,"+F3:",4))
+				{
+				int k;
+				double d;
+
+				p=buf+4;
+				k=atoi(sstrsep(&p,sep));
+				sstrsep(&p,sep);
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					dsa_results[k][0]=1/(1/dsa_results[k][0]+1/d);
+				else
+					dsa_results[k][0]=d;
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					dsa_results[k][1]=1/(1/dsa_results[k][1]+1/d);
+				else
+					dsa_results[k][1]=d;
+				}
+#ifndef OPENSSL_NO_ECDSA
+			else if(!strncmp(buf,"+F4:",4))
+				{
+				int k;
+				double d;
+
+				p=buf+4;
+				k=atoi(sstrsep(&p,sep));
+				sstrsep(&p,sep);
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					ecdsa_results[k][0]=1/(1/ecdsa_results[k][0]+1/d);
+				else
+					ecdsa_results[k][0]=d;
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					ecdsa_results[k][1]=1/(1/ecdsa_results[k][1]+1/d);
+				else
+					ecdsa_results[k][1]=d;
+				}
+#endif
+
+#ifndef OPENSSL_NO_ECDH
+			else if(!strncmp(buf,"+F5:",4))
+				{
+				int k;
+				double d;
+
+				p=buf+4;
+				k=atoi(sstrsep(&p,sep));
+				sstrsep(&p,sep);
+
+				d=atof(sstrsep(&p,sep));
+				if(n)
+					ecdh_results[k][0]=1/(1/ecdh_results[k][0]+1/d);
+				else
+					ecdh_results[k][0]=d;
+
+				}
+#endif
+
+			else if(!strncmp(buf,"+H:",3))
+				{
+				}
+			else
+				fprintf(stderr,"Unknown type '%s' from child %d\n",buf,n);
+			}
+		}
+	return 1;
+	}
+#endif
+
+#ifdef __AVR32__
+#include <avr32/io.h>
+
+int _init_startup (){
+#ifdef __SETUP_OSC__
+  /* Setup OSC0. */
+  AVR32_PM.oscctrl0 = 7;
+
+  /* Set OSC0 as main clock. */
+  AVR32_PM.mcctrl = ( AVR32_PM_MCCTRL_OSC0EN_MASK |
+                      (1 << AVR32_PM_MCCTRL_MCSEL_OFFSET) );
+#endif
+
+#ifdef __AVR32_UC__
+  /* Set flashc master type to last default to save one cycle for
+     each branch. */
+  volatile  avr32_hmatrix_scfg_t scfg = AVR32_HMATRIX.SCFG[0];
+  scfg.defmstr_type =
+    AVR32_HMATRIX_DEFMSTR_TYPE_LAST_DEFAULT;
+  AVR32_HMATRIX.SCFG[0] = scfg;
+
+  /* Set to one waitstate. */
+#ifdef __FLASH_WS__
+  AVR32_FLASHC.fcr |= AVR32_FLASHC_FCR_FWS_MASK | 0x10000000;
+#endif
+#endif
+}
+#endif
+
Index: openssl-0.9.8g/Configure
===================================================================
--- openssl-0.9.8g.orig/Configure	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/Configure	2008-09-24 11:01:01.000000000 +0200
@@ -120,6 +120,7 @@
 
 my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o::::md5-x86_64.o:::rc4-x86_64.o::";
 my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o::";
+my $avr32_asm="::asm/des-avr32.o asm/des_cbc.o fcrypt_b.o:aes_core.o aes_cbc.o asm/aes-avr32.o:::::::";
 
 my $no_asm="::::::::::";
 
@@ -170,6 +171,8 @@
 
 # Basic configs that should work on any (32 and less bit) box
 "gcc",		"gcc:-O3::(unknown):::BN_LLONG:::",
+"avr32-gcc",	"avr32-gcc:-mpart=\$(PROCESSOR) -DBN_NO_MUL_COMBA -DBN_NO_SQR_COMBA -DBN_NO_RECURSION -DBN_NO_CONSTTIME -DBN_DIV2W -DDES_CTABLES_IN_DATA -DAES_CTABLES_IN_DATA -DNO_CHMOD -DNO_STRINGS_H -DOPENSSL_NO_DGRAM -DOPENSSL_NO_SOCK -DOPENSSL_SYSNAME_NEWLIB -O3 -fno-common -g -fdata-sections -ffunction-sections -ffast-math::(unknown)::-g -mpart=\${PROCESSOR} -O3 -Wl,--gc-sections,--direct-data:BN_LLONG:${avr32_asm}",
+"avr32-gcc-size",	"avr32-gcc:-mpart=\$(PROCESSOR) -DBN_NO_MUL_COMBA -DBN_NO_SQR_COMBA -DBN_NO_RECURSION -DBN_NO_CONSTTIME  -DBN_DIV2W  -DNO_CHMOD -DNO_STRINGS_H -DOPENSSL_NO_DGRAM -DOPENSSL_NO_SOCK -DOPENSSL_SYSNAME_NEWLIB -Os -fno-common -g -fdata-sections -ffunction-sections -ffast-math::(unknown)::-Os -g -mrelax -mpart=\$(PROCESSOR) -Wl,--gc-sections,--direct-data:BN_LLONG:${avr32_asm}",
 "cc",		"cc:-O::(unknown)::::::",
 
 ####VOS Configurations
@@ -319,6 +322,7 @@
 "linux-ia32-icc",	"icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "linux-elf",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "linux-aout",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
+"linux-avr32",	"avr32-linux-gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG BF_PTR:${avr32_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 ####
 "linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "linux-ppc64",	"gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -742,6 +746,10 @@
 				{
 				$prefix=$1;
 				}
+			elsif (/^--processor=(.*)$/)
+				{
+				$processor=$1;
+				}
 			elsif (/^--openssldir=(.*)$/)
 				{
 				$openssldir=$1;
Index: openssl-0.9.8g/crypto/aes/asm/aes-avr32.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8g/crypto/aes/asm/aes-avr32.S	2008-09-24 11:01:01.000000000 +0200
@@ -0,0 +1,1106 @@
+	.global	AES_encrypt
+	.global	AES_decrypt
+
+
+/*One Round
+t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
+t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
+t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
+t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7] ;  */
+
+#define		AES_MAXNR 14
+#define		TE0	r4
+#define		TE1	r5
+#define		TE2	r6
+#define		TE3	r7
+#define		TD0	r4
+#define		TD1	r5
+#define		TD2	r6
+#define		TD3	r7
+#define		TE4	r4
+#define		TD4	r4
+
+#define		RK	r10
+#define		tmp	lr
+
+	.macro	RoundOddEncrypt s0, s1, s2, s3, t0, t1, t2, t3
+
+	ld.w		\t0, TE0[\s0:t << 2]
+	ld.w		\t3, TE1[\s0:u << 2]
+	ld.w		\t2, TE2[\s0:l << 2]
+	ld.w		tmp, RK[16]
+	ld.w		\t1, TE3[\s0:b << 2]
+
+	ld.w		\s0, TE1[\s1:u << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TE2[\s1:l << 2]
+	eor		\t0, \s0
+	ld.w		\s0, RK[28]
+	eor		\t3, tmp
+	ld.w		tmp, TE3[\s1:b << 2]
+	eor		\t3, \s0
+	ld.w		\s0, RK[24]
+	eor		\t2, tmp
+	ld.w		tmp, TE0[\s1:t << 2]
+	eor		\t2, \s0
+	ld.w		\s0, RK[20]
+	eor		\t1, tmp
+	ld.w		tmp, TE2[\s2:l << 2]	
+	eor		\t1, \s0
+	 			
+	ld.w		\s0, TE3[\s2:b << 2]	
+	ld.w		\s1, TE0[\s2:t << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TE1[\s2:u << 2]		
+	eor		\t3, \s0
+	eor		\t2, \s1
+	ld.w		\s0, TE3[\s3:b << 2]	
+	ld.w		\s1, TE0[\s3:t << 2]		
+	eor		\t1, tmp		
+
+	ld.w		\s2, TE1[\s3:u << 2]		
+	eor		\t0, \s0
+	ld.w		tmp, TE2[\s3:l << 2]			
+	eor		\t3, \s1
+	eor		\t2, \s2
+	eor		\t1, tmp		
+	sub		RK, -32
+	.endm
+		
+	.macro	RoundEvenEncrypt s0, s1, s2, s3, t0, t1, t2, t3
+		
+	ld.w		\t0, TE0[\s0:t << 2]
+	ld.w		\t3, TE1[\s0:u << 2]
+	ld.w		\t2, TE2[\s0:l << 2]
+	ld.w		tmp, RK[0]
+	ld.w		\t1, TE3[\s0:b << 2]
+
+	ld.w		\s0, TE1[\s1:u << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TE2[\s1:l << 2]
+	eor		\t0, \s0
+	ld.w		\s0, RK[12]
+	eor		\t3, tmp
+	ld.w		tmp, TE3[\s1:b << 2]
+	eor		\t3, \s0
+	ld.w		\s0, RK[8]
+	eor		\t2, tmp
+	ld.w		tmp, TE0[\s1:t << 2]
+	eor		\t2, \s0
+	ld.w		\s0, RK[4]
+	eor		\t1, tmp
+	ld.w		tmp, TE2[\s2:l << 2]	
+	eor		\t1, \s0
+	 			
+	ld.w		\s0, TE3[\s2:b << 2]	
+	ld.w		\s1, TE0[\s2:t << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TE1[\s2:u << 2]		
+	eor		\t3, \s0
+	eor		\t2, \s1
+	ld.w		\s0, TE3[\s3:b << 2]	
+	ld.w		\s1, TE0[\s3:t << 2]		
+	eor		\t1, tmp		
+
+	ld.w		\s2, TE1[\s3:u << 2]		
+	eor		\t0, \s0
+	ld.w		tmp, TE2[\s3:l << 2]			
+	eor		\t3, \s1
+	eor		\t2, \s2
+	eor		\t1, tmp		
+	.endm	
+	
+	.macro	RoundLastEncrypt s0, s1, s2, s3, t0, t1, t2, t3
+		
+	ld.w		\t0, TE4[\s0:t << 2]
+	ld.w		\t3, TE4[\s0:u << 2]
+	ld.w		\t2, TE4[\s0:l << 2]
+	ld.w		tmp, RK[0]
+	ld.w		\t1, TE4[\s0:b << 2]
+	andh		\t0, 0xFF00, COH
+	andh		\t3, 0x00FF, COH
+	andl		\t2, 0xFF00, COH
+	andl		\t1, 0x00FF, COH
+			
+	ld.w		\s0, TE4[\s1:u << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TE4[\s1:l << 2]
+	andh		\s0, 0x00FF, COH 
+	eor		\t0, \s0
+	ld.w		\s0, RK[12]
+	andl		tmp, 0xFF00, COH 
+	eor		\t3, tmp
+	ld.w		tmp, TE4[\s1:b << 2]
+	eor		\t3, \s0
+	ld.w		\s0, RK[8]
+	andl		tmp, 0x00FF, COH 
+	eor		\t2, tmp
+	ld.w		tmp, TE4[\s1:t << 2]
+	eor		\t2, \s0
+	ld.w		\s0, RK[4]
+	andh		tmp, 0xFF00, COH 
+	eor		\t1, tmp
+	ld.w		tmp, TE4[\s2:l << 2]	
+	eor		\t1, \s0
+	 			
+	ld.w		\s0, TE4[\s2:b << 2]	
+	ld.w		\s1, TE4[\s2:t << 2]
+
+	andl		tmp, 0xFF00, COH 
+	eor		\t0, tmp
+	ld.w		tmp, TE4[\s2:u << 2]		
+	andl		\s0, 0x00FF, COH 
+	eor		\t3, \s0
+	andh		\s1, 0xFF00, COH 
+	eor		\t2, \s1
+	ld.w		\s0, TE4[\s3:b << 2]	
+	ld.w		\s1, TE4[\s3:t << 2]		
+	andh		tmp, 0x00FF, COH 
+	eor		\t1, tmp		
+
+	ld.w		\s2, TE4[\s3:u << 2]		
+	andl		\s0, 0x00FF, COH 
+	eor		\t0, \s0
+	ld.w		tmp, TE4[\s3:l << 2]			
+	andh		\s1, 0xFF00, COH 
+	eor		\t3, \s1
+	andh		\s2, 0x00FF, COH 
+	eor		\t2, \s2
+	andl		tmp, 0xFF00, COH 
+	eor		\t1, tmp		
+	.endm	
+
+	.macro	RoundOddDecrypt	s0, s1, s2, s3, t0, t1, t2, t3
+		
+	ld.w		\t0, TD0[\s0:t << 2]
+	ld.w		\t3, TD3[\s0:b << 2]
+	ld.w		\t2, TD2[\s0:l << 2]
+	ld.w		tmp, RK[16]
+	ld.w		\t1, TD1[\s0:u << 2]
+
+	ld.w		\s0, TD3[\s1:b << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TD2[\s1:l << 2]
+	eor		\t0, \s0
+	ld.w		\s0, RK[28]
+	eor		\t3, tmp
+	ld.w		tmp, TD1[\s1:u << 2]
+	eor		\t3, \s0
+	ld.w		\s0, RK[24]
+	eor		\t2, tmp
+	ld.w		tmp, TD0[\s1:t << 2]
+	eor		\t2, \s0
+	ld.w		\s0, RK[20]
+	eor		\t1, tmp
+	ld.w		tmp, TD2[\s2:l << 2]	
+	eor		\t1, \s0
+	 			
+	ld.w		\s0, TD1[\s2:u << 2]	
+	ld.w		\s1, TD0[\s2:t << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TD3[\s2:b << 2]		
+	eor		\t3, \s0
+	eor		\t2, \s1
+	ld.w		\s0, TD1[\s3:u << 2]	
+	ld.w		\s1, TD0[\s3:t << 2]		
+	eor		\t1, tmp		
+
+	ld.w		\s2, TD3[\s3:b << 2]		
+	eor		\t0, \s0
+	ld.w		tmp, TD2[\s3:l << 2]			
+	eor		\t3, \s1
+	eor		\t2, \s2
+	eor		\t1, tmp		
+	sub		RK, -32
+	.endm	
+		
+	.macro	RoundEvenDecrypt s0, s1, s2, s3, t0, t1, t2, t3
+		
+	ld.w		\t0, TD0[\s0:t << 2]
+	ld.w		\t3, TD3[\s0:b << 2]
+	ld.w		\t2, TD2[\s0:l << 2]
+	ld.w		tmp, RK[0]
+	ld.w		\t1, TD1[\s0:u << 2]
+
+	ld.w		\s0, TD3[\s1:b << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TD2[\s1:l << 2]
+	eor		\t0, \s0
+	ld.w		\s0, RK[12]
+	eor		\t3, tmp
+	ld.w		tmp, TD1[\s1:u << 2]
+	eor		\t3, \s0
+	ld.w		\s0, RK[8]
+	eor		\t2, tmp
+	ld.w		tmp, TD0[\s1:t << 2]
+	eor		\t2, \s0
+	ld.w		\s0, RK[4]
+	eor		\t1, tmp
+	ld.w		tmp, TD2[\s2:l << 2]	
+	eor		\t1, \s0
+	 			
+	ld.w		\s0, TD1[\s2:u << 2]	
+	ld.w		\s1, TD0[\s2:t << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TD3[\s2:b << 2]		
+	eor		\t3, \s0
+	eor		\t2, \s1
+	ld.w		\s0, TD1[\s3:u << 2]	
+	ld.w		\s1, TD0[\s3:t << 2]		
+	eor		\t1, tmp		
+
+	ld.w		\s2, TD3[\s3:b << 2]		
+	eor		\t0, \s0
+	ld.w		tmp, TD2[\s3:l << 2]			
+	eor		\t3, \s1
+	eor		\t2, \s2
+	eor		\t1, tmp		
+	.endm
+		
+	.macro	RoundLastDecrypt s0, s1, s2, s3, t0, t1, t2, t3
+		
+	ld.w		\t0, TD4[\s0:t << 2]
+	ld.w		\t3, TD4[\s0:b << 2]
+	ld.w		\t2, TD4[\s0:l << 2]
+	ld.w		tmp, RK[0]
+	ld.w		\t1, TD4[\s0:u << 2]
+	andh		\t0, 0xFF00, COH
+	andl		\t3, 0x00FF, COH
+	andl		\t2, 0xFF00, COH
+	andh		\t1, 0x00FF, COH
+			
+	ld.w		\s0, TD4[\s1:b << 2]
+	eor		\t0, tmp
+	ld.w		tmp, TD4[\s1:l << 2]
+	andl		\s0, 0x00FF, COH 
+	eor		\t0, \s0
+	ld.w		\s0, RK[12]
+	andl		tmp, 0xFF00, COH 
+	eor		\t3, tmp
+	ld.w		tmp, TD4[\s1:u << 2]
+	eor		\t3, \s0
+	ld.w		\s0, RK[8]
+	andh		tmp, 0x00FF, COH 
+	eor		\t2, tmp
+	ld.w		tmp, TD4[\s1:t << 2]
+	eor		\t2, \s0
+	ld.w		\s0, RK[4]
+	andh		tmp, 0xFF00, COH 
+	eor		\t1, tmp
+	ld.w		tmp, TD4[\s2:l << 2]	
+	eor		\t1, \s0
+	 			
+	ld.w		\s0, TD4[\s2:u << 2]	
+	ld.w		\s1, TD4[\s2:t << 2]
+
+	andl		tmp, 0xFF00, COH 
+	eor		\t0, tmp
+	ld.w		tmp, TD4[\s2:b << 2]		
+	andh		\s0, 0x00FF, COH 
+	eor		\t3, \s0
+	andh		\s1, 0xFF00, COH 
+	eor		\t2, \s1
+	ld.w		\s0, TD4[\s3:u << 2]	
+	ld.w		\s1, TD4[\s3:t << 2]		
+	andl		tmp, 0x00FF, COH 
+	eor		\t1, tmp		
+
+	ld.w		\s2, TD4[\s3:b << 2]		
+	andh		\s0, 0x00FF, COH 
+	eor		\t0, \s0
+	ld.w		tmp, TD4[\s3:l << 2]			
+	andh		\s1, 0xFF00, COH 
+	eor		\t3, \s1
+	andl		\s2, 0x00FF, COH 
+	eor		\t2, \s2
+	andl		tmp, 0xFF00, COH 
+	eor		\t1, tmp		
+	.endm	
+
+
+	.text
+	.align 2
+/* void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) */
+AES_encrypt:	
+	pushm		r0-r3, r4-r7, lr
+
+/*	s0 = GETU32(pt     ) ^ rk[0];
+	s1 = GETU32(pt +  4) ^ rk[1];
+	s2 = GETU32(pt +  8) ^ rk[2];
+	\s3 = GETU32(pt + 12) ^ rk[3]; */
+	ldm		RK, r0-r3	
+	lda.w		TE0, AES_Te0
+	ld.w		lr, r12[0]
+	lda.w		TE1, AES_Te1
+	eor		r3, lr		// r3 = *pt ^ rk[0] 
+	ld.w		lr, r12[4]
+	lda.w		TE2, AES_Te2
+	eor		r2, lr		// r2 = *(pt + 4) ^ rk[1]
+	ld.w		lr, r12[8]
+	lda.w		TE3, AES_Te3
+	eor		r1, lr		// r1 = *(pt + 8) ^ rk[2]
+	ld.w		lr, r12[12]
+
+	ld.w		r9, RK[4*4*(AES_MAXNR+1)]
+	st.w		--sp, r11	
+	eor		r0, lr		// r0 = *(pt + 12) ^ rk[3]
+	lsr		r9, 1
+	st.w		--sp, r9	
+
+encryption_rounds:
+	RoundOddEncrypt	r3, r2, r1, r0, r8, r9, r11, r12
+	ld.w		lr, sp[0]
+	sub		lr, 1
+	st.w		sp[0], lr
+	breq		last_encryption_round	
+	RoundEvenEncrypt r8, r9, r11, r12, r3, r2, r1, r0
+	rjmp		encryption_rounds
+	
+last_encryption_round:	
+	lda.w		TE4, AES_Te4
+	RoundLastEncrypt r8, r9, r11, r12, r3, r2, r1, r0
+	ld.w		lr, sp[4] // lr = out
+	sub		sp, -8
+	stm		lr, r0-r3
+	popm		r0-r3, r4-r7, pc
+	
+	
+/* void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) */
+AES_decrypt:	
+	pushm		r0-r3, r4-r7, lr
+
+/*	s0 = GETU32(pt     ) ^ rk[0];
+	s1 = GETU32(pt +  4) ^ rk[1];
+	s2 = GETU32(pt +  8) ^ rk[2];
+	s3 = GETU32(pt + 12) ^ rk[3];*/
+	ldm		RK, r0-r3	
+	lda.w		TD0, AES_Td0
+	ld.w		lr, r12[0]
+	lda.w		TD1, AES_Td1
+	eor		r3, lr		// r3 = *ct ^ rk[0] 
+	ld.w		lr, r12[4]
+	lda.w		TD2, AES_Td2
+	eor		r2, lr		// r2 = *(ct + 4) ^ rk[1]
+	ld.w		lr, r12[8]
+	lda.w		TD3, AES_Td3
+	eor		r1, r1, lr << 0	// r1 = *(ct + 8) ^ rk[2]
+	ld.w		lr, r12[12]
+
+	ld.w		r9, RK[4*4*(AES_MAXNR+1)]
+	st.w		--sp, r11	
+	eor		r0, lr		// r0 = *(ct + 12) ^ rk[3]
+	lsr		r9, 1
+	st.w		--sp, r9	
+
+decryption_rounds:
+	RoundOddDecrypt	r3, r2, r1, r0, r8, r9, r11, r12
+	ld.w		lr, sp[0]
+	sub		lr, 1
+	st.w		sp[0], lr
+	breq		last_decryption_round	
+	RoundEvenDecrypt r8, r9, r11, r12, r3, r2, r1, r0
+	rjmp		decryption_rounds
+	
+last_decryption_round:	
+	lda.w		TD4, AES_Td4
+	RoundLastDecrypt r8, r9, r11, r12, r3, r2, r1, r0
+	ld.w		lr, sp[4] // lr = out
+	sub		sp, -8
+	stm		lr, r0-r3
+	popm		r0-r3, r4-r7, pc
+			
+
+#ifdef AES_CTABLES_IN_DATA
+	.data
+#endif
+	.align	2
+	.global	AES_Te0
+	.type	AES_Te0,@object
+	.size   AES_Te0, 1024
+AES_Te0:	
+        .word    0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d
+        .word    0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554
+        .word    0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d
+        .word    0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a
+        .word    0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87
+        .word    0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b
+        .word    0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea
+        .word    0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b
+        .word    0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a
+        .word    0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f
+        .word    0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108
+        .word    0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f
+        .word    0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e
+        .word    0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5
+        .word    0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d
+        .word    0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f
+        .word    0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e
+        .word    0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb
+        .word    0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce
+        .word    0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497
+        .word    0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c
+        .word    0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed
+        .word    0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b
+        .word    0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a
+        .word    0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16
+        .word    0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594
+        .word    0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81
+        .word    0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3
+        .word    0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a
+        .word    0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504
+        .word    0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163
+        .word    0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d
+        .word    0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f
+        .word    0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739
+        .word    0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47
+        .word    0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395
+        .word    0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f
+        .word    0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883
+        .word    0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c
+        .word    0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76
+        .word    0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e
+        .word    0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4
+        .word    0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6
+        .word    0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b
+        .word    0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7
+        .word    0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0
+        .word    0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25
+        .word    0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818
+        .word    0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72
+        .word    0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651
+        .word    0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21
+        .word    0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85
+        .word    0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa
+        .word    0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12
+        .word    0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0
+        .word    0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9
+        .word    0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133
+        .word    0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7
+        .word    0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920
+        .word    0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a
+        .word    0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17
+        .word    0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8
+        .word    0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11
+        .word    0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a
+
+	.global	AES_Te1
+	.type	AES_Te1,@object
+	.size   AES_Te1, 1024
+AES_Te1:	
+        .word    0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b
+        .word    0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5
+        .word    0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b
+        .word    0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676
+        .word    0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d
+        .word    0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0
+        .word    0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf
+        .word    0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0
+        .word    0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626
+        .word    0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc
+        .word    0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1
+        .word    0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515
+        .word    0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3
+        .word    0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a
+        .word    0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2
+        .word    0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575
+        .word    0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a
+        .word    0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0
+        .word    0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3
+        .word    0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484
+        .word    0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded
+        .word    0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b
+        .word    0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939
+        .word    0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf
+        .word    0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb
+        .word    0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585
+        .word    0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f
+        .word    0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8
+        .word    0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f
+        .word    0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5
+        .word    0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121
+        .word    0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2
+        .word    0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec
+        .word    0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717
+        .word    0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d
+        .word    0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373
+        .word    0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc
+        .word    0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888
+        .word    0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414
+        .word    0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb
+        .word    0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a
+        .word    0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c
+        .word    0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262
+        .word    0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979
+        .word    0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d
+        .word    0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9
+        .word    0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea
+        .word    0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808
+        .word    0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e
+        .word    0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6
+        .word    0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f
+        .word    0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a
+        .word    0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666
+        .word    0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e
+        .word    0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9
+        .word    0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e
+        .word    0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111
+        .word    0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494
+        .word    0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9
+        .word    0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf
+        .word    0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d
+        .word    0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868
+        .word    0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f
+        .word    0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616
+
+	.global	AES_Te2
+	.type	AES_Te2,@object
+	.size   AES_Te2, 1024
+AES_Te2:	
+        .word    0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b
+        .word    0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5
+        .word    0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b
+        .word    0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76
+        .word    0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d
+        .word    0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0
+        .word    0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af
+        .word    0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0
+        .word    0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26
+        .word    0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc
+        .word    0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1
+        .word    0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15
+        .word    0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3
+        .word    0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a
+        .word    0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2
+        .word    0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75
+        .word    0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a
+        .word    0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0
+        .word    0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3
+        .word    0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384
+        .word    0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed
+        .word    0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b
+        .word    0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239
+        .word    0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf
+        .word    0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb
+        .word    0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185
+        .word    0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f
+        .word    0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8
+        .word    0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f
+        .word    0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5
+        .word    0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221
+        .word    0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2
+        .word    0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec
+        .word    0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17
+        .word    0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d
+        .word    0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673
+        .word    0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc
+        .word    0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88
+        .word    0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814
+        .word    0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb
+        .word    0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a
+        .word    0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c
+        .word    0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462
+        .word    0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279
+        .word    0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d
+        .word    0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9
+        .word    0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea
+        .word    0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008
+        .word    0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e
+        .word    0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6
+        .word    0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f
+        .word    0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a
+        .word    0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66
+        .word    0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e
+        .word    0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9
+        .word    0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e
+        .word    0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211
+        .word    0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394
+        .word    0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9
+        .word    0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df
+        .word    0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d
+        .word    0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068
+        .word    0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f
+        .word    0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16
+
+	.global	AES_Te3
+	.type	AES_Te3,@object
+	.size   AES_Te3, 1024
+AES_Te3:	
+        .word    0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6
+        .word    0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491
+        .word    0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56
+        .word    0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec
+        .word    0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa
+        .word    0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb
+        .word    0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45
+        .word    0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b
+        .word    0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c
+        .word    0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83
+        .word    0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9
+        .word    0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a
+        .word    0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d
+        .word    0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f
+        .word    0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf
+        .word    0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea
+        .word    0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34
+        .word    0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b
+        .word    0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d
+        .word    0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713
+        .word    0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1
+        .word    0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6
+        .word    0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72
+        .word    0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85
+        .word    0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed
+        .word    0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411
+        .word    0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe
+        .word    0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b
+        .word    0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05
+        .word    0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1
+        .word    0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342
+        .word    0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf
+        .word    0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3
+        .word    0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e
+        .word    0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a
+        .word    0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6
+        .word    0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3
+        .word    0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b
+        .word    0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28
+        .word    0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad
+        .word    0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14
+        .word    0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8
+        .word    0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4
+        .word    0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2
+        .word    0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da
+        .word    0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049
+        .word    0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf
+        .word    0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810
+        .word    0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c
+        .word    0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197
+        .word    0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e
+        .word    0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f
+        .word    0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc
+        .word    0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c
+        .word    0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069
+        .word    0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927
+        .word    0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322
+        .word    0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733
+        .word    0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9
+        .word    0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5
+        .word    0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a
+        .word    0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0
+        .word    0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e
+        .word    0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c
+
+	.global	AES_Te4
+	.type	AES_Te4,@object
+	.size   AES_Te4, 1024
+AES_Te4:	
+        .word    0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b
+        .word    0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5
+        .word    0x30303030, 0x01010101, 0x67676767, 0x2b2b2b2b
+        .word    0xfefefefe, 0xd7d7d7d7, 0xabababab, 0x76767676
+        .word    0xcacacaca, 0x82828282, 0xc9c9c9c9, 0x7d7d7d7d
+        .word    0xfafafafa, 0x59595959, 0x47474747, 0xf0f0f0f0
+        .word    0xadadadad, 0xd4d4d4d4, 0xa2a2a2a2, 0xafafafaf
+        .word    0x9c9c9c9c, 0xa4a4a4a4, 0x72727272, 0xc0c0c0c0
+        .word    0xb7b7b7b7, 0xfdfdfdfd, 0x93939393, 0x26262626
+        .word    0x36363636, 0x3f3f3f3f, 0xf7f7f7f7, 0xcccccccc
+        .word    0x34343434, 0xa5a5a5a5, 0xe5e5e5e5, 0xf1f1f1f1
+        .word    0x71717171, 0xd8d8d8d8, 0x31313131, 0x15151515
+        .word    0x04040404, 0xc7c7c7c7, 0x23232323, 0xc3c3c3c3
+        .word    0x18181818, 0x96969696, 0x05050505, 0x9a9a9a9a
+        .word    0x07070707, 0x12121212, 0x80808080, 0xe2e2e2e2
+        .word    0xebebebeb, 0x27272727, 0xb2b2b2b2, 0x75757575
+        .word    0x09090909, 0x83838383, 0x2c2c2c2c, 0x1a1a1a1a
+        .word    0x1b1b1b1b, 0x6e6e6e6e, 0x5a5a5a5a, 0xa0a0a0a0
+        .word    0x52525252, 0x3b3b3b3b, 0xd6d6d6d6, 0xb3b3b3b3
+        .word    0x29292929, 0xe3e3e3e3, 0x2f2f2f2f, 0x84848484
+        .word    0x53535353, 0xd1d1d1d1, 0x00000000, 0xedededed
+        .word    0x20202020, 0xfcfcfcfc, 0xb1b1b1b1, 0x5b5b5b5b
+        .word    0x6a6a6a6a, 0xcbcbcbcb, 0xbebebebe, 0x39393939
+        .word    0x4a4a4a4a, 0x4c4c4c4c, 0x58585858, 0xcfcfcfcf
+        .word    0xd0d0d0d0, 0xefefefef, 0xaaaaaaaa, 0xfbfbfbfb
+        .word    0x43434343, 0x4d4d4d4d, 0x33333333, 0x85858585
+        .word    0x45454545, 0xf9f9f9f9, 0x02020202, 0x7f7f7f7f
+        .word    0x50505050, 0x3c3c3c3c, 0x9f9f9f9f, 0xa8a8a8a8
+        .word    0x51515151, 0xa3a3a3a3, 0x40404040, 0x8f8f8f8f
+        .word    0x92929292, 0x9d9d9d9d, 0x38383838, 0xf5f5f5f5
+        .word    0xbcbcbcbc, 0xb6b6b6b6, 0xdadadada, 0x21212121
+        .word    0x10101010, 0xffffffff, 0xf3f3f3f3, 0xd2d2d2d2
+        .word    0xcdcdcdcd, 0x0c0c0c0c, 0x13131313, 0xecececec
+        .word    0x5f5f5f5f, 0x97979797, 0x44444444, 0x17171717
+        .word    0xc4c4c4c4, 0xa7a7a7a7, 0x7e7e7e7e, 0x3d3d3d3d
+        .word    0x64646464, 0x5d5d5d5d, 0x19191919, 0x73737373
+        .word    0x60606060, 0x81818181, 0x4f4f4f4f, 0xdcdcdcdc
+        .word    0x22222222, 0x2a2a2a2a, 0x90909090, 0x88888888
+        .word    0x46464646, 0xeeeeeeee, 0xb8b8b8b8, 0x14141414
+        .word    0xdededede, 0x5e5e5e5e, 0x0b0b0b0b, 0xdbdbdbdb
+        .word    0xe0e0e0e0, 0x32323232, 0x3a3a3a3a, 0x0a0a0a0a
+        .word    0x49494949, 0x06060606, 0x24242424, 0x5c5c5c5c
+        .word    0xc2c2c2c2, 0xd3d3d3d3, 0xacacacac, 0x62626262
+        .word    0x91919191, 0x95959595, 0xe4e4e4e4, 0x79797979
+        .word    0xe7e7e7e7, 0xc8c8c8c8, 0x37373737, 0x6d6d6d6d
+        .word    0x8d8d8d8d, 0xd5d5d5d5, 0x4e4e4e4e, 0xa9a9a9a9
+        .word    0x6c6c6c6c, 0x56565656, 0xf4f4f4f4, 0xeaeaeaea
+        .word    0x65656565, 0x7a7a7a7a, 0xaeaeaeae, 0x08080808
+        .word    0xbabababa, 0x78787878, 0x25252525, 0x2e2e2e2e
+        .word    0x1c1c1c1c, 0xa6a6a6a6, 0xb4b4b4b4, 0xc6c6c6c6
+        .word    0xe8e8e8e8, 0xdddddddd, 0x74747474, 0x1f1f1f1f
+        .word    0x4b4b4b4b, 0xbdbdbdbd, 0x8b8b8b8b, 0x8a8a8a8a
+        .word    0x70707070, 0x3e3e3e3e, 0xb5b5b5b5, 0x66666666
+        .word    0x48484848, 0x03030303, 0xf6f6f6f6, 0x0e0e0e0e
+        .word    0x61616161, 0x35353535, 0x57575757, 0xb9b9b9b9
+        .word    0x86868686, 0xc1c1c1c1, 0x1d1d1d1d, 0x9e9e9e9e
+        .word    0xe1e1e1e1, 0xf8f8f8f8, 0x98989898, 0x11111111
+        .word    0x69696969, 0xd9d9d9d9, 0x8e8e8e8e, 0x94949494
+        .word    0x9b9b9b9b, 0x1e1e1e1e, 0x87878787, 0xe9e9e9e9
+        .word    0xcececece, 0x55555555, 0x28282828, 0xdfdfdfdf
+        .word    0x8c8c8c8c, 0xa1a1a1a1, 0x89898989, 0x0d0d0d0d
+        .word    0xbfbfbfbf, 0xe6e6e6e6, 0x42424242, 0x68686868
+        .word    0x41414141, 0x99999999, 0x2d2d2d2d, 0x0f0f0f0f
+        .word    0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616
+
+	.global	AES_Td0
+	.type	AES_Td0,@object
+	.size   AES_Td0, 1024
+AES_Td0:	
+        .word    0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96
+        .word    0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393
+        .word    0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25
+        .word    0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f
+        .word    0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1
+        .word    0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6
+        .word    0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da
+        .word    0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844
+        .word    0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd
+        .word    0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4
+        .word    0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45
+        .word    0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94
+        .word    0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7
+        .word    0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a
+        .word    0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5
+        .word    0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c
+        .word    0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1
+        .word    0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a
+        .word    0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75
+        .word    0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051
+        .word    0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46
+        .word    0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff
+        .word    0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77
+        .word    0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb
+        .word    0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000
+        .word    0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e
+        .word    0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927
+        .word    0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a
+        .word    0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e
+        .word    0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16
+        .word    0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d
+        .word    0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8
+        .word    0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd
+        .word    0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34
+        .word    0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163
+        .word    0xd731dcca, 0x42638510, 0x13972240, 0x84c61120
+        .word    0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d
+        .word    0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0
+        .word    0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422
+        .word    0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef
+        .word    0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36
+        .word    0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4
+        .word    0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662
+        .word    0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5
+        .word    0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3
+        .word    0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b
+        .word    0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8
+        .word    0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6
+        .word    0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6
+        .word    0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0
+        .word    0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815
+        .word    0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f
+        .word    0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df
+        .word    0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f
+        .word    0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e
+        .word    0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713
+        .word    0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89
+        .word    0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c
+        .word    0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf
+        .word    0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86
+        .word    0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f
+        .word    0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541
+        .word    0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190
+        .word    0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742
+
+	.global	AES_Td1
+	.type	AES_Td1,@object
+	.size   AES_Td1, 1024
+AES_Td1:	
+        .word    0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e
+        .word    0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303
+        .word    0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c
+        .word    0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3
+        .word    0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0
+        .word    0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9
+        .word    0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259
+        .word    0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8
+        .word    0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971
+        .word    0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a
+        .word    0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f
+        .word    0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b
+        .word    0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8
+        .word    0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab
+        .word    0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708
+        .word    0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682
+        .word    0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2
+        .word    0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe
+        .word    0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb
+        .word    0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10
+        .word    0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd
+        .word    0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015
+        .word    0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e
+        .word    0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee
+        .word    0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000
+        .word    0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72
+        .word    0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39
+        .word    0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e
+        .word    0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91
+        .word    0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a
+        .word    0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17
+        .word    0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9
+        .word    0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60
+        .word    0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e
+        .word    0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1
+        .word    0xcad731dc, 0x10426385, 0x40139722, 0x2084c611
+        .word    0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1
+        .word    0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3
+        .word    0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964
+        .word    0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390
+        .word    0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b
+        .word    0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf
+        .word    0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46
+        .word    0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af
+        .word    0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512
+        .word    0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb
+        .word    0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a
+        .word    0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8
+        .word    0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c
+        .word    0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266
+        .word    0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8
+        .word    0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6
+        .word    0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604
+        .word    0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551
+        .word    0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41
+        .word    0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647
+        .word    0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c
+        .word    0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1
+        .word    0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737
+        .word    0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db
+        .word    0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340
+        .word    0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95
+        .word    0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1
+        .word    0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857
+
+	.global	AES_Td2
+	.type	AES_Td2,@object
+	.size   AES_Td2, 1024
+AES_Td2:	
+        .word    0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27
+        .word    0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3
+        .word    0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502
+        .word    0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562
+        .word    0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe
+        .word    0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3
+        .word    0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552
+        .word    0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9
+        .word    0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9
+        .word    0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce
+        .word    0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253
+        .word    0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908
+        .word    0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b
+        .word    0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655
+        .word    0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337
+        .word    0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16
+        .word    0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69
+        .word    0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6
+        .word    0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6
+        .word    0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e
+        .word    0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6
+        .word    0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050
+        .word    0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9
+        .word    0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8
+        .word    0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000
+        .word    0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a
+        .word    0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d
+        .word    0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436
+        .word    0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b
+        .word    0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12
+        .word    0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b
+        .word    0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e
+        .word    0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f
+        .word    0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb
+        .word    0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4
+        .word    0xdccad731, 0x85104263, 0x22401397, 0x112084c6
+        .word    0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729
+        .word    0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1
+        .word    0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9
+        .word    0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233
+        .word    0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4
+        .word    0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad
+        .word    0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e
+        .word    0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3
+        .word    0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25
+        .word    0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b
+        .word    0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f
+        .word    0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15
+        .word    0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0
+        .word    0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2
+        .word    0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7
+        .word    0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791
+        .word    0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496
+        .word    0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665
+        .word    0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b
+        .word    0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6
+        .word    0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13
+        .word    0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47
+        .word    0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7
+        .word    0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844
+        .word    0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3
+        .word    0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d
+        .word    0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456
+        .word    0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8
+
+	.global	AES_Td3
+	.type	AES_Td3,@object
+	.size   AES_Td3, 1024
+AES_Td3:	
+        .word    0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a
+        .word    0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b
+        .word    0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5
+        .word    0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5
+        .word    0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d
+        .word    0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b
+        .word    0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95
+        .word    0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e
+        .word    0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27
+        .word    0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d
+        .word    0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562
+        .word    0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9
+        .word    0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752
+        .word    0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66
+        .word    0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3
+        .word    0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced
+        .word    0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e
+        .word    0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4
+        .word    0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4
+        .word    0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd
+        .word    0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d
+        .word    0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60
+        .word    0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767
+        .word    0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79
+        .word    0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000
+        .word    0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c
+        .word    0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736
+        .word    0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24
+        .word    0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b
+        .word    0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c
+        .word    0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12
+        .word    0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814
+        .word    0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3
+        .word    0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b
+        .word    0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8
+        .word    0x31dccad7, 0x63851042, 0x97224013, 0xc6112084
+        .word    0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7
+        .word    0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077
+        .word    0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247
+        .word    0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22
+        .word    0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698
+        .word    0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f
+        .word    0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254
+        .word    0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582
+        .word    0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf
+        .word    0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb
+        .word    0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883
+        .word    0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef
+        .word    0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629
+        .word    0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035
+        .word    0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533
+        .word    0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17
+        .word    0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4
+        .word    0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46
+        .word    0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb
+        .word    0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d
+        .word    0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb
+        .word    0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a
+        .word    0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73
+        .word    0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678
+        .word    0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2
+        .word    0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff
+        .word    0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064
+        .word    0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0
+
+	.global	AES_Td4
+	.type	AES_Td4,@object
+	.size   AES_Td4, 1024
+AES_Td4:	
+        .word    0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5
+        .word    0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838
+        .word    0xbfbfbfbf, 0x40404040, 0xa3a3a3a3, 0x9e9e9e9e
+        .word    0x81818181, 0xf3f3f3f3, 0xd7d7d7d7, 0xfbfbfbfb
+        .word    0x7c7c7c7c, 0xe3e3e3e3, 0x39393939, 0x82828282
+        .word    0x9b9b9b9b, 0x2f2f2f2f, 0xffffffff, 0x87878787
+        .word    0x34343434, 0x8e8e8e8e, 0x43434343, 0x44444444
+        .word    0xc4c4c4c4, 0xdededede, 0xe9e9e9e9, 0xcbcbcbcb
+        .word    0x54545454, 0x7b7b7b7b, 0x94949494, 0x32323232
+        .word    0xa6a6a6a6, 0xc2c2c2c2, 0x23232323, 0x3d3d3d3d
+        .word    0xeeeeeeee, 0x4c4c4c4c, 0x95959595, 0x0b0b0b0b
+        .word    0x42424242, 0xfafafafa, 0xc3c3c3c3, 0x4e4e4e4e
+        .word    0x08080808, 0x2e2e2e2e, 0xa1a1a1a1, 0x66666666
+        .word    0x28282828, 0xd9d9d9d9, 0x24242424, 0xb2b2b2b2
+        .word    0x76767676, 0x5b5b5b5b, 0xa2a2a2a2, 0x49494949
+        .word    0x6d6d6d6d, 0x8b8b8b8b, 0xd1d1d1d1, 0x25252525
+        .word    0x72727272, 0xf8f8f8f8, 0xf6f6f6f6, 0x64646464
+        .word    0x86868686, 0x68686868, 0x98989898, 0x16161616
+        .word    0xd4d4d4d4, 0xa4a4a4a4, 0x5c5c5c5c, 0xcccccccc
+        .word    0x5d5d5d5d, 0x65656565, 0xb6b6b6b6, 0x92929292
+        .word    0x6c6c6c6c, 0x70707070, 0x48484848, 0x50505050
+        .word    0xfdfdfdfd, 0xedededed, 0xb9b9b9b9, 0xdadadada
+        .word    0x5e5e5e5e, 0x15151515, 0x46464646, 0x57575757
+        .word    0xa7a7a7a7, 0x8d8d8d8d, 0x9d9d9d9d, 0x84848484
+        .word    0x90909090, 0xd8d8d8d8, 0xabababab, 0x00000000
+        .word    0x8c8c8c8c, 0xbcbcbcbc, 0xd3d3d3d3, 0x0a0a0a0a
+        .word    0xf7f7f7f7, 0xe4e4e4e4, 0x58585858, 0x05050505
+        .word    0xb8b8b8b8, 0xb3b3b3b3, 0x45454545, 0x06060606
+        .word    0xd0d0d0d0, 0x2c2c2c2c, 0x1e1e1e1e, 0x8f8f8f8f
+        .word    0xcacacaca, 0x3f3f3f3f, 0x0f0f0f0f, 0x02020202
+        .word    0xc1c1c1c1, 0xafafafaf, 0xbdbdbdbd, 0x03030303
+        .word    0x01010101, 0x13131313, 0x8a8a8a8a, 0x6b6b6b6b
+        .word    0x3a3a3a3a, 0x91919191, 0x11111111, 0x41414141
+        .word    0x4f4f4f4f, 0x67676767, 0xdcdcdcdc, 0xeaeaeaea
+        .word    0x97979797, 0xf2f2f2f2, 0xcfcfcfcf, 0xcececece
+        .word    0xf0f0f0f0, 0xb4b4b4b4, 0xe6e6e6e6, 0x73737373
+        .word    0x96969696, 0xacacacac, 0x74747474, 0x22222222
+        .word    0xe7e7e7e7, 0xadadadad, 0x35353535, 0x85858585
+        .word    0xe2e2e2e2, 0xf9f9f9f9, 0x37373737, 0xe8e8e8e8
+        .word    0x1c1c1c1c, 0x75757575, 0xdfdfdfdf, 0x6e6e6e6e
+        .word    0x47474747, 0xf1f1f1f1, 0x1a1a1a1a, 0x71717171
+        .word    0x1d1d1d1d, 0x29292929, 0xc5c5c5c5, 0x89898989
+        .word    0x6f6f6f6f, 0xb7b7b7b7, 0x62626262, 0x0e0e0e0e
+        .word    0xaaaaaaaa, 0x18181818, 0xbebebebe, 0x1b1b1b1b
+        .word    0xfcfcfcfc, 0x56565656, 0x3e3e3e3e, 0x4b4b4b4b
+        .word    0xc6c6c6c6, 0xd2d2d2d2, 0x79797979, 0x20202020
+        .word    0x9a9a9a9a, 0xdbdbdbdb, 0xc0c0c0c0, 0xfefefefe
+        .word    0x78787878, 0xcdcdcdcd, 0x5a5a5a5a, 0xf4f4f4f4
+        .word    0x1f1f1f1f, 0xdddddddd, 0xa8a8a8a8, 0x33333333
+        .word    0x88888888, 0x07070707, 0xc7c7c7c7, 0x31313131
+        .word    0xb1b1b1b1, 0x12121212, 0x10101010, 0x59595959
+        .word    0x27272727, 0x80808080, 0xecececec, 0x5f5f5f5f
+        .word    0x60606060, 0x51515151, 0x7f7f7f7f, 0xa9a9a9a9
+        .word    0x19191919, 0xb5b5b5b5, 0x4a4a4a4a, 0x0d0d0d0d
+        .word    0x2d2d2d2d, 0xe5e5e5e5, 0x7a7a7a7a, 0x9f9f9f9f
+        .word    0x93939393, 0xc9c9c9c9, 0x9c9c9c9c, 0xefefefef
+        .word    0xa0a0a0a0, 0xe0e0e0e0, 0x3b3b3b3b, 0x4d4d4d4d
+        .word    0xaeaeaeae, 0x2a2a2a2a, 0xf5f5f5f5, 0xb0b0b0b0
+        .word    0xc8c8c8c8, 0xebebebeb, 0xbbbbbbbb, 0x3c3c3c3c
+        .word    0x83838383, 0x53535353, 0x99999999, 0x61616161
+        .word    0x17171717, 0x2b2b2b2b, 0x04040404, 0x7e7e7e7e
+        .word    0xbabababa, 0x77777777, 0xd6d6d6d6, 0x26262626
+        .word    0xe1e1e1e1, 0x69696969, 0x14141414, 0x63636363
+        .word    0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d
+
Index: openssl-0.9.8g/crypto/aes/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/aes/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/aes/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -90,7 +90,7 @@
 	mv -f Makefile.new $(MAKEFILE)
 
 clean:
-	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+	rm -f asm/*.o *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
Index: openssl-0.9.8g/crypto/asn1/t_x509.c
===================================================================
--- openssl-0.9.8g.orig/crypto/asn1/t_x509.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/asn1/t_x509.c	2008-09-24 11:01:01.000000000 +0200
@@ -264,6 +264,10 @@
 	return(ret);
 	}
 
+#ifdef OPENSSL_NO_SHA
+#define SHA_DIGEST_LENGTH 20
+#endif
+
 int X509_ocspid_print (BIO *bp, X509 *x)
 	{
 	unsigned char *der=NULL ;
Index: openssl-0.9.8g/crypto/asn1/x_info.c
===================================================================
--- openssl-0.9.8g.orig/crypto/asn1/x_info.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/asn1/x_info.c	2008-09-24 11:01:01.000000000 +0200
@@ -73,7 +73,9 @@
 		return(NULL);
 		}
  
+#ifndef OPENSSL_NO_EVP
         ret->enc_cipher.cipher=NULL;
+#endif
         ret->enc_len=0;
         ret->enc_data=NULL;
  
Index: openssl-0.9.8g/crypto/bio/bss_conn.c
===================================================================
--- openssl-0.9.8g.orig/crypto/bio/bss_conn.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bio/bss_conn.c	2008-09-24 11:01:01.000000000 +0200
@@ -63,7 +63,6 @@
 #include <openssl/bio.h>
 
 #ifndef OPENSSL_NO_SOCK
-
 #ifdef OPENSSL_SYS_WIN16
 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
 #else
Index: openssl-0.9.8g/crypto/bio/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/bio/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bio/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -170,13 +170,6 @@
 bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 bss_conn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 bss_conn.o: ../../include/openssl/symhacks.h ../cryptlib.h bss_conn.c
-bss_dgram.o: ../../e_os.h ../../include/openssl/bio.h
-bss_dgram.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
-bss_dgram.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
-bss_dgram.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
-bss_dgram.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-bss_dgram.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
-bss_dgram.o: ../../include/openssl/symhacks.h ../cryptlib.h bss_dgram.c
 bss_fd.o: ../../e_os.h ../../include/openssl/bio.h
 bss_fd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
Index: openssl-0.9.8g/crypto/bn/bn_asm.c
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn_asm.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn_asm.c	2008-09-24 11:01:01.000000000 +0200
@@ -219,7 +219,6 @@
 #endif /* !(defined(BN_LLONG) || defined(BN_UMULT_HIGH)) */
 
 #if defined(BN_LLONG) && defined(BN_DIV2W)
-
 BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
 	{
 	return((BN_ULONG)(((((BN_ULLONG)h)<<BN_BITS2)|l)/(BN_ULLONG)d));
@@ -821,17 +820,16 @@
 	r[7]=c2;
 	}
 #else /* !BN_MUL_COMBA */
-
 /* hmm... is it faster just to do a multiply? */
 #undef bn_sqr_comba4
-void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
+void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
 	{
 	BN_ULONG t[8];
 	bn_sqr_normal(r,a,4,t);
 	}
 
 #undef bn_sqr_comba8
-void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
+void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
 	{
 	BN_ULONG t[16];
 	bn_sqr_normal(r,a,8,t);
Index: openssl-0.9.8g/crypto/bn/bn_div.c
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn_div.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn_div.c	2008-09-24 11:01:01.000000000 +0200
@@ -187,10 +187,12 @@
 	BN_ULONG d0,d1;
 	int num_n,div_n;
 
+#ifndef BN_NO_CONSTTIME
 	if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0))
 		{
 		return BN_div_no_branch(dv, rm, num, divisor, ctx);
 		}
+#endif
 
 	bn_check_top(dv);
 	bn_check_top(rm);
Index: openssl-0.9.8g/crypto/bn/bn_exp.c
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn_exp.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn_exp.c	2008-09-24 11:01:01.000000000 +0200
@@ -379,11 +379,12 @@
 	BIGNUM *val[TABLE_SIZE];
 	BN_MONT_CTX *mont=NULL;
 
+#ifndef BN_NO_CONSTTIME
 	if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
 		{
 		return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
 		}
-
+#endif
 	bn_check_top(a);
 	bn_check_top(p);
 	bn_check_top(m);
Index: openssl-0.9.8g/crypto/bn/bn_gcd.c
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn_gcd.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn_gcd.c	2008-09-24 11:01:01.000000000 +0200
@@ -212,10 +212,12 @@
 	BIGNUM *ret=NULL;
 	int sign;
 
+#ifndef BN_NO_CONSTTIME
 	if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
 		{
 		return BN_mod_inverse_no_branch(in, a, n, ctx);
 		}
+#endif
 
 	bn_check_top(a);
 	bn_check_top(n);
Index: openssl-0.9.8g/crypto/bn/bn.h
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn.h	2008-09-24 11:01:01.000000000 +0200
@@ -94,9 +94,15 @@
 /* #define BN_DEBUG */
 /* #define BN_DEBUG_RAND */
 
+#ifndef BN_NO_MUL_COMBA
 #define BN_MUL_COMBA
+#endif
+#ifndef BN_NO_SQR_COMBA
 #define BN_SQR_COMBA
+#endif
+#ifndef BN_NO_RECURSION
 #define BN_RECURSION
+#endif
 
 /* This next option uses the C libraries (2 word)/(1 word) function.
  * If it is not defined, I use my C version (which is slower).
@@ -219,6 +225,7 @@
 #endif
 
 #ifdef EIGHT_BIT
+#error
 #ifndef BN_DIV2W
 #define BN_DIV2W
 #endif
@@ -406,7 +413,11 @@
 int	BN_rand_range(BIGNUM *rnd, BIGNUM *range);
 int	BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
 int	BN_num_bits(const BIGNUM *a);
+#if defined(__GNUC__)
+#define BN_num_bits_word(w) (BN_BITS2 - __builtin_clz(w)) 
+#else
 int	BN_num_bits_word(BN_ULONG);
+#endif
 BIGNUM *BN_new(void);
 void	BN_init(BIGNUM *);
 void	BN_clear_free(BIGNUM *a);
Index: openssl-0.9.8g/crypto/bn/bn_lcl.h
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn_lcl.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn_lcl.h	2008-09-24 11:01:01.000000000 +0200
@@ -301,6 +301,36 @@
 #endif
 
 #ifdef BN_LLONG
+#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) && defined(__AVR32__)
+#define mul_add(r,a,w,c) {                      \
+    BN_ULLONG t;                                  \
+    asm ( "add    %0, %1, %2\n"                   \
+          "srcs   %m0\n"                          \
+          "macu.d %0, %3, %4\n"                   \
+          : "=&r"(t)                              \
+          : "r"(r), "r"(c), "r"(w), "r"(a)        \
+          : "cc");                                \
+    (r)= Lw(t);                                   \
+    (c)= Hw(t);                                   \
+ }
+  
+#define mul(r,a,w,c) {                          \
+    BN_ULLONG t = c;                            \
+    asm ( "macu.d %0, %1, %2\n"                 \
+          : "+r"(t)                            \
+          : "r"(w), "r"(a));                    \
+    (r)= Lw(t);                                 \
+    (c)= Hw(t);                                 \
+  }
+  
+#define sqr(r0,r1,a) {                          \
+    BN_ULLONG t;                                \
+    t=(BN_ULLONG)(a)*(a);                       \
+    (r0)=Lw(t);                                 \
+    (r1)=Hw(t);                                 \
+  }
+
+#else
 #define mul_add(r,a,w,c) { \
 	BN_ULLONG t; \
 	t=(BN_ULLONG)w * (a) + (r) + (c); \
@@ -310,7 +340,7 @@
 
 #define mul(r,a,w,c) { \
 	BN_ULLONG t; \
-	t=(BN_ULLONG)w * (a) + (c); \
+	t=(BN_ULLONG)w * (a) + (c);             \
 	(r)= Lw(t); \
 	(c)= Hw(t); \
 	}
@@ -322,6 +352,7 @@
 	(r1)=Hw(t); \
 	}
 
+#endif
 #elif defined(BN_UMULT_LOHI)
 #define mul_add(r,a,w,c) {		\
 	BN_ULONG high,low,ret,tmp=(a);	\
Index: openssl-0.9.8g/crypto/bn/bn_lib.c
===================================================================
--- openssl-0.9.8g.orig/crypto/bn/bn_lib.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/bn/bn_lib.c	2008-09-24 11:01:01.000000000 +0200
@@ -158,6 +158,7 @@
 	return(data);
 	}
 
+#ifndef BN_num_bits_word
 int BN_num_bits_word(BN_ULONG l)
 	{
 	static const char bits[256]={
@@ -244,6 +245,7 @@
 			}
 		}
 	}
+#endif
 
 int BN_num_bits(const BIGNUM *a)
 	{
Index: openssl-0.9.8g/crypto/conf/conf.h
===================================================================
--- openssl-0.9.8g.orig/crypto/conf/conf.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/conf/conf.h	2008-09-24 11:01:01.000000000 +0200
@@ -121,13 +121,14 @@
 LHASH *CONF_load(LHASH *conf,const char *file,long *eline);
 #ifndef OPENSSL_NO_FP_API
 LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
+int CONF_dump_fp(LHASH *conf, FILE *out);
+int NCONF_dump_fp(const CONF *conf, FILE *out);
 #endif
 LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline);
 STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section);
 char *CONF_get_string(LHASH *conf,const char *group,const char *name);
 long CONF_get_number(LHASH *conf,const char *group,const char *name);
 void CONF_free(LHASH *conf);
-int CONF_dump_fp(LHASH *conf, FILE *out);
 int CONF_dump_bio(LHASH *conf, BIO *out);
 
 void OPENSSL_config(const char *config_name);
@@ -161,7 +162,6 @@
 char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
 int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
 		       long *result);
-int NCONF_dump_fp(const CONF *conf, FILE *out);
 int NCONF_dump_bio(const CONF *conf, BIO *out);
 
 #if 0 /* The following function has no error checking,
Index: openssl-0.9.8g/crypto/cryptlib.c
===================================================================
--- openssl-0.9.8g.orig/crypto/cryptlib.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/cryptlib.c	2008-09-24 11:01:01.000000000 +0200
@@ -68,7 +68,7 @@
  * 
  * Copyright remains Eric Young's, and as such any Copyright notices in
  * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
+5~ * If this package is used in a product, Eric Young should be given attribution
  * as the author of the parts of the library used.
  * This can be in the form of a textual message at program startup or
  * in documentation (online or textual) provided with the package.
@@ -740,9 +740,11 @@
 void OPENSSL_showfatal (const char *fmta,...)
 { va_list ap;
 
+#ifndef OPENSSL_NO_STDIO
     va_start (ap,fmta);
     vfprintf (stderr,fmta,ap);
     va_end (ap);
+#endif
 }
 int OPENSSL_isservice (void) { return 0; }
 #endif
@@ -755,4 +757,8 @@
 	abort();
 	}
 
-void *OPENSSL_stderr(void)	{ return stderr; }
+void *OPENSSL_stderr(void)	{ 
+#ifndef OPENSSL_NO_STDIO
+  return stderr; 
+#endif
+}
Index: openssl-0.9.8g/crypto/des/asm/des-avr32.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8g/crypto/des/asm/des-avr32.S	2008-09-24 11:01:01.000000000 +0200
@@ -0,0 +1,309 @@
+	.global	DES_encrypt1
+	.global	DES_encrypt2	
+	.global	DES_encrypt3	
+	.global	DES_decrypt3	
+			
+	.macro	DesEncrypt L, R, s, S, u /*hi*/, t /*lo*/, tmp, mask, to_u, to_t, spt0, spt1
+	ld.d	\t, \s[\S<<3]
+	eor	\u, \R
+	eor	\t, \R
+	lsl	\tmp, \t, 28
+	or	\t, \tmp, \t >> 4
+	and	\u, \mask, \u >> 2	
+	and	\t, \mask, \t >> 2	
+	or	\u, \to_u	
+	or	\t, \to_t	
+	ld.w	\tmp, \spt0[\u:b << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt0[\u:l << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt1[\u:u << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt1[\u:t << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt0[\t:b << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt0[\t:l << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt1[\t:u << 2]
+	eor	\L, \tmp
+	ld.w	\tmp, \spt1[\t:t << 2]
+	eor	\L, \tmp
+	.endm
+	
+	.macro	PermOp a, b, tmp, n, m
+	eor	\tmp, \b, \a >> \n
+	andh	\tmp, hi(\m)
+	andl	\tmp, lo(\m)
+	eor	\b, \tmp
+	eor	\a, \a, \tmp << \n
+	.endm		
+
+	.macro IP l, r, tmp
+	PermOp		\r, \l, \tmp,  4, 0x0f0f0f0f	
+	PermOp		\l, \r, \tmp, 16, 0x0000ffff	
+	PermOp		\r, \l, \tmp,  2, 0x33333333
+	PermOp		\l, \r, \tmp,  8, 0x00ff00ff	
+	PermOp		\r, \l, \tmp,  1, 0x55555555	
+	.endm
+
+	.macro FP l, r, tmp
+	PermOp		\l, \r, \tmp,  1, 0x55555555	
+	PermOp		\r, \l, \tmp,  8, 0x00ff00ff	
+	PermOp		\l, \r, \tmp,  2, 0x33333333
+	PermOp		\r, \l, \tmp, 16, 0x0000ffff	
+	PermOp		\l, \r, \tmp,  4, 0x0f0f0f0f	
+	.endm
+	
+	.text
+	.align 2
+/* void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc) */
+DES_encrypt1:	
+	pushm		r0-r3, r4-r7, lr
+	
+	/*	
+	r=data[0];
+	l=data[1];
+	*/
+	ld.d		r8, r12[0] /* r8 = l, r9 = r */
+
+	/* 
+	IP(r,l); 
+	*/
+	IP	r9, r8, r0
+
+	/*
+	r=ROTATE(r,29)&0xffffffffL;
+	l=ROTATE(l,29)&0xffffffffL;
+	*/
+	lsl		r0, r8, 3
+	or		r8, r0, r8 >> 29  		
+	lsl		r0, r9, 3
+	or		r9, r0, r9 >> 29  		
+
+	/* Setup mask and table offset values. */
+	mov		r3, 0x3f3f
+	or		r3, r3, r3 << 16
+	mov		r4, (2 << 14) | (0 << 6)
+	or		r4, r4, r4 << 16
+	mov		r5, (3 << 14) | (1 << 6)
+	or		r5, r5, r5 << 16
+
+	/* Load DES_SPtrans pointer, we also need pointer to
+	   DES_SPtrans[4] */
+	lda.w		r6, DES_SPtrans
+	sub		r7, r6, -(64*4*4)
+	
+	cp.w		r10, 0
+	movne		lr, 1
+	movne		r10, 0
+	moveq		lr, -1
+	moveq		r10, 15
+	
+DES_encrypt1_loop:
+	DesEncrypt	/*L*/r8,/*R*/r9,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7  
+	add		r10, lr
+	DesEncrypt	/*R*/r9,/*L*/r8,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7  
+	add		r10, lr
+	/* If bit 4 is set it means that r10 is either -1 or 16
+	   in which case the algorithm is finished and the loop should exit. */	
+	bld		r10, 4
+	brne		DES_encrypt1_loop	
+
+	/*
+	r=ROTATE(r,3)&0xffffffffL;
+	l=ROTATE(l,3)&0xffffffffL;
+
+	Note we also move l and r into r1 and r0 respectively 	
+	*/
+	lsl		r1, r8, 29
+	or		r1, r1, r8 >> 3  		
+	lsl		r0, r9, 29
+	or		r0, r0, r9 >> 3  		
+
+	/* 
+	FP(r,l); 
+	*/
+	FP		r0, r1, r2
+
+	/*
+	data[0]=l;
+	data[1]=r;
+	*/
+	st.d		r12[0], r0			
+	popm		r0-r3, r4-r7, pc
+	
+	
+/*void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc) */
+DES_encrypt2:	
+	pushm		r0-r3, r4-r7, lr
+	
+	/*	
+	r=data[0];
+	l=data[1];
+	*/
+	ld.d		r8, r12[0] /* r8 = l, r9 = r */
+
+	/*
+	r=ROTATE(r,29)&0xffffffffL;
+	l=ROTATE(l,29)&0xffffffffL;
+	*/
+	lsl		r0, r8, 3
+	or		r8, r0, r8 >> 29  		
+	lsl		r0, r9, 3
+	or		r9, r0, r9 >> 29  		
+
+	/* Setup mask and table offset values. */
+	mov		r3, 0x3f3f
+	or		r3, r3, r3 << 16
+	mov		r4, (2 << 14) | (0 << 6)
+	or		r4, r4, r4 << 16
+	mov		r5, (3 << 14) | (1 << 6)
+	or		r5, r5, r5 << 16
+
+	/* Load DES_SPtrans pointer, we also need pointer to
+	   DES_SPtrans[4] */
+	lda.w		r6, DES_SPtrans
+	sub		r7, r6, -(64*4*4)
+	
+	cp.w		r10, 0
+	movne		lr, 1
+	movne		r10, 0
+	moveq		lr, -1
+	moveq		r10, 15
+	
+DES_encrypt2_loop:
+	DesEncrypt	/*L*/r8,/*R*/r9,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7  
+	add		r10, lr
+	DesEncrypt	/*R*/r9,/*L*/r8,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7  
+	add		r10, lr
+	/* If bit 4 is set it means that r10 is either -1 or 16
+	   in which case the algorithm is finished and the loop should exit. */	
+	bld		r10, 4
+	brne		DES_encrypt2_loop	
+
+	/*
+	r=ROTATE(r,3)&0xffffffffL;
+	l=ROTATE(l,3)&0xffffffffL;
+
+	Note we also move l and r into r1 and r0 respectively 
+	*/	
+	lsl		r1, r8, 29
+	or		r1, r1, r8 >> 3  		
+	lsl		r0, r9, 29
+	or		r0, r0, r9 >> 3  		
+
+	/*
+	data[0]=l;
+	data[1]=r;
+	*/
+	st.d		r12[0], r0			
+	popm		r0-r3, r4-r7, pc
+
+
+/* void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
+		     DES_key_schedule *ks2, DES_key_schedule *ks3) */
+DES_encrypt3:	
+	pushm		r0-r3, lr
+	
+	/*	
+	l=data[0];
+	r=data[1];
+	*/
+	ld.d		r0, r12[0] /* r0 = r, r1 = l */
+
+	mov		r2, r10
+	mov		r3, r9
+
+	/* 
+	IP(l,r); 
+	*/
+	IP		r1, r0, lr
+		
+	/*	
+	data[0] = l;
+	data[1] = r;
+	*/
+	st.d		r12[0], r0	
+
+	mov		r10, 1
+	call		DES_encrypt2
+	mov		r10, 0
+	mov		r11, r2
+	call		DES_encrypt2
+	mov		r10, 1
+	mov		r11, r3
+	call		DES_encrypt2
+	
+	/*	
+	l=data[0];
+	r=data[1];
+	*/
+	ld.d		r0, r12[0] /* r0 = r, r1 = l */
+
+	/* 
+	FP(r,l); 
+	*/
+	FP		r0, r1, lr
+		
+	/*	
+	data[0] = l;
+	data[1] = r;
+	*/
+	st.d		r12[0], r0	
+
+	popm		r0-r3, pc
+
+/* void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
+		     DES_key_schedule *ks2, DES_key_schedule *ks3) */
+DES_decrypt3:	
+	pushm		r0-r3, lr
+	
+	/*	
+	l=data[0];
+	r=data[1];
+	*/
+	ld.d		r0, r12[0] /* r0 = r, r1 = l */
+
+	mov		r2, r10
+	mov		r3, r11
+	mov		r11, r9
+
+	/* 
+	IP(l,r); 
+	*/
+	IP		r1, r0, lr
+		
+	/*	
+	data[0] = l;
+	data[1] = r;
+	*/
+	st.d		r12[0], r0	
+
+	mov		r10, 0
+	call		DES_encrypt2
+	mov		r10, 1
+	mov		r11, r2
+	call		DES_encrypt2
+	mov		r10, 0
+	mov		r11, r3
+	call		DES_encrypt2
+	
+	/*	
+	l=data[0];
+	r=data[1];
+	*/
+	ld.d		r0, r12[0] /* r0 = r, r1 = l */
+
+	/* 
+	FP(r,l); 
+	*/
+	FP		r0, r1, lr
+		
+	/*	
+	data[0] = l;
+	data[1] = r;
+	*/
+	st.d		r12[0], r0	
+
+	popm		r0-r3, pc
Index: openssl-0.9.8g/crypto/des/asm/des_cbc.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8g/crypto/des/asm/des_cbc.c	2008-09-24 11:01:01.000000000 +0200
@@ -0,0 +1,191 @@
+#include "../des_locl.h"
+
+#ifndef DES_DEFAULT_OPTIONS
+
+void DES_ncbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+		     DES_key_schedule *_schedule, DES_cblock *ivec, int enc)
+	{
+	register DES_LONG tin0,tin1;
+	register DES_LONG tout0,tout1,xor0,xor1;
+	register long l=length;
+	DES_LONG tin[2];
+	unsigned char *iv;
+
+	iv = &(*ivec)[0];
+
+	if (enc)
+		{
+		c2l(iv,tout0);
+		c2l(iv,tout1);
+		for (l-=8; l>=0; l-=8)
+			{
+			c2l(in,tin0);
+			c2l(in,tin1);
+			tin0^=tout0; tin[0]=tin0;
+			tin1^=tout1; tin[1]=tin1;
+			DES_encrypt1((DES_LONG *)tin,_schedule,DES_ENCRYPT);
+			tout0=tin[0]; l2c(tout0,out);
+			tout1=tin[1]; l2c(tout1,out);
+			}
+		if (l != -8)
+			{
+			c2ln(in,tin0,tin1,l+8);
+			tin0^=tout0; tin[0]=tin0;
+			tin1^=tout1; tin[1]=tin1;
+			DES_encrypt1((DES_LONG *)tin,_schedule,DES_ENCRYPT);
+			tout0=tin[0]; l2c(tout0,out);
+			tout1=tin[1]; l2c(tout1,out);
+			}
+		iv = &(*ivec)[0];
+		l2c(tout0,iv);
+		l2c(tout1,iv);
+		}
+	else
+		{
+		c2l(iv,xor0);
+		c2l(iv,xor1);
+		for (l-=8; l>=0; l-=8)
+			{
+			c2l(in,tin0); tin[0]=tin0;
+			c2l(in,tin1); tin[1]=tin1;
+			DES_encrypt1((DES_LONG *)tin,_schedule,DES_DECRYPT);
+			tout0=tin[0]^xor0;
+			tout1=tin[1]^xor1;
+			l2c(tout0,out);
+			l2c(tout1,out);
+			xor0=tin0;
+			xor1=tin1;
+			}
+		if (l != -8)
+			{
+			c2l(in,tin0); tin[0]=tin0;
+			c2l(in,tin1); tin[1]=tin1;
+			DES_encrypt1((DES_LONG *)tin,_schedule,DES_DECRYPT);
+			tout0=tin[0]^xor0;
+			tout1=tin[1]^xor1;
+			l2cn(tout0,tout1,out,l+8);
+			xor0=tin0;
+			xor1=tin1;
+			}
+		iv = &(*ivec)[0];
+		l2c(xor0,iv);
+		l2c(xor1,iv);
+		}
+	tin0=tin1=tout0=tout1=xor0=xor1=0;
+	tin[0]=tin[1]=0;
+	}
+
+
+void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
+			  long length, DES_key_schedule *ks1,
+			  DES_key_schedule *ks2, DES_key_schedule *ks3,
+			  DES_cblock *ivec, int enc)
+	{
+	register DES_LONG tin0,tin1;
+	register DES_LONG tout0,tout1,xor0,xor1;
+	register const unsigned char *in;
+	unsigned char *out;
+	register long l=length;
+	DES_LONG tin[2];
+	unsigned char *iv;
+
+	in=input;
+	out=output;
+	iv = &(*ivec)[0];
+
+	if (enc)
+		{
+		c2l(iv,tout0);
+		c2l(iv,tout1);
+		for (l-=8; l>=0; l-=8)
+			{
+			c2l(in,tin0);
+			c2l(in,tin1);
+			tin0^=tout0;
+			tin1^=tout1;
+
+			tin[0]=tin0;
+			tin[1]=tin1;
+			DES_encrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+			tout0=tin[0];
+			tout1=tin[1];
+
+			l2c(tout0,out);
+			l2c(tout1,out);
+			}
+		if (l != -8)
+			{
+			c2ln(in,tin0,tin1,l+8);
+			tin0^=tout0;
+			tin1^=tout1;
+
+			tin[0]=tin0;
+			tin[1]=tin1;
+			DES_encrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+			tout0=tin[0];
+			tout1=tin[1];
+
+			l2c(tout0,out);
+			l2c(tout1,out);
+			}
+		iv = &(*ivec)[0];
+		l2c(tout0,iv);
+		l2c(tout1,iv);
+		}
+	else
+		{
+		register DES_LONG t0,t1;
+
+		c2l(iv,xor0);
+		c2l(iv,xor1);
+		for (l-=8; l>=0; l-=8)
+			{
+			c2l(in,tin0);
+			c2l(in,tin1);
+
+			t0=tin0;
+			t1=tin1;
+
+			tin[0]=tin0;
+			tin[1]=tin1;
+			DES_decrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+			tout0=tin[0];
+			tout1=tin[1];
+
+			tout0^=xor0;
+			tout1^=xor1;
+			l2c(tout0,out);
+			l2c(tout1,out);
+			xor0=t0;
+			xor1=t1;
+			}
+		if (l != -8)
+			{
+			c2l(in,tin0);
+			c2l(in,tin1);
+			
+			t0=tin0;
+			t1=tin1;
+
+			tin[0]=tin0;
+			tin[1]=tin1;
+			DES_decrypt3((DES_LONG *)tin,ks1,ks2,ks3);
+			tout0=tin[0];
+			tout1=tin[1];
+		
+			tout0^=xor0;
+			tout1^=xor1;
+			l2cn(tout0,tout1,out,l+8);
+			xor0=t0;
+			xor1=t1;
+			}
+
+		iv = &(*ivec)[0];
+		l2c(xor0,iv);
+		l2c(xor1,iv);
+		}
+	tin0=tin1=tout0=tout1=xor0=xor1=0;
+	tin[0]=tin[1]=0;
+	}
+
+#endif /* DES_DEFAULT_OPTIONS */
Index: openssl-0.9.8g/crypto/des/des_locl.h
===================================================================
--- openssl-0.9.8g.orig/crypto/des/des_locl.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/des/des_locl.h	2008-09-24 11:01:01.000000000 +0200
@@ -421,7 +421,11 @@
 	PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
 	}
 
+#ifdef DES_CTABLES_IN_DATA
+extern DES_LONG DES_SPtrans[8][64];
+#else
 extern const DES_LONG DES_SPtrans[8][64];
+#endif
 
 void fcrypt_body(DES_LONG *out,DES_key_schedule *ks,
 		 DES_LONG Eswap0, DES_LONG Eswap1);
Index: openssl-0.9.8g/crypto/des/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/des/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/des/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -116,7 +116,7 @@
 	mv -f Makefile.new $(MAKEFILE)
 
 clean:
-	rm -f *.s *.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
+	rm asm/*.o -f *.s *.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
Index: openssl-0.9.8g/crypto/des/spr.h
===================================================================
--- openssl-0.9.8g.orig/crypto/des/spr.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/des/spr.h	2008-09-24 11:01:01.000000000 +0200
@@ -56,7 +56,11 @@
  * [including the GNU Public Licence.]
  */
 
+#ifdef DES_CTABLES_IN_DATA
+OPENSSL_GLOBAL DES_LONG DES_SPtrans[8][64]={
+#else
 OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64]={
+#endif
 {
 /* nibble 0 */
 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
Index: openssl-0.9.8g/crypto/dsa/dsa_depr.c
===================================================================
--- openssl-0.9.8g.orig/crypto/dsa/dsa_depr.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/dsa/dsa_depr.c	2008-09-24 11:01:01.000000000 +0200
@@ -71,8 +71,8 @@
 
 static void *dummy=&dummy;
 
+#include <openssl/e_os2.h>
 #ifndef OPENSSL_NO_SHA
-
 #include <stdio.h>
 #include <time.h>
 #include "cryptlib.h"
Index: openssl-0.9.8g/crypto/ec/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/ec/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/ec/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -95,7 +95,6 @@
 ec2_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 ec2_smpl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 ec2_smpl.o: ../../include/openssl/symhacks.h ec2_smpl.c ec2_smpt.c ec_lcl.h
-ec2_smpt.o: ec2_smpt.c
 ec_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
 ec_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
Index: openssl-0.9.8g/crypto/ecdh/ech_ossl.c
===================================================================
--- openssl-0.9.8g.orig/crypto/ecdh/ech_ossl.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/ecdh/ech_ossl.c	2008-09-24 11:01:01.000000000 +0200
@@ -75,7 +75,7 @@
 
 #include "ech_locl.h"
 #include <openssl/err.h>
-#include <openssl/sha.h>
+//#include <openssl/sha.h>
 #include <openssl/obj_mac.h>
 #include <openssl/bn.h>
 
Index: openssl-0.9.8g/crypto/ecdh/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/ecdh/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/ecdh/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -106,6 +106,6 @@
 ech_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 ech_ossl.o: ../../include/openssl/opensslconf.h
 ech_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-ech_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
-ech_ossl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-ech_ossl.o: ../cryptlib.h ech_locl.h ech_ossl.c
+ech_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
+ech_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h ech_locl.h
+ech_ossl.o: ech_ossl.c
Index: openssl-0.9.8g/crypto/evp/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/evp/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/evp/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -245,7 +245,6 @@
 e_null.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
 e_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 e_null.o: ../cryptlib.h e_null.c
-e_old.o: e_old.c
 e_rc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 e_rc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
Index: openssl-0.9.8g/crypto/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -186,7 +186,7 @@
 mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
 mem_dbg.o: mem_dbg.c
 o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
-o_dir.o: LPdir_unix.c o_dir.c o_dir.h
+o_dir.o: o_dir.c o_dir.h
 o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
 o_str.o: o_str.c o_str.h
 o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
Index: openssl-0.9.8g/crypto/o_dir.c
===================================================================
--- openssl-0.9.8g.orig/crypto/o_dir.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/o_dir.c	2008-09-24 11:01:01.000000000 +0200
@@ -70,7 +70,20 @@
 #include "o_dir.h"
 
 #define LPDIR_H
-#if defined OPENSSL_SYS_UNIX || defined DJGPP
+#if defined OPENSSL_SYS_NEWLIB
+struct OPENSSL_dir_context_st {
+    //void *dummy;
+};
+
+const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory){
+    return NULL;
+}
+
+int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx){
+    return 1;
+}
+
+#elif defined OPENSSL_SYS_UNIX || defined DJGPP
 #include "LPdir_unix.c"
 #elif defined OPENSSL_SYS_VMS
 #include "LPdir_vms.c"
Index: openssl-0.9.8g/crypto/opensslconf.h
===================================================================
--- openssl-0.9.8g.orig/crypto/opensslconf.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/opensslconf.h	2008-09-24 11:01:01.000000000 +0200
@@ -25,6 +25,9 @@
 #ifndef OPENSSL_NO_SEED
 # define OPENSSL_NO_SEED
 #endif
+#ifndef OPENSSL_NO_THREAD
+# define OPENSSL_NO_THREAD
+#endif
 #ifndef OPENSSL_NO_TLSEXT
 # define OPENSSL_NO_TLSEXT
 #endif
@@ -60,6 +63,9 @@
 # if defined(OPENSSL_NO_SEED) && !defined(NO_SEED)
 #  define NO_SEED
 # endif
+# if defined(OPENSSL_NO_THREAD) && !defined(NO_THREAD)
+#  define NO_THREAD
+# endif
 # if defined(OPENSSL_NO_TLSEXT) && !defined(NO_TLSEXT)
 #  define NO_TLSEXT
 # endif
@@ -125,7 +131,7 @@
 
 #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
 #define CONFIG_HEADER_BN_H
-#undef BN_LLONG
+#define BN_LLONG
 
 /* Should we define BN_DIV2W here? */
 
Index: openssl-0.9.8g/crypto/pem/pem.h
===================================================================
--- openssl-0.9.8g.orig/crypto/pem/pem.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/pem/pem.h	2008-09-24 11:01:01.000000000 +0200
@@ -353,6 +353,7 @@
 
 #define DECLARE_PEM_read_fp(name, type) /**/
 #define DECLARE_PEM_write_fp(name, type) /**/
+#define DECLARE_PEM_write_fp_const(name, type) /**/
 #define DECLARE_PEM_write_cb_fp(name, type) /**/
 
 #else
Index: openssl-0.9.8g/crypto/rand/md_rand.c
===================================================================
--- openssl-0.9.8g.orig/crypto/rand/md_rand.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rand/md_rand.c	2008-09-24 11:01:01.000000000 +0200
@@ -152,6 +152,7 @@
 int rand_predictable=0;
 #endif
 
+#ifndef OPENSSL_NO_EVP
 const char RAND_version[]="RAND" OPENSSL_VERSION_PTEXT;
 
 static void ssleay_rand_cleanup(void);
@@ -496,6 +497,7 @@
 	CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 
 	EVP_MD_CTX_cleanup(&m);
+
 	if (ok)
 		return(1);
 	else
@@ -570,3 +572,4 @@
 	
 	return ret;
 	}
+#endif
Index: openssl-0.9.8g/crypto/rand/rand_egd.c
===================================================================
--- openssl-0.9.8g.orig/crypto/rand/rand_egd.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rand/rand_egd.c	2008-09-24 11:01:01.000000000 +0200
@@ -95,7 +95,7 @@
  *   RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
  */
 
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS)
+#if defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS)
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
 	{
 	return(-1);
Index: openssl-0.9.8g/crypto/rand/rand_lib.c
===================================================================
--- openssl-0.9.8g.orig/crypto/rand/rand_lib.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rand/rand_lib.c	2008-09-24 11:01:01.000000000 +0200
@@ -102,7 +102,9 @@
 			funct_ref = e;
 		else
 #endif
+#ifndef OPENSSL_NO_EVP
 			default_RAND_meth = RAND_SSLeay();
+#endif
 		}
 	return default_RAND_meth;
 	}
Index: openssl-0.9.8g/crypto/rand/rand_unix.c
===================================================================
--- openssl-0.9.8g.orig/crypto/rand/rand_unix.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rand/rand_unix.c	2008-09-24 11:01:01.000000000 +0200
@@ -116,7 +116,7 @@
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
-#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE))
+#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_NEWLIB))
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -322,7 +322,7 @@
 #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */
 
 
-#if defined(OPENSSL_SYS_VXWORKS)
+#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NEWLIB)
 int RAND_poll(void)
 	{
 	return 0;
Index: openssl-0.9.8g/crypto/rsa/Makefile
===================================================================
--- openssl-0.9.8g.orig/crypto/rsa/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rsa/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -167,9 +167,8 @@
 rsa_oaep.o: ../../include/openssl/opensslconf.h
 rsa_oaep.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 rsa_oaep.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
-rsa_oaep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
-rsa_oaep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-rsa_oaep.o: ../cryptlib.h rsa_oaep.c
+rsa_oaep.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
+rsa_oaep.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_oaep.c
 rsa_pk1.o: ../../e_os.h ../../include/openssl/asn1.h
 rsa_pk1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 rsa_pk1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
@@ -188,8 +187,8 @@
 rsa_pss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 rsa_pss.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
 rsa_pss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
-rsa_pss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
-rsa_pss.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pss.c
+rsa_pss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
+rsa_pss.o: ../cryptlib.h rsa_pss.c
 rsa_saos.o: ../../e_os.h ../../include/openssl/asn1.h
 rsa_saos.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
Index: openssl-0.9.8g/crypto/rsa/rsa_oaep.c
===================================================================
--- openssl-0.9.8g.orig/crypto/rsa/rsa_oaep.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rsa/rsa_oaep.c	2008-09-24 11:01:01.000000000 +0200
@@ -26,7 +26,8 @@
 #include <openssl/rsa.h>
 #include <openssl/evp.h>
 #include <openssl/rand.h>
-#include <openssl/sha.h>
+//#include <openssl/sha.h>
+#define SHA_DIGEST_LENGTH 20
 
 int MGF1(unsigned char *mask, long len,
 	const unsigned char *seed, long seedlen);
Index: openssl-0.9.8g/crypto/rsa/rsa_pss.c
===================================================================
--- openssl-0.9.8g.orig/crypto/rsa/rsa_pss.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/rsa/rsa_pss.c	2008-09-24 11:01:01.000000000 +0200
@@ -62,7 +62,7 @@
 #include <openssl/rsa.h>
 #include <openssl/evp.h>
 #include <openssl/rand.h>
-#include <openssl/sha.h>
+//#include <openssl/sha.h>
 
 static const unsigned char zeroes[] = {0,0,0,0,0,0,0,0};
 
Index: openssl-0.9.8g/crypto/ui/ui_openssl.c
===================================================================
--- openssl-0.9.8g.orig/crypto/ui/ui_openssl.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/ui/ui_openssl.c	2008-09-24 11:01:01.000000000 +0200
@@ -212,6 +212,12 @@
 #undef SGTTY
 #endif
 
+#if defined(OPENSSL_SYS_NEWLIB)
+# undef  TERMIOS
+# undef  TERMIO
+# undef  SGTTY
+#endif
+
 #ifdef TERMIOS
 # include <termios.h>
 # define TTY_STRUCT		struct termios
@@ -236,7 +242,7 @@
 # define TTY_set(tty,data)	ioctl(tty,TIOCSETP,data)
 #endif
 
-#if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_SUNOS)
+#if !defined(OPENSSL_SYS_NEWLIB) && !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_SUNOS)
 # include <sys/ioctl.h>
 #endif
 
@@ -260,7 +266,7 @@
 	typedef int sig_atomic_t;
 #endif
 
-#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE)
+#if defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE)
 /*
  * This one needs work. As a matter of fact the code is unoperational
  * and this is only a trick to get it compiled.
@@ -473,7 +479,7 @@
 	CRYPTO_w_lock(CRYPTO_LOCK_UI);
 	is_a_tty = 1;
 
-#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
+#if defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
 	tty_in=stdin;
 	tty_out=stderr;
 #else
Index: openssl-0.9.8g/crypto/uid.c
===================================================================
--- openssl-0.9.8g.orig/crypto/uid.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/uid.c	2008-09-24 11:01:01.000000000 +0200
@@ -65,7 +65,7 @@
 	return issetugid();
 	}
 
-#elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
+#elif defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
 
 int OPENSSL_issetugid(void)
 	{
Index: openssl-0.9.8g/crypto/x509/x509.h
===================================================================
--- openssl-0.9.8g.orig/crypto/x509/x509.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/x509/x509.h	2008-09-24 11:01:01.000000000 +0200
@@ -69,9 +69,9 @@
 #ifndef OPENSSL_NO_BUFFER
 #include <openssl/buffer.h>
 #endif
-#ifndef OPENSSL_NO_EVP
+//#ifndef OPENSSL_NO_EVP
 #include <openssl/evp.h>
-#endif
+//#endif
 #ifndef OPENSSL_NO_BIO
 #include <openssl/bio.h>
 #endif
@@ -476,14 +476,15 @@
 	int references;
 	} X509_PKEY;
 
-#ifndef OPENSSL_NO_EVP
 typedef struct X509_info_st
 	{
 	X509 *x509;
 	X509_CRL *crl;
 	X509_PKEY *x_pkey;
 
+#ifndef OPENSSL_NO_EVP
 	EVP_CIPHER_INFO enc_cipher;
+#endif
 	int enc_len;
 	char *enc_data;
 
@@ -491,7 +492,6 @@
 	} X509_INFO;
 
 DECLARE_STACK_OF(X509_INFO)
-#endif
 
 /* The next 2 structures and their 8 routines were sent to me by
  * Pat Richard <patr@x509.com> and are used to manipulate
Index: openssl-0.9.8g/crypto/x509v3/x509v3.h
===================================================================
--- openssl-0.9.8g.orig/crypto/x509v3/x509v3.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/crypto/x509v3/x509v3.h	2008-09-24 11:01:01.000000000 +0200
@@ -592,7 +592,9 @@
 void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
 								 int ml);
 int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
+#ifndef OPENSSL_NO_FP_API
 int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
+#endif
 
 int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent);
 
Index: openssl-0.9.8g/e_os2.h
===================================================================
--- openssl-0.9.8g.orig/e_os2.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/e_os2.h	2008-09-24 11:01:01.000000000 +0200
@@ -157,6 +157,11 @@
 # define OPENSSL_SYS_OS2
 #endif
 
+/* --------------------------------- Newlib ---------------------------------- */
+#ifdef OPENSSL_SYSNAME_NEWLIB
+#define OPENSSL_SYS_NEWLIB
+#endif
+
 /* --------------------------------- Unix ---------------------------------- */
 #ifdef OPENSSL_SYS_UNIX
 # if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)
Index: openssl-0.9.8g/e_os.h
===================================================================
--- openssl-0.9.8g.orig/e_os.h	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/e_os.h	2008-09-24 11:01:01.000000000 +0200
@@ -94,6 +94,12 @@
 #  define NO_SYSLOG
 #endif
   
+#if defined(OPENSSL_SYS_NEWLIB)
+#      define NO_SYS_PARAM_H
+  //#      define NO_CHMOD
+#      define NO_SYSLOG
+#endif
+
 #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC)
 # if macintosh==1
 #  ifndef MAC_OS_GUSI_SOURCE
@@ -425,7 +431,12 @@
 /*************/
 
 #ifdef USE_SOCKETS
-#  if defined(WINDOWS) || defined(MSDOS)
+#  if defined(OPENSSL_SYS_NEWLIB)
+#      define SSLeay_Write(a,b,c)	(-1)
+#      define SSLeay_Read(a,b,c)	(-1)
+#      define SHUTDOWN(fd)		close(fd)
+#      define SHUTDOWN2(fd)		close(fd)
+#  elif defined(WINDOWS) || defined(MSDOS)
       /* windows world */
 
 #    ifdef OPENSSL_NO_SOCK
Index: openssl-0.9.8g/ssl/bio_ssl.c
===================================================================
--- openssl-0.9.8g.orig/ssl/bio_ssl.c	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/ssl/bio_ssl.c	2008-09-24 11:01:01.000000000 +0200
@@ -534,12 +534,14 @@
 	{
 	BIO *ret=NULL,*con=NULL,*ssl=NULL;
 
+#ifndef OPENSSL_NO_SOCK
 	if ((con=BIO_new(BIO_s_connect())) == NULL)
 		return(NULL);
 	if ((ssl=BIO_new_ssl(ctx,1)) == NULL)
 		goto err;
 	if ((ret=BIO_push(ssl,con)) == NULL)
 		goto err;
+#endif
 	return(ret);
 err:
 	if (con != NULL) BIO_free(con);
Index: openssl-0.9.8g/ssl/Makefile
===================================================================
--- openssl-0.9.8g.orig/ssl/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/ssl/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -634,20 +634,20 @@
 s3_srvr.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
 s3_srvr.o: ../include/openssl/ecdsa.h ../include/openssl/err.h
 s3_srvr.o: ../include/openssl/evp.h ../include/openssl/hmac.h
-s3_srvr.o: ../include/openssl/krb5_asn.h ../include/openssl/kssl.h
-s3_srvr.o: ../include/openssl/lhash.h ../include/openssl/md5.h
-s3_srvr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-s3_srvr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-s3_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
-s3_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
-s3_srvr.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h
-s3_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h
-s3_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-s3_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
-s3_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
-s3_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-s3_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h
-s3_srvr.o: ../include/openssl/x509_vfy.h kssl_lcl.h s3_srvr.c ssl_locl.h
+s3_srvr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h
+s3_srvr.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
+s3_srvr.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+s3_srvr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+s3_srvr.o: ../include/openssl/pem.h ../include/openssl/pem2.h
+s3_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h
+s3_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
+s3_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+s3_srvr.o: ../include/openssl/sha.h ../include/openssl/ssl.h
+s3_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
+s3_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
+s3_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
+s3_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h kssl_lcl.h
+s3_srvr.o: s3_srvr.c ssl_locl.h
 ssl_algs.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 ssl_algs.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 ssl_algs.o: ../include/openssl/comp.h ../include/openssl/crypto.h
Index: openssl-0.9.8g/test/Makefile
===================================================================
--- openssl-0.9.8g.orig/test/Makefile	2008-09-24 11:00:04.000000000 +0200
+++ openssl-0.9.8g/test/Makefile	2008-09-24 11:01:01.000000000 +0200
@@ -445,8 +445,9 @@
 bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bntest.c
 casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h
 casttest.o: ../include/openssl/opensslconf.h casttest.c
-destest.o: ../include/openssl/des.h ../include/openssl/des_old.h
-destest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
+destest.o: ../include/openssl/crypto.h ../include/openssl/des.h
+destest.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h
+destest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 destest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
 destest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 destest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h destest.c
@@ -476,41 +477,69 @@
 ecdhtest.o: ../include/openssl/sha.h ../include/openssl/stack.h
 ecdhtest.o: ../include/openssl/symhacks.h ecdhtest.c
 ecdsatest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
-ecdsatest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
-ecdsatest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+ecdsatest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
+ecdsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
+ecdsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
+ecdsatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
 ecdsatest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
 ecdsatest.o: ../include/openssl/err.h ../include/openssl/evp.h
 ecdsatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
 ecdsatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
 ecdsatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-ecdsatest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
-ecdsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-ecdsatest.o: ecdsatest.c
+ecdsatest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
+ecdsatest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+ecdsatest.o: ../include/openssl/sha.h ../include/openssl/stack.h
+ecdsatest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
+ecdsatest.o: ../include/openssl/ui.h ../include/openssl/x509.h
+ecdsatest.o: ../include/openssl/x509_vfy.h ecdsatest.c
 ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-ectest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
-ectest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
-ectest.o: ../include/openssl/engine.h ../include/openssl/err.h
+ectest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
+ectest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
+ectest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
+ectest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
+ectest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
+ectest.o: ../include/openssl/err.h ../include/openssl/evp.h
 ectest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
 ectest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
 ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-ectest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
-ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h ectest.c
-enginetest.o: ../include/openssl/bio.h ../include/openssl/buffer.h
-enginetest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h
-enginetest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
+ectest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
+ectest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+ectest.o: ../include/openssl/sha.h ../include/openssl/stack.h
+ectest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
+ectest.o: ../include/openssl/ui.h ../include/openssl/x509.h
+ectest.o: ../include/openssl/x509_vfy.h ectest.c
+enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
+enginetest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
+enginetest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
+enginetest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
+enginetest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
+enginetest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
+enginetest.o: ../include/openssl/err.h ../include/openssl/evp.h
+enginetest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
+enginetest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
 enginetest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-enginetest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
-enginetest.o: ../include/openssl/symhacks.h enginetest.c
+enginetest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
+enginetest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+enginetest.o: ../include/openssl/sha.h ../include/openssl/stack.h
+enginetest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
+enginetest.o: ../include/openssl/ui.h ../include/openssl/x509.h
+enginetest.o: ../include/openssl/x509_vfy.h enginetest.c
 evp_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
+evp_test.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 evp_test.o: ../include/openssl/conf.h ../include/openssl/crypto.h
-evp_test.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
-evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h
-evp_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
-evp_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-evp_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-evp_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
-evp_test.o: ../include/openssl/symhacks.h evp_test.c
+evp_test.o: ../include/openssl/dh.h ../include/openssl/dsa.h
+evp_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+evp_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+evp_test.o: ../include/openssl/engine.h ../include/openssl/err.h
+evp_test.o: ../include/openssl/evp.h ../include/openssl/lhash.h
+evp_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+evp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+evp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
+evp_test.o: ../include/openssl/rand.h ../include/openssl/rsa.h
+evp_test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
+evp_test.o: ../include/openssl/stack.h ../include/openssl/store.h
+evp_test.o: ../include/openssl/symhacks.h ../include/openssl/ui.h
+evp_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h evp_test.c
 exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h
 exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h
@@ -519,39 +548,42 @@
 exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
 exptest.o: ../include/openssl/symhacks.h exptest.c
 hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
-hmactest.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
-hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-hmactest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
-hmactest.o: ../include/openssl/symhacks.h hmactest.c
+hmactest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+hmactest.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+hmactest.o: ../include/openssl/hmac.h ../include/openssl/md5.h
+hmactest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+hmactest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+hmactest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
+hmactest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h hmactest.c
 ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h
 ideatest.o: ../include/openssl/opensslconf.h ideatest.c
 igetest.o: ../include/openssl/aes.h ../include/openssl/e_os2.h
 igetest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h
 igetest.o: ../include/openssl/rand.h igetest.c
 md2test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-md2test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-md2test.o: ../include/openssl/evp.h ../include/openssl/md2.h
-md2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-md2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-md2test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
-md2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md2test.c
+md2test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+md2test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+md2test.o: ../include/openssl/md2.h ../include/openssl/obj_mac.h
+md2test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+md2test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+md2test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
+md2test.o: ../include/openssl/symhacks.h md2test.c
 md4test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-md4test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-md4test.o: ../include/openssl/evp.h ../include/openssl/md4.h
-md4test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-md4test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-md4test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
-md4test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md4test.c
+md4test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+md4test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+md4test.o: ../include/openssl/md4.h ../include/openssl/obj_mac.h
+md4test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+md4test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+md4test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
+md4test.o: ../include/openssl/symhacks.h md4test.c
 md5test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-md5test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-md5test.o: ../include/openssl/evp.h ../include/openssl/md5.h
-md5test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-md5test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-md5test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
-md5test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md5test.c
+md5test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+md5test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+md5test.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
+md5test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+md5test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+md5test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
+md5test.o: ../include/openssl/symhacks.h md5test.c
 mdc2test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
 mdc2test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
 mdc2test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
@@ -571,12 +603,13 @@
 rc5test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
 rc5test.o: ../include/openssl/symhacks.h rc5test.c
 rmdtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-rmdtest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-rmdtest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
-rmdtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-rmdtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-rmdtest.o: ../include/openssl/ripemd.h ../include/openssl/safestack.h
-rmdtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h rmdtest.c
+rmdtest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+rmdtest.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+rmdtest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+rmdtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+rmdtest.o: ../include/openssl/ossl_typ.h ../include/openssl/ripemd.h
+rmdtest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
+rmdtest.o: ../include/openssl/symhacks.h rmdtest.c
 rsa_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
 rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h
@@ -586,19 +619,21 @@
 rsa_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
 rsa_test.o: ../include/openssl/symhacks.h rsa_test.c
 sha1test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-sha1test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-sha1test.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
-sha1test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-sha1test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h sha1test.c
+sha1test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+sha1test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+sha1test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+sha1test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+sha1test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
+sha1test.o: ../include/openssl/sha.h ../include/openssl/stack.h
+sha1test.o: ../include/openssl/symhacks.h sha1test.c
 shatest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-shatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-shatest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
-shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
-shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
-shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
-shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c
+shatest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
+shatest.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
+shatest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+shatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+shatest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
+shatest.o: ../include/openssl/sha.h ../include/openssl/stack.h
+shatest.o: ../include/openssl/symhacks.h shatest.c
 ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h
@@ -618,6 +653,7 @@
 ssltest.o: ../include/openssl/sha.h ../include/openssl/ssl.h
 ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
 ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
-ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
+ssltest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
+ssltest.o: ../include/openssl/tls1.h ../include/openssl/ui.h
 ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
 ssltest.o: ../include/openssl/x509v3.h ssltest.c