summaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/crypto/aes_cbc.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-03-29 13:47:54 +0100
committerDamjan Marion <damarion@cisco.com>2019-04-07 11:19:35 +0200
commit060bfb987a277624e5644de2fcbee1196c2c76e8 (patch)
tree2ca6ccf57c09c5e016f9613b0e0e75f8e49475eb /src/plugins/unittest/crypto/aes_cbc.c
parentdc43bcd8abef2cee4eebdc94d9a82c0194ba00fb (diff)
crypto: add support for AEAD and AES-GCM
Change-Id: Iff6f81a49b9cff5522fbb4914d47472423eac5db Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/unittest/crypto/aes_cbc.c')
-rw-r--r--src/plugins/unittest/crypto/aes_cbc.c48
1 files changed, 12 insertions, 36 deletions
diff --git a/src/plugins/unittest/crypto/aes_cbc.c b/src/plugins/unittest/crypto/aes_cbc.c
index 465f91e675f..b52f728a1cb 100644
--- a/src/plugins/unittest/crypto/aes_cbc.c
+++ b/src/plugins/unittest/crypto/aes_cbc.c
@@ -54,23 +54,15 @@ static u8 ciphertext128[] = {
};
/* *INDENT-OFF* */
-UNITTEST_REGISTER_CRYPTO_TEST (nist_aes128_cbc_enc) = {
+UNITTEST_REGISTER_CRYPTO_TEST (nist_aes128_cbc) = {
.name = "NIST SP 800-38A",
- .op = VNET_CRYPTO_OP_AES_128_CBC_ENC,
+ .alg = VNET_CRYPTO_ALG_AES_128_CBC,
.iv = TEST_DATA (iv),
.key = TEST_DATA (key128),
- .data = TEST_DATA (plaintext),
- .expected = TEST_DATA (ciphertext128),
+ .plaintext = TEST_DATA (plaintext),
+ .ciphertext = TEST_DATA (ciphertext128),
};
-UNITTEST_REGISTER_CRYPTO_TEST (nist_aes128_cbc_dec) = {
- .name = "NIST SP 800-38A",
- .op = VNET_CRYPTO_OP_AES_128_CBC_DEC,
- .iv = TEST_DATA (iv),
- .key = TEST_DATA (key128),
- .data = TEST_DATA (ciphertext128),
- .expected = TEST_DATA (plaintext),
-};
/* *INDENT-ON* */
static u8 key192[24] = {
@@ -91,23 +83,15 @@ static u8 ciphertext192[64] = {
};
/* *INDENT-OFF* */
-UNITTEST_REGISTER_CRYPTO_TEST (nist_aes192_cbc_enc) = {
+UNITTEST_REGISTER_CRYPTO_TEST (nist_aes192_cbc) = {
.name = "NIST SP 800-38A",
- .op = VNET_CRYPTO_OP_AES_192_CBC_ENC,
+ .alg = VNET_CRYPTO_ALG_AES_192_CBC,
.iv = TEST_DATA (iv),
.key = TEST_DATA (key192),
- .data = TEST_DATA (plaintext),
- .expected = TEST_DATA (ciphertext192),
+ .plaintext = TEST_DATA (plaintext),
+ .ciphertext = TEST_DATA (ciphertext192),
};
-UNITTEST_REGISTER_CRYPTO_TEST (nist_aes192_cbc_dec) = {
- .name = "NIST SP 800-38A",
- .op = VNET_CRYPTO_OP_AES_192_CBC_DEC,
- .iv = TEST_DATA (iv),
- .key = TEST_DATA (key192),
- .data = TEST_DATA (ciphertext192),
- .expected = TEST_DATA (plaintext),
-};
/* *INDENT-ON* */
static u8 key256[32] = {
@@ -129,23 +113,15 @@ static u8 ciphertext256[64] = {
};
/* *INDENT-OFF* */
-UNITTEST_REGISTER_CRYPTO_TEST (nist_aes256_cbc_enc) = {
+UNITTEST_REGISTER_CRYPTO_TEST (nist_aes256_cbc) = {
.name = "NIST SP 800-38A",
- .op = VNET_CRYPTO_OP_AES_256_CBC_ENC,
+ .alg = VNET_CRYPTO_ALG_AES_256_CBC,
.iv = TEST_DATA (iv),
.key = TEST_DATA (key256),
- .data = TEST_DATA (plaintext),
- .expected = TEST_DATA (ciphertext256),
+ .plaintext = TEST_DATA (plaintext),
+ .ciphertext = TEST_DATA (ciphertext256),
};
-UNITTEST_REGISTER_CRYPTO_TEST (nist_aes256_cbc_dec) = {
- .name = "NIST SP 800-38A",
- .op = VNET_CRYPTO_OP_AES_256_CBC_DEC,
- .iv = TEST_DATA (iv),
- .key = TEST_DATA (key256),
- .data = TEST_DATA (ciphertext256),
- .expected = TEST_DATA (plaintext),
-};
/* *INDENT-ON* */
/*