forked from wolfSSL/wolfssl
account for testing on big endian system
This commit is contained in:
42
tests/api.c
42
tests/api.c
@ -15524,7 +15524,7 @@ static int test_wc_RabbitSetKey (void)
|
||||
static int test_wc_RabbitProcess (void)
|
||||
{
|
||||
int ret = 0;
|
||||
#ifndef NO_RABBIT
|
||||
#if !defined(NO_RABBIT) && !defined(BIG_ENDIAN_ORDER)
|
||||
Rabbit enc, dec;
|
||||
byte cipher[25];
|
||||
byte plain[25];
|
||||
@ -36232,10 +36232,17 @@ static void test_wolfSSL_MD5_Transform(void)
|
||||
byte input2[] = "abc";
|
||||
byte local[WC_MD5_BLOCK_SIZE];
|
||||
word32 sLen = 0;
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
unsigned char output1[] =
|
||||
"\x03\x1f\x1d\xac\x6e\xa5\x8e\xd0\x1f\xab\x67\xb7\x74\x31\x77\x91";
|
||||
unsigned char output2[] =
|
||||
"\xef\xd3\x79\x8d\x67\x17\x25\x90\xa4\x13\x79\xc7\xe3\xa7\x7b\xbc";
|
||||
#else
|
||||
unsigned char output1[] =
|
||||
"\xac\x1d\x1f\x03\xd0\x8e\xa5\x6e\xb7\x67\xab\x1f\x91\x77\x31\x74";
|
||||
unsigned char output2[] =
|
||||
"\x8d\x79\xd3\xef\x90\x25\x17\x67\xc7\x79\x13\xa4\xbc\x7b\xa7\xe3";
|
||||
#endif
|
||||
|
||||
MD5_CTX md5;
|
||||
|
||||
@ -36314,12 +36321,21 @@ static void test_wolfSSL_SHA_Transform(void)
|
||||
byte input2[] = "abc";
|
||||
byte local[WC_SHA_BLOCK_SIZE];
|
||||
word32 sLen = 0;
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
unsigned char output1[] =
|
||||
"\x92\xb4\x04\xe5\x56\x58\x8c\xed\x6c\x1a\xcd\x4e\xbf\x05\x3f\x68"
|
||||
"\x09\xf7\x3a\x93";
|
||||
unsigned char output2[] =
|
||||
"\x97\xb2\x74\x8b\x4f\x5b\xbc\xca\x5b\xc0\xe6\xea\x2d\x40\xb4\xa0"
|
||||
"\x7c\x6e\x08\xb8";
|
||||
#else
|
||||
unsigned char output1[] =
|
||||
"\xe5\x04\xb4\x92\xed\x8c\x58\x56\x4e\xcd\x1a\x6c\x68\x3f\x05\xbf"
|
||||
"\x93\x3a\xf7\x09";
|
||||
unsigned char output2[] =
|
||||
"\x8b\x74\xb2\x97\xca\xbc\x5b\x4f\xea\xe6\xc0\x5b\xa0\xb4\x40\x2d"
|
||||
"\xb8\x08\x6e\x7c";
|
||||
#endif
|
||||
|
||||
SHA_CTX sha;
|
||||
SHA_CTX sha1;
|
||||
@ -36389,13 +36405,21 @@ static void test_wolfSSL_SHA256_Transform(void)
|
||||
byte input2[] = "abc";
|
||||
byte local[WC_SHA256_BLOCK_SIZE];
|
||||
word32 sLen = 0;
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
unsigned char output1[] =
|
||||
"\xda\x56\x98\xbe\x17\xb9\xb4\x69\x62\x33\x57\x99\x77\x9f\xbe\xca"
|
||||
"\x8c\xe5\xd4\x91\xc0\xd2\x62\x43\xba\xfe\xf9\xea\x18\x37\xa9\xd8";
|
||||
unsigned char output2[] =
|
||||
"\x1d\x4e\xd4\x67\x67\x7c\x61\x67\x44\x10\x76\x26\x78\x10\xff\xb8"
|
||||
"\x40\xc8\x9a\x39\x73\x16\x60\x8c\xa6\x61\xd6\x05\x91\xf2\x8c\x35";
|
||||
#else
|
||||
unsigned char output1[] =
|
||||
"\xbe\x98\x56\xda\x69\xb4\xb9\x17\x99\x57\x33\x62\xca\xbe\x9f\x77"
|
||||
"\x91\xd4\xe5\x8c\x43\x62\xd2\xc0\xea\xf9\xfe\xba\xd8\xa9\x37\x18";
|
||||
unsigned char output2[] =
|
||||
"\x67\xd4\x4e\x1d\x67\x61\x7c\x67\x26\x76\x10\x44\xb8\xff\x10\x78"
|
||||
"\x39\x9a\xc8\x40\x8c\x60\x16\x73\x05\xd6\x61\xa6\x35\x8c\xf2\x91";
|
||||
|
||||
#endif
|
||||
SHA256_CTX sha256;
|
||||
|
||||
printf(testingFmt, "wolfSSL_SHA256_Transform()");
|
||||
@ -36467,6 +36491,18 @@ static void test_wolfSSL_SHA512_Transform(void)
|
||||
byte input2[] = "abc";
|
||||
byte local[WC_SHA512_BLOCK_SIZE];
|
||||
word32 sLen = 0;
|
||||
#ifdef BIG_ENDIAN_ORDER
|
||||
unsigned char output1[] =
|
||||
"\xcf\x78\x81\xd5\x77\x4a\xcb\xe8\x53\x33\x62\xe0\xfb\xc7\x80\x70"
|
||||
"\x02\x67\x63\x9d\x87\x46\x0e\xda\x30\x86\xcb\x40\xe8\x59\x31\xb0"
|
||||
"\x71\x7d\xc9\x52\x88\xa0\x23\xa3\x96\xba\xb2\xc1\x4c\xe0\xb5\xe0"
|
||||
"\x6f\xc4\xfe\x04\xea\xe3\x3e\x0b\x91\xf4\xd8\x0c\xbd\x66\x8b\xee";
|
||||
unsigned char output2[] =
|
||||
"\x11\x10\x93\x4e\xeb\xa0\xcc\x0d\xfd\x33\x43\x9c\xfb\x04\xc8\x21"
|
||||
"\xa9\xb4\x26\x3d\xca\xab\x31\x41\xe2\xc6\xaa\xaf\xe1\x67\xd7\xab"
|
||||
"\x31\x8f\x2e\x54\x2c\xba\x4e\x83\xbe\x88\xec\x9d\x8f\x2b\x38\x98"
|
||||
"\x14\xd2\x4e\x9d\x53\x8b\x5e\x4d\xde\x68\x6c\x69\xaf\x20\x96\xf0";
|
||||
#else
|
||||
unsigned char output1[] =
|
||||
"\xe8\xcb\x4a\x77\xd5\x81\x78\xcf\x70\x80\xc7\xfb\xe0\x62\x33\x53"
|
||||
"\xda\x0e\x46\x87\x9d\x63\x67\x02\xb0\x31\x59\xe8\x40\xcb\x86\x30"
|
||||
@ -36477,7 +36513,7 @@ static void test_wolfSSL_SHA512_Transform(void)
|
||||
"\x41\x31\xab\xca\x3d\x26\xb4\xa9\xab\xd7\x67\xe1\xaf\xaa\xc6\xe2"
|
||||
"\x83\x4e\xba\x2c\x54\x2e\x8f\x31\x98\x38\x2b\x8f\x9d\xec\x88\xbe"
|
||||
"\x4d\x5e\x8b\x53\x9d\x4e\xd2\x14\xf0\x96\x20\xaf\x69\x6c\x68\xde";
|
||||
|
||||
#endif
|
||||
SHA512_CTX sha512;
|
||||
|
||||
printf(testingFmt, "wolfSSL_SHA512_Transform()");
|
||||
|
Reference in New Issue
Block a user