|
@@ -33,11 +33,11 @@ int file_test(void)
|
|
err = hash_filehandle(isha256, in, buf, &len);
|
|
err = hash_filehandle(isha256, in, buf, &len);
|
|
fclose(in);
|
|
fclose(in);
|
|
DO(err);
|
|
DO(err);
|
|
- DO(do_compare_testvector(buf, len, exp_sha256, 32, "hash_filehandle", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_sha256, 32, "hash_filehandle", 1);
|
|
|
|
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(hash_file(isha256, fname, buf, &len));
|
|
DO(hash_file(isha256, fname, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_sha256, 32, "hash_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_sha256, 32, "hash_file", 1);
|
|
|
|
|
|
#ifdef LTC_HMAC
|
|
#ifdef LTC_HMAC
|
|
{
|
|
{
|
|
@@ -45,7 +45,7 @@ int file_test(void)
|
|
0x8F, 0x68, 0xCF, 0xBA, 0x2E, 0xAD, 0xC4, 0x63, 0x9D, 0x7F, 0x02, 0x99, 0x8C, 0x08, 0xAC, 0xC0 };
|
|
0x8F, 0x68, 0xCF, 0xBA, 0x2E, 0xAD, 0xC4, 0x63, 0x9D, 0x7F, 0x02, 0x99, 0x8C, 0x08, 0xAC, 0xC0 };
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(hmac_file(isha256, fname, key, 32, buf, &len));
|
|
DO(hmac_file(isha256, fname, key, 32, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_hmacsha256, 32, "hmac_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_hmacsha256, 32, "hmac_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_OMAC
|
|
#ifdef LTC_OMAC
|
|
@@ -53,7 +53,7 @@ int file_test(void)
|
|
unsigned char exp_omacaes[16] = { 0x50, 0xB4, 0x6C, 0x62, 0xE9, 0xCA, 0x48, 0xFC, 0x38, 0x8D, 0xF4, 0xA2, 0x7D, 0x6A, 0x1E, 0xD8 };
|
|
unsigned char exp_omacaes[16] = { 0x50, 0xB4, 0x6C, 0x62, 0xE9, 0xCA, 0x48, 0xFC, 0x38, 0x8D, 0xF4, 0xA2, 0x7D, 0x6A, 0x1E, 0xD8 };
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(omac_file(iaes, key, 32, fname, buf, &len));
|
|
DO(omac_file(iaes, key, 32, fname, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_omacaes, 16, "omac_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_omacaes, 16, "omac_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_PMAC
|
|
#ifdef LTC_PMAC
|
|
@@ -61,7 +61,7 @@ int file_test(void)
|
|
unsigned char exp_pmacaes[16] = { 0x7D, 0x65, 0xF0, 0x75, 0x4F, 0x8D, 0xE2, 0xB0, 0xE4, 0xFA, 0x54, 0x4E, 0x45, 0x01, 0x36, 0x1B };
|
|
unsigned char exp_pmacaes[16] = { 0x7D, 0x65, 0xF0, 0x75, 0x4F, 0x8D, 0xE2, 0xB0, 0xE4, 0xFA, 0x54, 0x4E, 0x45, 0x01, 0x36, 0x1B };
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(pmac_file(iaes, key, 32, fname, buf, &len));
|
|
DO(pmac_file(iaes, key, 32, fname, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_pmacaes, 16, "pmac_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_pmacaes, 16, "pmac_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_XCBC
|
|
#ifdef LTC_XCBC
|
|
@@ -69,7 +69,7 @@ int file_test(void)
|
|
unsigned char exp_xcbcaes[16] = { 0x9C, 0x73, 0xA2, 0xD7, 0x90, 0xA5, 0x86, 0x25, 0x4D, 0x3C, 0x8A, 0x6A, 0x24, 0x6D, 0xD1, 0xAB };
|
|
unsigned char exp_xcbcaes[16] = { 0x9C, 0x73, 0xA2, 0xD7, 0x90, 0xA5, 0x86, 0x25, 0x4D, 0x3C, 0x8A, 0x6A, 0x24, 0x6D, 0xD1, 0xAB };
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(xcbc_file(iaes, key, 32, fname, buf, &len));
|
|
DO(xcbc_file(iaes, key, 32, fname, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_xcbcaes, 16, "xcbc_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_xcbcaes, 16, "xcbc_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_F9_MODE
|
|
#ifdef LTC_F9_MODE
|
|
@@ -77,7 +77,7 @@ int file_test(void)
|
|
unsigned char exp_f9aes[16] = { 0x6B, 0x6A, 0x18, 0x34, 0x13, 0x8E, 0x01, 0xEF, 0x33, 0x8E, 0x7A, 0x3F, 0x5B, 0x9A, 0xA6, 0x7A };
|
|
unsigned char exp_f9aes[16] = { 0x6B, 0x6A, 0x18, 0x34, 0x13, 0x8E, 0x01, 0xEF, 0x33, 0x8E, 0x7A, 0x3F, 0x5B, 0x9A, 0xA6, 0x7A };
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(f9_file(iaes, key, 32, fname, buf, &len));
|
|
DO(f9_file(iaes, key, 32, fname, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_f9aes, 16, "f9_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_f9aes, 16, "f9_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_POLY1305
|
|
#ifdef LTC_POLY1305
|
|
@@ -85,7 +85,7 @@ int file_test(void)
|
|
unsigned char exp_poly1305[16] = { 0xD0, 0xC7, 0xFB, 0x13, 0xA8, 0x87, 0x84, 0x23, 0x21, 0xCC, 0xA9, 0x43, 0x81, 0x18, 0x75, 0xBE };
|
|
unsigned char exp_poly1305[16] = { 0xD0, 0xC7, 0xFB, 0x13, 0xA8, 0x87, 0x84, 0x23, 0x21, 0xCC, 0xA9, 0x43, 0x81, 0x18, 0x75, 0xBE };
|
|
len = sizeof(buf);
|
|
len = sizeof(buf);
|
|
DO(poly1305_file(fname, key, 32, buf, &len));
|
|
DO(poly1305_file(fname, key, 32, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_poly1305, 16, "poly1305_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_poly1305, 16, "poly1305_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_BLAKE2SMAC
|
|
#ifdef LTC_BLAKE2SMAC
|
|
@@ -93,7 +93,7 @@ int file_test(void)
|
|
unsigned char exp_blake2smac[16] = { 0x4f, 0x94, 0x45, 0x15, 0xcd, 0xd1, 0xca, 0x02, 0x1a, 0x0c, 0x7a, 0xe4, 0x6d, 0x2f, 0xe8, 0xb3 };
|
|
unsigned char exp_blake2smac[16] = { 0x4f, 0x94, 0x45, 0x15, 0xcd, 0xd1, 0xca, 0x02, 0x1a, 0x0c, 0x7a, 0xe4, 0x6d, 0x2f, 0xe8, 0xb3 };
|
|
len = 16;
|
|
len = 16;
|
|
DO(blake2smac_file(fname, key, 32, buf, &len));
|
|
DO(blake2smac_file(fname, key, 32, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_blake2smac, 16, "exp_blake2smac_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_blake2smac, 16, "exp_blake2smac_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#ifdef LTC_BLAKE2BMAC
|
|
#ifdef LTC_BLAKE2BMAC
|
|
@@ -101,7 +101,7 @@ int file_test(void)
|
|
unsigned char exp_blake2bmac[16] = { 0xdf, 0x0e, 0x7a, 0xab, 0x96, 0x6b, 0x75, 0x4e, 0x52, 0x6a, 0x43, 0x96, 0xbd, 0xef, 0xab, 0x44 };
|
|
unsigned char exp_blake2bmac[16] = { 0xdf, 0x0e, 0x7a, 0xab, 0x96, 0x6b, 0x75, 0x4e, 0x52, 0x6a, 0x43, 0x96, 0xbd, 0xef, 0xab, 0x44 };
|
|
len = 16;
|
|
len = 16;
|
|
DO(blake2bmac_file(fname, key, 32, buf, &len));
|
|
DO(blake2bmac_file(fname, key, 32, buf, &len));
|
|
- DO(do_compare_testvector(buf, len, exp_blake2bmac, 16, "exp_blake2bmac_file", 1));
|
|
|
|
|
|
+ COMPARE_TESTVECTOR(buf, len, exp_blake2bmac, 16, "exp_blake2bmac_file", 1);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|