From ec42022e53bce32a72e15cb1a7dc34abe55cc213 Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Mon, 29 Jul 2019 11:44:18 -0500 Subject: [PATCH] [cc1352] limit DRBG to only use 128-bit AES keys (#4032) The CC2650 only has hardware acceleration for 128-bit AES keys. The CC1352 and CC2652 have hardware acceleration for 128- and 256-bit keys. However, the current driver does not implement larger than 128-bit keys. --- examples/platforms/cc1352/crypto/cc1352-mbedtls-config.h | 3 +++ examples/platforms/cc2650/crypto/cc2650-mbedtls-config.h | 2 ++ examples/platforms/cc2652/crypto/cc2652-mbedtls-config.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/examples/platforms/cc1352/crypto/cc1352-mbedtls-config.h b/examples/platforms/cc1352/crypto/cc1352-mbedtls-config.h index d7509e5bd..c45f603af 100644 --- a/examples/platforms/cc1352/crypto/cc1352-mbedtls-config.h +++ b/examples/platforms/cc1352/crypto/cc1352-mbedtls-config.h @@ -31,4 +31,7 @@ #define MBEDTLS_AES_ALT +/* TODO: remove once AES alt driver supports 256-bit keys */ +#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY + #endif // CC1352_MBEDTLS_CONFIG_H diff --git a/examples/platforms/cc2650/crypto/cc2650-mbedtls-config.h b/examples/platforms/cc2650/crypto/cc2650-mbedtls-config.h index 72a201af9..db4605814 100644 --- a/examples/platforms/cc2650/crypto/cc2650-mbedtls-config.h +++ b/examples/platforms/cc2650/crypto/cc2650-mbedtls-config.h @@ -32,4 +32,6 @@ #define MBEDTLS_AES_ALT #define MBEDTLS_SHA256_ALT +#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY + #endif // CC2650_MBEDTLS_CONFIG_H diff --git a/examples/platforms/cc2652/crypto/cc2652-mbedtls-config.h b/examples/platforms/cc2652/crypto/cc2652-mbedtls-config.h index 399d9e3c2..3baa39455 100644 --- a/examples/platforms/cc2652/crypto/cc2652-mbedtls-config.h +++ b/examples/platforms/cc2652/crypto/cc2652-mbedtls-config.h @@ -31,4 +31,7 @@ #define MBEDTLS_AES_ALT +/* TODO: remove once AES alt driver supports 256-bit keys */ +#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY + #endif // CC2652_MBEDTLS_CONFIG_H