Fix eckey_priv_encode()
[openssl.git] / crypto / rc5 / rc5test.c
index 14c321d7b8592e908a5a85dfe2bc108d1e4be010..ce3d0cc16f322e1ef346b0d898eeb4d77d48d0ca 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include "rc5.h"
 
-unsigned char RC5key[5][16]={
+#include "../e_os.h"
+
+#ifdef OPENSSL_NO_RC5
+int main(int argc, char *argv[])
+{
+    printf("No RC5 support\n");
+    return(0);
+}
+#else
+#include <openssl/rc5.h>
+
+static unsigned char RC5key[5][16]={
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
        {0x91,0x5f,0x46,0x19,0xbe,0x41,0xb2,0x51,
@@ -77,7 +87,7 @@ unsigned char RC5key[5][16]={
         0x24,0x97,0x57,0x4d,0x7f,0x15,0x31,0x25},
        };
 
-unsigned char RC5plain[5][8]={
+static unsigned char RC5plain[5][8]={
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
        {0x21,0xA5,0xDB,0xEE,0x15,0x4B,0x8F,0x6D},
        {0xF7,0xC0,0x13,0xAC,0x5B,0x2B,0x89,0x52},
@@ -85,7 +95,7 @@ unsigned char RC5plain[5][8]={
        {0x65,0xC1,0x78,0xB2,0x84,0xD1,0x97,0xCC},
        };
 
-unsigned char RC5cipher[5][8]={
+static unsigned char RC5cipher[5][8]={
        {0x21,0xA5,0xDB,0xEE,0x15,0x4B,0x8F,0x6D},
        {0xF7,0xC0,0x13,0xAC,0x5B,0x2B,0x89,0x52},
        {0x2F,0x42,0xB3,0xB7,0x03,0x69,0xFC,0x92},
@@ -94,7 +104,7 @@ unsigned char RC5cipher[5][8]={
        };
 
 #define RC5_CBC_NUM 27
-unsigned char rc5_cbc_cipher[RC5_CBC_NUM][8]={
+static unsigned char rc5_cbc_cipher[RC5_CBC_NUM][8]={
        {0x7a,0x7b,0xba,0x4d,0x79,0x11,0x1d,0x1e},
        {0x79,0x7b,0xba,0x4d,0x78,0x11,0x1d,0x1e},
        {0x7a,0x7b,0xba,0x4d,0x79,0x11,0x1d,0x1f},
@@ -124,7 +134,7 @@ unsigned char rc5_cbc_cipher[RC5_CBC_NUM][8]={
        {0x7f,0xd1,0xa0,0x23,0xa5,0xbb,0xa2,0x17},
        };
 
-unsigned char rc5_cbc_key[RC5_CBC_NUM][17]={
+static unsigned char rc5_cbc_key[RC5_CBC_NUM][17]={
        { 1,0x00},
        { 1,0x00},
        { 1,0x00},
@@ -157,7 +167,7 @@ unsigned char rc5_cbc_key[RC5_CBC_NUM][17]={
        { 5,0x01,0x02,0x03,0x04,0x05},
        };
 
-unsigned char rc5_cbc_plain[RC5_CBC_NUM][8]={
+static unsigned char rc5_cbc_plain[RC5_CBC_NUM][8]={
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
        {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
@@ -187,14 +197,14 @@ unsigned char rc5_cbc_plain[RC5_CBC_NUM][8]={
        {0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x01},
        };
 
-int rc5_cbc_rounds[RC5_CBC_NUM]={
+static int rc5_cbc_rounds[RC5_CBC_NUM]={
         0, 0, 0, 0, 0, 1, 2, 2,
         8, 8,12,16, 8,12,16,12,
         8,12,16, 8,12,16,12, 8,
         8, 8, 8,
        };
 
-unsigned char rc5_cbc_iv[RC5_CBC_NUM][8]={
+static unsigned char rc5_cbc_iv[RC5_CBC_NUM][8]={
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01},
@@ -224,9 +234,7 @@ unsigned char rc5_cbc_iv[RC5_CBC_NUM][8]={
        {0x7c,0xb3,0xf1,0xdf,0x34,0xf9,0x48,0x11},
        };
 
-int main(argc,argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
        {
        int i,n,err=0;
        RC5_32_KEY key; 
@@ -312,13 +320,12 @@ char *argv[];
                }
        if (err == 0) printf("cbc RC5 ok\n");
 
-       exit(err);
+       EXIT(err);
        return(err);
        }
 
 #ifdef undef
-static int cfb64_test(cfb_cipher)
-unsigned char *cfb_cipher;
+static int cfb64_test(unsigned char *cfb_cipher)
         {
         IDEA_KEY_SCHEDULE eks,dks;
         int err=0,i,n;
@@ -356,8 +363,7 @@ unsigned char *cfb_cipher;
         return(err);
         }
 
-static char *pt(p)
-unsigned char *p;
+static char *pt(unsigned char *p)
        {
        static char bufs[10][20];
        static int bnum=0;
@@ -377,3 +383,4 @@ unsigned char *p;
        }
        
 #endif
+#endif