summaryrefslogtreecommitdiff
path: root/times/x86
diff options
context:
space:
mode:
Diffstat (limited to 'times/x86')
-rw-r--r--times/x86/bfs.cpp67
-rw-r--r--times/x86/casts.cpp67
-rw-r--r--times/x86/des3s.cpp67
-rw-r--r--times/x86/dess.cpp67
-rw-r--r--times/x86/md4s.cpp78
-rw-r--r--times/x86/md5s.cpp78
-rw-r--r--times/x86/rc4s.cpp73
-rw-r--r--times/x86/sha1s.cpp79
8 files changed, 0 insertions, 576 deletions
diff --git a/times/x86/bfs.cpp b/times/x86/bfs.cpp
deleted file mode 100644
index d74c457..0000000
--- a/times/x86/bfs.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/blowfish.h>
-
-void main(int argc,char *argv[])
- {
- BF_KEY key;
- unsigned long s1,s2,e1,e2;
- unsigned long data[2];
- int i,j;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<1000; i++) /**/
- {
- BF_encrypt(&data[0],&key);
- GetTSC(s1);
- BF_encrypt(&data[0],&key);
- BF_encrypt(&data[0],&key);
- BF_encrypt(&data[0],&key);
- GetTSC(e1);
- GetTSC(s2);
- BF_encrypt(&data[0],&key);
- BF_encrypt(&data[0],&key);
- BF_encrypt(&data[0],&key);
- BF_encrypt(&data[0],&key);
- GetTSC(e2);
- BF_encrypt(&data[0],&key);
- }
-
- printf("blowfish %d %d (%d)\n",
- e1-s1,e2-s2,((e2-s2)-(e1-s1)));
- }
- }
-
diff --git a/times/x86/casts.cpp b/times/x86/casts.cpp
deleted file mode 100644
index 7661191..0000000
--- a/times/x86/casts.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/cast.h>
-
-void main(int argc,char *argv[])
- {
- CAST_KEY key;
- unsigned long s1,s2,e1,e2;
- unsigned long data[2];
- int i,j;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<1000; i++) /**/
- {
- CAST_encrypt(&data[0],&key);
- GetTSC(s1);
- CAST_encrypt(&data[0],&key);
- CAST_encrypt(&data[0],&key);
- CAST_encrypt(&data[0],&key);
- GetTSC(e1);
- GetTSC(s2);
- CAST_encrypt(&data[0],&key);
- CAST_encrypt(&data[0],&key);
- CAST_encrypt(&data[0],&key);
- CAST_encrypt(&data[0],&key);
- GetTSC(e2);
- CAST_encrypt(&data[0],&key);
- }
-
- printf("cast %d %d (%d)\n",
- e1-s1,e2-s2,((e2-s2)-(e1-s1)));
- }
- }
-
diff --git a/times/x86/des3s.cpp b/times/x86/des3s.cpp
deleted file mode 100644
index cd2b112..0000000
--- a/times/x86/des3s.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/des.h>
-
-void main(int argc,char *argv[])
- {
- des_key_schedule key1,key2,key3;
- unsigned long s1,s2,e1,e2;
- unsigned long data[2];
- int i,j;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<1000; i++) /**/
- {
- des_encrypt3(&data[0],key1,key2,key3);
- GetTSC(s1);
- des_encrypt3(&data[0],key1,key2,key3);
- des_encrypt3(&data[0],key1,key2,key3);
- des_encrypt3(&data[0],key1,key2,key3);
- GetTSC(e1);
- GetTSC(s2);
- des_encrypt3(&data[0],key1,key2,key3);
- des_encrypt3(&data[0],key1,key2,key3);
- des_encrypt3(&data[0],key1,key2,key3);
- des_encrypt3(&data[0],key1,key2,key3);
- GetTSC(e2);
- des_encrypt3(&data[0],key1,key2,key3);
- }
-
- printf("des3 %d %d (%d)\n",
- e1-s1,e2-s2,((e2-s2)-(e1-s1)));
- }
- }
-
diff --git a/times/x86/dess.cpp b/times/x86/dess.cpp
deleted file mode 100644
index 753e67a..0000000
--- a/times/x86/dess.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/des.h>
-
-void main(int argc,char *argv[])
- {
- des_key_schedule key;
- unsigned long s1,s2,e1,e2;
- unsigned long data[2];
- int i,j;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<1000; i++) /**/
- {
- des_encrypt(&data[0],key,1);
- GetTSC(s1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- GetTSC(e1);
- GetTSC(s2);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- des_encrypt(&data[0],key,1);
- GetTSC(e2);
- des_encrypt(&data[0],key,1);
- }
-
- printf("des %d %d (%d)\n",
- e1-s1,e2-s2,((e2-s2)-(e1-s1)));
- }
- }
-
diff --git a/times/x86/md4s.cpp b/times/x86/md4s.cpp
deleted file mode 100644
index c0ec97f..0000000
--- a/times/x86/md4s.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/md4.h>
-
-extern "C" {
-void md4_block_x86(MD4_CTX *ctx, unsigned char *buffer,int num);
-}
-
-void main(int argc,char *argv[])
- {
- unsigned char buffer[64*256];
- MD4_CTX ctx;
- unsigned long s1,s2,e1,e2;
- unsigned char k[16];
- unsigned long data[2];
- unsigned char iv[8];
- int i,num=0,numm;
- int j=0;
-
- if (argc >= 2)
- num=atoi(argv[1]);
-
- if (num == 0) num=16;
- if (num > 250) num=16;
- numm=num+2;
- num*=64;
- numm*=64;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<10; i++) /**/
- {
- md4_block_x86(&ctx,buffer,numm);
- GetTSC(s1);
- md4_block_x86(&ctx,buffer,numm);
- GetTSC(e1);
- GetTSC(s2);
- md4_block_x86(&ctx,buffer,num);
- GetTSC(e2);
- md4_block_x86(&ctx,buffer,num);
- }
- printf("md4 (%d bytes) %d %d (%.2f)\n",num,
- e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
- }
- }
-
diff --git a/times/x86/md5s.cpp b/times/x86/md5s.cpp
deleted file mode 100644
index dd343fd..0000000
--- a/times/x86/md5s.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/md5.h>
-
-extern "C" {
-void md5_block_x86(MD5_CTX *ctx, unsigned char *buffer,int num);
-}
-
-void main(int argc,char *argv[])
- {
- unsigned char buffer[64*256];
- MD5_CTX ctx;
- unsigned long s1,s2,e1,e2;
- unsigned char k[16];
- unsigned long data[2];
- unsigned char iv[8];
- int i,num=0,numm;
- int j=0;
-
- if (argc >= 2)
- num=atoi(argv[1]);
-
- if (num == 0) num=16;
- if (num > 250) num=16;
- numm=num+2;
- num*=64;
- numm*=64;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<10; i++) /**/
- {
- md5_block_x86(&ctx,buffer,numm);
- GetTSC(s1);
- md5_block_x86(&ctx,buffer,numm);
- GetTSC(e1);
- GetTSC(s2);
- md5_block_x86(&ctx,buffer,num);
- GetTSC(e2);
- md5_block_x86(&ctx,buffer,num);
- }
- printf("md5 (%d bytes) %d %d (%.2f)\n",num,
- e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
- }
- }
-
diff --git a/times/x86/rc4s.cpp b/times/x86/rc4s.cpp
deleted file mode 100644
index 3814fde..0000000
--- a/times/x86/rc4s.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/rc4.h>
-
-void main(int argc,char *argv[])
- {
- unsigned char buffer[1024];
- RC4_KEY ctx;
- unsigned long s1,s2,e1,e2;
- unsigned char k[16];
- unsigned long data[2];
- unsigned char iv[8];
- int i,num=64,numm;
- int j=0;
-
- if (argc >= 2)
- num=atoi(argv[1]);
-
- if (num == 0) num=256;
- if (num > 1024-16) num=1024-16;
- numm=num+8;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<10; i++) /**/
- {
- RC4(&ctx,numm,buffer,buffer);
- GetTSC(s1);
- RC4(&ctx,numm,buffer,buffer);
- GetTSC(e1);
- GetTSC(s2);
- RC4(&ctx,num,buffer,buffer);
- GetTSC(e2);
- RC4(&ctx,num,buffer,buffer);
- }
-
- printf("RC4 (%d bytes) %d %d (%d) - 8 bytes\n",num,
- e1-s1,e2-s2,(e1-s1)-(e2-s2));
- }
- }
-
diff --git a/times/x86/sha1s.cpp b/times/x86/sha1s.cpp
deleted file mode 100644
index 3103e18..0000000
--- a/times/x86/sha1s.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// gettsc.inl
-//
-// gives access to the Pentium's (secret) cycle counter
-//
-// This software was written by Leonard Janke (janke@unixg.ubc.ca)
-// in 1996-7 and is entered, by him, into the public domain.
-
-#if defined(__WATCOMC__)
-void GetTSC(unsigned long&);
-#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
-#elif defined(__GNUC__)
-inline
-void GetTSC(unsigned long& tsc)
-{
- asm volatile(".byte 15, 49\n\t"
- : "=eax" (tsc)
- :
- : "%edx", "%eax");
-}
-#elif defined(_MSC_VER)
-inline
-void GetTSC(unsigned long& tsc)
-{
- unsigned long a;
- __asm _emit 0fh
- __asm _emit 31h
- __asm mov a, eax;
- tsc=a;
-}
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/sha.h>
-
-extern "C" {
-void sha1_block_x86(SHA_CTX *ctx, unsigned char *buffer,int num);
-}
-
-void main(int argc,char *argv[])
- {
- unsigned char buffer[64*256];
- SHA_CTX ctx;
- unsigned long s1,s2,e1,e2;
- unsigned char k[16];
- unsigned long data[2];
- unsigned char iv[8];
- int i,num=0,numm;
- int j=0;
-
- if (argc >= 2)
- num=atoi(argv[1]);
-
- if (num == 0) num=16;
- if (num > 250) num=16;
- numm=num+2;
- num*=64;
- numm*=64;
-
- for (j=0; j<6; j++)
- {
- for (i=0; i<10; i++) /**/
- {
- sha1_block_x86(&ctx,buffer,numm);
- GetTSC(s1);
- sha1_block_x86(&ctx,buffer,numm);
- GetTSC(e1);
- GetTSC(s2);
- sha1_block_x86(&ctx,buffer,num);
- GetTSC(e2);
- sha1_block_x86(&ctx,buffer,num);
- }
-
- printf("sha1 (%d bytes) %d %d (%.2f)\n",num,
- e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
- }
- }
-