CryIf¶
文档信息 Document Information¶
版本历史 Version History¶
日期(Date) |
作者(Author) |
版本(Version) |
状态(Status) |
说明(Description) |
|---|---|---|---|---|
2025/02/22 |
jie.gu |
V0.1 |
发布(Release) |
首次发布(First release) |
2025/04/04 |
jie.gu |
V1.0 |
发布(Release) |
正式发布(Official release) |
参考文档 References¶
编号(Number) |
分类(Classification) |
标题(Title) |
版本(Version) |
|---|---|---|---|
1 |
Autosar |
AUTOSAR_CP_SRS_CryptoStack.pdf |
R23-11 |
2 |
Autosar |
AUTOSAR_CP_SWS_CryptoInterface.pdf |
R23-11 |
术语与简写 Terms and Abbreviations¶
术语 Terms¶
术语(Terms) |
解释(Explanation) |
|---|---|
Crypto Driver Object |
Crypto Driver实现一个或多个Crypto Driver Object。Crypto Driver Object可通过硬件或软件提供不同的crypto primitive。同一Crypto Driver下的各个Crypto Driver Object彼此独立。每个Crypto Driver Object仅拥有一个workspace(即同一时间只能执行一个 crypto primitive)。(Crypto Driver realizes one or more Crypto Driver Objects.The Crypto Driver Object can provide different crypto primitives via either hardware or software. Each Crypto Driver Object under the same Crypto Driver is independent from each other. Each Crypto Driver Object has one workspace only (i.e. only one crypto primitive can be executed each time).) |
Key |
Key可由Csm中的job进行引用。在Crypto Driver中,该Key指向特定的key type。(Key can be referenced by job in Csm.) In Crypto Driver, this key points to the specific key type. |
Key Type |
key type由key element构成,且指向这些key element。通常,key type由Crypto Driver的供应商预先配置。(The key type consists of key elements and points to these key elements.) The key type is generally pre-configured by the supplier of the Crypto Driver. |
Key Element |
Key element用于存储数据。此类数据例如可以是密钥材料(key material),或是AES加密所需的初始向量(IV);Key element还可用于配置密钥管理功能(key management functions)的行为。不同Key对应的Key element拥有不同的存储区域(包括非易失性存储区NV和随机存取存储区RAM)。(The key element is used for storing data.) This type of data can be key material or the initial vector (IV) required for AES encryption; furthermore, the Key elements can also be used for configuring the behavior of key management functions. The Key elements corresponding to different keys have different storage areas (including non-volatile memory NV and random access memory RAM). |
Job |
Job是已完成配置的 “CsmJob”。其中,Job会引用key、cryptographic primitive 以及reference channel等要素。(Job refers to the configured ‘CsmJob’.) To be specific, Job will reference elements such as key, cryptographic primitive, and reference channel. |
Channel |
channel是从Crypto Service Manager队列经Crypto Interface到特定Crypto Driver Object的路径。(Channel is the path from the Crypto Service Manager queue to a specific Crypto Driver Object via the Crypto Interface.) |
Primitive |
primitive是在Crypto Driver Object中实现的、已配置的加密算法(cryptographic algorithm)的实例。其中,primitive会引用CSM提供给应用的功能、具体的底层 “algorithmfamily”(如 AES、MD5、RSA等)以及 “algorithmmode”(如 ECB、CBC等)。(primitive is an instance of a configured cryptographic algorithm realized in the Crypto Driver Object.) To be specific, primitive will reference the functions provided by CSM for the application, the specific underlying “algorithm family” (such as AES, MD5, RSA, etc.), and “algorithm mod” (such as ECB, CBC, etc.). |
Operation |
crypto primitive的操作(operation)用于声明应执行该加密原语的哪部分功能。存在三种不同的操作类型:(The operation of crypto primitive is used for declaring the specific part of the function of the encryption primitive that should be executed) There’re three different operation types: |
START |
Operation表示一个新的crypto primitive请求,它应取消所有先前的请求,执行必要的初始化,并检查该加密原语是否可被处理。(Operation refers to a new crypto primitive request that should cancel all previous requests, perform necessary initialization, and check if the encryption primitive can be processed.) |
UPDATE |
Operation表示crypto primitive需要输入数据。更新操作(update operation)可提供中间结果。(Operation means that crypto primitive needs data inputting.) The update operation can provide intermediate results. |
FINISH |
Operation表示,至此所有数据已完全输入,crypto primitive可完成最终计算。完成操作(finish operation)可提供最终结果。(Operation means that all data has been fully inputted, and crypto primitive can complete the final calculation.) The finish operation can provide the final results. |
Priority |
job的priority定义了其重要程度。priority数值越高,job的执行就越紧急。cryptographic job的priority是配置的一部分。(The priority of job defines its level of importance.) The higher the priority value, the more urgent the job execution. The priority of cryptographic jobs is part of the configuration. |
Processing |
指示job处理的类型。(It indicates the type of job processing.) |
Service |
service应按照《TR_Glossary》文档中的定义理解:service是一种operation类型,其接口(interface)和行为(behavior)具有公开的规范(published specification),涉及能力提供者(provider of the capability)与潜在客户端(potential clients)之间的约定(contract)。(Service should be understood according to the definition in the TR_Glossary file: Service refers to an operation type, the interface and behavior of which have published specifications. It involves the contract between providers of the capability and potential clients.) |
简写 Abbreviations¶
简写(Abbreviation) |
全称(Full name) |
解释(Explanation) |
|---|---|---|
CDD |
Complex Device Driver |
复杂设备驱动 |
CSM |
Crypto Service Manager |
加密服务管理器 |
CRYIF |
Crypto Interface |
加密接口层 |
CRYPTO |
Crypto Driver |
加密驱动 |
DET |
Default Error Tracer |
默认错误追踪器 |
HSM |
Hardware Security Module |
硬件安全模块 |
HW |
Hardware |
硬件 |
SHE |
Security Hardware Extension |
安全硬件扩展 |
SW |
Software |
软件 |
简介 Introduction¶
CryIf 模块位于底层密码解决方案(Crypto Driver 和基于 sw 的 CDD)和上层 服务层(CSM)之间。它表示到上层服务层的密码驱动程序服务的接口。CryIf 模块 提供了一个独特的接口来管理不同的密码 HW 和 SW 解决方案,如 HSM、SHE 或基于 SW 的 CDD。因此,基于 Crypto 接口维护的映射方案,Crypto 服务管理 模块可以利用多种底层的内部和外部加密 HW 以及 SW 解决方案
The CryIf module is between the underlying cryptographic solutions (Crypto Driver and SW based CDD) and the upper layer service layer (CSM). It indicates the interface of the password driver service to the upper layer service layer. The CryIf module provides a unique interface, which can manage different password HW and SW solutions, such as HSM, SHE, or SW-based CDD. Therefore, based on the mapping scheme maintained by the Crypto interface, the Crypto service management module can utilize many kinds of underlying internal and external encryption HW and SW solutions
功能描述 Functional Description¶
特性 Features¶
1.CryIf基本功能介绍
1.Introduction to the basic functions of CryIf
CryIf 位于 CSM 和 Crypto Driver 之间,是访问所有上层(BSW)密码操作的 唯一接口。密码接口也是密码驱动程序的唯一用户,并提供了一个独特的接口 来管理不同的密码硬件和软件解决方案。抽象层封装了不同的硬件和软件访问 机制,因此加密接口的实现独立于底层的加密驱动程序,可以在硬件或软件中 实现。它还保证了对加密服务的并发访问,使同时处理多个加密任务成为可 能。
Located between CSM and Crypto Driver, CryIf is the only interface for accessing all upper layer (BSW) cryptographic operations. The password interface is also the only user of the password driver program. One unique interface is also provided for managing different password hardware and software solutions. In the abstraction layer, different hardware and software access mechanisms are encapsulated, so the realization of the encryption interface is independent from the underlying encryption driver and can be realized in hardware or software. It also ensures the concurrent access to encryption services, and supports the processing of multiple encryption tasks simultaneously.
2.转发请求
2.forward request
CryIf作为接口层,接收 CSM 传输的数据并传输给 Crypto Driver去执行对应的加密服务,同时将 Crypto Driver 的执行结果返回给 CSM。
As the interface layer, CryIf receives data transmitted by CSM and transmits it to Crypto Driver to execute the corresponding encryption services. It can also send the execution result of Crypto Driver to CSM at the same time.
3.支持多驱动
3.Support multiple drivers
当需要支持多驱动时,打开 CryIfMulDriverSupport 开关,并填写不同驱动接口的前缀,即可根据接口名使 用不同的驱动。
When multiple drivers need supporting, turn on the CryIfMulDriveSupport switch and fill in the prefixes of different driver interfaces, to use different drivers based on the interface name.
偏差 Deviation¶
None
扩展 Extension¶
None
集成 Integration¶
文件列表 File List¶
CryIF组件文件组织结构描述. (Descriptions of CryIf component file organization structure)¶
如图 CryIF组件文件组织结构描述. (Descriptions of CryIf component file organization structure) 所示,CryIf模块的文件引用关系如下:
As shown in the figure CryIF组件文件组织结构描述. (Descriptions of CryIf component file organization structure), the file reference relationship of the CryIf module is shown as follows:
静态文件 Static Files¶
None
动态文件 Dynamic Files¶
文件(File) |
描述(Description) |
|---|---|
CryIf.c |
CryIf 模块源文件,包含了 API 函数的实现。(The CryIf module source file, which contains the realization of API functions.) |
CryIf.h |
CryIf 模块头文件,包含了 API 函数的扩展声明并定义了配置的数据结构。(The CryIf module header file contains extension declarations for API functions and defines the structure of configured data.) |
CryIf_Cfg.h |
定义 CryIf 模块预编译时用到的配置参数。(Configuration parameters used for defining the pre-compilation of CryIf modules.) |
CryIf_cfg.c |
CryIf 模块配置生成文件。(Files generated by CryIf module configuration.) |
错误处理 Error Handling¶
开发错误 Development Errors¶
Error code
Value[hex]
Description
CRYIF_E_UNINIT
0x00
API request called before initialisation of CRYIF module.
CRYIF_E_INIT_FAILED
0x01
Initialisation of CRYIF module failed.
CRYIF_E_PARAM_POINTER
0x02
API request called with invalid parameter (null pointer).
CRYIF_E_PARAM_HANDLE
0x03
API request called with invalid parameter (out of range).
CRYIF_E_PARAM_VALUE
0x04
API request called with invalid parameter (invalid value).
CRYIF_E_KEY_SIZE_MISMATCH
0x05
Source key element size does not match the target key elements size.
产品错误 Product Errors¶
None
运行时错误 Runtime Errors¶
None
应用程序集成 Application Integration¶
1.依赖模块
1.Dependency module
配置CryIf模块需要保证工程中存在CryptoDriver,将秘钥,通道等信息往CsM中传递,由CsM进行管理。
To configure the CryIf module, make sure the CryptoDriver is available in project so as to transfer key, channel, and other information to CsM for management.
类型定义 Type Definitions¶
None
提供的服务 Services¶
CryIf_CallbackNotification¶
void CryIf_CallbackNotification(Crypto_JobType *job, Crypto_ResultType result)
Callback function for Crypto Job notification.This function is called by the Crypto driver to notify the application about the completion of a Crypto Job.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
job |
Pointer to a Crypto Job structure. This parameter is a pointer to a structure that contains information about the Crypto Job, such as the job ID, the input data, and the output data. |
[in] |
result |
Result of the Crypto Job. This parameter indicates whether the Crypto Job was successful or not. It can be one of the following values |
- Return type
void
类型定义 Type Definitions¶
Type Name |
Type |
Description |
|---|---|---|
CryIf_ConfigType |
uint8 |
Type definition for CryIf configuration. |
CryIf_FuncNameConfigType |
struct CryIf_FuncNameConfigType |
Function pointer configuration structure for Crypto operations. |
CryIf_KeyCfgType |
struct CryIf_KeyCfgType |
Key configuration structure for CryIf. |
CryIf_ChannelCfgType |
struct CryIf_ChannelCfgType |
Channel configuration structure for CryIf. |
提供的服务 Services¶
CryIf_Init¶
void CryIf_Init(const CryIf_ConfigType *configPtr)
Initializes the Cryptographic Interface (CryIf) module.
- Sync/Async
TRUE
- Reentrancy
Not reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
configPtr |
Pointer to the configuration structure for the CryIf module. |
- Return type
void
CryIf_GetVersionInfo¶
void CryIf_GetVersionInfo(Std_VersionInfoType *versioninfo)
Retrieves the version information of the Cryptographic Interface (CryIf) module.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[out] |
versioninfo |
Pointer to the version information structure. |
- Return type
void
CryIf_ProcessJob¶
Std_ReturnType CryIf_ProcessJob(uint32 channelId, Crypto_JobType *job)
Processes a cryptographic job using the specified channel.
- Sync/Async
TRUE
- Reentrancy
Reentrant but not for the same channel ID
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
channelId |
The ID of the channel to use for processing the job. |
[inout] |
job |
Pointer to the cryptographic job structure. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The job was successfully processed. |
E_NOT_OK |
The job could not be processed due to an error. |
CryIf_CancelJob¶
Std_ReturnType CryIf_CancelJob(uint32 channelId, Crypto_JobType *job)
Cancels a cryptographic job using the specified channel.
- Sync/Async
TRUE
- Reentrancy
Reentrant but not for the same channel ID
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
channelId |
The ID of the channel to use for canceling the job. |
[inout] |
job |
Pointer to the cryptographic job structure. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The job was successfully canceled. |
E_NOT_OK |
The job could not be canceled due to an error. |
CryIf_KeyElementSet¶
Std_ReturnType CryIf_KeyElementSet(uint32 cryIfKeyId, uint32 keyElementId, const uint8 *keyPtr, uint32 keyLength)
Sets a key element for a cryptographic key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key. |
[in] |
keyElementId |
The ID of the key element to set. |
[in] |
keyPtr |
Pointer to the key data. |
[in] |
keyLength |
The length of the key data. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key element was successfully set. |
E_NOT_OK |
The key element could not be set due to an error. |
CryIf_KeySetValid¶
Std_ReturnType CryIf_KeySetValid(uint32 cryIfKeyId)
Sets a cryptographic key as valid.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key to set as valid. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key was successfully set as valid. |
E_NOT_OK |
The key could not be set as valid due to an error. |
CryIf_KeySetInValid¶
Std_ReturnType CryIf_KeySetInValid(uint32 cryIfKeyId)
Sets a cryptographic key as INvalid.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key to set as INvalid. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key was successfully set as INvalid. |
E_NOT_OK |
The key could not be set as valid due to an error. |
CryIf_KeyElementGet¶
Std_ReturnType CryIf_KeyElementGet(uint32 cryIfKeyId, uint32 keyElementId, uint8 *resultPtr, uint32 *resultLengthPtr)
Retrieves a key element from a cryptographic key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key. |
[in] |
keyElementId |
The ID of the key element to retrieve. |
[out] |
resultPtr |
Pointer to the buffer to store the key element data. |
[inout] |
resultLengthPtr |
Pointer to the length of the buffer. On return, it contains the actual length of the key element data. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key element was successfully retrieved. |
E_NOT_OK |
The key element could not be retrieved due to an error. |
CryIf_KeyElementCopy¶
Std_ReturnType CryIf_KeyElementCopy(uint32 cryIfKeyId, uint32 keyElementId, uint32 targetCryIfKeyId, uint32 targetKeyElementId)
Copies a key element from one cryptographic key to another.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the source cryptographic key. |
[in] |
keyElementId |
The ID of the key element to copy. |
[in] |
targetCryIfKeyId |
The ID of the target cryptographic key. |
[in] |
targetKeyElementId |
The ID of the target key element. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key element was successfully copied. |
E_NOT_OK |
The key element could not be copied due to an error. |
CryIf_KeyElementCopyPartial¶
Std_ReturnType CryIf_KeyElementCopyPartial(uint32 cryIfKeyId, uint32 keyElementId, uint32 keyElementSourceOffset, uint32 keyElementTargetOffset, uint32 keyElementCopyLength, uint32 targetCryIfKeyId, uint32 targetKeyElementId)
Copies a partial key element from one cryptographic key to another.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the source cryptographic key. |
[in] |
keyElementId |
The ID of the key element to copy. |
[in] |
keyElementSourceOffset |
The offset within the source key element to start copying from. |
[in] |
keyElementTargetOffset |
The offset within the target key element to start copying to. |
[in] |
keyElementCopyLength |
The length of the data to copy. |
[in] |
targetCryIfKeyId |
The ID of the target cryptographic key. |
[in] |
targetKeyElementId |
The ID of the target key element. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The partial key element was successfully copied. |
E_NOT_OK |
The partial key element could not be copied due to an error. |
CryIf_KeyCopy¶
Std_ReturnType CryIf_KeyCopy(uint32 cryIfKeyId, uint32 targetCryIfKeyId)
Copies a cryptographic key to another key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the source cryptographic key. |
[in] |
targetCryIfKeyId |
The ID of the target cryptographic key. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key was successfully copied. |
E_NOT_OK |
The key could not be copied due to an error. |
CryIf_RandomSeed¶
Std_ReturnType CryIf_RandomSeed(uint32 cryIfKeyId, const uint8 *seedPtr, uint32 seedLength)
Seeds the random number generator with a cryptographic key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key to use as a seed. |
[in] |
seedPtr |
Pointer to the seed data. |
[in] |
seedLength |
The length of the seed data. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The random number generator was successfully seeded. |
E_NOT_OK |
The random number generator could not be seeded due to an error. |
CryIf_KeyGenerate¶
Std_ReturnType CryIf_KeyGenerate(uint32 cryIfKeyId)
Generates a key using the Crypto driver.This function generates a key based on the provided cryIfKeyId.It first checks if the CryIf module is initialized and if the provided key ID is valid.If the checks pass, it calls the Crypto_KeyGenerate_Name function of the corresponding driver API to generate the key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
Key ID to generate a key for. This parameter is a unique identifier for a key configuration. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key generation was successful. |
E_NOT_OK |
The key generation failed, or a development error was detected. |
CryIf_KeyDerive¶
Std_ReturnType CryIf_KeyDerive(uint32 cryIfKeyId, uint32 targetCryIfKeyId)
Derives a key from an existing key using the Crypto driver.This function derives a key based on the provided cryIfKeyId and targetCryIfKeyId.It first checks if the CryIf module is initialized and if the provided key IDs are valid.If the checks pass, it calls the Crypto_KeyDerive_Name function of the corresponding driver API to derive the key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
Source key ID to derive a key from. This parameter is a unique identifier for a source key configuration. |
[in] |
targetCryIfKeyId |
Target key ID to derive a key for. This parameter is a unique identifier for a target key configuration. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key derivation was successful. |
E_NOT_OK |
The key derivation failed, or a development error was detected. |
CryIf_KeyExchangeCalcPubVal¶
Std_ReturnType CryIf_KeyExchangeCalcPubVal(uint32 cryIfKeyId, uint8 *publicValuePtr, uint32 *publicValueLengthPtr)
Calculates the public value for a key exchange using a cryptographic key.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key to use for the key exchange. |
[out] |
publicValuePtr |
Pointer to the buffer to store the public value. |
[inout] |
publicValueLengthPtr |
Pointer to the length of the buffer. On return, it contains the actual length of the public value. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The public value was successfully calculated. |
E_NOT_OK |
The public value could not be calculated due to an error. |
CryIf_KeyExchangeCalcSecret¶
Std_ReturnType CryIf_KeyExchangeCalcSecret(uint32 cryIfKeyId, const uint8 *partnerPublicValuePtr, uint32 partnerPublicValueLength)
Calculates the secret value for a key exchange using a cryptographic key and a partner’s public value.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
The ID of the cryptographic key to use for the key exchange. |
[in] |
partnerPublicValuePtr |
Pointer to the partner’s public value. |
[in] |
partnerPublicValueLength |
The length of the partner’s public value. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The secret value was successfully calculated. |
E_NOT_OK |
The secret value could not be calculated due to an error. |
CryIf_CustomSync¶
Std_ReturnType CryIf_CustomSync(uint32 dispatchId, uint32 keyId, uint32 keyElementId, uint32 targetKeyId, uint32 targetKeyElementId, const uint8 *inputPtr, uint32 inputLength, uint8 *outputPtr, uint32 *outputLengthPtr, uint8 *secondaryOutputPtr, uint32 *secondaryOutputLengthPtr)
Performs a custom synchronous cryptographic operation.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
dispatchId |
The dispatch ID for the custom operation. |
[in] |
keyId |
The ID of the cryptographic key to use. |
[in] |
keyElementId |
The ID of the key element to use. |
[in] |
targetKeyId |
The ID of the target cryptographic key. |
[in] |
targetKeyElementId |
The ID of the target key element. |
[in] |
inputPtr |
Pointer to the input data. |
[in] |
inputLength |
The length of the input data. |
[out] |
outputPtr |
Pointer to the buffer to store the output data. |
[inout] |
outputLengthPtr |
Pointer to the length of the output buffer. On return, it contains the actual length of the output data. |
[out] |
secondaryOutputPtr |
Pointer to the buffer to store the secondary output data. |
[inout] |
secondaryOutputLengthPtr |
Pointer to the length of the secondary output buffer. On return, it contains the actual length of the secondary output data. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The custom operation was successfully performed. |
E_NOT_OK |
The custom operation could not be performed due to an error. |
CryIf_KeyGetStatus¶
Std_ReturnType CryIf_KeyGetStatus(uint32 cryIfKeyId, Crypto_KeyStatusType *keyStatusPtr)
Retrieves the status of a key using the Crypto driver.This function retrieves the status of a key based on the provided cryIfKeyId.It calls the Crypto_62_KeyGetStatus function to get the key status.
- Sync/Async
TRUE
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
cryIfKeyId |
Key ID to retrieve the status for. This parameter is a unique identifier for a key configuration. |
[out] |
keyStatusPtr |
Pointer to the key status destination data. This parameter is a pointer to a variable that will store the key status. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
The key status retrieval was successful. |
E_NOT_OK |
The key status retrieval failed. |
配置 Configuration¶
CryIfInclude配置 Configuration of CryIfInclude¶
CryIfInclude配置图 (CryIfInclude Configuration Diagram)¶
IncludeName : 此参数用于cryif的配置文件引用头文件
IncludeName: This parameter is used for referencing the header file for cryif configuration file
CryIfGeneral配置 Configuration of CryIfGeneral¶
CryIfGeneral配置图 (CryIfGeneral Configuration Diagram)¶
CryIfDevErrorDetect : 控制开发错误检测的开关
CryIfDevError Detect: Switch for controlling the development error detection
CryIfVersionInfoApi : 控制版本信息获取接口的开关
CryIfVersions InfoApi: Switch for controlling version information retrieval interface
CryIfChannel配置 Configuration of CryIfChannel¶
CryIfChannel配置图 (CryIfChannel Configuration Diagram)¶
CryIfChannelId :指定 CSM 队列连接到哪个加密通道。
CryIfChannelId: Specify the specific encrypted channel that the CSM queue is connected to.
CryIfDriverObjectRef :此参数引用加密驱动程序对象。指定密码通道连接到哪个密码驱动程序对象
CryIfDriver Object Ref: This parameter references the encrypted driver object.) Specify the specific password driver object that the password channel connects to
CryIfKey配置 Configuration of CryIfKey¶
CryIfKey配置图 (CryIfKey Configuration Diagram)¶
CryIfKeyId : 指定 CSM 密钥映射到哪个 CryIf 密钥。
CryIfKeyId: Specify the specific CryIf key that the CSM key is mapped to.
CryIfKeyRef : 指定 CryIf 密钥映射到哪个加密驱动程序密钥。
CryIfKeyRef: Specify the specific encryption driver key that the CryIf key is mapped to.