summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-03-18 18:57:19 +0100
committerWerner Koch <wk@gnupg.org>2016-03-18 18:57:19 +0100
commit897ccd21b7221982806b5c024518f4e989152f14 (patch)
tree14eb21b32255c176e1cdfad843fe35edf0471eac /tests
parent9ecc2690181ba0bb44f66451a7dce2fc19965793 (diff)
downloadlibgcrypt-897ccd21b7221982806b5c024518f4e989152f14.tar.gz
Always require a 64 bit integer type
* configure.ac (available_digests_64): Merge with available_digests. (available_kdfs_64): Merge with available_kdfs. <64 bit datatype test>: Bail out if no such type is available. * src/types.h: Emit #error if no u64 can be defined. (PROPERLY_ALIGNED_TYPE): Always add u64 type. * cipher/bithelp.h: Remove all code paths which handle the case of !HAVE_U64_TYPEDEF. * cipher/bufhelp.h: Ditto. * cipher/cipher-ccm.c: Ditto. * cipher/cipher-gcm.c: Ditto. * cipher/cipher-internal.h: Ditto. * cipher/cipher.c: Ditto. * cipher/hash-common.h: Ditto. * cipher/md.c: Ditto. * cipher/poly1305.c: Ditto. * cipher/scrypt.c: Ditto. * cipher/tiger.c: Ditto. * src/g10lib.h: Ditto. * tests/basic.c: Ditto. * tests/bench-slope.c: Ditto. * tests/benchmark.c: Ditto. -- Given that SHA-2 and some other algorithms require a 64 bit type it does not make anymore sense to conditionally compile some part when the platform does not provide such a type. GnuPG-bug-id: 1815. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/basic.c2
-rw-r--r--tests/bench-slope.c4
-rw-r--r--tests/benchmark.c4
3 files changed, 0 insertions, 10 deletions
diff --git a/tests/basic.c b/tests/basic.c
index 63fbcf6b..c633ae96 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -2039,7 +2039,6 @@ check_poly1305_cipher (void)
static void
check_ccm_cipher (void)
{
-#ifdef HAVE_U64_TYPEDEF
static const struct tv
{
int algo;
@@ -2816,7 +2815,6 @@ check_ccm_cipher (void)
if (verbose)
fprintf (stderr, " Completed CCM checks.\n");
#endif
-#endif /*HAVE_U64_TYPEDEF*/
}
diff --git a/tests/bench-slope.c b/tests/bench-slope.c
index 3a2aa38e..8938f18c 100644
--- a/tests/bench-slope.c
+++ b/tests/bench-slope.c
@@ -741,7 +741,6 @@ static struct bench_ops decrypt_ops = {
};
-#ifdef HAVE_U64_TYPEDEF
static void
bench_ccm_encrypt_do_bench (struct bench_obj *obj, void *buf, size_t buflen)
{
@@ -904,7 +903,6 @@ static struct bench_ops ccm_authenticate_ops = {
&bench_encrypt_free,
&bench_ccm_authenticate_do_bench
};
-#endif /*HAVE_U64_TYPEDEF*/
static void
@@ -1167,11 +1165,9 @@ static struct bench_cipher_mode cipher_modes[] = {
{GCRY_CIPHER_MODE_OFB, "OFB dec", &decrypt_ops},
{GCRY_CIPHER_MODE_CTR, "CTR enc", &encrypt_ops},
{GCRY_CIPHER_MODE_CTR, "CTR dec", &decrypt_ops},
-#ifdef HAVE_U64_TYPEDEF
{GCRY_CIPHER_MODE_CCM, "CCM enc", &ccm_encrypt_ops},
{GCRY_CIPHER_MODE_CCM, "CCM dec", &ccm_decrypt_ops},
{GCRY_CIPHER_MODE_CCM, "CCM auth", &ccm_authenticate_ops},
-#endif
{GCRY_CIPHER_MODE_GCM, "GCM enc", &gcm_encrypt_ops},
{GCRY_CIPHER_MODE_GCM, "GCM dec", &gcm_decrypt_ops},
{GCRY_CIPHER_MODE_GCM, "GCM auth", &gcm_authenticate_ops},
diff --git a/tests/benchmark.c b/tests/benchmark.c
index 1258b81c..53b83b1b 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -724,7 +724,6 @@ mac_bench ( const char *algoname )
}
-#ifdef HAVE_U64_TYPEDEF
static void ccm_aead_init(gcry_cipher_hd_t hd, size_t buflen, int authlen)
{
const int _L = 4;
@@ -756,7 +755,6 @@ static void ccm_aead_init(gcry_cipher_hd_t hd, size_t buflen, int authlen)
exit (1);
}
}
-#endif
static void
@@ -786,10 +784,8 @@ cipher_bench ( const char *algoname )
{ GCRY_CIPHER_MODE_CFB, " CFB", 0 },
{ GCRY_CIPHER_MODE_OFB, " OFB", 0 },
{ GCRY_CIPHER_MODE_CTR, " CTR", 0 },
-#ifdef HAVE_U64_TYPEDEF
{ GCRY_CIPHER_MODE_CCM, " CCM", 0,
ccm_aead_init, GCRY_CCM_BLOCK_LEN, 8 },
-#endif
{ GCRY_CIPHER_MODE_GCM, " GCM", 0,
NULL, GCRY_GCM_BLOCK_LEN, GCRY_GCM_BLOCK_LEN },
{ GCRY_CIPHER_MODE_OCB, " OCB", 1,