summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClemens Lang <cllang@redhat.com>2022-08-02 13:26:37 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-08-02 18:38:39 +0300
commit97e2c237f15dcdb44152887f4773f1f212b529bd (patch)
tree043de776edf5f54fe1483a6e581e6a4f04655c48 /tests
parenta8f66410ca0ded040abea4790efaeb36bb4ccc91 (diff)
downloadlibgcrypt-97e2c237f15dcdb44152887f4773f1f212b529bd.tar.gz
tests/basic: Add ifdefs for SM4 and CAMELLIA tests
* tests/basic.c (check_gcm_siv_cipher): Do not run test vectors that are known to fail when compiled without support for SM4 or CAMELLIA. -- Fixes test execution when configured --enable-ciphers excluding sm4 or camellia. Signed-off-by: Clemens Lang <cllang@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/basic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/basic.c b/tests/basic.c
index 0d03636b..26980e15 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -6160,6 +6160,7 @@ check_gcm_siv_cipher (void)
"\xee\x12\x55\x82\x25\x25\x30\xb9\xa6\xf8\x3c\x81\x36\xcd\xef",
"\xce\xc3\x13\x6c\x40\x2a\xcc\x51\xa1\xce\xb3\xed\xe8\xa6\x5b\x04",
},
+#if USE_SM4
{
GCRY_CIPHER_SM4, FLAG_NOFIPS,
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -6298,6 +6299,8 @@ check_gcm_siv_cipher (void)
"\x64\x15\x17\x55\x60\x71\xb4\xaf\xcd\xc8\x90\x25\xc8\xc8\x62",
"\xe2\x32\xda\x3a\x5a\x0e\x45\x1b\x8e\xf8\xbb\xe6\x60\x71\x81\xeb",
},
+#endif /* USE_SM4 */
+#if USE_CAMELLIA
{
GCRY_CIPHER_CAMELLIA128, FLAG_NOFIPS,
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -6564,6 +6567,7 @@ check_gcm_siv_cipher (void)
"\xfb\x92\x1d\xd1\x31\x8d\x9d\xa1\xc3\x46\x69\xfa\x71\x2c\x42",
"\xc6\x54\xf9\xf0\x22\x2c\xc3\xee\xdd\x13\x02\xb8\xe7\x5a\x2e\x7e"
}
+#endif /* USE_CAMELLIA */
};
gcry_cipher_hd_t hde, hdd;
unsigned char out[MAX_DATA_LEN * 2];