Loading test/bftest.c +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) # include <openssl/ebcdic.h> # endif static char *bf_key[2] = { static char bf_key[2][30] = { "abcdefghijklmnopqrstuvwxyz", "Who is John Galt?" }; Loading test/mdc2test.c +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) unsigned char md[MDC2_DIGEST_LENGTH]; int i; EVP_MD_CTX *c; static char *text = "Now is the time for all "; static char text[30] = "Now is the time for all "; # ifdef CHARSET_EBCDIC ebcdic2ascii(text, text, strlen(text)); Loading test/rmdtest.c +18 −20 Original line number Diff line number Diff line Loading @@ -75,16 +75,15 @@ int main(int argc, char *argv[]) # include <openssl/ebcdic.h> # endif static char *test[] = { "", "a", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "12345678901234567890123456789012345678901234567890123456789012345678901234567890", NULL, static char test[][100] = { { "" }, { "a" }, { "abc" }, { "message digest" }, { "abcdefghijklmnopqrstuvwxyz" }, { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, { "12345678901234567890123456789012345678901234567890123456789012345678901234567890" } }; static char *ret[] = { Loading @@ -101,30 +100,29 @@ static char *ret[] = { static char *pt(unsigned char *md); int main(int argc, char *argv[]) { int i, err = 0; char **P, **R; unsigned int i; int err = 0; char **R; char *p; unsigned char md[RIPEMD160_DIGEST_LENGTH]; P = test; R = ret; i = 1; while (*P != NULL) { i = 0; while (i < OSSL_NELEM(test)) { # ifdef CHARSET_EBCDIC ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P)); ebcdic2ascii(test[i], test[i], strlen(test[i])); # endif EVP_Digest(&(P[0][0]), strlen((char *)*P), md, NULL, EVP_ripemd160(), EVP_Digest(test[i], strlen(test[i]), md, NULL, EVP_ripemd160(), NULL); p = pt(md); if (strcmp(p, (char *)*R) != 0) { printf("error calculating RIPEMD160 on '%s'\n", *P); printf("error calculating RIPEMD160 on '%s'\n", test[i]); printf("got %s instead of %s\n", p, *R); err++; } else printf("test %d ok\n", i); printf("test %d ok\n", i + 1); i++; R++; P++; } EXIT(err); } Loading test/sha1test.c +14 −18 Original line number Diff line number Diff line Loading @@ -67,10 +67,9 @@ # include <openssl/ebcdic.h> #endif static char *test[] = { "abc", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", NULL, static char test[][80] = { { "abc" }, { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" } }; static char *ret[] = { Loading @@ -83,34 +82,31 @@ static char *bigret = "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; static char *pt(unsigned char *md); int main(int argc, char *argv[]) { int i, err = 0; char **P, **R; unsigned int i; int err = 0; char **R; static unsigned char buf[1000]; char *p, *r; EVP_MD_CTX *c; unsigned char md[SHA_DIGEST_LENGTH]; #ifdef CHARSET_EBCDIC ebcdic2ascii(test[0], test[0], strlen(test[0])); ebcdic2ascii(test[1], test[1], strlen(test[1])); #endif c = EVP_MD_CTX_new(); P = test; R = ret; i = 1; while (*P != NULL) { EVP_Digest(*P, strlen((char *)*P), md, NULL, EVP_sha1(), NULL); i = 0; while (i < OSSL_NELEM(test)) { # ifdef CHARSET_EBCDIC ebcdic2ascii(test[i], test[i], strlen(test[i])); # endif EVP_Digest(test[i], strlen(test[i]), md, NULL, EVP_sha1(), NULL); p = pt(md); if (strcmp(p, (char *)*R) != 0) { printf("error calculating SHA1 on '%s'\n", *P); printf("error calculating SHA1 on '%s'\n", test[i]); printf("got %s instead of %s\n", p, *R); err++; } else printf("test %d ok\n", i); printf("test %d ok\n", i + 1); i++; R++; P++; } memset(buf, 'a', 1000); Loading Loading
test/bftest.c +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) # include <openssl/ebcdic.h> # endif static char *bf_key[2] = { static char bf_key[2][30] = { "abcdefghijklmnopqrstuvwxyz", "Who is John Galt?" }; Loading
test/mdc2test.c +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) unsigned char md[MDC2_DIGEST_LENGTH]; int i; EVP_MD_CTX *c; static char *text = "Now is the time for all "; static char text[30] = "Now is the time for all "; # ifdef CHARSET_EBCDIC ebcdic2ascii(text, text, strlen(text)); Loading
test/rmdtest.c +18 −20 Original line number Diff line number Diff line Loading @@ -75,16 +75,15 @@ int main(int argc, char *argv[]) # include <openssl/ebcdic.h> # endif static char *test[] = { "", "a", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "12345678901234567890123456789012345678901234567890123456789012345678901234567890", NULL, static char test[][100] = { { "" }, { "a" }, { "abc" }, { "message digest" }, { "abcdefghijklmnopqrstuvwxyz" }, { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, { "12345678901234567890123456789012345678901234567890123456789012345678901234567890" } }; static char *ret[] = { Loading @@ -101,30 +100,29 @@ static char *ret[] = { static char *pt(unsigned char *md); int main(int argc, char *argv[]) { int i, err = 0; char **P, **R; unsigned int i; int err = 0; char **R; char *p; unsigned char md[RIPEMD160_DIGEST_LENGTH]; P = test; R = ret; i = 1; while (*P != NULL) { i = 0; while (i < OSSL_NELEM(test)) { # ifdef CHARSET_EBCDIC ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P)); ebcdic2ascii(test[i], test[i], strlen(test[i])); # endif EVP_Digest(&(P[0][0]), strlen((char *)*P), md, NULL, EVP_ripemd160(), EVP_Digest(test[i], strlen(test[i]), md, NULL, EVP_ripemd160(), NULL); p = pt(md); if (strcmp(p, (char *)*R) != 0) { printf("error calculating RIPEMD160 on '%s'\n", *P); printf("error calculating RIPEMD160 on '%s'\n", test[i]); printf("got %s instead of %s\n", p, *R); err++; } else printf("test %d ok\n", i); printf("test %d ok\n", i + 1); i++; R++; P++; } EXIT(err); } Loading
test/sha1test.c +14 −18 Original line number Diff line number Diff line Loading @@ -67,10 +67,9 @@ # include <openssl/ebcdic.h> #endif static char *test[] = { "abc", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", NULL, static char test[][80] = { { "abc" }, { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" } }; static char *ret[] = { Loading @@ -83,34 +82,31 @@ static char *bigret = "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; static char *pt(unsigned char *md); int main(int argc, char *argv[]) { int i, err = 0; char **P, **R; unsigned int i; int err = 0; char **R; static unsigned char buf[1000]; char *p, *r; EVP_MD_CTX *c; unsigned char md[SHA_DIGEST_LENGTH]; #ifdef CHARSET_EBCDIC ebcdic2ascii(test[0], test[0], strlen(test[0])); ebcdic2ascii(test[1], test[1], strlen(test[1])); #endif c = EVP_MD_CTX_new(); P = test; R = ret; i = 1; while (*P != NULL) { EVP_Digest(*P, strlen((char *)*P), md, NULL, EVP_sha1(), NULL); i = 0; while (i < OSSL_NELEM(test)) { # ifdef CHARSET_EBCDIC ebcdic2ascii(test[i], test[i], strlen(test[i])); # endif EVP_Digest(test[i], strlen(test[i]), md, NULL, EVP_sha1(), NULL); p = pt(md); if (strcmp(p, (char *)*R) != 0) { printf("error calculating SHA1 on '%s'\n", *P); printf("error calculating SHA1 on '%s'\n", test[i]); printf("got %s instead of %s\n", p, *R); err++; } else printf("test %d ok\n", i); printf("test %d ok\n", i + 1); i++; R++; P++; } memset(buf, 'a', 1000); Loading