Fix issues when AES support was added for the STM32L1. From Juha Niskanen

This commit is contained in:
Gregory Nutt
2015-03-04 06:38:03 -06:00
parent 2fc99df452
commit cb5cb96bc9
4 changed files with 32 additions and 18 deletions
+17 -3
View File
@@ -54,6 +54,14 @@
#include "testmngr.h"
/*****************************************************************************
* Pre-processor Definitions
*****************************************************************************/
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#if defined(CONFIG_CRYPTO_AES)
/****************************************************************************
@@ -99,9 +107,15 @@ static int test_aes(void)
{
int i;
AES_CYPHER_TEST(AES_MODE_ECB, "ECB", AES_ENC_TEST_VECTORS, AES_DEC_TEST_VECTORS, aes_enc_tv_template, aes_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_CBC, "CBC", AES_CBC_ENC_TEST_VECTORS, AES_CBC_DEC_TEST_VECTORS, aes_cbc_enc_tv_template, aes_cbc_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_CTR, "CTR", AES_CTR_ENC_TEST_VECTORS, AES_CTR_DEC_TEST_VECTORS, aes_ctr_enc_tv_template, aes_ctr_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_ECB, "ECB", ARRAY_SIZE(aes_enc_tv_template),
ARRAY_SIZE(aes_dec_tv_template), aes_enc_tv_template,
aes_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_CBC, "CBC", ARRAY_SIZE(aes_cbc_enc_tv_template),
ARRAY_SIZE(aes_cbc_dec_tv_template),
aes_cbc_enc_tv_template, aes_cbc_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_CTR, "CTR", ARRAY_SIZE(aes_ctr_enc_tv_template),
ARRAY_SIZE(aes_ctr_dec_tv_template),
aes_ctr_enc_tv_template, aes_ctr_dec_tv_template)
return OK;
}
-7
View File
@@ -64,13 +64,6 @@ struct cipher_testvec
/* AES test vectors */
#define AES_ENC_TEST_VECTORS 3
#define AES_DEC_TEST_VECTORS 3
#define AES_CBC_ENC_TEST_VECTORS 4
#define AES_CBC_DEC_TEST_VECTORS 4
#define AES_CTR_ENC_TEST_VECTORS 3
#define AES_CTR_DEC_TEST_VECTORS 3
static struct cipher_testvec aes_enc_tv_template[] =
{
#ifndef CONFIG_CRYPTO_AES128_DISABLE