The experimental Rijndael code moved to the main trunk.
[openssl.git] / crypto / hmac / hmactest.c
index 13b394634820aba5f6e0b39b3e628c663a12c7ab..4b56b8ee135564499bb701dab5fce1af7704dfb8 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include "hmac.h"
 
-struct test_st
+#ifdef NO_HMAC
+int main(int argc, char *argv[])
+{
+    printf("No HMAC support\n");
+    return(0);
+}
+#else
+#include <openssl/hmac.h>
+
+#ifdef CHARSET_EBCDIC
+#include <openssl/ebcdic.h>
+#endif
+
+static struct test_st
        {
        unsigned char key[16];
        int key_len;
@@ -102,17 +114,19 @@ struct test_st
        };
 
 
-#ifndef NOPROTO
 static char *pt(unsigned char *md);
-#else
-static char *pt();
-#endif
-
 int main(int argc, char *argv[])
        {
        int i,err=0;
        char *p;
 
+#ifdef CHARSET_EBCDIC
+       ebcdic2ascii(test[0].data, test[0].data, test[0].data_len);
+       ebcdic2ascii(test[1].data, test[1].data, test[1].data_len);
+       ebcdic2ascii(test[2].key,  test[2].key,  test[2].key_len);
+       ebcdic2ascii(test[2].data, test[2].data, test[2].data_len);
+#endif
+
        for (i=0; i<4; i++)
                {
                p=pt(HMAC(EVP_md5(),
@@ -142,3 +156,4 @@ static char *pt(unsigned char *md)
                sprintf(&(buf[i*2]),"%02x",md[i]);
        return(buf);
        }
+#endif