This commit is contained in:
2025-12-24 17:21:08 +09:00
parent a96323de19
commit 96dc62d8dc
2302 changed files with 455822 additions and 0 deletions

View File

@@ -0,0 +1,672 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_H)
#define R_ICUMIF_API_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**********************************************************************************/
/* Ensure the structure alignment */
/**********************************************************************************/
#pragma pack(8)
/**********************************************************************************/
/* Headers */
/**********************************************************************************/
/**********************************************************************************/
/* Defines */
/**********************************************************************************/
#include "renesas_types.h"
/*===========================================================================*/
/* Transition state of ISD service request / response queue */
/*===========================================================================*/
#define R_ICUMIF_REQRES_PE_REQ_ENQUE (0x01U) /* PE enqueued ISD to service request queue */
#define R_ICUMIF_REQRES_ICUM_REQ_DEQUE (0x02U) /* ICU-M dequeued ISD from service request queue */
#define R_ICUMIF_REQRES_ICUM_RES_ENQUE (0x03U) /* ICU-M enqueued ISD to service response queue */
#define R_ICUMIF_REQRES_PE_RES_DEQUE (0x04U) /* PE dequeued ISD from service response queue */
#define R_ICUMIF_REQRES_INTERRPUT (0x00U)
#define R_ICUMIF_REQRES_NOINTERRPUT (0x01U)
/*===========================================================================*/
/* Priority of ICU-M service */
/*===========================================================================*/
#define R_ICUMIF_SERV_PRIORITY_HIGHEST (0x00U)
#define R_ICUMIF_SERV_PRIORITY_HIGH (0x3FU)
#define R_ICUMIF_SERV_PRIORITY_NORMAL (0x7fU)
#define R_ICUMIF_SERV_PRIORITY_LOWEST (0xffU)
/*===========================================================================*/
/* The defines of job cycle (r_job_cycle_t) used for each service parameter */
/*===========================================================================*/
#define JOB_ALL_AT_ONCE (0x00000000u)
#define JOB_INIT (0x00000001u)
#define JOB_UPDATE (0x00000002u)
#define JOB_FINISH (0x00000004u)
/**********************************************************************************/
/* Macros */
/**********************************************************************************/
/*===========================================================================*/
/* To set the memory cluster verification flags in mem_cluster_verif_t */
/*===========================================================================*/
#define MEM_CLUSTER(i) (1 << (i))
/**********************************************************************************/
/* ICU-M interface: types */
/**********************************************************************************/
/*===========================================================================*/
/* Enumerates: ICU-M service ID */
/*===========================================================================*/
/*******************************************/
/* Note: the below enumerates should align */
/* with the table service_handler[] */
/*******************************************/
typedef enum
{
SERVICE_00_SYSTEM_INIT = 0x00,
SERVICE_00_SYSTEM_CONFIG,
SERVICE_00_GET_INFO,
SERVICE_00_KEY_MNGT,
SERVICE_00_CANCEL_SHE,
SERVICE_00_STAGE_TRANSITION,
SERVICE_00_GET_STAGE,
SERVICE_00_GET_ID,
SERVICE_00_CMD_DEBUG = 0x0C,
SERVICE_00_SECURE_BOOT_API,
SERVICE_01_AES_CIPHER = 0x10,
SERVICE_01_AES_AUTH_CIPHER,
SERVICE_01_AES_CMAC,
SERVICE_01_AES_CMAC_SHORT,
SERVICE_01_RSA_VERIFY,
SERVICE_01_RSA_SIGN,
SERVICE_01_RSA_ENCRYPT,
SERVICE_01_RSA_DECRYPT,
SERVICE_01_ECDSA_VERIFY,
SERVICE_01_ECDSA_SIGN,
SERVICE_01_ECDH,
SERVICE_01_HASH,
SERVICE_01_HMAC,
SERVICE_01_TLS_RSA_EXCHANGE,
SERVICE_01_TLS_ECDH_EXCHANGE,
SERVICE_01_TLS_VERIFY_DATA,
SERVICE_02_RAND_INIT_RNG = 0x20,
SERVICE_02_RAND_EXTEND_SEED,
SERVICE_02_RAND_RND,
SERVICE_02_RAND_TRNG,
SERVICE_02_RAND_INSTANTIATE,
SERVICE_02_RAND_RESEED,
SERVICE_02_RAND_UNINSTANTIATE,
SERVICE_02_RAND_GENERATE,
SERVICE_03_AES_KEY_UPDATE_PLAIN = 0x30,
SERVICE_03_AES_KEY_UPDATE_SHE,
SERVICE_03_AES_RAM_KEY_EXP_SHE,
SERVICE_03_PK_IMPORT,
SERVICE_03_PK_EXPORT,
SERVICE_03_RSA_KEY_GENERATE,
SERVICE_03_ECC_KEY_GENERATE,
SERVICE_03_ISO15118_UPDATE,
SERVICE_03_HMAC_IMPORT,
SERVICE_03_PK_IMPORT_EXT,
SERVICE_03_AES_KEY_UPDATE_SHE_EXT,
SERVICE_03_AES_RAM_KEY_EXP_SHE_EXT,
SERVICE_04_ICUMDF_WRITE = 0x45,
SERVICE_05_MEMCLSTR_DEFINITION = 0x50,
SERVICE_05_MEMCLSTR_INSTALL,
SERVICE_05_MEMCLSTR_VERIFY,
SERVICE_05_MEMCLSTR_VERIFY_AUTO,
SERVICE_07_MONO_CTR_MGMT = 0x70,
SERVICE_01_EDDSA_VERIFY = 0x80,
SERVICE_01_EDDSA_SIGN,
LAST_ITEM_SERV_ID = 0x01000000
} r_icumif_service_id_t;
/*===========================================================================*/
/* Enumerates: ICU-M service results */
/*===========================================================================*/
typedef enum
{
SERV_OK, /* service completed with no error */
SERV_SYS_CFG_NOT_INITIALIZED, /* system configuration not initialized */
SERV_ID_ERROR, /* wrong service ID */
SERV_REQUESTER_ID_ERROR, /* wrong requester ID */
SERV_PRM_ERROR, /* wrong service parameter error */
SERV_KEY_INVALID, /* key invalid */
SERV_KEY_NOT_USABLE, /* key not usable for the service */
SERV_INVALID_KEY_GROUP, /* key group is not valid */
SERV_INVALID_KEY_INDEX, /* wrong key index provided */
SERV_KEY_SLOT_EMPTY, /* key slot empty */
SERV_KEY_WRITE_PROTECTED, /* key is write protected */
SERV_KEY_UPDATE_ERROR, /* key update error */
SERV_SRC_MEM_ERROR, /* error on source memory range */
SERV_DEST_MEM_ERROR, /* error on destination memory range */
SERV_JOB_QUEUE_FULL, /* cannot accept another service request */
SERV_UNAVAILABLE, /* service unavailable */
SERV_INSTANCE_ALREADY_RUNNING, /* service instance already running */
SERV_SYS_ERROR, /* the service caused a system error (exception) */
SERV_MPU_ERROR, /* the service caused a MPU error (exception) */
SERV_NVM_PROG_ERROR, /* error while programming the Flash */
SERV_NVM_SYS_ERROR, /* error in the Flash sequencer */
SERV_NVM_SYS_ERROR_CRITICAL, /* error in the Flash sequencer */
SERV_NVM_UNAVAILABLE, /* Flash memory unavailable (e.g. PE1 reprogramming it) */
SERV_DATA_INVALID, /* error on the DVC (data inconsistency) */
SERV_NVM_DATA_WARNING, /* one data slot broken */
SERV_NVM_SIZE_ERROR, /* secure DF too small for the number of keys to manage */
SERV_CRYPT_ERROR, /* error in the cryptographic library */
SERV_INVALID_MEM_CLUST_INDEX, /* wrong memory cluster index */
SERV_INVALID_INSTALL_METHOD, /* invalid memory cluster installation method */
SERV_INVALID_VERIF_METHOD, /* invalid memory cluster verification method */
SERV_INVALID_CLUSTER_SIZE, /* invalid data size processed during memory cluster installation */
SERV_CLUSTER_NOT_DEFINED, /* memory cluster not defined */
SERV_CLUSTER_ALREADY_DEFINED, /* memory cluster already defined */
SERV_CLUSTER_NOT_INSTALLED, /* memory cluster not installed */
SERV_CLUSTER_INSTALL_FAIL, /* memory cluster installation fail */
SERV_CLUSTER_VERIFICATION_FAIL, /* memory cluster verification fail */
SERV_CLUSTER_NOT_VERIFIED, /* memory cluster not verified */
SERV_CLUSTER_ALREADY_VERIFIED, /* memory cluster already verified */
SERV_CLUSTER_ALREADY_INSTALLED, /* memory cluster already installed */
SERV_CLUSTER_VERIF_STATUS_LOCK, /* memory verification status locked */
SERV_BKGROUND_CHECK_RUNNING, /* background check running - unable to continue */
SERV_INVALID_ENCODING_FORMAT = 0x2A, /* invalid data encoding format */
SERV_ISD_NOT_ACCESSIBLE, /* service request not accessible by ICUP */
SERV_RAM_SIZE_ERROR, /* secure config ram too small for the number of keys to manage */
SERV_KEY_GENERATION_ERROR, /* error while generating RSA / ECC private keys */
SERV_KEY_VERIFICATION_FAIL, /* error on signature key verification */
SERV_INVALID_CURVE_ID, /* invalid ECC curve id */
SERV_ECC_POINT_INVALID, /* invalid ECC public key */
SERV_MEMORY_FULL, /* no more memory space */
SERV_INIT_DELAY, /* service initialization delayed (e.g. no AES context available) */
SERV_MYDATA_SET_EMPTY, /* no custom data set available */
SERV_MYDATA_SLOT_EMPTY, /* data slot available */
SERV_MYDATA_SIZE_ERR, /* invalid data size */
SERV_MYDATA_INVALID_IDX, /* invalid data slot index */
SERV_REQUEST_QUEUE_FULL, /* service request queue full */
SERV_MONOCTR_INVALID_TYPE, /* invalid monotonic counter type */
SERV_MONOCTR_INVALID_IDX, /* invalid monotonic counter index */
SERV_MONOCTR_NOT_INITIALIZED, /* monotonic counter not initialized */
SERV_MONOCTR_INVALID_INCREMENT, /* monotonic counter invalid increment value */
SERV_MONOCTR_INVALID, /* monotonic counter invalid counter value in Flash */
SERV_INVALID_OPERATION, /* invalid operation */
SERV_KEY_CACHE_FULL, /* unable to fix another key in cache */
SERV_MEMCLTR_CACHE_FULL, /* unable to fix another memory cluster in cache */
SERV_SEQUENCE_ERROR, /* Wrong calling sequence */
SERV_CR_VERIFY_FAIL, /* Failure on challenge & response */
SERV_AES_TIMEOUT_ERROR, /* wrong aes driver time out error */
SERV_AES_STATUS_ERROR, /* wrong aes driver status error */
SERV_AES_PRM_ERROR, /* wrong aes driver parameter error */
SERV_NO_COMP_TRNG, /* Call initialization services during the true random number generation */
SERV_NO_INIT_RNG, /* Using random number generation service not initialized */
SERV_TRN_ERROR, /* online test NG, or non-online test 3 times in consecutive random values match */
SERV_NEED_RESEED, /* A reseed is required(CTR_DRBG method) */
SERV_RESTRICTED, /* service is restricted by life cycle stage */
/* Error ID unique to the R-Car series */
SERV_NVM_REJECTED = 0xff00, /* Failed to acquire flash access authority */
SERV_REQUEST = 0xfff0,
SERV_NEW_REQUEST,
SERV_PENDING,
SERV_IN_PROCESS = 0xffff,
LAST_ITEM_SERV_ERR = 0x01000000
} r_icumif_service_result_t;
/*===========================================================================*/
/* Enumerates: verification result (CMAC, signature) */
/*===========================================================================*/
typedef enum
{
VERIFICATION_PASS,
VERIFICATION_FAIL,
LAST_ITEM_VERIF_STATUS = 0x01000000
} r_verif_result_t;
/*===========================================================================*/
/* Enumerates: number formats */
/*===========================================================================*/
typedef enum
{
FORMAT_STRING_DECIMAL,
FORMAT_STRING_HEXA,
FORMAT_BINARY_PLAIN,
LAST_ITEM_FORMAT_TYPE = 0x01000000
} r_number_format_t;
/*===========================================================================*/
/* Enumerates: hash encoding formats (rsa sign/verify) */
/*===========================================================================*/
typedef enum
{
ENCODING_FORMAT_EMSA_PSS,
ENCODING_FORMAT_EMSA_PKCS1_V15,
LAST_ITEM_HASH_ENCODING_TYPE = 0x01000000
} r_hash_encoding_format_t;
/*===========================================================================*/
/* Enumerates: message encoding formats (rsa encrypt/decrypt) */
/*===========================================================================*/
typedef enum
{
ENCODING_FORMAT_EME_OAEP,
ENCODING_FORMAT_EME_PKCS1_V15,
LAST_ITEM_MSG_ENCODING_TYPE = 0x01000000
} r_message_encoding_format_t;
/*===========================================================================*/
/* Enumerates: hash primitives */
/*===========================================================================*/
typedef enum
{
HASH_PRIMITIVE_MD5,
HASH_PRIMITIVE_RIPEMD_128,
HASH_PRIMITIVE_RIPEMD_160,
HASH_PRIMITIVE_RIPEMD_256,
HASH_PRIMITIVE_RIPEMD_320,
HASH_PRIMITIVE_SHA1,
HASH_PRIMITIVE_SHA2_224,
HASH_PRIMITIVE_SHA2_256,
HASH_PRIMITIVE_SHA2_384,
HASH_PRIMITIVE_SHA2_512,
HASH_PRIMITIVE_SHA2_512_224,
HASH_PRIMITIVE_SHA2_512_256,
HASH_PRIMITIVE_SHA3_224,
HASH_PRIMITIVE_SHA3_256,
HASH_PRIMITIVE_SHA3_384,
HASH_PRIMITIVE_SHA3_512,
HASH_PRIMITIVE_SHAKE_128,
HASH_PRIMITIVE_SHAKE_256,
LAST_ITEM_HASH_PRIMITIVE = 0x01000000
} r_hash_primitive_t;
/*===========================================================================*/
/* Enumerates: signature algorithms (for PK key imports/exports) */
/*===========================================================================*/
typedef enum
{
SIGALGO_NONE,
SIGALGO_RSA_PSS,
SIGALGO_RSA_PKCS1_V15,
LAST_ITEM_SIGNATURE_ALGO = 0x01000000
} r_signature_algo_t;
/*===========================================================================*/
/* Enumerates: ECC curves */
/*===========================================================================*/
typedef enum
{
ECC_CURVE_NIST_P192,
ECC_CURVE_NIST_P224,
ECC_CURVE_NIST_P256,
ECC_CURVE_NIST_P384,
ECC_CURVE_NIST_P521,
ECC_CURVE_BRAINPOOL_P192,
ECC_CURVE_BRAINPOOL_P224,
ECC_CURVE_BRAINPOOL_P256,
ECC_CURVE_BRAINPOOL_P320,
ECC_CURVE_BRAINPOOL_P384,
ECC_CURVE_BRAINPOOL_P512,
ECC_CURVE_BRAINPOOL_P256_T,
ECC_CURVE_BRAINPOOL_P320_T,
ECC_CURVE_BRAINPOOL_P384_T,
ECC_CURVE_BRAINPOOL_P512_T,
ECC_CURVE_CURVE25519,
ECC_CURVE_ED25519,
LAST_ITEM_ECC_TYPE = 0x01000000
} r_ecc_curve_t;
/*===========================================================================*/
/* Enumerates: KDF algorithms */
/*===========================================================================*/
typedef enum
{
KDF_ALGO_KDF1,
KDF_ALGO_KDF2,
KDF_ALGO_KDF3,
KDF_ALGO_PKDF1,
KDF_ALGO_PKDF2,
LAST_ITEM_KDF_ALGO = 0x01000000
} r_kdf_algo_t;
/*===========================================================================*/
/* Enumerates: key group */
/*===========================================================================*/
typedef enum
{
KEY_GRP_AES_ROM,
KEY_GRP_AES,
KEY_GRP_AES_RAM,
KEY_GRP_SHE,
KEY_GRP_RSA,
KEY_GRP_RSA_PUB,
KEY_GRP_RSA_ROM_PUB,
KEY_GRP_ECC,
KEY_GRP_ECC_RAM,
KEY_GRP_ECC_PUB,
KEY_GRP_ECC_ROM_PUB,
KEY_GRP_AES_CR,
KEY_GRP_HMAC,
KEY_GRP_TLS_MASTER,
KEY_GRP_RSA_PUB_EXT,
KEY_GRP_ECC_PUB_EXT,
LAST_ITEM_KEY_GRP = 0x01000000
} r_key_group_t;
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
/*===========================================================================*/
/* Type definition: requester ID */
/*===========================================================================*/
typedef uint8_t r_icumif_requester_id_t;
/*===========================================================================*/
/* Type definition: vm ID */
/*===========================================================================*/
typedef uint8_t r_icumif_vm_id_t;
/*===========================================================================*/
/* Type definition: host interrupt channel definition */
/*===========================================================================*/
typedef uint8_t r_icumif_host_intch_t;
/*===========================================================================*/
/* Type definition: transition state of ISD service request / response queue */
/*===========================================================================*/
typedef uint8_t r_icumif_req_res_status_t;
/*===========================================================================*/
/* Type definition: priority of ICU-M service */
/*===========================================================================*/
typedef uint8_t r_icumif_service_priority_t;
/*===========================================================================*/
/* Type definition: request no interrupt */
/*===========================================================================*/
typedef uint8_t r_icumif_req_nointerrupt_t;
/*===========================================================================*/
/* Type definition: responset no interrupt */
/*===========================================================================*/
typedef uint8_t r_icumif_res_nointerrupt_t;
/*===========================================================================*/
/* Type definition: job ID */
/*===========================================================================*/
typedef uint16_t r_icumif_job_id_t;
/*===========================================================================*/
/* Type definition: pointer to call back function */
/*===========================================================================*/
typedef void (*p_func_t)(void *p_ISD);
/*===========================================================================*/
/* Job slice */
/*===========================================================================*/
typedef uint16_t r_job_slice_t;
/*===========================================================================*/
/* Type definition: key index */
/*===========================================================================*/
typedef uint16_t r_key_index_t;
/*===========================================================================*/
/* Type definition: memory cluster ID */
/*===========================================================================*/
typedef uint8_t r_mem_cluster_id_t;
/*===========================================================================*/
/* Type definition: key property flag set */
/*===========================================================================*/
typedef uint16_t r_key_property_flags_t;
/*===========================================================================*/
/* Type definition: memory cluster verification map */
/*===========================================================================*/
typedef uint32_t r_mem_cluster_verif_t;
/*===========================================================================*/
/* Type definition: service job cycle */
/*===========================================================================*/
typedef uint32_t r_job_cycle_t;
/**********************************************************************************/
/* Header files inclusion for specific service properties */
/**********************************************************************************/
#include "r_icumif_api_sys_init.h"
#include "r_icumif_api_get_info.h"
#include "r_icumif_api_get_id.h"
#include "r_icumif_api_aes_key_update_plain.h"
#include "r_icumif_api_aes_key_update_she.h"
#include "r_icumif_api_aes_key_export_she.h"
#include "r_icumif_api_aes_cipher.h"
#include "r_icumif_api_aes_auth_cipher.h"
#include "r_icumif_api_aes_cmac.h"
#include "r_icumif_api_aes_cmac_short.h"
#include "r_icumif_api_rand_generate.h"
#include "r_icumif_api_pk_import.h"
#include "r_icumif_api_pk_import_ext.h"
#include "r_icumif_api_pk_export.h"
#include "r_icumif_api_iso15118_update.h"
#include "r_icumif_api_rsa_key_generate.h"
#include "r_icumif_api_ecc_key_generate.h"
#include "r_icumif_api_rsa_verify.h"
#include "r_icumif_api_rsa_sign.h"
#include "r_icumif_api_rsa_encrypt.h"
#include "r_icumif_api_rsa_decrypt.h"
#include "r_icumif_api_ecdh.h"
#include "r_icumif_api_ecdsa_verify.h"
#include "r_icumif_api_ecdsa_sign.h"
#include "r_icumif_api_hash.h"
#include "r_icumif_api_hmac.h"
#include "r_icumif_api_hmac_import.h"
#include "r_icumif_api_tls_ecdh_exchange.h"
#include "r_icumif_api_tls_rsa_exchange.h"
#include "r_icumif_api_tls_verify_data.h"
#include "r_icumif_api_lifecycle.h"
#include "r_icumif_api_mem_cluster_def.h"
#include "r_icumif_api_mem_cluster_install.h"
#include "r_icumif_api_mem_cluster_verify.h"
#include "r_icumif_api_mem_cluster_verify_auto.h"
#include "r_icumif_api_sys_cfg.h"
#include "r_icumif_api_key_mgmt.h"
#include "r_icumif_api_mono_ctr.h"
#include "r_icumif_api_cancel_she.h"
#include "r_icumif_api_cmd_debug.h"
#include "r_icumif_api_eddsa_verify.h"
#include "r_icumif_api_eddsa_sign.h"
#include "r_icumif_api_secure_boot_api.h"
/**********************************************************************************/
/* Header files inclusion for SHE specific parameters */
/**********************************************************************************/
#include "r_icumif_api_she.h"
/*===========================================================================*/
/* Type definition: ICU-M service descriptor (ISD) */
/*===========================================================================*/
typedef struct service_descriptor
{
r_icumif_service_id_t service_id;
r_icumif_requester_id_t requester_id;
r_icumif_vm_id_t vm_id;
r_icumif_host_intch_t host_int_ch;
volatile r_icumif_req_res_status_t req_res_status;
r_icumif_service_priority_t service_priority;
volatile r_icumif_service_result_t service_result;
volatile r_icumif_req_nointerrupt_t req_nointerrupt;
volatile r_icumif_res_nointerrupt_t res_nointerrupt;
volatile r_icumif_job_id_t job_id;
union
{
p_func_t p_callbackfunc;
uint64_t padding_sys64;
} ptr;
union service_parameters
{
ISD_SYSTEM_INIT_t SYSTEM_INIT;
ISD_SYSTEM_CONFIG_t SYSTEM_CONFIG;
ISD_GET_INFO_t GET_INFO;
ISD_GET_ID_t GET_ID;
ISD_KEY_UPDATE_PLAIN_t KEY_UPDATE_PLAIN;
ISD_KEY_UPDATE_SHE_t KEY_UPDATE_SHE;
ISD_KEY_AES_RAM_EXP_t RAM_KEY_EXPORT_SHE;
ISD_AES_CIPHER_t AES_CIPHER;
ISD_AES_AUTH_CIPHER_t AES_AUTH_CIPHER;
ISD_AES_CMAC_t AES_CMAC;
ISD_AES_CMAC_SHORT_t AES_CMAC_SHORT;
ISD_KEY_MNGT_t KEY_MGMT;
ISD_CANCEL_SHE_t CANCEL_SHE;
ISD_RAND_INIT_t RAND_INIT;
ISD_RAND_EXTEND_SEED_t RAND_EXTEND_SEED;
ISD_RAND_GENERATE_t RAND_GENERATE;
ISD_PK_IMPORT_t PK_IMPORT;
ISD_PK_EXPORT_t PK_EXPORT;
ISD_RSA_KEY_GENERATE_t RSA_KEY_GENERATE;
ISD_ECC_KEY_GENERATE_t ECC_KEY_GENERATE;
ISD_RSA_VERIFY_t RSA_VERIFY;
ISD_RSA_SIGN_t RSA_SIGN;
ISD_RSA_ENCRYPT_t RSA_ENCRYPT;
ISD_RSA_DECRYPT_t RSA_DECRYPT;
ISD_ECDH_t ECDH;
ISD_ECDSA_VERIFY_t ECDSA_VERIFY;
ISD_ECDSA_SIGN_t ECDSA_SIGN;
ISD_EDDSA_VERIFY_t EDDSA_VERIFY;
ISD_EDDSA_SIGN_t EDDSA_SIGN;
ISD_HASH_t HASH;
ISD_MEM_CLUSTER_DEF_t MEM_CLUSTER_DEF;
ISD_MEM_CLUSTER_INST_t MEM_CLUSTER_INSTALL;
ISD_MEM_CLUSTER_VERIF_t MEM_CLUSTER_VERIFY;
ISD_MEM_CLUSTER_VERIF_AUTO_t MEM_CLUSTER_VERIFY_AUTO;
ISD_MONO_CTR_t MONO_CTR_MGMT;
ISD_LIFE_CYCLE_t LIFE_CYCLE;
ISD_HMAC_t HMAC;
ISD_HMAC_IMPORT_t HMAC_IMPORT;
ISD_TLS_RSA_EXCHANGE_t TLS_RSA_EXCHANGE;
ISD_TLS_ECDH_EXCHANGE_t TLS_ECDH_EXCHANGE;
ISD_TLS_VERIFY_DATA_t TLS_VERIFY_DATA;
ISD_ISO15118_UPDATE_t ISO15118_UPDATE;
ISD_PK_IMPORT_EXT_t PK_IMPORT_EXT;
ISD_CMD_DEBUG_t CMD_DEBUG;
ISD_SECURE_BOOT_API_t SECURE_BOOT_API;
} prm;
} r_icumif_isd_t;
/*===========================================================================*/
/* Type definition: ICU-M firmware status */
/*===========================================================================*/
typedef struct r_icumif_sts
{
uint32_t BUSY:1;
uint32_t SECURE_BOOT:1;
uint32_t BOOT_INIT:1;
uint32_t BOOT_FINISHED:1;
uint32_t BOOT_OK:1;
uint32_t RND_INIT:1;
uint32_t EXT_DEBUGGER:1;
uint32_t INT_DEBUGGER:1;
uint32_t :1;
uint32_t FUSAERR:1;
uint32_t MONERR:1;
uint32_t BUSERR:1;
uint32_t ROMERR:1;
uint32_t RAMERR:1;
uint32_t WDTERR:1;
uint32_t SYSTEMERR:1;
uint32_t :1;
uint32_t EXTERR:1;
uint32_t FCUERR:1;
uint32_t RNDERR:1;
uint32_t DFWARNING_B:1;
uint32_t DFWARNING_A:1;
uint32_t STARTUP_BANK:1;
uint32_t BOOTERR:1;
uint32_t RPC_WAIT:1;
uint32_t TRNG:1;
uint32_t FLS_WAIT:1;
uint32_t FACIACC:1;
uint32_t SERVAVAIL:1;
uint32_t FCUINIT:1;
uint32_t PLLSET:1;
uint32_t STARTPE:1;
} r_icumif_sts_t;
/**********************************************************************************/
/* Structure alignment back to default configuration */
/**********************************************************************************/
#pragma pack()
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* R_ICUMIF_API_H */

View File

@@ -0,0 +1,109 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_AUTH_CIPHER_H)
#define R_ICUMIF_API_AES_AUTH_CIPHER_H
/**********************************************************************************/
/* Defines */
/**********************************************************************************/
#define AES_BLOCK_SIZE_IN_BYTES (16u)
#define AUTH_CIPHER_SAFETY_MODE_ENABLE (0xA55AA55Au)
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
AUTH_CIPHER_MOD_GCM,
AUTH_CIPHER_MOD_CCM,
LAST_ITEM_AUTH_CIPHER_MOD = 0x01000000
} auth_cipher_modes_t;
typedef struct auth_cipher_status_reg
{
uint32_t dma_used;
uint32_t status;
uint32_t transfer_num;
uint32_t control_src;
uint32_t control_dst;
uint32_t transfered_num_src;
uint32_t transfered_num_dst;
uint32_t remain_num_src;
uint32_t remain_num_dst;
uint32_t address_src;
uint32_t address_dst;
} auth_cipher_status_reg_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_AES_AUTH_CIPHER
{
union
{
const uint32_t *p_iv;
uint64_t padding_sys64;
} ptr1;
union
{
const uint32_t *p_auth_data;
uint64_t padding_sys64;
} ptr2;
union
{
const uint32_t *p_data_in;
uint64_t padding_sys64;
} ptr3;
union
{
uint32_t *p_data_out;
uint64_t padding_sys64;
} ptr4;
union
{
uint32_t *p_auth_tag;
uint64_t padding_sys64;
} ptr5;
union
{
auth_cipher_status_reg_t *p_status_reg_auth_data;
uint64_t padding_sys64;
} ptr6;
union
{
auth_cipher_status_reg_t *p_status_reg_data;
uint64_t padding_sys64;
} ptr7;
uint32_t data_size_in_bits;
uint32_t auth_data_size_in_bits;
uint32_t iv_size_in_bits;
uint8_t auth_tag_size_in_bits;
uint32_t safety_mode;
r_key_group_t key_group;
r_key_index_t key_id;
cipher_direction_t direction;
auth_cipher_modes_t cipher_mode;
r_job_slice_t job_slice;
r_job_cycle_t job_cycle;
volatile r_verif_result_t verification_result;
} ISD_AES_AUTH_CIPHER_t;
#endif /* R_ICUMIF_API_AES_AUTH_CIPHER_H */

View File

@@ -0,0 +1,86 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_CIPHER_H)
#define R_ICUMIF_API_AES_CIPHER_H
/**********************************************************************************/
/* Defines */
/**********************************************************************************/
#define AES_BLOCK_SIZE_IN_BYTES (16u)
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
CIPHER_DIR_ENCRYPTION,
CIPHER_DIR_DECRYPTION,
LAST_ITEM_CIPHER_DIR = 0x01000000
} cipher_direction_t;
typedef enum
{
CIPHER_MOD_CBC,
CIPHER_MOD_ECB,
CIPHER_MOD_CFB,
CIPHER_MOD_OFB,
CIPHER_MOD_CTR,
CIPHER_MOD_XTS,
LAST_ITEM_CIPHER_MOD = 0x01000000
} cipher_modes_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_AES_CIPHER
{
union
{
const uint32_t *p_iv;
uint64_t padding_sys64;
} ptr1;
union
{
const uint32_t *p_block_in;
uint64_t padding_sys64;
} ptr2;
union
{
uint32_t *p_block_out;
uint64_t padding_sys64;
} ptr3;
union
{
uint32_t nb_blocks;
uint32_t data_size_in_bits;
} size;
r_key_group_t key_group;
r_key_index_t key_id;
r_key_group_t key_group_2;
r_key_index_t key_id_2;
cipher_direction_t direction;
cipher_modes_t cipher_mode;
r_job_slice_t job_slice;
r_job_cycle_t job_cycle;
} ISD_AES_CIPHER_t;
#endif /* R_ICUMIF_API_AES_CIPHER_H */

View File

@@ -0,0 +1,58 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_CMAC_H)
#define R_ICUMIF_API_AES_CMAC_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
CMAC_GENERATION,
CMAC_VERIFICATION,
LAST_ITEM_CMAC = 0x01000000
} cmac_operation_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_AES_CMAC
{
union
{
const uint32_t *p_msg;
uint64_t padding_sys64;
} ptr1;
union
{
uint32_t *p_cmac;
uint64_t padding_sys64;
} ptr2;
uint32_t msg_size_in_bits;
r_key_group_t key_group;
r_key_index_t key_id;
uint8_t cmac_size_in_bits;
cmac_operation_t cmac_operation;
r_job_slice_t job_slice;
r_job_cycle_t job_cycle;
volatile r_verif_result_t verification_result;
} ISD_AES_CMAC_t;
#endif /* R_ICUMIF_API_AES_CMAC_H */

View File

@@ -0,0 +1,46 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_CMAC_SHORT_H)
#define R_ICUMIF_API_AES_CMAC_SHORT_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef struct cmac_position
{
uint8_t cmac_position;
uint8_t cmac_size;
uint8_t message_position;
uint8_t message_size;
} cmac_position_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_AES_CMAC_SHORT
{
uint32_t text[2];
cmac_position_t position_data;
r_key_group_t key_group;
r_key_index_t key_id;
cmac_operation_t cmac_operation;
volatile r_verif_result_t verification_result;
} ISD_AES_CMAC_SHORT_t;
#endif /* R_ICUMIF_API_AES_CMAC_SHORT_H */

View File

@@ -0,0 +1,53 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_KEY_EXPORT_SHE_H)
#define R_ICUMIF_API_AES_KEY_EXPORT_SHE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_KEY_AES_RAM_EXP
{
union
{
uint8_t *p_M1;
uint64_t padding_sys64;
} ptr1;
union
{
uint8_t *p_M2;
uint64_t padding_sys64;
} ptr2;
union
{
uint8_t *p_M3;
uint64_t padding_sys64;
} ptr3;
union
{
uint8_t *p_M4;
uint64_t padding_sys64;
} ptr4;
union
{
uint8_t *p_M5;
uint64_t padding_sys64;
} ptr5;
} ISD_KEY_AES_RAM_EXP_t;
#endif /* R_ICUMIF_API_AES_KEY_EXPORT_SHE_H */

View File

@@ -0,0 +1,47 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_KET_UPDATE_PLAIN_H)
#define R_ICUMIF_API_AES_KET_UPDATE_PLAIN_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_KEY_UPDATE_PLAIN
{
union
{
const uint8_t *p_key_value;
uint64_t padding_sys64;
} ptr;
r_key_group_t key_group;
r_key_index_t key_id;
uint16_t key_size_in_bytes;
r_mem_cluster_verif_t mem_cluster_verif;
struct
{
r_key_property_flags_t encryption:1;
r_key_property_flags_t decryption:1;
r_key_property_flags_t cmac_generation:1;
r_key_property_flags_t cmac_verification:1;
r_key_property_flags_t write_protected:1;
r_key_property_flags_t disable_on_debug:1;
r_key_property_flags_t no_wild_card:1;
} flags;
} ISD_KEY_UPDATE_PLAIN_t;
#endif /* R_ICUMIF_API_AES_KET_UPDATE_PLAIN_H */

View File

@@ -0,0 +1,54 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_AES_KEY_UPDATE_SHE_H)
#define R_ICUMIF_API_AES_KEY_UPDATE_SHE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_KEY_UPDATE_SHE
{
union
{
const uint8_t *p_M1;
uint64_t padding_sys64;
} ptr1;
union
{
const uint8_t *p_M2;
uint64_t padding_sys64;
} ptr2;
union
{
const uint8_t *p_M3;
uint64_t padding_sys64;
} ptr3;
union
{
uint8_t *p_M4;
uint64_t padding_sys64;
} ptr4;
union
{
uint8_t *p_M5;
uint64_t padding_sys64;
} ptr5;
uint8_t extended_key_id;
} ISD_KEY_UPDATE_SHE_t;
#endif /* R_ICUMIF_API_AES_KEY_UPDATE_SHE_H */

View File

@@ -0,0 +1,29 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_CANCEL_SHE_H)
#define R_ICUMIF_API_CANCEL_SHE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_CANCEL_SHE
{
r_icumif_job_id_t cancel_job_id;
} ISD_CANCEL_SHE_t;
#endif /* R_ICUMIF_API_CANCEL_SHE_H */

View File

@@ -0,0 +1,47 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_CMD_DEBUG_H)
#define R_ICUMIF_API_CMD_DEBUG_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef enum
{
DBG_CR_CHALLENGE,
DBG_CR_RESPONSE,
LAST_ITEM_DBG_CR_REQ = 0x01000000
} r_debug_request_t;
typedef struct ISD_CMD_DEBUG
{
r_debug_request_t cr_request;
union
{
uint32_t *p_challenge;
uint64_t padding_sys64;
} ptr1;
union
{
uint32_t *p_response;
uint64_t padding_sys64;
} ptr2;
} ISD_CMD_DEBUG_t;
#endif /* R_ICUMIF_API_CMD_DEBUG_H */

View File

@@ -0,0 +1,37 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_ECC_KEY_GENERATE_H)
#define R_ICUMIF_API_ECC_KEY_GENERATE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_ECC_KEY_GENERATE
{
r_key_group_t key_group;
r_key_index_t key_id;
r_ecc_curve_t curve_id;
r_mem_cluster_verif_t mem_cluster_verif;
struct
{
r_key_property_flags_t disable_on_debug:1;
r_key_property_flags_t write_protected:1;
} flags;
} ISD_ECC_KEY_GENERATE_t;
#endif /* R_ICUMIF_API_ECC_KEY_GENERATE_H */

View File

@@ -0,0 +1,57 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_ECDH_H)
#define R_ICUMIF_API_ECDH_H
/**********************************************************************************/
/* Defines */
/**********************************************************************************/
#define SET_SHARED_SECRET (0u)
#define OUTPUT_SHARED_SECRET (1u)
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_ECDH
{
r_key_group_t ecc_priv_key_group;
r_key_index_t ecc_priv_key_id;
r_key_group_t ecc_pub_key_group;
r_key_index_t ecc_pub_key_id;
r_key_group_t shared_key_group;
r_key_index_t shared_key_id;
r_kdf_algo_t kdf_algo;
r_hash_primitive_t hash_primitive;
r_job_slice_t job_slice;
union
{
const uint8_t *p_info;
uint64_t padding_sys64;
} ptr;
uint16_t counter;
uint8_t info_size_in_bytes;
uint16_t key_size_in_bytes;
union
{
uint8_t *p_shared_secret;
uint64_t padding_sys64;
} ptr2;
uint8_t output_select;
} ISD_ECDH_t;
#endif /* R_ICUMIF_API_ECDH_H */

View File

@@ -0,0 +1,52 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_ECDSA_SIGN_H)
#define R_ICUMIF_API_ECDSA_SIGN_H
/**********************************************************************************/
/* Definition */
/**********************************************************************************/
#define ECDSA_SIGNATURE_NUM (2u)
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_ECDSA_SIGN
{
union
{
const uint8_t *p_source;
uint64_t padding_sys64;
} ptr;
union
{
uint8_t *p_data;
uint64_t padding_sys64;
} signature[ECDSA_SIGNATURE_NUM];
uint32_t source_size_in_bytes;
r_hash_primitive_t hash_primitive;
r_number_format_t signature_format;
r_key_group_t key_group;
r_key_index_t key_id;
r_job_slice_t job_slice_hash;
r_job_slice_t job_slice_point_mul;
volatile uint16_t signature_size_in_bits[ECDSA_SIGNATURE_NUM];
uint8_t is_precalculated_hash;
} ISD_ECDSA_SIGN_t;
#endif /* R_ICUMIF_API_ECDSA_SIGN_H */

View File

@@ -0,0 +1,53 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_ECDSA_VERIFY_H)
#define R_ICUMIF_API_ECDSA_VERIFY_H
/**********************************************************************************/
/* Definition */
/**********************************************************************************/
#define ECDSA_SIGNATURE_NUM (2u)
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_ECDSA_VERIFY
{
union
{
const uint8_t *p_source;
uint64_t padding_sys64;
} ptr;
union
{
const uint8_t *p_data;
uint64_t padding_sys64;
} signature[ECDSA_SIGNATURE_NUM];
uint32_t source_size_in_bytes;
uint16_t signature_size_in_bits[ECDSA_SIGNATURE_NUM];
r_hash_primitive_t hash_primitive;
r_number_format_t signature_format;
r_key_group_t key_group;
r_key_index_t key_id;
r_job_slice_t job_slice_hash;
r_job_slice_t job_slice_point_mul;
uint8_t is_precalculated_hash;
volatile r_verif_result_t verification_result;
} ISD_ECDSA_VERIFY_t;
#endif /* R_ICUMIF_API_ECDSA_VERIFY_H */

View File

@@ -0,0 +1,52 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_EDDSA_SIGH_H)
#define R_ICUMIF_API_EDDSA_SIGH_H
/**********************************************************************************/
/* Definition */
/**********************************************************************************/
#define EDDSA_SIGNATURE_NUM (2u)
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_EDDSA_SIGN
{
union
{
const uint8_t *p_source;
uint64_t padding_sys64;
} ptr;
union
{
uint8_t *p_data;
uint64_t padding_sys64;
} signature[EDDSA_SIGNATURE_NUM];
uint32_t source_size_in_bytes;
r_hash_primitive_t hash_primitive;
r_number_format_t signature_format;
r_key_group_t key_group;
r_key_index_t key_id;
r_job_slice_t job_slice_hash;
r_job_slice_t job_slice_point_mul;
volatile uint16_t signature_size_in_bits[EDDSA_SIGNATURE_NUM];
uint8_t is_precalculated_hash;
} ISD_EDDSA_SIGN_t;
#endif /* R_ICUMIF_API_EDDSA_SIGH_H */

View File

@@ -0,0 +1,53 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_EDDSA_VERIFY_H)
#define R_ICUMIF_API_EDDSA_VERIFY_H
/**********************************************************************************/
/* Definition */
/**********************************************************************************/
#define EDDSA_SIGNATURE_NUM (2u)
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_EDDSA_VERIFY
{
union
{
const uint8_t *p_source;
uint64_t padding_sys64;
} ptr;
union
{
const uint8_t *p_data;
uint64_t padding_sys64;
} signature[EDDSA_SIGNATURE_NUM];
uint32_t source_size_in_bytes;
uint16_t signature_size_in_bits[EDDSA_SIGNATURE_NUM];
r_hash_primitive_t hash_primitive;
r_number_format_t signature_format;
r_key_group_t key_group;
r_key_index_t key_id;
r_job_slice_t job_slice_hash;
r_job_slice_t job_slice_point_mul;
uint8_t is_precalculated_hash;
volatile r_verif_result_t verification_result;
} ISD_EDDSA_VERIFY_t;
#endif /* R_ICUMIF_API_EDDSA_VERIFY_H */

View File

@@ -0,0 +1,45 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_GET_ID_H)
#define R_ICUMIF_API_GET_ID_H
/**********************************************************************************/
/* Definition */
/**********************************************************************************/
#define UID_SIZE_15 (15u)
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_GET_ID
{
union
{
uint8_t *p_challenge;
uint64_t padding_sys64;
} ptr1;
uint8_t UID[UID_SIZE_15];
uint8_t SREG;
union
{
uint8_t *p_CMAC;
uint64_t padding_sys64;
} ptr2;
} ISD_GET_ID_t;
#endif /* R_ICUMIF_API_GET_ID_H */

View File

@@ -0,0 +1,125 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_GET_INFO_H)
#define R_ICUMIF_API_GET_INFO_H
/**********************************************************************************/
/* Definition */
/**********************************************************************************/
/* number of warning data */
#define INFO_WARNING_DATA_NUM (16u)
/* 16 is the maximum number of secure data flash physical blocks
assumed by the target microcomputer */
#define INFO_DF_BLOCK_NUM (16u)
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
INFO_GET_FW_NAME,
INFO_GET_FW_VERSION,
INFO_GET_FW_BUILD_TYPE,
INFO_GET_JOB_COUNT,
INFO_GET_KEY_MAPPING,
INFO_GET_MYDATA_SET,
INFO_GET_MONOCTR_MAPPING,
INFO_GET_SECURE_TICK,
INFO_GET_SECURE_TICK_FREQ,
INFO_GET_TIMING_1ST_STAGE_BOOT,
INFO_GET_CMAC_MIN,
INFO_GET_BOOT_STAGE_SLICE,
INFO_GET_BOOT_STAGE_SANCTION,
INFO_GET_SECURE_BOOT,
INFO_GET_WDT,
INFO_GET_RND,
INFO_GET_DEBUG,
INFO_GET_SECURE_TICK_INTERVAL,
INFO_GET_START_PE,
INFO_GET_EARLY_STARTUP_PE,
INFO_GET_DEVICE_ID,
INFO_GET_MEMCLUSTER_MAPPING,
INFO_GET_RAM_EXECUTE,
INFO_GET_ECC_TEST_LOCK,
INFO_GET_NVM_DATA_WARNING,
INFO_GET_FLS_CFG,
INFO_GET_FREE_BLOCK,
INFO_GET_VM_CFG,
LAST_ITEM_INFO_FW = 0x01000000
} info_type_t;
typedef enum
{
DATASET_SYS_CFG,
DATASET_MEM_CLUSTER,
DATASET_AES_KEY,
DATASET_CR_KEY,
DATASET_RSA_PRIV_KEY,
DATASET_RSA_PUB_KEY,
DATASET_ECC_PRIV_KEY,
DATASET_ECC_PUB_KEY,
DATASET_MYDATA,
DATASET_RSA_PUB_EXT_KEY,
DATASET_ECC_PUB_EXT_KEY,
DATASET_FW_INTERNAL = 0xFE,
DATASET_NONE = 0xFF,
LAST_ITEM_DATASET = 0x01000000
} info_dataset_type_t;
typedef struct
{
info_dataset_type_t dataset;
uint16_t index;
} info_warning_data_t;
typedef struct
{
info_warning_data_t data[INFO_WARNING_DATA_NUM];
} info_warning_t;
typedef struct
{
uint16_t total_num;
uint16_t num[INFO_DF_BLOCK_NUM];
} info_free_block_t;
typedef struct
{
uint64_t counter;
} secure_tick_info_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_GET_INFO
{
info_type_t info_id;
union
{
void *p_info;
uint64_t padding_sys64;
} ptr;
volatile uint8_t data_size_in_bytes;
} ISD_GET_INFO_t;
#endif /* R_ICUMIF_API_GET_INFO_H */

View File

@@ -0,0 +1,44 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_HASH_H)
#define R_ICUMIF_API_HASH_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_HASH
{
union
{
const uint8_t *p_message;
uint64_t padding_sys64;
} ptr1;
union
{
uint8_t *p_hash;
uint64_t padding_sys64;
} ptr2;
uint32_t message_size_in_bytes;
volatile uint16_t hash_size_in_bytes;
r_hash_primitive_t hash_primitive;
r_job_slice_t job_slice;
r_job_cycle_t job_cycle;
uint32_t total_msg_size_in_bytes;
} ISD_HASH_t;
#endif /* R_ICUMIF_API_HASH_H */

View File

@@ -0,0 +1,57 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_HMAC_H)
#define R_ICUMIF_API_HMAC_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
HMAC_GENERATION,
HMAC_VERIFICATION,
LAST_ITEM_HMAC = 0x01000000
} hmac_operation_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_HMAC
{
r_key_index_t key_id;
hmac_operation_t hmac_operation;
r_hash_primitive_t hash_primitive;
union
{
const uint8_t *p_msg;
uint64_t padding_sys64;
} ptr1;
uint32_t msg_size_in_bytes;
union
{
uint8_t *p_hmac;
uint64_t padding_sys64;
} ptr2;
uint8_t hmac_size_in_bytes;
r_job_slice_t job_slice;
volatile r_verif_result_t verification_result;
} ISD_HMAC_t;
#endif /* R_ICUMIF_API_HMAC_H */

View File

@@ -0,0 +1,35 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_HMAC_IMPORT_H)
#define R_ICUMIF_API_HMAC_IMPORT_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_HMAC_IMPORT
{
r_key_index_t key_id;
union
{
const uint8_t *p_key;
uint64_t padding_sys64;
} ptr;
uint8_t key_size_in_bytes;
} ISD_HMAC_IMPORT_t;
#endif /* R_ICUMIF_API_HMAC_IMPORT_H */

View File

@@ -0,0 +1,54 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_ISO15118_UPDATE_H)
#define R_ICUMIF_API_ISO15118_UPDATE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_ISO15118_UPDATE
{
r_key_index_t ecc_priv_key_id_for_ecdh;
r_key_index_t ecc_pub_key_id_for_ecdh;
r_key_index_t ecc_priv_key_id_for_update;
union
{
const uint8_t *p_new_priv_key; /* include IV */
uint64_t padding_sys64;
} ptr1;
uint32_t new_priv_key_size_in_bytes; /* include IV */
union
{
const uint8_t *p_new_pub_key_x;
uint64_t padding_sys64;
} ptr2;
uint32_t new_pub_key_x_size_in_bytes;
union
{
const uint8_t *p_new_pub_key_y;
uint64_t padding_sys64;
} ptr3;
uint32_t new_pub_key_y_size_in_bytes;
r_mem_cluster_verif_t mem_cluster_verif;
struct
{
r_key_property_flags_t disable_on_debug:1;
r_key_property_flags_t write_protected:1;
} flags;
} ISD_ISO15118_UPDATE_t;
#endif /* R_ICUMIF_API_ISO15118_UPDATE_H */

View File

@@ -0,0 +1,40 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_KEY_MGMT_H)
#define R_ICUMIF_API_KEY_MGMT_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
BUFFER_KEY_CONFIG,
LAST_ITEM_KEY_MNGT_OP = 0x01000000
} key_mngt_op_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_KEY_MNGT
{
key_mngt_op_t key_mngt_op;
} ISD_KEY_MNGT_t;
#endif /* R_ICUMIF_API_KEY_MGMT_H */

View File

@@ -0,0 +1,77 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_LIFECYCLE_H)
#define R_ICUMIF_API_LIFECYCLE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef enum
{
LC_STAGE_LC0 = 0x1122,
LC_STAGE_LC1 = 0x2233,
LC_STAGE_LC2 = 0x3344,
LC_STAGE_LC2S = 0x4455,
LC_STAGE_TERMINATION = 0x5566,
LAST_ITEM_LC_STAGE = 0x01000000
} r_stage_type_t;
typedef enum
{
LC_CR_NONE,
LC_CR_CHALLENGE,
LC_CR_RESPONSE,
LAST_ITEM_LC_CR_REQ = 0x01000000
} r_cr_request_t;
typedef struct
{
uint16_t life_cycle_stage;
uint16_t lc_terminate_status;
} sys_cfg_lc_t;
typedef enum
{
LC_TERMINATE_NON,
LC_TERMINATE_EXECUTE,
LC_TERMINATE_COMPLETE,
LAST_ITEM_LC_TERM = 0x01000000
} r_trm_status_t;
typedef struct ISD_LIFE_CYCLE
{
r_stage_type_t current_stage;
r_stage_type_t transition_dest;
r_mem_cluster_id_t cluster_id;
r_cr_request_t cr_request;
union
{
uint8_t *p_challenge;
uint64_t padding_sys64;
} ptr1;
union
{
uint8_t *p_response;
uint64_t padding_sys64;
} ptr2;
} ISD_LIFE_CYCLE_t;
#endif /* R_ICUMIF_API_LIFECYCLE_H */

View File

@@ -0,0 +1,75 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_MEM_CLUSTER_DEF_H)
#define R_ICUMIF_API_MEM_CLUSTER_DEF_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
INSTALL_METHOD_0,
INSTALL_METHOD_1,
LAST_ITEM_INSTALL_METHOD = 0x01000000
} r_install_method_t;
typedef enum
{
VERIF_ON_DEMAND,
VERIF_FIRST_STAGE_BOOT,
VERIF_SECOND_STAGE_BOOT,
VERIF_BACK_GROUND,
LAST_ITEM_VERIF_TYPE = 0x01000000
} r_verif_method_t;
typedef enum
{
BOOTMODE_NORMAL,
BOOTMODE_USER,
BOOTMODE_BOTH,
LAST_ITEM_BOOTMODE = 0x01000000
} r_boot_mode_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_MEM_CLUSTER_DEF
{
union
{
const uint32_t *p_data;
uint64_t padding_sys64;
} ptr;
uint32_t data_size_in_bytes;
r_mem_cluster_id_t cluster_id;
r_install_method_t install_method;
r_key_group_t install_key_group;
r_key_index_t install_key_id;
r_key_group_t verif_key_group;
r_key_index_t verif_key_id;
r_verif_method_t verif_method;
r_boot_mode_t boot_mode;
r_job_slice_t job_slice_cmac_install;
} ISD_MEM_CLUSTER_DEF_t;
#endif /* R_ICUMIF_API_MEM_CLUSTER_DEF_H */

View File

@@ -0,0 +1,43 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_MEM_CLUSTER_INSTALL_H)
#define R_ICUMIF_API_MEM_CLUSTER_INSTALL_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_MEM_CLUSTER_INST
{
union
{
const uint32_t *p_data;
uint64_t padding_sys64;
} ptr1;
uint32_t data_size_in_bytes;
union
{
const uint8_t *p_authentication_data;
uint64_t padding_sys64;
} ptr2;
uint32_t auth_data_size_in_bytes;
r_number_format_t auth_data_format;
r_mem_cluster_id_t cluster_id;
} ISD_MEM_CLUSTER_INST_t;
#endif /* R_ICUMIF_API_MEM_CLUSTER_INSTALL_H */

View File

@@ -0,0 +1,57 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_MEM_CLUSTER_VERIFY_H)
#define R_ICUMIF_API_MEM_CLUSTER_VERIFY_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
ACTION_VERIFY,
ACTION_FORCE_INSTALL,
ACTION_GET_VERIFICATION_STATUS,
ACTION_FORCE_VERIFICATION_FAIL,
ACTION_LOCK_VERIFICATION_STATUS,
LAST_ITEM_ACTION_TYPE = 0x01000000
} r_cluster_verif_action_t;
typedef enum
{
CLUSTER_NOT_VERIFIED,
CLUSTER_VERIFICATION_FAILED,
CLUSTER_VERIFIED,
LAST_ITEM_CLUSTER_STATUS = 0x01000000
} r_cluster_verif_status_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_MEM_CLUSTER_VERIF
{
r_mem_cluster_id_t cluster_id;
r_cluster_verif_action_t action;
r_job_slice_t job_slice;
volatile r_cluster_verif_status_t verification_status;
} ISD_MEM_CLUSTER_VERIF_t;
#endif /* R_ICUMIF_API_MEM_CLUSTER_VERIFY_H */

View File

@@ -0,0 +1,31 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_MEM_CLUSTER_VERIFY_AUTO_H)
#define R_ICUMIF_API_MEM_CLUSTER_VERIFY_AUTO_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_MEM_CLUSTER_VERIF_AUTO
{
r_job_slice_t job_slice;
uint32_t timing_interval;
} ISD_MEM_CLUSTER_VERIF_AUTO_t;
#endif /* R_ICUMIF_API_MEM_CLUSTER_VERIFY_AUTO_H */

View File

@@ -0,0 +1,50 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_MONO_CTR_H)
#define R_ICUMIF_API_MONO_CTR_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef enum
{
MONOTONIC_CTR_RAM,
MONOTONIC_CTR,
LAST_ITEM_MONO_CTR = 0x01000000
} mono_ctr_type_t;
typedef enum
{
MONO_CTR_READ,
MONO_CTR_SET_VALUE,
MONO_CTR_INCREMENT,
LAST_ITEM_MONO_CTR_OP = 0x01000000
} mono_ctr_op_t;
typedef struct ISD_MONO_CTR
{
mono_ctr_type_t mono_ctr_type;
uint8_t mono_ctr_id;
mono_ctr_op_t mono_ctr_op;
volatile uint64_t counter;
} ISD_MONO_CTR_t;
#endif /* R_ICUMIF_API_MONO_CTR_H */

View File

@@ -0,0 +1,66 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_PK_EXPORT_H)
#define R_ICUMIF_API_PK_EXPORT_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_PK_EXPORT
{
union
{
uint8_t *p_modulus;
uint8_t *p_pub_point_x;
uint64_t padding_sys64;
} ptr1;
union
{
uint8_t *p_pub_exp;
uint8_t *p_pub_point_y;
uint64_t padding_sys64;
} ptr2;
union
{
uint8_t *p_signature;
uint64_t padding_sys64;
} ptr3;
r_number_format_t key_format;
r_number_format_t sig_format;
r_key_group_t key_group;
r_key_index_t key_id;
r_key_group_t sig_key_group;
r_key_index_t sig_key_id;
r_signature_algo_t sig_algo;
r_hash_primitive_t hash_primitive;
volatile r_ecc_curve_t curve_id;
union
{
volatile uint16_t point_x_size_in_bits;
volatile uint16_t modulus_size_in_bits;
} size1;
union
{
volatile uint16_t point_y_size_in_bits;
volatile uint16_t pub_exp_size_in_bits;
} size2;
volatile uint16_t sig_size_in_bits;
uint8_t skip_sign;
} ISD_PK_EXPORT_t;
#endif /* R_ICUMIF_API_PK_EXPORT_H */

View File

@@ -0,0 +1,98 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_PK_IMPORT_H)
#define R_ICUMIF_API_PK_IMPORT_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_PK_IMPORT
{
union
{
const uint8_t *p_modulus;
const uint8_t *p_pub_point_x;
uint64_t padding_sys64;
} ptr1;
union
{
const uint8_t *p_pub_exp;
const uint8_t *p_pub_point_y;
uint64_t padding_sys64;
} ptr2;
/* added for private key value import */
union
{
const uint8_t *p_priv_exp;
const uint8_t *p_priv_scalar;
uint64_t padding_sys64;
} ptr3;
union
{
const uint8_t *p_signature;
uint64_t padding_sys64;
} ptr4;
union
{
uint8_t *p_info;
uint64_t padding_sys64;
} ptr5;
r_number_format_t key_format;
r_number_format_t sig_format;
r_key_group_t key_group; /* need for x.509 import */
r_key_index_t key_id; /* need for x.509 import */
r_key_group_t sig_key_group; /* need for x.509 import */
r_key_index_t sig_key_id; /* need for x.509 import */
r_mem_cluster_verif_t mem_cluster_verif; /* need for x.509 import */
r_signature_algo_t sig_algo; /* need for x.509 import */
r_hash_primitive_t hash_primitive; /* need for x.509 import */
r_ecc_curve_t curve_id;
union
{
uint16_t point_x_size_in_bits;
uint16_t modulus_size_in_bits;
} size1;
union
{
uint16_t point_y_size_in_bits;
uint16_t pub_exp_size_in_bits;
} size2;
/* added for private key value import */
union
{
uint16_t priv_scalar_size_in_bits;
uint16_t priv_exp_size_in_bits;
} size3;
uint16_t sig_size_in_bits;
uint16_t info_size_in_bytes;
union
{
const uint8_t *p_x509_certificate;
uint64_t padding_sys64;
} ptr6;
uint16_t x509_certificate_size_in_bytes;
struct
{
r_key_property_flags_t disable_on_debug:1;
r_key_property_flags_t write_protected:1;
r_key_property_flags_t iso15118:1;
} flags;
uint8_t skip_verify;
} ISD_PK_IMPORT_t;
#endif /* R_ICUMIF_API_PK_IMPORT_H */

View File

@@ -0,0 +1,49 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_PK_IMPORT_EXT_H)
#define R_ICUMIF_API_PK_IMPORT_EXT_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_PK_IMPORT_EXT
{
r_key_group_t key_group;
r_key_index_t key_id;
struct
{
r_key_property_flags_t disable_on_debug:1;
r_key_property_flags_t write_protected:1;
r_key_property_flags_t iso15118:1;
} flags;
r_mem_cluster_verif_t mem_cluster_verif;
r_key_group_t sig_key_group;
r_key_index_t sig_key_id;
r_signature_algo_t sig_algo;
r_hash_primitive_t hash_primitive;
union
{
const uint32_t *p_x509_certificate;
uint64_t padding_sys64;
} ptr;
uint16_t x509_certificate_size_in_bytes;
uint8_t skip_verify;
} ISD_PK_IMPORT_EXT_t;
#endif /* R_ICUMIF_API_PK_IMPORT_EXT_H */

View File

@@ -0,0 +1,62 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_RAND_GENERATE_H)
#define R_ICUMIF_API_RAND_GENERATE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef enum
{
RAND_NO_TEST,
RAND_DIAG_P1_TEST,
RAND_DIAG_P2_TEST,
RAND_HEALTH_TEST,
LAST_ITEM_RAND_TEST = 0x01000000
} r_rand_test_t;
typedef struct _ISD_RAND_INIT
{
r_rand_test_t online_test;
}
ISD_RAND_INIT_t;
typedef struct _ISD_RAND_EXTEND_SEED
{
union
{
const uint32_t *p_entropy;
const uint64_t padding_sys64;
} ptr;
}
ISD_RAND_EXTEND_SEED_t;
typedef struct ISD_RAND_GENERATE
{
union
{
uint32_t *p_block_out;
uint64_t padding_sys64;
} ptr;
uint32_t nb_blocks;
r_job_slice_t job_slice;
}
ISD_RAND_GENERATE_t;
#endif /* R_ICUMIF_API_RAND_GENERATE_H */

View File

@@ -0,0 +1,51 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_RSA_DECRYPT_H)
#define R_ICUMIF_API_RSA_DECRYPT_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_RSA_DECRYPT
{
union
{
const uint8_t* p_encrypted_message; /* in */
uint64_t padding_sys64;
} ptr1;
uint16_t encrypted_message_size_in_bits; /* in */
union
{
uint8_t* p_message; /* out */
uint64_t padding_sys64;
} ptr2;
uint32_t message_size_in_bytes; /* out */
union
{
const uint8_t* p_label; /* in */
uint64_t padding_sys64;
} ptr3;
uint32_t label_size_in_bytes; /* in */
r_hash_primitive_t hash_primitive; /* in */
r_message_encoding_format_t message_encoding_format; /* in */
r_key_index_t key_id; /* in */
r_number_format_t encrypted_message_format; /* in */
r_job_slice_t job_slice_mod_exp; /* in */
} ISD_RSA_DECRYPT_t;
#endif /* R_ICUMIF_API_RSA_DECRYPT_H */

View File

@@ -0,0 +1,52 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_RSA_ENCRYPT_H)
#define R_ICUMIF_API_RSA_ENCRYPT_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_RSA_ENCRYPT
{
union
{
const uint8_t* p_message; /* in */
uint64_t padding_sys64;
} ptr1;
uint32_t message_size_in_bytes; /* in */
union
{
uint8_t* p_encrypted_message; /* out */
uint64_t padding_sys64;
} ptr2;
uint16_t encrypted_message_size_in_bits; /* out */
union
{
const uint8_t* p_label; /* in (option for OAEP) */
uint64_t padding_sys64;
} ptr3;
uint32_t label_size_in_bytes; /* in (option for OAEP) */
r_hash_primitive_t hash_primitive; /* in */
r_message_encoding_format_t message_encoding_format; /* in */
r_key_group_t key_group; /* in */
r_key_index_t key_id; /* in */
r_number_format_t encrypted_message_format; /* in */
r_job_slice_t job_slice_mod_exp; /* in */
} ISD_RSA_ENCRYPT_t;
#endif /* R_ICUMIF_API_RSA_ENCRYPT_H */

View File

@@ -0,0 +1,37 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_KEY_GENERATE_H)
#define R_ICUMIF_API_KEY_GENERATE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_RSA_KEY_GENERATE
{
r_key_index_t key_id;
r_mem_cluster_verif_t mem_cluster_verif;
uint16_t modulus_size_in_bits;
struct
{
r_key_property_flags_t disable_on_debug:1;
r_key_property_flags_t write_protected:1;
} flags;
} ISD_RSA_KEY_GENERATE_t;
#endif /* R_ICUMIF_API_KEY_GENERATE_H */

View File

@@ -0,0 +1,48 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_RSA_SIGN_H)
#define R_ICUMIF_API_RSA_SIGN_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_RSA_SIGN
{
union
{
const uint8_t *p_source;
uint64_t padding_sys64;
} ptr1;
union
{
uint8_t *p_signature;
uint64_t padding_sys64;
} ptr2;
uint32_t source_size_in_bytes;
r_hash_primitive_t hash_primitive;
r_hash_encoding_format_t hash_encoding_format;
r_number_format_t signature_format;
r_key_index_t key_id;
r_job_slice_t job_slice_hash;
r_job_slice_t job_slice_mod_exp;
volatile uint16_t signature_size_in_bits;
volatile uint16_t salt_size_in_bytes;
uint8_t is_precalculated_hash;
} ISD_RSA_SIGN_t;
#endif /* R_ICUMIF_API_RSA_SIGN_H */

View File

@@ -0,0 +1,50 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_RSA_VERIFY_H)
#define R_ICUMIF_API_RSA_VERIFY_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_RSA_VERIFY
{
union
{
const uint8_t *p_source;
uint64_t padding_sys64;
} ptr1;
union
{
const uint8_t *p_signature;
uint64_t padding_sys64;
} ptr2;
uint32_t source_size_in_bytes;
uint16_t signature_size_in_bits;
uint16_t salt_size_in_bytes;
r_hash_primitive_t hash_primitive;
r_hash_encoding_format_t hash_encoding_format;
r_number_format_t signature_format;
r_key_group_t key_group;
r_key_index_t key_id;
r_job_slice_t job_slice_hash;
r_job_slice_t job_slice_mod_exp;
uint8_t is_precalculated_hash;
volatile r_verif_result_t verification_result;
} ISD_RSA_VERIFY_t;
#endif /* R_ICUMIF_API_RSA_VERIFY_H */

View File

@@ -0,0 +1,114 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2022-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_SECURE_BOOT_API_H)
#define R_ICUMIF_API_SECURE_BOOT_API_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
ROM_GET_LCS = 0,
ROM_SECURE_BOOT_VERIFY,
ROM_SECURE_BOOT_DECRYPT,
ROM_SECURE_BOOT_COMPARE,
LAST_ITEM_BOOT_API = 0x01000000
} boot_api_t;
typedef struct
{
union
{
uint32_t *p_lcs;
uint64_t padding_sys64;
} ptr;
uint32_t lcs_size_in_bytes;
} boot_api_get_lcs_t;
typedef struct
{
union
{
uint32_t *p_key_cert;
uint64_t padding_sys64;
} ptr1;
union
{
uint32_t *p_content_cert;
uint64_t padding_sys64;
} ptr2;
union
{
uint32_t *p_cmac;
uint64_t padding_sys64;
} ptr3;
} boot_api_boot_verify_t;
typedef struct
{
union
{
uint32_t *p_content_cert;
uint64_t padding_sys64;
} ptr1;
union
{
uint32_t *p_cmac;
uint64_t padding_sys64;
} ptr2;
} boot_api_boot_decrypt_t;
typedef struct
{
union
{
uint32_t *p_content_cert;
uint64_t padding_sys64;
} ptr1;
union
{
uint32_t *p_hash;
uint64_t padding_sys64;
} ptr2;
uint32_t hash_size_in_bytes;
union
{
uint32_t *p_cmac;
uint64_t padding_sys64;
} ptr3;
} boot_api_boot_compare_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_SECURE_BOOT_API
{
boot_api_t boot_api_id;
uint32_t api_return_value;
union api_parameters
{
boot_api_get_lcs_t get_lcs;
boot_api_boot_verify_t boot_verify;
boot_api_boot_decrypt_t boot_decrypt;
boot_api_boot_compare_t boot_compare;
} api;
} ISD_SECURE_BOOT_API_t;
#endif /* R_ICUMIF_API_SECURE_BOOT_API_H */

View File

@@ -0,0 +1,129 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_SHE_H)
#define R_ICUMIF_API_SHE_H
/**********************************************************************************/
/* SHE specific parameters */
/**********************************************************************************/
/*===========================================================================*/
/* SHE key index */
/*===========================================================================*/
typedef enum
{
SHE_SECRET_KEY, /* SHE key index : 0 */
SHE_MASTER_ECU_KEY, /* SHE key index : 1 */
SHE_BOOT_MAC_KEY, /* SHE key index : 2 */
SHE_BOOT_MAC, /* SHE key index : 3 */
SHE_KEY_1, /* SHE key index : 4 */
SHE_KEY_2, /* SHE key index : 5 */
SHE_KEY_3, /* SHE key index : 6 */
SHE_KEY_4, /* SHE key index : 7 */
SHE_KEY_5, /* SHE key index : 8 */
SHE_KEY_6, /* SHE key index : 9 */
SHE_KEY_7, /* SHE key index : 10 */
SHE_KEY_8, /* SHE key index : 11 */
SHE_KEY_9, /* SHE key index : 12 */
SHE_KEY_10, /* SHE key index : 13 */
SHE_RAM_KEY, /* SHE key index : 14 */
SHE_KEY_11, /* SHE key index : 15 */
SHE_KEY_12, /* SHE key index : 16 */
SHE_KEY_13, /* SHE key index : 17 */
SHE_KEY_14, /* SHE key index : 18 */
SHE_KEY_15, /* SHE key index : 19 */
SHE_KEY_16, /* SHE key index : 20 */
SHE_KEY_17, /* SHE key index : 21 */
SHE_KEY_18, /* SHE key index : 22 */
SHE_KEY_19, /* SHE key index : 23 */
SHE_KEY_20, /* SHE key index : 24 */
SHE_KEY_21, /* SHE key index : 25 */
SHE_KEY_22, /* SHE key index : 26 */
SHE_KEY_23, /* SHE key index : 27 */
SHE_KEY_24, /* SHE key index : 28 */
SHE_KEY_25, /* SHE key index : 29 */
SHE_KEY_26, /* SHE key index : 30 */
SHE_KEY_27, /* SHE key index : 31 */
SHE_KEY_28, /* SHE key index : 32 */
SHE_KEY_29, /* SHE key index : 33 */
SHE_KEY_30, /* SHE key index : 34 */
SHE_KEY_31, /* SHE key index : 35 */
SHE_KEY_32, /* SHE key index : 36 */
SHE_KEY_33, /* SHE key index : 37 */
SHE_KEY_34, /* SHE key index : 38 */
SHE_KEY_35, /* SHE key index : 39 */
SHE_KEY_36, /* SHE key index : 40 */
SHE_KEY_37, /* SHE key index : 41 */
SHE_KEY_38, /* SHE key index : 42 */
SHE_KEY_39, /* SHE key index : 43 */
SHE_KEY_40, /* SHE key index : 44 */
SHE_KEY_41, /* SHE key index : 45 */
SHE_KEY_42, /* SHE key index : 46 */
SHE_KEY_43, /* SHE key index : 47 */
SHE_KEY_44, /* SHE key index : 48 */
SHE_KEY_45, /* SHE key index : 49 */
SHE_KEY_46, /* SHE key index : 50 */
SHE_KEY_47, /* SHE key index : 51 */
SHE_KEY_48, /* SHE key index : 52 */
SHE_KEY_49, /* SHE key index : 53 */
SHE_KEY_50, /* SHE key index : 54 */
SHE_KEY_51, /* SHE key index : 55 */
SHE_KEY_52, /* SHE key index : 56 */
SHE_KEY_53, /* SHE key index : 57 */
SHE_KEY_54, /* SHE key index : 58 */
SHE_KEY_55, /* SHE key index : 59 */
SHE_KEY_56, /* SHE key index : 60 */
SHE_KEY_57, /* SHE key index : 61 */
SHE_KEY_58, /* SHE key index : 62 */
SHE_KEY_59, /* SHE key index : 63 */
SHE_KEY_60, /* SHE key index : 64 */
SHE_KEY_61, /* SHE key index : 65 */
SHE_KEY_62, /* SHE key index : 66 */
SHE_KEY_63, /* SHE key index : 67 */
SHE_KEY_64, /* SHE key index : 68 */
SHE_KEY_65, /* SHE key index : 69 */
SHE_KEY_66, /* SHE key index : 70 */
SHE_KEY_67, /* SHE key index : 71 */
SHE_KEY_68, /* SHE key index : 72 */
SHE_KEY_69, /* SHE key index : 73 */
SHE_KEY_70, /* SHE key index : 74 */
SHE_KEY_71, /* SHE key index : 75 */
SHE_KEY_72, /* SHE key index : 76 */
SHE_KEY_73, /* SHE key index : 77 */
SHE_KEY_74, /* SHE key index : 78 */
SHE_KEY_75, /* SHE key index : 79 */
SHE_KEY_76, /* SHE key index : 80 */
SHE_KEY_77, /* SHE key index : 81 */
SHE_KEY_78, /* SHE key index : 82 */
SHE_KEY_79, /* SHE key index : 83 */
SHE_KEY_80, /* SHE key index : 84 */
SHE_KEY_81, /* SHE key index : 85 */
SHE_KEY_82, /* SHE key index : 86 */
SHE_KEY_83, /* SHE key index : 87 */
SHE_KEY_84, /* SHE key index : 88 */
SHE_KEY_85, /* SHE key index : 89 */
SHE_KEY_86, /* SHE key index : 90 */
SHE_KEY_87, /* SHE key index : 91 */
SHE_KEY_88, /* SHE key index : 92 */
SHE_KEY_89, /* SHE key index : 93 */
SHE_KEY_90, /* SHE key index : 94 */
LAST_ITEM_SHE_KEY = 0x01000000
} r_she_key_index_t;
#endif /* R_ICUMIF_API_SHE_H */

View File

@@ -0,0 +1,196 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_SYS_CFG_H)
#define R_ICUMIF_API_SYS_CFG_H
/**********************************************************************************/
/* Defines */
/**********************************************************************************/
#define STARTUP_BANK_A (0xA5u)
#define STARTUP_BANK_B (0x00u)
#define ECC_TEST_UNLOCK (0x00u)
#define ECC_TEST_LOCK (0x01u)
#define SYS_CFG_NORMAL_STARTUP_PE (0x00u)
#define SYS_CFG_EARLY_STARTUP_PE (0x01u)
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
#define SYS_CFG_MEMCLUSTER_MAX_ID (32u)
typedef enum
{
SET_KEY_MAPPING,
SET_BOOT_STAGE,
SET_MYDATA_MAPPING,
SET_MONOCTR_MAPPING,
SET_SECURE_TICK,
SET_SYS_INTERRUPT,
SET_WDT,
SET_CMAC_MIN,
SET_SECURE_BOOT_CFG,
SET_DEBUG,
SET_RAND,
SET_START_PE,
SET_EARLY_STARTUP_PE,
SET_MEMCLUSTER_MAPPING,
SET_ECC_TEST_LOCK,
SET_FLS_CFG,
SET_VM_CFG,
LAST_ITEM_CONFIG = 0x01000000
} sys_config_t;
typedef struct
{
uint16_t nb_aes_keys;
uint16_t nb_rsa_priv_keys;
uint16_t nb_rsa_pub_keys;
uint16_t nb_ecc_priv_keys;
uint16_t nb_ecc_pub_keys;
uint16_t nb_rsa_pub_ext_keys;
uint16_t nb_ecc_pub_ext_keys;
uint16_t nb_aes_ram_keys;
uint16_t nb_aes_buffer_keys;
uint16_t nb_ecc_ram_keys;
uint16_t nb_hmac_keys;
uint16_t nb_tls_master_keys;
} sys_cfg_key_mapping_t;
typedef struct
{
uint8_t nb_items;
uint16_t item_size_in_bytes;
} sys_cfg_mydata_set_t;
typedef enum
{
SANCTION_DO_NOTHING,
SANCTION_DEVICE_STOP,
SANCTION_ICUM_ADMIN,
LAST_ITEM_SANCTION = 0x01000000
} r_sanction_t;
typedef struct
{
uint8_t peid:4;
uint8_t channel:4;
} sys_cfg_sys_int_t;
typedef struct
{
uint16_t int_freq;
} sys_cfg_secure_tick_t;
typedef struct
{
uint32_t erm;
} sys_cfg_watchdog_t;
typedef struct
{
uint8_t bclr_psm;
uint8_t nsbf_psm;
uint16_t enable_skip_secureboot;
} sys_cfg_boot_t;
typedef struct
{
uint8_t mc_length_min_ctr;
uint8_t mc_length_min_val;
uint8_t short_mac_length_min_ctr;
uint8_t short_mac_length_min_val;
} sys_cfg_cmac_min_t;
typedef struct
{
uint32_t rand_trng_pre_init_start;
uint32_t rand_olt_no_ds_reset;
uint32_t rand_olt_ds_reset;
uint32_t rand_first_init_type;
} sys_cfg_rand_t;
typedef struct
{
uint32_t cr_auth_key_type;
uint32_t cr_auth_dlt;
} sys_cfg_debug_t;
typedef struct
{
uint16_t warning1;
uint16_t warning2;
} sys_cfg_fls_t;
typedef enum
{
NONE_VM,
UNIQUE_VM_ID_ALL_CORE,
LAST_ITEM_VM_TYPE = 0x01000000
} sys_cfg_vm_type_t;
typedef struct
{
sys_cfg_vm_type_t vm_type;
uint8_t nb_vms;
uint8_t privilege_vm_id;
uint8_t memcluster_vm_id[SYS_CFG_MEMCLUSTER_MAX_ID];
} sys_cfg_vm_t;
typedef struct
{
r_verif_method_t verif_method;
r_sanction_t sanction;
r_job_slice_t job_slice;
} sys_cfg_cluster_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_SYSTEM_CONFIG
{
sys_config_t sys_cfg_id;
struct config_parameters
{
sys_cfg_key_mapping_t key_mapping;
sys_cfg_mydata_set_t mydata_set;
uint8_t nb_monoctr_nv;
uint8_t mem_cluster_mapping;
sys_cfg_sys_int_t sys_interrupt;
sys_cfg_secure_tick_t secure_tick;
sys_cfg_watchdog_t watchdog;
sys_cfg_boot_t boot;
sys_cfg_cmac_min_t mac_length;
r_stage_type_t life_cycle_stage;
sys_cfg_debug_t debug;
sys_cfg_rand_t rand;
sys_cfg_cluster_t cluster;
uint8_t start_pe_set;
uint8_t early_startup_pe;
uint8_t test_lock;
sys_cfg_fls_t fls_cfg;
sys_cfg_vm_t vm_cfg;
} cfg;
} ISD_SYSTEM_CONFIG_t;
#endif /* R_ICUMIF_API_SYS_CFG_H */

View File

@@ -0,0 +1,40 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_SYS_INIT_H)
#define R_ICUMIF_API_SYS_INIT_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
SYS_INIT_FW_INITIALIZATION,
LAST_ITEM_SYS_INIT = 0x01000000
} sys_init_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_SYSTEM_INIT
{
sys_init_t sys_init_id;
} ISD_SYSTEM_INIT_t;
#endif /* R_ICUMIF_API_SYS_INIT_H */

View File

@@ -0,0 +1,49 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_TLS_ECDH_EXCHANGE_H)
#define R_ICUMIF_API_TLS_ECDH_EXCHANGE_H
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_TLS_ECDH_EXCHANGE
{
union
{
const uint8_t *p_client_random;
uint64_t padding_sys64;
} ptr1;
union
{
const uint8_t *p_server_random;
uint64_t padding_sys64;
} ptr2;
r_key_group_t ecc_priv_key_group;
r_key_index_t ecc_priv_key_id;
r_key_group_t ecc_pub_key_group;
r_key_index_t ecc_pub_key_id;
r_key_index_t master_secret_id;
r_key_index_t aes_send_key_id;
r_key_index_t aes_receive_key_id;
r_key_index_t hmac_send_key_id;
r_key_index_t hmac_receive_key_id;
uint32_t hmac_key_size_in_bytes;
r_job_slice_t job_slice_multiply;
} ISD_TLS_ECDH_EXCHANGE_t;
#endif /* R_ICUMIF_API_TLS_ECDH_EXCHANGE_H */

View File

@@ -0,0 +1,63 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_TLS_RSA_EXCHANGE_H)
#define R_ICUMIF_API_TLS_RSA_EXCHANGE_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef struct
{
uint8_t major;
uint8_t minor;
} protocol_version_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_TLS_RSA_EXCHANGE
{
protocol_version_t protocol_version;
union
{
const uint8_t *p_client_random;
uint64_t padding_sys64;
} ptr1;
union
{
const uint8_t *p_server_random;
uint64_t padding_sys64;
} ptr2;
r_key_index_t rsa_pub_key_id;
r_key_index_t master_secret_id;
r_key_index_t aes_send_key_id;
r_key_index_t aes_receive_key_id;
r_key_index_t hmac_send_key_id;
r_key_index_t hmac_receive_key_id;
uint32_t hmac_key_size_in_bytes;
r_job_slice_t job_slice_mod_exp;
union
{
uint8_t *p_premaster;
uint64_t padding_sys64;
} ptr3;
uint32_t premaster_size_in_bytes;
} ISD_TLS_RSA_EXCHANGE_t;
#endif /* R_ICUMIF_API_TLS_RSA_EXCHANGE_H */

View File

@@ -0,0 +1,55 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined(R_ICUMIF_API_TLS_VERIFY_DATA_H)
#define R_ICUMIF_API_TLS_VERIFY_DATA_H
/**********************************************************************************/
/* Type definition */
/**********************************************************************************/
typedef enum
{
TLS_VERIFY_CLIENT,
TLS_VERIFY_SERVER,
LAST_ITEM_TLS_VERIFY_DATA = 0x01000000
} tls_verify_data_operation_t;
/**********************************************************************************/
/* Service parameters */
/**********************************************************************************/
typedef struct ISD_TLS_VERIFY_DATA
{
r_key_index_t key_id;
union
{
const uint8_t *p_msg;
uint64_t padding_sys64;
} ptr1;
uint32_t msg_size_in_bytes;
union
{
uint8_t *p_verify;
uint64_t padding_sys64;
} ptr2;
uint32_t verify_size_in_bytes;
tls_verify_data_operation_t side;
r_job_slice_t job_slice_hash;
} ISD_TLS_VERIFY_DATA_t;
#endif /* R_ICUMIF_API_TLS_VERIFY_DATA_H */

View File

@@ -0,0 +1,24 @@
/******************************************************************************/
/* Component Name ICU-M Interface Library (ICUMIF) */
/******************************************************************************/
/* Product : ICU-M Firmware */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.
*
* RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
*
* These instructions, statements, and programs are the confidential information
* of Renesas Electronics Corporation. They must be used and modified solely for
* the purpose for which it was furnished by Renesas Electronics Corporation.
* All part of them must not be reproduced nor disclosed to others in any form,
* without the prior written permission of Renesas Electronics Corporation.
*******************************************************************************/
#if !defined (R_TYPEDEFS_H)
#define R_TYPEDEFS_H
#include <stddef.h>
#include <stdint.h>
#endif /* R_TYPEDEFS_H */