des_opts.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /* crypto/des/des_opts.c */
  2. /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  3. * All rights reserved.
  4. *
  5. * This package is an SSL implementation written
  6. * by Eric Young (eay@cryptsoft.com).
  7. * The implementation was written so as to conform with Netscapes SSL.
  8. *
  9. * This library is free for commercial and non-commercial use as long as
  10. * the following conditions are aheared to. The following conditions
  11. * apply to all code found in this distribution, be it the RC4, RSA,
  12. * lhash, DES, etc., code; not just the SSL code. The SSL documentation
  13. * included with this distribution is covered by the same copyright terms
  14. * except that the holder is Tim Hudson (tjh@cryptsoft.com).
  15. *
  16. * Copyright remains Eric Young's, and as such any Copyright notices in
  17. * the code are not to be removed.
  18. * If this package is used in a product, Eric Young should be given attribution
  19. * as the author of the parts of the library used.
  20. * This can be in the form of a textual message at program startup or
  21. * in documentation (online or textual) provided with the package.
  22. *
  23. * Redistribution and use in source and binary forms, with or without
  24. * modification, are permitted provided that the following conditions
  25. * are met:
  26. * 1. Redistributions of source code must retain the copyright
  27. * notice, this list of conditions and the following disclaimer.
  28. * 2. Redistributions in binary form must reproduce the above copyright
  29. * notice, this list of conditions and the following disclaimer in the
  30. * documentation and/or other materials provided with the distribution.
  31. * 3. All advertising materials mentioning features or use of this software
  32. * must display the following acknowledgement:
  33. * "This product includes cryptographic software written by
  34. * Eric Young (eay@cryptsoft.com)"
  35. * The word 'cryptographic' can be left out if the rouines from the library
  36. * being used are not cryptographic related :-).
  37. * 4. If you include any Windows specific code (or a derivative thereof) from
  38. * the apps directory (application code) you must include an acknowledgement:
  39. * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
  40. *
  41. * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  42. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  43. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  44. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  45. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  46. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  47. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  48. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  49. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  50. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  51. * SUCH DAMAGE.
  52. *
  53. * The licence and distribution terms for any publically available version or
  54. * derivative of this code cannot be changed. i.e. this code cannot simply be
  55. * copied and put under another distribution licence
  56. * [including the GNU Public Licence.]
  57. */
  58. /* define PART1, PART2, PART3 or PART4 to build only with a few of the options.
  59. * This is for machines with 64k code segment size restrictions. */
  60. #if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
  61. #define TIMES
  62. #endif
  63. #include <stdio.h>
  64. #ifndef OPENSSL_SYS_MSDOS
  65. #include <openssl/e_os2.h>
  66. #include OPENSSL_UNISTD
  67. #else
  68. #include <io.h>
  69. extern void exit();
  70. #endif
  71. #include <signal.h>
  72. #ifndef _IRIX
  73. #include <time.h>
  74. #endif
  75. #ifdef TIMES
  76. #include <sys/types.h>
  77. #include <sys/times.h>
  78. #endif
  79. /* Depending on the VMS version, the tms structure is perhaps defined.
  80. The __TMS macro will show if it was. If it wasn't defined, we should
  81. undefine TIMES, since that tells the rest of the program how things
  82. should be handled. -- Richard Levitte */
  83. #if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS)
  84. #undef TIMES
  85. #endif
  86. #ifndef TIMES
  87. #include <sys/timeb.h>
  88. #endif
  89. #if defined(sun) || defined(__ultrix)
  90. #define _POSIX_SOURCE
  91. #include <limits.h>
  92. #include <sys/param.h>
  93. #endif
  94. #include <openssl/des.h>
  95. #include "spr.h"
  96. #define DES_DEFAULT_OPTIONS
  97. #if !defined(PART1) && !defined(PART2) && !defined(PART3) && !defined(PART4)
  98. #define PART1
  99. #define PART2
  100. #define PART3
  101. #define PART4
  102. #endif
  103. #ifdef PART1
  104. #undef DES_UNROLL
  105. #undef DES_RISC1
  106. #undef DES_RISC2
  107. #undef DES_PTR
  108. #undef D_ENCRYPT
  109. #define des_encrypt des_encrypt_u4_cisc_idx
  110. #define des_encrypt2 des_encrypt2_u4_cisc_idx
  111. #define des_encrypt3 des_encrypt3_u4_cisc_idx
  112. #define des_decrypt3 des_decrypt3_u4_cisc_idx
  113. #undef HEADER_DES_LOCL_H
  114. #include "des_enc.c"
  115. #define DES_UNROLL
  116. #undef DES_RISC1
  117. #undef DES_RISC2
  118. #undef DES_PTR
  119. #undef D_ENCRYPT
  120. #undef des_encrypt
  121. #undef des_encrypt2
  122. #undef des_encrypt3
  123. #undef des_decrypt3
  124. #define des_encrypt des_encrypt_u16_cisc_idx
  125. #define des_encrypt2 des_encrypt2_u16_cisc_idx
  126. #define des_encrypt3 des_encrypt3_u16_cisc_idx
  127. #define des_decrypt3 des_decrypt3_u16_cisc_idx
  128. #undef HEADER_DES_LOCL_H
  129. #include "des_enc.c"
  130. #undef DES_UNROLL
  131. #define DES_RISC1
  132. #undef DES_RISC2
  133. #undef DES_PTR
  134. #undef D_ENCRYPT
  135. #undef des_encrypt
  136. #undef des_encrypt2
  137. #undef des_encrypt3
  138. #undef des_decrypt3
  139. #define des_encrypt des_encrypt_u4_risc1_idx
  140. #define des_encrypt2 des_encrypt2_u4_risc1_idx
  141. #define des_encrypt3 des_encrypt3_u4_risc1_idx
  142. #define des_decrypt3 des_decrypt3_u4_risc1_idx
  143. #undef HEADER_DES_LOCL_H
  144. #include "des_enc.c"
  145. #endif
  146. #ifdef PART2
  147. #undef DES_UNROLL
  148. #undef DES_RISC1
  149. #define DES_RISC2
  150. #undef DES_PTR
  151. #undef D_ENCRYPT
  152. #undef des_encrypt
  153. #undef des_encrypt2
  154. #undef des_encrypt3
  155. #undef des_decrypt3
  156. #define des_encrypt des_encrypt_u4_risc2_idx
  157. #define des_encrypt2 des_encrypt2_u4_risc2_idx
  158. #define des_encrypt3 des_encrypt3_u4_risc2_idx
  159. #define des_decrypt3 des_decrypt3_u4_risc2_idx
  160. #undef HEADER_DES_LOCL_H
  161. #include "des_enc.c"
  162. #define DES_UNROLL
  163. #define DES_RISC1
  164. #undef DES_RISC2
  165. #undef DES_PTR
  166. #undef D_ENCRYPT
  167. #undef des_encrypt
  168. #undef des_encrypt2
  169. #undef des_encrypt3
  170. #undef des_decrypt3
  171. #define des_encrypt des_encrypt_u16_risc1_idx
  172. #define des_encrypt2 des_encrypt2_u16_risc1_idx
  173. #define des_encrypt3 des_encrypt3_u16_risc1_idx
  174. #define des_decrypt3 des_decrypt3_u16_risc1_idx
  175. #undef HEADER_DES_LOCL_H
  176. #include "des_enc.c"
  177. #define DES_UNROLL
  178. #undef DES_RISC1
  179. #define DES_RISC2
  180. #undef DES_PTR
  181. #undef D_ENCRYPT
  182. #undef des_encrypt
  183. #undef des_encrypt2
  184. #undef des_encrypt3
  185. #undef des_decrypt3
  186. #define des_encrypt des_encrypt_u16_risc2_idx
  187. #define des_encrypt2 des_encrypt2_u16_risc2_idx
  188. #define des_encrypt3 des_encrypt3_u16_risc2_idx
  189. #define des_decrypt3 des_decrypt3_u16_risc2_idx
  190. #undef HEADER_DES_LOCL_H
  191. #include "des_enc.c"
  192. #endif
  193. #ifdef PART3
  194. #undef DES_UNROLL
  195. #undef DES_RISC1
  196. #undef DES_RISC2
  197. #define DES_PTR
  198. #undef D_ENCRYPT
  199. #undef des_encrypt
  200. #undef des_encrypt2
  201. #undef des_encrypt3
  202. #undef des_decrypt3
  203. #define des_encrypt des_encrypt_u4_cisc_ptr
  204. #define des_encrypt2 des_encrypt2_u4_cisc_ptr
  205. #define des_encrypt3 des_encrypt3_u4_cisc_ptr
  206. #define des_decrypt3 des_decrypt3_u4_cisc_ptr
  207. #undef HEADER_DES_LOCL_H
  208. #include "des_enc.c"
  209. #define DES_UNROLL
  210. #undef DES_RISC1
  211. #undef DES_RISC2
  212. #define DES_PTR
  213. #undef D_ENCRYPT
  214. #undef des_encrypt
  215. #undef des_encrypt2
  216. #undef des_encrypt3
  217. #undef des_decrypt3
  218. #define des_encrypt des_encrypt_u16_cisc_ptr
  219. #define des_encrypt2 des_encrypt2_u16_cisc_ptr
  220. #define des_encrypt3 des_encrypt3_u16_cisc_ptr
  221. #define des_decrypt3 des_decrypt3_u16_cisc_ptr
  222. #undef HEADER_DES_LOCL_H
  223. #include "des_enc.c"
  224. #undef DES_UNROLL
  225. #define DES_RISC1
  226. #undef DES_RISC2
  227. #define DES_PTR
  228. #undef D_ENCRYPT
  229. #undef des_encrypt
  230. #undef des_encrypt2
  231. #undef des_encrypt3
  232. #undef des_decrypt3
  233. #define des_encrypt des_encrypt_u4_risc1_ptr
  234. #define des_encrypt2 des_encrypt2_u4_risc1_ptr
  235. #define des_encrypt3 des_encrypt3_u4_risc1_ptr
  236. #define des_decrypt3 des_decrypt3_u4_risc1_ptr
  237. #undef HEADER_DES_LOCL_H
  238. #include "des_enc.c"
  239. #endif
  240. #ifdef PART4
  241. #undef DES_UNROLL
  242. #undef DES_RISC1
  243. #define DES_RISC2
  244. #define DES_PTR
  245. #undef D_ENCRYPT
  246. #undef des_encrypt
  247. #undef des_encrypt2
  248. #undef des_encrypt3
  249. #undef des_decrypt3
  250. #define des_encrypt des_encrypt_u4_risc2_ptr
  251. #define des_encrypt2 des_encrypt2_u4_risc2_ptr
  252. #define des_encrypt3 des_encrypt3_u4_risc2_ptr
  253. #define des_decrypt3 des_decrypt3_u4_risc2_ptr
  254. #undef HEADER_DES_LOCL_H
  255. #include "des_enc.c"
  256. #define DES_UNROLL
  257. #define DES_RISC1
  258. #undef DES_RISC2
  259. #define DES_PTR
  260. #undef D_ENCRYPT
  261. #undef des_encrypt
  262. #undef des_encrypt2
  263. #undef des_encrypt3
  264. #undef des_decrypt3
  265. #define des_encrypt des_encrypt_u16_risc1_ptr
  266. #define des_encrypt2 des_encrypt2_u16_risc1_ptr
  267. #define des_encrypt3 des_encrypt3_u16_risc1_ptr
  268. #define des_decrypt3 des_decrypt3_u16_risc1_ptr
  269. #undef HEADER_DES_LOCL_H
  270. #include "des_enc.c"
  271. #define DES_UNROLL
  272. #undef DES_RISC1
  273. #define DES_RISC2
  274. #define DES_PTR
  275. #undef D_ENCRYPT
  276. #undef des_encrypt
  277. #undef des_encrypt2
  278. #undef des_encrypt3
  279. #undef des_decrypt3
  280. #define des_encrypt des_encrypt_u16_risc2_ptr
  281. #define des_encrypt2 des_encrypt2_u16_risc2_ptr
  282. #define des_encrypt3 des_encrypt3_u16_risc2_ptr
  283. #define des_decrypt3 des_decrypt3_u16_risc2_ptr
  284. #undef HEADER_DES_LOCL_H
  285. #include "des_enc.c"
  286. #endif
  287. /* The following if from times(3) man page. It may need to be changed */
  288. #ifndef HZ
  289. # ifndef CLK_TCK
  290. # ifndef _BSD_CLK_TCK_ /* FreeBSD fix */
  291. # define HZ 100.0
  292. # else /* _BSD_CLK_TCK_ */
  293. # define HZ ((double)_BSD_CLK_TCK_)
  294. # endif
  295. # else /* CLK_TCK */
  296. # define HZ ((double)CLK_TCK)
  297. # endif
  298. #endif
  299. #define BUFSIZE ((long)1024)
  300. long run=0;
  301. double Time_F(int s);
  302. #ifdef SIGALRM
  303. #if defined(__STDC__) || defined(sgi)
  304. #define SIGRETTYPE void
  305. #else
  306. #define SIGRETTYPE int
  307. #endif
  308. SIGRETTYPE sig_done(int sig);
  309. SIGRETTYPE sig_done(int sig)
  310. {
  311. signal(SIGALRM,sig_done);
  312. run=0;
  313. #ifdef LINT
  314. sig=sig;
  315. #endif
  316. }
  317. #endif
  318. #define START 0
  319. #define STOP 1
  320. double Time_F(int s)
  321. {
  322. double ret;
  323. #ifdef TIMES
  324. static struct tms tstart,tend;
  325. if (s == START)
  326. {
  327. times(&tstart);
  328. return(0);
  329. }
  330. else
  331. {
  332. times(&tend);
  333. ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
  334. return((ret == 0.0)?1e-6:ret);
  335. }
  336. #else /* !times() */
  337. static struct timeb tstart,tend;
  338. long i;
  339. if (s == START)
  340. {
  341. ftime(&tstart);
  342. return(0);
  343. }
  344. else
  345. {
  346. ftime(&tend);
  347. i=(long)tend.millitm-(long)tstart.millitm;
  348. ret=((double)(tend.time-tstart.time))+((double)i)/1000.0;
  349. return((ret == 0.0)?1e-6:ret);
  350. }
  351. #endif
  352. }
  353. #ifdef SIGALRM
  354. #define print_name(name) fprintf(stderr,"Doing %s's for 10 seconds\n",name); alarm(10);
  355. #else
  356. #define print_name(name) fprintf(stderr,"Doing %s %ld times\n",name,cb);
  357. #endif
  358. #define time_it(func,name,index) \
  359. print_name(name); \
  360. Time_F(START); \
  361. for (count=0,run=1; COND(cb); count++) \
  362. { \
  363. unsigned long d[2]; \
  364. func(d,&(sch[0]),DES_ENCRYPT); \
  365. } \
  366. tm[index]=Time_F(STOP); \
  367. fprintf(stderr,"%ld %s's in %.2f second\n",count,name,tm[index]); \
  368. tm[index]=((double)COUNT(cb))/tm[index];
  369. #define print_it(name,index) \
  370. fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \
  371. tm[index]*8,1.0e6/tm[index]);
  372. int main(int argc, char **argv)
  373. {
  374. long count;
  375. static unsigned char buf[BUFSIZE];
  376. static des_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
  377. static des_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
  378. static des_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
  379. des_key_schedule sch,sch2,sch3;
  380. double d,tm[16],max=0;
  381. int rank[16];
  382. char *str[16];
  383. int max_idx=0,i,num=0,j;
  384. #ifndef SIGALARM
  385. long ca,cb,cc,cd,ce;
  386. #endif
  387. for (i=0; i<12; i++)
  388. {
  389. tm[i]=0.0;
  390. rank[i]=0;
  391. }
  392. #ifndef TIMES
  393. fprintf(stderr,"To get the most accurate results, try to run this\n");
  394. fprintf(stderr,"program when this computer is idle.\n");
  395. #endif
  396. des_set_key_unchecked(&key,sch);
  397. des_set_key_unchecked(&key2,sch2);
  398. des_set_key_unchecked(&key3,sch3);
  399. #ifndef SIGALRM
  400. fprintf(stderr,"First we calculate the approximate speed ...\n");
  401. des_set_key_unchecked(&key,sch);
  402. count=10;
  403. do {
  404. long i;
  405. unsigned long data[2];
  406. count*=2;
  407. Time_F(START);
  408. for (i=count; i; i--)
  409. des_encrypt(data,&(sch[0]),DES_ENCRYPT);
  410. d=Time_F(STOP);
  411. } while (d < 3.0);
  412. ca=count;
  413. cb=count*3;
  414. cc=count*3*8/BUFSIZE+1;
  415. cd=count*8/BUFSIZE+1;
  416. ce=count/20+1;
  417. #define COND(d) (count != (d))
  418. #define COUNT(d) (d)
  419. #else
  420. #define COND(c) (run)
  421. #define COUNT(d) (count)
  422. signal(SIGALRM,sig_done);
  423. alarm(10);
  424. #endif
  425. #ifdef PART1
  426. time_it(des_encrypt_u4_cisc_idx, "des_encrypt_u4_cisc_idx ", 0);
  427. time_it(des_encrypt_u16_cisc_idx, "des_encrypt_u16_cisc_idx ", 1);
  428. time_it(des_encrypt_u4_risc1_idx, "des_encrypt_u4_risc1_idx ", 2);
  429. num+=3;
  430. #endif
  431. #ifdef PART2
  432. time_it(des_encrypt_u16_risc1_idx,"des_encrypt_u16_risc1_idx", 3);
  433. time_it(des_encrypt_u4_risc2_idx, "des_encrypt_u4_risc2_idx ", 4);
  434. time_it(des_encrypt_u16_risc2_idx,"des_encrypt_u16_risc2_idx", 5);
  435. num+=3;
  436. #endif
  437. #ifdef PART3
  438. time_it(des_encrypt_u4_cisc_ptr, "des_encrypt_u4_cisc_ptr ", 6);
  439. time_it(des_encrypt_u16_cisc_ptr, "des_encrypt_u16_cisc_ptr ", 7);
  440. time_it(des_encrypt_u4_risc1_ptr, "des_encrypt_u4_risc1_ptr ", 8);
  441. num+=3;
  442. #endif
  443. #ifdef PART4
  444. time_it(des_encrypt_u16_risc1_ptr,"des_encrypt_u16_risc1_ptr", 9);
  445. time_it(des_encrypt_u4_risc2_ptr, "des_encrypt_u4_risc2_ptr ",10);
  446. time_it(des_encrypt_u16_risc2_ptr,"des_encrypt_u16_risc2_ptr",11);
  447. num+=3;
  448. #endif
  449. #ifdef PART1
  450. str[0]=" 4 c i";
  451. print_it("des_encrypt_u4_cisc_idx ",0);
  452. max=tm[0];
  453. max_idx=0;
  454. str[1]="16 c i";
  455. print_it("des_encrypt_u16_cisc_idx ",1);
  456. if (max < tm[1]) { max=tm[1]; max_idx=1; }
  457. str[2]=" 4 r1 i";
  458. print_it("des_encrypt_u4_risc1_idx ",2);
  459. if (max < tm[2]) { max=tm[2]; max_idx=2; }
  460. #endif
  461. #ifdef PART2
  462. str[3]="16 r1 i";
  463. print_it("des_encrypt_u16_risc1_idx",3);
  464. if (max < tm[3]) { max=tm[3]; max_idx=3; }
  465. str[4]=" 4 r2 i";
  466. print_it("des_encrypt_u4_risc2_idx ",4);
  467. if (max < tm[4]) { max=tm[4]; max_idx=4; }
  468. str[5]="16 r2 i";
  469. print_it("des_encrypt_u16_risc2_idx",5);
  470. if (max < tm[5]) { max=tm[5]; max_idx=5; }
  471. #endif
  472. #ifdef PART3
  473. str[6]=" 4 c p";
  474. print_it("des_encrypt_u4_cisc_ptr ",6);
  475. if (max < tm[6]) { max=tm[6]; max_idx=6; }
  476. str[7]="16 c p";
  477. print_it("des_encrypt_u16_cisc_ptr ",7);
  478. if (max < tm[7]) { max=tm[7]; max_idx=7; }
  479. str[8]=" 4 r1 p";
  480. print_it("des_encrypt_u4_risc1_ptr ",8);
  481. if (max < tm[8]) { max=tm[8]; max_idx=8; }
  482. #endif
  483. #ifdef PART4
  484. str[9]="16 r1 p";
  485. print_it("des_encrypt_u16_risc1_ptr",9);
  486. if (max < tm[9]) { max=tm[9]; max_idx=9; }
  487. str[10]=" 4 r2 p";
  488. print_it("des_encrypt_u4_risc2_ptr ",10);
  489. if (max < tm[10]) { max=tm[10]; max_idx=10; }
  490. str[11]="16 r2 p";
  491. print_it("des_encrypt_u16_risc2_ptr",11);
  492. if (max < tm[11]) { max=tm[11]; max_idx=11; }
  493. #endif
  494. printf("options des ecb/s\n");
  495. printf("%s %12.2f 100.0%%\n",str[max_idx],tm[max_idx]);
  496. d=tm[max_idx];
  497. tm[max_idx]= -2.0;
  498. max= -1.0;
  499. for (;;)
  500. {
  501. for (i=0; i<12; i++)
  502. {
  503. if (max < tm[i]) { max=tm[i]; j=i; }
  504. }
  505. if (max < 0.0) break;
  506. printf("%s %12.2f %4.1f%%\n",str[j],tm[j],tm[j]/d*100.0);
  507. tm[j]= -2.0;
  508. max= -1.0;
  509. }
  510. switch (max_idx)
  511. {
  512. case 0:
  513. printf("-DDES_DEFAULT_OPTIONS\n");
  514. break;
  515. case 1:
  516. printf("-DDES_UNROLL\n");
  517. break;
  518. case 2:
  519. printf("-DDES_RISC1\n");
  520. break;
  521. case 3:
  522. printf("-DDES_UNROLL -DDES_RISC1\n");
  523. break;
  524. case 4:
  525. printf("-DDES_RISC2\n");
  526. break;
  527. case 5:
  528. printf("-DDES_UNROLL -DDES_RISC2\n");
  529. break;
  530. case 6:
  531. printf("-DDES_PTR\n");
  532. break;
  533. case 7:
  534. printf("-DDES_UNROLL -DDES_PTR\n");
  535. break;
  536. case 8:
  537. printf("-DDES_RISC1 -DDES_PTR\n");
  538. break;
  539. case 9:
  540. printf("-DDES_UNROLL -DDES_RISC1 -DDES_PTR\n");
  541. break;
  542. case 10:
  543. printf("-DDES_RISC2 -DDES_PTR\n");
  544. break;
  545. case 11:
  546. printf("-DDES_UNROLL -DDES_RISC2 -DDES_PTR\n");
  547. break;
  548. }
  549. exit(0);
  550. #if defined(LINT) || defined(OPENSSL_SYS_MSDOS)
  551. return(0);
  552. #endif
  553. }