diff options
| author | markus <> | 2002-09-05 12:51:52 +0000 |
|---|---|---|
| committer | markus <> | 2002-09-05 12:51:52 +0000 |
| commit | 5514995a9d5ed91db089875adb509c7781357c0e (patch) | |
| tree | 2484410a46ba6c05ef94c253da36fbceef990b64 /src/lib/libcrypto/rc2/rc2test.c | |
| parent | fd9566423b542798f5c8b06e68101a9ea5bb9885 (diff) | |
| download | openbsd-5514995a9d5ed91db089875adb509c7781357c0e.tar.gz openbsd-5514995a9d5ed91db089875adb509c7781357c0e.tar.bz2 openbsd-5514995a9d5ed91db089875adb509c7781357c0e.zip | |
import openssl-0.9.7-beta1
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/rc2/rc2test.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/lib/libcrypto/rc2/rc2test.c b/src/lib/libcrypto/rc2/rc2test.c index 9d0f8016ec..d9a2a0a1cb 100644 --- a/src/lib/libcrypto/rc2/rc2test.c +++ b/src/lib/libcrypto/rc2/rc2test.c | |||
| @@ -62,9 +62,17 @@ | |||
| 62 | #include <stdio.h> | 62 | #include <stdio.h> |
| 63 | #include <string.h> | 63 | #include <string.h> |
| 64 | #include <stdlib.h> | 64 | #include <stdlib.h> |
| 65 | #include "rc2.h" | ||
| 66 | 65 | ||
| 67 | unsigned char RC2key[4][16]={ | 66 | #ifdef OPENSSL_NO_RC2 |
| 67 | int main(int argc, char *argv[]) | ||
| 68 | { | ||
| 69 | printf("No RC2 support\n"); | ||
| 70 | return(0); | ||
| 71 | } | ||
| 72 | #else | ||
| 73 | #include <openssl/rc2.h> | ||
| 74 | |||
| 75 | static unsigned char RC2key[4][16]={ | ||
| 68 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | 76 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 69 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, | 77 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, |
| 70 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | 78 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| @@ -75,14 +83,14 @@ unsigned char RC2key[4][16]={ | |||
| 75 | 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}, | 83 | 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}, |
| 76 | }; | 84 | }; |
| 77 | 85 | ||
| 78 | unsigned char RC2plain[4][8]={ | 86 | static unsigned char RC2plain[4][8]={ |
| 79 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, | 87 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, |
| 80 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, | 88 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, |
| 81 | {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, | 89 | {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, |
| 82 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, | 90 | {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, |
| 83 | }; | 91 | }; |
| 84 | 92 | ||
| 85 | unsigned char RC2cipher[4][8]={ | 93 | static unsigned char RC2cipher[4][8]={ |
| 86 | {0x1C,0x19,0x8A,0x83,0x8D,0xF0,0x28,0xB7}, | 94 | {0x1C,0x19,0x8A,0x83,0x8D,0xF0,0x28,0xB7}, |
| 87 | {0x21,0x82,0x9C,0x78,0xA9,0xF9,0xC0,0x74}, | 95 | {0x21,0x82,0x9C,0x78,0xA9,0xF9,0xC0,0x74}, |
| 88 | {0x13,0xDB,0x35,0x17,0xD3,0x21,0x86,0x9E}, | 96 | {0x13,0xDB,0x35,0x17,0xD3,0x21,0x86,0x9E}, |
| @@ -125,19 +133,11 @@ static unsigned char cfb_cipher64[CFB_TEST_SIZE]={ | |||
| 125 | }; | 133 | }; |
| 126 | 134 | ||
| 127 | 135 | ||
| 128 | #ifndef NOPROTO | ||
| 129 | /*static int cfb64_test(unsigned char *cfb_cipher);*/ | 136 | /*static int cfb64_test(unsigned char *cfb_cipher);*/ |
| 130 | static char *pt(unsigned char *p); | 137 | static char *pt(unsigned char *p); |
| 131 | #else | ||
| 132 | /*static int cfb64_test(); */ | ||
| 133 | static char *pt(); | ||
| 134 | #endif | 138 | #endif |
| 135 | 139 | ||
| 136 | #endif | 140 | int main(int argc, char *argv[]) |
| 137 | |||
| 138 | int main(argc,argv) | ||
| 139 | int argc; | ||
| 140 | char *argv[]; | ||
| 141 | { | 141 | { |
| 142 | int i,n,err=0; | 142 | int i,n,err=0; |
| 143 | RC2_KEY key; | 143 | RC2_KEY key; |
| @@ -208,8 +208,7 @@ char *argv[]; | |||
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | #ifdef undef | 210 | #ifdef undef |
| 211 | static int cfb64_test(cfb_cipher) | 211 | static int cfb64_test(unsigned char *cfb_cipher) |
| 212 | unsigned char *cfb_cipher; | ||
| 213 | { | 212 | { |
| 214 | IDEA_KEY_SCHEDULE eks,dks; | 213 | IDEA_KEY_SCHEDULE eks,dks; |
| 215 | int err=0,i,n; | 214 | int err=0,i,n; |
| @@ -247,8 +246,7 @@ unsigned char *cfb_cipher; | |||
| 247 | return(err); | 246 | return(err); |
| 248 | } | 247 | } |
| 249 | 248 | ||
| 250 | static char *pt(p) | 249 | static char *pt(unsigned char *p) |
| 251 | unsigned char *p; | ||
| 252 | { | 250 | { |
| 253 | static char bufs[10][20]; | 251 | static char bufs[10][20]; |
| 254 | static int bnum=0; | 252 | static int bnum=0; |
| @@ -268,3 +266,4 @@ unsigned char *p; | |||
| 268 | } | 266 | } |
| 269 | 267 | ||
| 270 | #endif | 268 | #endif |
| 269 | #endif | ||
