mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
aes: Add aes 256 support for ipq5332 platform
ipq5332 is a TME-L based platform in which before
encrypt/decrypt, we are required to derive a key
handle.
This patch adds support for the same.
Change-Id: I28b327611b62381542086d6d599c4a0195525aca
Signed-off-by: Poovendhan Selvaraj <quic_poovendh@quicinc.com>
(cherry picked from commit e15df34ac8)
This commit is contained in:
parent
4d07c250f2
commit
bae645d417
4 changed files with 11 additions and 7 deletions
|
|
@ -1,3 +1,2 @@
|
|||
config QCA_COMMON
|
||||
bool "QCA Common IPs"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||
enum tz_crypto_service_aes_cmd_t {
|
||||
TZ_CRYPTO_SERVICE_AES_ENC_ID = 0x7,
|
||||
TZ_CRYPTO_SERVICE_AES_DEC_ID = 0x8,
|
||||
#ifdef CONFIG_IPQ9574
|
||||
#ifdef CONFIG_IPQ_DERIVE_KEY
|
||||
TZ_CRYPTO_SERVICE_AES_DERIVE_KEY_ID = 0x9,
|
||||
#endif
|
||||
};
|
||||
|
|
@ -40,7 +40,7 @@ enum tz_crypto_service_aes_mode_t {
|
|||
TZ_CRYPTO_SERVICE_AES_MODE_MAX,
|
||||
};
|
||||
|
||||
#ifndef CONFIG_IPQ9574
|
||||
#ifndef CONFIG_IPQ_DERIVE_KEY
|
||||
struct crypto_aes_req_data_t {
|
||||
uint64_t type;
|
||||
uint64_t mode;
|
||||
|
|
@ -192,7 +192,7 @@ static int do_aes_256(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
int cmd_id = -1;
|
||||
int ret = CMD_RET_USAGE;
|
||||
|
||||
#ifndef CONFIG_IPQ9574
|
||||
#ifndef CONFIG_IPQ_DERIVE_KEY
|
||||
if (argc != 10)
|
||||
return ret;
|
||||
#else
|
||||
|
|
@ -248,7 +248,7 @@ static int do_aes_256(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IPQ9574
|
||||
#ifdef CONFIG_IPQ_DERIVE_KEY
|
||||
req_ptr->key_handle = simple_strtoul(argv[10], NULL, 16);
|
||||
#endif
|
||||
req_ptr->type = type;
|
||||
|
|
@ -277,12 +277,12 @@ U_BOOT_CMD(
|
|||
"AES 256 CBC/ECB encryption/decryption",
|
||||
"Encryption: aes_256 enc <type> <mode> <plain data address> <plain data len>"
|
||||
"<iv data address> <iv len> <response buf address> <response buf len>"
|
||||
#ifdef CONFIG_IPQ9574
|
||||
#ifdef CONFIG_IPQ_DERIVE_KEY
|
||||
"<key_handle>"
|
||||
#endif
|
||||
"Decryption: echo dec <type> <mode> <Encrypted buf address> <encrypted"
|
||||
"buf len> <iv data address> <iv len> <response buf address> <response buf len>"
|
||||
#ifdef CONFIG_IPQ9574
|
||||
#ifdef CONFIG_IPQ_DERIVE_KEY
|
||||
"<key_handle>"
|
||||
#endif
|
||||
);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@
|
|||
#define CONFIG_SYS_NO_FLASH
|
||||
#define CONFIG_IPQ_NO_RELOC
|
||||
|
||||
#define CONFIG_CMD_AES
|
||||
#define CONFIG_CMD_AES_256
|
||||
#define CONFIG_IPQ_DERIVE_KEY
|
||||
|
||||
#ifndef CONFIG_IPQ_TINY
|
||||
#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20)
|
||||
#endif /* CONFIG_IPQ_TINY */
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#define CONFIG_CMD_AES
|
||||
#define CONFIG_CMD_AES_256
|
||||
#define CONFIG_IPQ_DERIVE_KEY
|
||||
|
||||
#define CONFIG_BOARD_EARLY_INIT_F
|
||||
#define CONFIG_BOARD_LATE_INIT
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue