diff options
author | 2006-07-11 11:57:11 +0000 | |
---|---|---|
committer | 2006-07-11 11:57:11 +0000 | |
commit | 1205ea5f9792e62ac10c82824a29ed64f9793143 (patch) | |
tree | 860982fc54dea2403b3da01fd6f64c5fee6d4e56 | |
parent | 1b35564dcf300e1a007d14529996286b538b5f81 (diff) |
Cast des litteraux de chaine en unsigned char *
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@48 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r-- | test/harness/mainaes.c | 20 | ||||
-rw-r--r-- | test/harness/mainsha1.c | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/test/harness/mainaes.c b/test/harness/mainaes.c index 82c9c0d..7c658c7 100644 --- a/test/harness/mainaes.c +++ b/test/harness/mainaes.c @@ -705,7 +705,7 @@ static void do_bench(int nblocks) u8 temp[16]; int nr; - nr = rijndaelKeySetupEnc(ckey, "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", 128); + nr = rijndaelKeySetupEnc(ckey, (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", 128); for (; nblocks > 0; nblocks--) rijndaelEncrypt(ckey, nr, temp, temp); } @@ -714,19 +714,19 @@ int main(int argc, char ** argv) { if (argc < 2) { do_test(128, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", - "\x69\xC4\xE0\xD8\x6A\x7B\x04\x30\xD8\xCD\xB7\x80\x70\xB4\xC5\x5A", + (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", + (u8 *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", + (u8 *)"\x69\xC4\xE0\xD8\x6A\x7B\x04\x30\xD8\xCD\xB7\x80\x70\xB4\xC5\x5A", 1, 2); do_test(192, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17", - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", - "\xDD\xA9\x7C\xA4\x86\x4C\xDF\xE0\x6E\xAF\x70\xA0\xEC\x0D\x71\x91", + (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17", + (u8 *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", + (u8 *)"\xDD\xA9\x7C\xA4\x86\x4C\xDF\xE0\x6E\xAF\x70\xA0\xEC\x0D\x71\x91", 3, 4); do_test(256, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", - "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", - "\x8E\xA2\xB7\xCA\x51\x67\x45\xBF\xEA\xFC\x49\x90\x4B\x49\x60\x89", + (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", + (u8 *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", + (u8 *)"\x8E\xA2\xB7\xCA\x51\x67\x45\xBF\xEA\xFC\x49\x90\x4B\x49\x60\x89", 5, 6); } else { do_bench(atoi(argv[1])); diff --git a/test/harness/mainsha1.c b/test/harness/mainsha1.c index 2364076..845a46a 100644 --- a/test/harness/mainsha1.c +++ b/test/harness/mainsha1.c @@ -39,12 +39,12 @@ static void do_test(unsigned char * txt, unsigned char * expected_output) * 8498 3E44 1C3B D26E BAAE 4AA1 F951 29E5 E546 70F1 */ -unsigned char * test_input_1 = "abc"; +unsigned char * test_input_1 = (unsigned char *) "abc"; unsigned char test_output_1[20] = { 0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, 0xBA, 0x3E , 0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C, 0x9C, 0xD0, 0xD8, 0x9D }; -unsigned char * test_input_2 = +unsigned char * test_input_2 = (unsigned char *) "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; unsigned char test_output_2[20] = { 0x84, 0x98, 0x3E, 0x44, 0x1C, 0x3B, 0xD2, 0x6E, 0xBA, 0xAE, |