diff options
author | jsg <> | 2014-04-15 12:27:34 +0000 |
---|---|---|
committer | jsg <> | 2014-04-15 12:27:34 +0000 |
commit | 97d5a40127ca3e120751be508651e33c4f294db2 (patch) | |
tree | 7b46d36ee15bc455e72fbd721910267d9c52fcdc /src/lib/libcrypto/rc4/rc4s.cpp | |
parent | 119df02356e2634a1f38a23d288d8774e841e5f7 (diff) | |
download | openbsd-97d5a40127ca3e120751be508651e33c4f294db2.tar.gz openbsd-97d5a40127ca3e120751be508651e33c4f294db2.tar.bz2 openbsd-97d5a40127ca3e120751be508651e33c4f294db2.zip |
remove pentium specific benchmark code
ok miod@
Diffstat (limited to 'src/lib/libcrypto/rc4/rc4s.cpp')
-rw-r--r-- | src/lib/libcrypto/rc4/rc4s.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/lib/libcrypto/rc4/rc4s.cpp b/src/lib/libcrypto/rc4/rc4s.cpp deleted file mode 100644 index 3814fde997..0000000000 --- a/src/lib/libcrypto/rc4/rc4s.cpp +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | // | ||
2 | // gettsc.inl | ||
3 | // | ||
4 | // gives access to the Pentium's (secret) cycle counter | ||
5 | // | ||
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) | ||
7 | // in 1996-7 and is entered, by him, into the public domain. | ||
8 | |||
9 | #if defined(__WATCOMC__) | ||
10 | void GetTSC(unsigned long&); | ||
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; | ||
12 | #elif defined(__GNUC__) | ||
13 | inline | ||
14 | void GetTSC(unsigned long& tsc) | ||
15 | { | ||
16 | asm volatile(".byte 15, 49\n\t" | ||
17 | : "=eax" (tsc) | ||
18 | : | ||
19 | : "%edx", "%eax"); | ||
20 | } | ||
21 | #elif defined(_MSC_VER) | ||
22 | inline | ||
23 | void GetTSC(unsigned long& tsc) | ||
24 | { | ||
25 | unsigned long a; | ||
26 | __asm _emit 0fh | ||
27 | __asm _emit 31h | ||
28 | __asm mov a, eax; | ||
29 | tsc=a; | ||
30 | } | ||
31 | #endif | ||
32 | |||
33 | #include <stdio.h> | ||
34 | #include <stdlib.h> | ||
35 | #include <openssl/rc4.h> | ||
36 | |||
37 | void main(int argc,char *argv[]) | ||
38 | { | ||
39 | unsigned char buffer[1024]; | ||
40 | RC4_KEY ctx; | ||
41 | unsigned long s1,s2,e1,e2; | ||
42 | unsigned char k[16]; | ||
43 | unsigned long data[2]; | ||
44 | unsigned char iv[8]; | ||
45 | int i,num=64,numm; | ||
46 | int j=0; | ||
47 | |||
48 | if (argc >= 2) | ||
49 | num=atoi(argv[1]); | ||
50 | |||
51 | if (num == 0) num=256; | ||
52 | if (num > 1024-16) num=1024-16; | ||
53 | numm=num+8; | ||
54 | |||
55 | for (j=0; j<6; j++) | ||
56 | { | ||
57 | for (i=0; i<10; i++) /**/ | ||
58 | { | ||
59 | RC4(&ctx,numm,buffer,buffer); | ||
60 | GetTSC(s1); | ||
61 | RC4(&ctx,numm,buffer,buffer); | ||
62 | GetTSC(e1); | ||
63 | GetTSC(s2); | ||
64 | RC4(&ctx,num,buffer,buffer); | ||
65 | GetTSC(e2); | ||
66 | RC4(&ctx,num,buffer,buffer); | ||
67 | } | ||
68 | |||
69 | printf("RC4 (%d bytes) %d %d (%d) - 8 bytes\n",num, | ||
70 | e1-s1,e2-s2,(e1-s1)-(e2-s2)); | ||
71 | } | ||
72 | } | ||
73 | |||