diff options
| author | cvs2svn <admin@example.com> | 2012-07-13 17:49:56 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2012-07-13 17:49:56 +0000 |
| commit | ee04221ea8063435416c7e6369e6eae76843aa71 (patch) | |
| tree | 821921a1dd0a5a3cece91121e121cc63c4b68128 /src/lib/libcrypto/des/des3s.cpp | |
| parent | adf6731f6e1d04718aee00cb93435143046aee9a (diff) | |
| download | openbsd-eric_g2k12.tar.gz openbsd-eric_g2k12.tar.bz2 openbsd-eric_g2k12.zip | |
This commit was manufactured by cvs2git to create tag 'eric_g2k12'.eric_g2k12
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/des/des3s.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/lib/libcrypto/des/des3s.cpp b/src/lib/libcrypto/des/des3s.cpp deleted file mode 100644 index 02d527c057..0000000000 --- a/src/lib/libcrypto/des/des3s.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__) | ||
| 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/des.h> | ||
| 36 | |||
| 37 | void main(int argc,char *argv[]) | ||
| 38 | { | ||
| 39 | des_key_schedule key1,key2,key3; | ||
| 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 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 49 | GetTSC(s1); | ||
| 50 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 51 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 52 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 53 | GetTSC(e1); | ||
| 54 | GetTSC(s2); | ||
| 55 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 56 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 57 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 58 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 59 | GetTSC(e2); | ||
| 60 | des_encrypt3(&data[0],key1,key2,key3); | ||
| 61 | } | ||
| 62 | |||
| 63 | printf("des %d %d (%d)\n", | ||
| 64 | e1-s1,e2-s2,((e2-s2)-(e1-s1))); | ||
| 65 | } | ||
| 66 | } | ||
| 67 | |||
