summaryrefslogtreecommitdiff
path: root/lib/crypto-selftests.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2020-05-30 12:53:20 +0000
committerDmitry Baryshkov <dbaryshkov@gmail.com>2020-05-30 12:53:20 +0000
commit727f7e78024854a6dc7b422e57c751ecb7013b43 (patch)
treef1eacc499b385774e775f06b2f0aad6fd76521be /lib/crypto-selftests.c
parenta7a821d78eab24b9ef84d4ec4078a223497e7e8e (diff)
parent2e0f47858fd85dbb4ffa1cd0c741b3b1ff7203fe (diff)
downloadgnutls-727f7e78024854a6dc7b422e57c751ecb7013b43.tar.gz
Merge branch 'add-aes192-gcm' into 'master'
lib: add support for AES-192-GCM See merge request gnutls/gnutls!1267
Diffstat (limited to 'lib/crypto-selftests.c')
-rw-r--r--lib/crypto-selftests.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/crypto-selftests.c b/lib/crypto-selftests.c
index f915b6d744..a589a7747c 100644
--- a/lib/crypto-selftests.c
+++ b/lib/crypto-selftests.c
@@ -141,6 +141,27 @@ const struct cipher_aead_vectors_st aes128_gcm_vectors[] = {
"\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb\x94\xfa\xe9\x5a\xe7\x12\x1a\x47"}
};
+const struct cipher_aead_vectors_st aes192_gcm_vectors[] = {
+ {
+ .compat_apis = 1,
+ STR(key, key_size,
+ "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08\xfe\xff\xe9\x92\x86\x65\x73\x1c"),
+ .auth = NULL,
+ .auth_size = 0,
+ STR(plaintext, plaintext_size,
+ "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55"),
+ .ciphertext =
+ (uint8_t *)
+ "\x39\x80\xca\x0b\x3c\x00\xe8\x41\xeb\x06\xfa\xc4\x87\x2a\x27\x57\x85\x9e\x1c\xea\xa6\xef\xd9\x84\x62\x85\x93\xb4\x0c\xa1\xe1\x9c\x7d\x77\x3d\x00\xc1\x44\xc5\x25\xac\x61\x9d\x18\xc8\x4a\x3f\x47\x18\xe2\x44\x8b\x2f\xe3\x24\xd9\xcc\xda\x27\x10\xac\xad\xe2\x56",
+ STR(iv, iv_size,
+ "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88"),
+ .tag_size = 16,
+ .tag =
+ (void *)
+ "\x99\x24\xa7\xc8\x58\x73\x36\xbf\xb1\x18\x02\x4d\xb8\x67\x4a\x14"},
+
+};
+
const struct cipher_aead_vectors_st aes256_gcm_vectors[] = {
{
.compat_apis = 1,
@@ -1984,6 +2005,9 @@ int gnutls_cipher_self_test(unsigned flags, gnutls_cipher_algorithm_t cipher)
CASE(GNUTLS_CIPHER_AES_128_GCM, test_cipher_aead,
aes128_gcm_vectors);
FALLTHROUGH;
+ CASE(GNUTLS_CIPHER_AES_192_GCM, test_cipher_aead,
+ aes192_gcm_vectors);
+ FALLTHROUGH;
CASE(GNUTLS_CIPHER_AES_256_GCM, test_cipher_aead,
aes256_gcm_vectors);
FALLTHROUGH;