diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2019-07-03 09:04:54 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-02-18 22:55:24 +0000 |
commit | a9075dcf65c14f1269faad4ba0e2ed9b06dd3140 (patch) | |
tree | 53557a600ff1224724f7cf37ea43c9c980f5627b /src/plugins/unittest/crypto/aes_gcm.c | |
parent | dd398c6c5cbf388e912de33dbe63a441fa1e0886 (diff) |
crypto: add support for testing quad loops in crypto algos
This patch adds support for test cases with arbitrary long plaintext.
Type: feature
Change-Id: I48cd3642e30cc49eabc196c45d7f73c484e93057
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/unittest/crypto/aes_gcm.c')
-rw-r--r-- | src/plugins/unittest/crypto/aes_gcm.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/plugins/unittest/crypto/aes_gcm.c b/src/plugins/unittest/crypto/aes_gcm.c index 764ca9e97c5..3d1b221bf32 100644 --- a/src/plugins/unittest/crypto/aes_gcm.c +++ b/src/plugins/unittest/crypto/aes_gcm.c @@ -264,6 +264,60 @@ UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_tc4_chain) = { TEST_DATA_CHUNK (tc4_ciphertext256, 40, 20), }, }; + +UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_inc_1024) = { + .name = "256-GCM (incr 1024 B)", + .alg = VNET_CRYPTO_ALG_AES_256_GCM, + .plaintext_incremental = 1024, + .key.length = 32, + .aad.length = 20, + .tag.length = 16, +}; + +UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_inc1) = { + .name = "256-GCM (incr 1056 B)", + .alg = VNET_CRYPTO_ALG_AES_256_GCM, + .plaintext_incremental = 1024 + 32, + .key.length = 32, + .aad.length = 20, + .tag.length = 16, +}; + +UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_inc2) = { + .name = "256-GCM (incr 1042 B)", + .alg = VNET_CRYPTO_ALG_AES_256_GCM, + .plaintext_incremental = 1024 + 8, + .key.length = 32, + .aad.length = 20, + .tag.length = 16, +}; + +UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_inc3) = { + .name = "256-GCM (incr 1025 B)", + .alg = VNET_CRYPTO_ALG_AES_256_GCM, + .plaintext_incremental = 1024 + 1, + .key.length = 32, + .aad.length = 20, + .tag.length = 16, +}; + +UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_inc4) = { + .name = "256-GCM (incr 1009 B)", + .alg = VNET_CRYPTO_ALG_AES_256_GCM, + .plaintext_incremental = 1024 - 15, + .key.length = 32, + .aad.length = 20, + .tag.length = 16, +}; + +UNITTEST_REGISTER_CRYPTO_TEST (aes_gcm256_inc5) = { + .name = "256-GCM (incr 1008)", + .alg = VNET_CRYPTO_ALG_AES_256_GCM, + .plaintext_incremental = 1024 - 16, + .key.length = 32, + .aad.length = 20, + .tag.length = 16, +}; /* *INDENT-ON* */ /* |