summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bf/bfs.cpp
diff options
context:
space:
mode:
authorjsg <>2014-04-15 12:27:34 +0000
committerjsg <>2014-04-15 12:27:34 +0000
commit97d5a40127ca3e120751be508651e33c4f294db2 (patch)
tree7b46d36ee15bc455e72fbd721910267d9c52fcdc /src/lib/libcrypto/bf/bfs.cpp
parent119df02356e2634a1f38a23d288d8774e841e5f7 (diff)
downloadopenbsd-97d5a40127ca3e120751be508651e33c4f294db2.tar.gz
openbsd-97d5a40127ca3e120751be508651e33c4f294db2.tar.bz2
openbsd-97d5a40127ca3e120751be508651e33c4f294db2.zip
remove pentium specific benchmark code
ok miod@
Diffstat (limited to 'src/lib/libcrypto/bf/bfs.cpp')
-rw-r--r--src/lib/libcrypto/bf/bfs.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/lib/libcrypto/bf/bfs.cpp b/src/lib/libcrypto/bf/bfs.cpp
deleted file mode 100644
index d74c457760..0000000000
--- a/src/lib/libcrypto/bf/bfs.cpp
+++ /dev/null
@@ -1,67 +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__)
10void GetTSC(unsigned long&);
11#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12#elif defined(__GNUC__)
13inline
14void 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)
22inline
23void 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/blowfish.h>
36
37void main(int argc,char *argv[])
38 {
39 BF_KEY key;
40 unsigned long s1,s2,e1,e2;
41 unsigned long data[2];
42 int i,j;
43
44 for (j=0; j<6; j++)
45 {
46 for (i=0; i<1000; i++) /**/
47 {
48 BF_encrypt(&data[0],&key);
49 GetTSC(s1);
50 BF_encrypt(&data[0],&key);
51 BF_encrypt(&data[0],&key);
52 BF_encrypt(&data[0],&key);
53 GetTSC(e1);
54 GetTSC(s2);
55 BF_encrypt(&data[0],&key);
56 BF_encrypt(&data[0],&key);
57 BF_encrypt(&data[0],&key);
58 BF_encrypt(&data[0],&key);
59 GetTSC(e2);
60 BF_encrypt(&data[0],&key);
61 }
62
63 printf("blowfish %d %d (%d)\n",
64 e1-s1,e2-s2,((e2-s2)-(e1-s1)));
65 }
66 }
67