Crypto Interface (CryIf)
Abstracts cryptographic hardware and software acceleration engines.
Funktionen — Übersicht
void CryIf_Init (const CryIf_ConfigType* configPtr);Initializes the CRYIF module.void CryIf_GetVersionInfo (Std_VersionInfoType* versioninfo);Returns the version information of this module.Std_ReturnType CryIf_ProcessJob (uint32 channelId, Crypto_JobType* job);Service CryIf_ProcessJob.Std_ReturnType CryIf_CancelJob (uint32 channelId, Crypto_JobType* job);This interface dispatches the job cancellation function to the configured crypto driver object.Std_ReturnType CryIf_KeyElementSet (uint32 cryIfKeyId, uint32 keyElementId, const uint8* keyPtr, uint32 keyLength);This function shall dispatch the set key element function to the configured crypto driver object.Std_ReturnType CryIf_KeySetValid (uint32 cryIfKeyId);This function shall dispatch the set key valid function to the configured crypto driver object.Std_ReturnType CryIf_KeySetInvalid (uint32 cryIfKeyId);Sets invalid for the status of the key identifi ed by cry If Key Id.Std_ReturnType CryIf_KeyGetStatus (uint32 cryIfKeyId, Crypto_KeyStatusType* keyStatusPtr);Returns the key state of the key identified by cry If Key Id.Std_ReturnType CryIf_KeyElementGet (uint32 cryIfKeyId, uint32 keyElementId, uint8* resultPtr, uint32* resultLengthPtr);This function shall dispatch the get key ele ment function to the configured crypto driver object.Std_ReturnType CryIf_KeyElementCopy (uint32 cryIfKeyId, uint32 keyElementId, uint32 targetCryIfKeyId, uint32 targetKeyElementId);Service CryIf_KeyElementCopy.Std_ReturnType CryIf_KeyElementCopyPartial (uint32 cryIfKeyId, uint32 keyElementId, uint32 keyElementSourceOffset, uint32 keyElementTargetOffset, uint32 keyElementCopyLength, uint32 targetCryIfKeyId, uint32 targetKeyElementId);Service CryIf_KeyElementCopyPartial.Std_ReturnType CryIf_KeyCopy (uint32 cryIfKeyId, uint32 targetCryIfKeyId);This function shall co py all key elements from the source key to a target key.Std_ReturnType CryIf_RandomSeed (uint32 cryIfKeyId, const uint8* seedPtr, uint32 seedLength);This function shall dispatch the random seed function to the configured crypto driver object.Std_ReturnType CryIf_KeyGenerate (uint32 cryIfKeyId);This function shall dispatch the key generate function to the configured crypto driver object.Std_ReturnType CryIf_KeyDerive (uint32 cryIfKeyId, uint32 targetCryIfKeyId);This function shall dispatch th e key derive function to the configured crypto driver object.Std_ReturnType CryIf_KeyExchangeCalcPubVal (uint32 cryIfKeyId, uint8* publicValuePtr, uint32* publicValueLengthPtr);This function shall dispatch the key exchange public value calculation function to the configured crypto driver object.Std_ReturnType CryIf_KeyExchangeCalcSecret (uint32 cryIfKeyId, const uint8* partnerPublicValuePtr, uint32 partnerPublicValueLength);This function shall dispatch the key exchange common shared secret calculation function to the configured crypto driver object.void CryIf_CallbackNotification (Crypto_JobType* job, Crypto_ResultType result);Notifies the CRYIF about the completion of the request with the result of the cryptographic operation.
Typen — Übersicht
struct CryIf_ConfigTypeConfiguration data structure of Cry If module
Funktionen & Typen — Detailansicht
function CryIf_Init [SWS_CryIf_91000] 📄 PDF
void CryIf_Init (const CryIf_ConfigType* configPtr);
Initializes the CRYIF module. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CryptoInterface
use
The synchronous function CryIf_Init serves for the complete initialization of the Crypto Interface (CryIf) module according to AUTOSAR Classic Platform [SWS_CryIf_91000]. The function is declared in the header file CryIf.h and has the service ID 0x00 [SWS_CryIf_91000]. As the only input parameter, the interface expects configPtr, a pointer to a selected configuration structure of type CryIf_ConfigType [SWS_CryIf_91000]. The function returns no return value (void) and has neither inout nor out parameters [SWS_CryIf_91000].
Semantics and concurrency
The call to CryIf_Init is executed synchronously [SWS_CryIf_91000]. The module thus completes all required initialization work before execution is returned to the caller. Regarding concurrency, the function is classified as non-reentrant (Non Reentrant) [SWS_CryIf_91000]. Therefore, the routine must not be called in parallel or nested at any time.
Restrictions and Integration
Interpretation: The call to CryIf_Init is likely typically performed centrally during system startup within the initialization phase of the basic software before downstream crypto interface services may be called. Question Q-31b82ca9b144c843 (open) Since the payload does not mention any specific error handling, DET messages, or DEM events, the caller must ensure a valid pointer to the configuration in advance. Related requirements are not defined in the payload.
This usage note was generated automatically and is based exclusively on the specification data for SWS_CryIf_91000.
Implementer's Guide to follow (complexity I1)
function CryIf_GetVersionInfo [SWS_CryIf_91001] 📄 PDF
void CryIf_GetVersionInfo (Std_VersionInfoType* versioninfo);
Returns the version information of this module.
function CryIf_ProcessJob [SWS_CryIf_91003] 📄 PDF
Std_ReturnType CryIf_ProcessJob (uint32 channelId, Crypto_JobType* job);
Service CryIf_ProcessJob.
Function CryIf_ProcessJob (service ID 0x03), provided via header CryIf.h, forwards cryptographic processing jobs to the respectively configured crypto driver object [SWS_CryIf_91003]. As parameters, it takes the identifier of the crypto channel (channelId) and a pointer to the job configuration (job) [SWS_CryIf_91003]. Structure job contains all information relevant to the user as well as to the specific crypto primitive [SWS_CryIf_91003]. Depending on the configuration, job processing is performed synchronously or asynchronously; in addition, the interface is implemented as reentrant [SWS_CryIf_91003].
Upon error-free acceptance, the function returns E_OK [SWS_CryIf_91003]. If the request fails, the return value signals either E_NOT_OK or a specific error state of the driver: CRYPTO_E_BUSY (driver object busy), CRYPTO_E_QUEUE_FULL (queue full), errors regarding key states such as CRYPTO_E_KEY_NOT_VALID, CRYPTO_E_KEY_SIZE_MISMATCH, CRYPTO_E_KEY_NOT_AVAILABLE, CRYPTO_E_KEY_EMPTY, CRYPTO_E_KEY_READ_FAIL, or CRYPTO_E_KEY_WRITE_FAIL, as well as CRYPTO_E_JOB_CANCELED upon cancellation of a synchronous job and CRYPTO_E_ENTROPY_EXHAUSTED [SWS_CryIf_91003].
In addition, the interface performs pre-checks of the key identifiers:
- If
job->jobPrimitiveInfo->primitiveInfo->serviceis set toCRYPTO_KEYSETVALID,CRYPTO_KEYSETINVALID,CRYPTO_RANDOMSEED,CRYPTO_KEYGENERATE,CRYPTO_KEYDERIVE,CRYPTO_KEYEXCHANGECALCPUBVAL, orCRYPTO_KEYEXCHANGECALCSECRET,job->cryIfKeyIdmust be within the valid range of values [SWS_CryIf_00134]. Otherwise, the function reports the errorCRYPTO_E_PARAM_HANDLEto the DET and aborts withE_NOT_OK[SWS_CryIf_00134]. - If service
CRYPTO_KEYDERIVEis requested, the target key identifierjob->cryIfTargetKeyIdmust additionally be within the valid range; otherwise,CRYPTO_E_PARAM_HANDLEis likewise reported to the DET andE_NOT_OKis returned [SWS_CryIf_00135].
This text was created by an AI and is based on the AUTOSAR CP R20-11 specification.
function CryIf_CancelJob [SWS_CryIf_91014] 📄 PDF
Std_ReturnType CryIf_CancelJob (uint32 channelId, Crypto_JobType* job);
This interface dispatches the job cancellation function to the configured crypto driver object.
Function CryIf_CancelJob serves to forward a cancellation request for a crypto job to the configured crypto driver object [SWS_CryIf_91014]. It provides the standardized interface of the crypto interface, is declared via header CryIf.h, and has service ID 0x0e [SWS_CryIf_91014].
To make the call, the identifier of the target channel and the configuration of the job must be passed [SWS_CryIf_91014]:
channelId(input,uint32): Holds the identifier of the respective crypto channel [SWS_CryIf_91014].job(in/out,Crypto_JobType*): Pointer to the job configuration, which comprises structures with user- and primitive-relevant information [SWS_CryIf_91014].
Execution is synchronous and returns a status of type Std_ReturnType to the caller [SWS_CryIf_91014]:
E_OK: The request was successful and the job was removed from the driver [SWS_CryIf_91014].E_NOT_OK: The request failed because the job could not be removed [SWS_CryIf_91014].CRYPTO_E_JOB_CANCELED: Specified crypto return value confirming job cancellation [SWS_CryIf_91014].
Regarding concurrency behavior, CryIf_CancelJob is specified as reentrant [SWS_CryIf_91014]. This permits parallel calls for job cancellation, with processing being delegated to the underlying driver object in a blocking manner [SWS_CryIf_91014].
This text was generated by an AI based on the AUTOSAR specification R20-11.
function CryIf_KeyElementSet [SWS_CryIf_91004] 📄 PDF
Std_ReturnType CryIf_KeyElementSet (uint32 cryIfKeyId, uint32 keyElementId, const uint8* keyPtr, uint32 keyLength);
This function shall dispatch the set key element function to the configured crypto driver object.
The synchronous function CryIf_KeyElementSet (service ID 0x04) forwards the request to set a key element to the configured Crypto Driver Object [SWS_CryIf_91004]. The function declaration is provided via the header file CryIf.h [SWS_CryIf_91004].
The call is made via four input parameters [SWS_CryIf_91004]:
cryIfKeyId: Denotes the identifier of the key whose key element is to be updated.keyElementId: Denotes the identifier of the specific key element to be set.keyPtr: Pointer to the buffer containing the key data to be applied as the element.keyLength: Specifies the length of the key element to be set in bytes.
The function is specified as non-reentrant (Non Reentrant) [SWS_CryIf_91004]. Therefore, callers must ensure that calls do not occur uncoordinatedly in parallel.
The return value of type Std_ReturnType signals the result of the forwarding or execution [SWS_CryIf_91004]:
E_OK: The request was successful.E_NOT_OK: The request has failed.CRYPTO_E_BUSY: The associated Crypto Driver Object is currently busy.CRYPTO_E_KEY_WRITE_FAIL: Write access to the key element was denied.CRYPTO_E_KEY_NOT_AVAILABLE: The requested key is not available.CRYPTO_E_KEY_SIZE_MISMATCH: The size of the key element does not match the length of the provided data.
This usage note was generated by an AI based on the AUTOSAR R20-11 specification.
Implementer's Guide to follow (complexity I1)
function CryIf_KeySetValid [SWS_CryIf_91005] 📄 PDF
Std_ReturnType CryIf_KeySetValid (uint32 cryIfKeyId);
This function shall dispatch the set key valid function to the configured crypto driver object.
use
The synchronous interface CryIf_KeySetValid (service ID 0x05) is provided via the header file CryIf.h and forwards the request to set a key valid to the respectively configured Crypto Driver Object [SWS_CryIf_91005]. As the only parameter, the identifier cryIfKeyId is passed, which determines the target key whose key elements are to be marked as valid [SWS_CryIf_91005]. Additional input/output or output parameters do not exist for this function [SWS_CryIf_91005].
Return Values and Error Handling
The return value of type Std_ReturnType informs the caller about the result of the forwarding and processing in the driver [SWS_CryIf_91005]:
E_OK: The operation was successfully forwarded to the Crypto Driver Object and completed successfully [SWS_CryIf_91005].E_NOT_OK: The forwarding or the execution of the request failed [SWS_CryIf_91005].CRYPTO_E_BUSY: The request could not be executed because the responsible Crypto Driver Object is currently busy [SWS_CryIf_91005].
Concurrency and Limitations
The function is explicitly designated as non-reentrant (Non Reentrant) in the specification [SWS_CryIf_91005]. Calling instances must therefore ensure that calls to CryIf_KeySetValid are never executed concurrently or interrupting, in order to reliably prevent conflicts during forwarding to the driver object.
This usage note was generated automatically based on the specification.
function CryIf_KeySetInvalid [SWS_CryIf_91021] 📄 PDF
Std_ReturnType CryIf_KeySetInvalid (uint32 cryIfKeyId);
Sets invalid for the status of the key identifi ed by cry If Key Id.
The synchronous interface CryIf_KeySetInvalid (service ID 0x14) sets the state of the key identified via the parameter cryIfKeyId to invalid [SWS_CryIf_91021]. The declaration of the function is provided via the header file CryIf.h [SWS_CryIf_91021].
The following parameters and return values apply to the use of the function [SWS_CryIf_91021]:
- Passing parameters: The identifier of the key whose validity is to be revoked is passed via the input parameter
cryIfKeyIdof typeuint32. Input/output parameters do not exist. - Return value (
Std_ReturnType):E_OK: The request to change the status was successful.E_NOT_OK: The request has failed.CRYPTO_E_BUSY: Execution failed because the responsible Crypto Driver Object is busy.
Regarding concurrency and execution context, CryIf_KeySetInvalid is specified as non-reentrant (Non Reentrant) [SWS_CryIf_91021]. Calling instances must therefore ensure that calls proceed sequentially and do not mutually overlap. If the return value CRYPTO_E_BUSY occurs, the Crypto Driver Object is temporarily blocked [SWS_CryIf_91021]; in this case, the caller is likely responsible for retrying the status invalidation later. Question Q-4377065d4d4eecab (open)
This text was created by an AI and is based exclusively on the specification data of AUTOSAR R20-11.
Implementer's Guide to follow (complexity I1)
function CryIf_KeyGetStatus [SWS_CryIf_91012] 📄 PDF
Std_ReturnType CryIf_KeyGetStatus (uint32 cryIfKeyId, Crypto_KeyStatusType* keyStatusPtr);
Returns the key state of the key identified by cry If Key Id.
Usage and Call Context
Function CryIf_KeyGetStatus serves to synchronously query the status of a cryptographic key within the crypto interface [SWS_CryIf_91012]. It is available via header CryIf.h with service ID 0x13 [SWS_CryIf_91012]. When called, the following parameters are passed:
cryIfKeyId(input): Unique identifier of the key whose status is to be determined [SWS_CryIf_91012].keyStatusPtr(output): Pointer to a variable of typeCrypto_KeyStatusTypeinto which the key status is written [SWS_CryIf_91012].
Error Handling and Return Values
The return value of type Std_ReturnType signals the result of the execution [SWS_CryIf_91012]:
E_OK: The status query was successful and the status was stored in the destination memory [SWS_CryIf_91012].E_NOT_OK: The request has failed [SWS_CryIf_91012].
Specific error codes, DET reports, or DEM events are not designated in the element specification; caller-side error handling relies primarily on evaluating the return value.
Concurrency and Limitations
The function is specified as non-reentrant (Non Reentrant) [SWS_CryIf_91012]. Callers must therefore ensure that no concurrent or interrupting calls occur for the same or different key instances. In addition, the caller presumably has to provide a valid memory area for output pointer keyStatusPtr, as it is written directly by the function. Question Q-da3a034d4f2e9442 (open)
This text was generated by an AI based on the AUTOSAR specification R20-11.
Implementer's Guide to follow (complexity I1)
function CryIf_KeyElementGet [SWS_CryIf_91006] 📄 PDF
Std_ReturnType CryIf_KeyElementGet (uint32 cryIfKeyId, uint32 keyElementId, uint8* resultPtr, uint32* resultLengthPtr);
This function shall dispatch the get key ele ment function to the configured crypto driver object.
The synchronous function CryIf_KeyElementGet forwards the query of a key element to the configured Crypto Driver Object [SWS_CryIf_91006]. It is declared via the header file CryIf.h and specified as reentrant [SWS_CryIf_91006].
Usage and Parameters
Upon invocation, cryIfKeyId identifies the affected key and keyElementId the key element to be retrieved [SWS_CryIf_91006]. The payload data is stored in the buffer resultPtr [SWS_CryIf_91006]. The pointer resultLengthPtr serves as a combined input and output parameter for length control [SWS_CryIf_91006]:
- Prior to execution, the caller passes the available buffer size of
resultPtrtherein [SWS_CryIf_91006]. - If the key element allows partial access, the value defines instead the amount of data to be retrieved, which does not have to correspond to the buffer size [SWS_CryIf_91006].
- After completion of the operation, the function stores the amount of data actually written at this memory location [SWS_CryIf_91006].
Error Handling and Return Values
The return value of type Std_ReturnType signals the success or error status [SWS_CryIf_91006]:
E_OK: The request was completed successfully [SWS_CryIf_91006].E_NOT_OK: The execution failed [SWS_CryIf_91006].CRYPTO_E_BUSY: The Crypto Driver Object is busy [SWS_CryIf_91006].CRYPTO_E_KEY_NOT_AVAILABLE: The requested key element is not available [SWS_CryIf_91006].CRYPTO_E_KEY_READ_FAIL: Read access to the key element was denied [SWS_CryIf_91006].CRYPTO_E_KEY_EMPTY: The source key element is not initialized [SWS_CryIf_91006].
This usage note was generated automatically based on the specification of AUTOSAR R20-11.
Implementer's Guide to follow (complexity I1)
function CryIf_KeyElementCopy [SWS_CryIf_91015] 📄 PDF
Std_ReturnType CryIf_KeyElementCopy (uint32 cryIfKeyId, uint32 keyElementId, uint32 targetCryIfKeyId, uint32 targetKeyElementId);
Service CryIf_KeyElementCopy.
The synchronous function CryIf_KeyElementCopy serves to copy a key element from a source key to a target key according to [SWS_CryIf_91015]. The service is available via header file CryIf.h.
For the call, the source key (cryIfKeyId), the source element to be copied (keyElementId), the target key (targetCryIfKeyId), and the target element (targetKeyElementId) are passed via the input parameters [SWS_CryIf_91015]. The function is designed to be reentrant, but explicitly not for the same cryIfKeyId [SWS_CryIf_91015]. As an interpretation, it would seem reasonable that concurrent write accesses to the same target key (targetCryIfKeyId) should also be synchronized by the caller to avoid data conflicts. Question Q-cba3554c537dd498 (open)
The return value of type Std_ReturnType signals the result of the operation [SWS_CryIf_91015]:
E_OK: The copy operation was successful.E_NOT_OK: The request has failed.CRYPTO_E_BUSY: The associated crypto driver object is busy.CRYPTO_E_KEY_NOT_AVAILABLE: The requested key element is not available.CRYPTO_E_KEY_READ_FAIL: Reading the source key element is not allowed.CRYPTO_E_KEY_WRITE_FAIL: Writing the target key element is not allowed.CRYPTO_E_KEY_SIZE_MISMATCH: The sizes of the involved key elements are not compatible.CRYPTO_E_KEY_EMPTY: The source key element is uninitialized.
This usage note was generated automatically based on AUTOSAR R20-11.
Implementer's Guide to follow (complexity I1)
function CryIf_KeyElementCopyPartial [SWS_CryIf_91018] 📄 PDF
Std_ReturnType CryIf_KeyElementCopyPartial (uint32 cryIfKeyId, uint32 keyElementId, uint32 keyElementSourceOffset, uint32 keyElementTargetOffset, uint32 keyElementCopyLength, uint32 targetCryIfKeyId, uint32 targetKeyElementId);
Service CryIf_KeyElementCopyPartial.
The synchronous function CryIf_KeyElementCopyPartial, provided via the header CryIf.h, copies subparts of a key element into another key element [SWS_CryIf_91018]. The source and target keys as well as the respective elements are specified via the parameters cryIfKeyId, keyElementId, targetCryIfKeyId, and targetKeyElementId [SWS_CryIf_91018]. The start positions within the two elements are determined by keyElementSourceOffset and keyElementTargetOffset, while keyElementCopyLength specifies the exact number of bytes to be transferred [SWS_CryIf_91018].
Regarding concurrency, the routine is designed to be reentrant, but explicitly not for the same source key (cryIfKeyId) [SWS_CryIf_91018]. Parallel calls with an identical source key ID must therefore be synchronized or avoided by the caller.
The return value reports the detailed execution status of the synchronous request [SWS_CryIf_91018]:
E_OK: The copy operation was performed successfully.E_NOT_OK: The request has failed.CRYPTO_E_BUSY: The responsible Crypto Driver Object is busy.CRYPTO_E_KEY_NOT_AVAILABLE: The requested source or target key element is not available.CRYPTO_E_KEY_READ_FAIL: Reading the source key element is not allowed.CRYPTO_E_KEY_WRITE_FAIL: Writing to the target key element is not permitted.CRYPTO_E_KEY_SIZE_MISMATCH: The element sizes or offset and length specifications are incompatible.CRYPTO_E_KEY_EMPTY: The source key element is uninitialized.
This usage note was generated automatically based on the specification of AUTOSAR R20-11.
Implementer's Guide to follow (complexity I1)
function CryIf_KeyCopy [SWS_CryIf_91016] 📄 PDF
Std_ReturnType CryIf_KeyCopy (uint32 cryIfKeyId, uint32 targetCryIfKeyId);
This function shall co py all key elements from the source key to a target key.
use
The synchronous function CryIf_KeyCopy copies all key elements from a source key to a specified target key ([SWS_CryIf_91016]). It is provided via the header file CryIf.h and has the service ID 0x10 ([SWS_CryIf_91016]).
The function expects two input parameters ([SWS_CryIf_91016]):
cryIfKeyId: Identifier of the key whose key elements serve as the source.targetCryIfKeyId: Identifier of the key that receives the key elements as the target.
Concurrency and Limitations
The interface is specified as reentrant, but must not be called simultaneously for the same source key identifier (cryIfKeyId) ([SWS_CryIf_91016]).
Error handling
The return value of type Std_ReturnType signals the result of the operation ([SWS_CryIf_91016]):
E_OK: Copy operation completed successfully.E_NOT_OK: Request failed.CRYPTO_E_BUSY: Failed because the underlying Crypto Driver Object is busy.CRYPTO_E_KEY_NOT_AVAILABLE: The requested key element is not available.CRYPTO_E_KEY_READ_FAIL: Reading out the key element is not permitted.CRYPTO_E_KEY_WRITE_FAIL: Writing the target key element is not allowed.CRYPTO_E_KEY_SIZE_MISMATCH: The sizes of the key elements are not compatible with each other.CRYPTO_E_KEY_EMPTY: The source key element is uninitialized.
This usage note was generated automatically based on the specification.
function CryIf_RandomSeed [SWS_CryIf_91007] 📄 PDF
Std_ReturnType CryIf_RandomSeed (uint32 cryIfKeyId, const uint8* seedPtr, uint32 seedLength);
This function shall dispatch the random seed function to the configured crypto driver object.
The function CryIf_RandomSeed serves to forward the generation or feeding of a random seed to the configured crypto driver object [SWS_CryIf_91007]. It is available via the header file CryIf.h and has the service ID 0x07 [SWS_CryIf_91007].
The interface expects three input parameters [SWS_CryIf_91007]:
cryIfKeyId: Identifier of the key for which a new seed is to be generated.seedPtr: Pointer to the memory area containing the data for seeding.seedLength: Length of the seed in bytes.
The execution behavior (synchronous or asynchronous) is not fixed, but depends on the respective configuration [SWS_CryIf_91007]. With respect to concurrency, the function is specified as reentrant [SWS_CryIf_91007].
As a return value, the function returns a Std_ReturnType with the following status values [SWS_CryIf_91007]:
E_OK: The request was successful.E_NOT_OK: The request has failed.CRYPTO_E_KEY_NOT_VALID: The request failed because the key state of the key is \"invalid\".
Interpretation: Upon returning CRYPTO_E_KEY_NOT_VALID, the check is likely to refer to the passed key cryIfKeyId, even though the specification text speaks of cryptoKeyId instead [SWS_CryIf_91007]. Question Q-22b20256f21f131b (open)
This text was generated by an AI and is based on the AUTOSAR CP R20-11 specification.
function CryIf_KeyGenerate [SWS_CryIf_91008] 📄 PDF
Std_ReturnType CryIf_KeyGenerate (uint32 cryIfKeyId);
This function shall dispatch the key generate function to the configured crypto driver object.
use
The function CryIf_KeyGenerate forwards the function call for key generation to the configured Crypto Driver Object [SWS_CryIf_91008]. Via the input parameter cryIfKeyId, the unique identifier of the key is passed, which is to be updated with the newly generated key value [SWS_CryIf_91008]. The declaration of this interface is provided via the header CryIf.h [SWS_CryIf_91008].
Synchronization Behavior and Concurrency
Execution is performed either synchronously or asynchronously depending on the underlying configuration [SWS_CryIf_91008]. Regarding call context and concurrency, the function is specified as reentrant [SWS_CryIf_91008].
Return Values and Error Handling
The call returns a status value of type Std_ReturnType [SWS_CryIf_91008]:
E_OK: The request for key generation was executed successfully [SWS_CryIf_91008].E_NOT_OK: The request failed [SWS_CryIf_91008].CRYPTO_E_BUSY: The request failed because the addressed Crypto Driver Object is currently busy [SWS_CryIf_91008].CRYPTO_E_KEY_EMPTY: The request failed because a required source key element is uninitialized [SWS_CryIf_91008].CRYPTO_E_KEY_NOT_VALID: The request failed because the state of the key referenced by the key identifier is invalid [SWS_CryIf_91008].
This usage note was generated automatically based on the specification of AUTOSAR Release R20-11.
function CryIf_KeyDerive [SWS_CryIf_91009] 📄 PDF
Std_ReturnType CryIf_KeyDerive (uint32 cryIfKeyId, uint32 targetCryIfKeyId);
This function shall dispatch th e key derive function to the configured crypto driver object.
use
Function CryIf_KeyDerive serves to synchronously forward a request for key derivation to the respectively configured crypto driver object [SWS_CryIf_91009]. The interface is declared via the header file CryIf.h with service ID 0x09 [SWS_CryIf_91009].
When called, two key identifiers are passed [SWS_CryIf_91009]:
cryIfKeyId: Identifier of the key used as the basis for the derivation.targetCryIfKeyId: Identifier of the key in which the derived key is stored.
Error Handling and Return Values
The result of the operation is transmitted via return type Std_ReturnType [SWS_CryIf_91009]:
E_OK: The request was executed successfully [SWS_CryIf_91009].E_NOT_OK: The execution failed [SWS_CryIf_91009].CRYPTO_E_KEY_EMPTY: The source key element is not initialized [SWS_CryIf_91009].CRYPTO_E_KEY_NOT_VALID: The key state of the referenced key is invalid [SWS_CryIf_91009].CRYPTO_E_BUSY: The underlying crypto driver object reportedCRYPTO_E_BUSY[SWS_CryIf_91009].
Concurrency and Constraints
The interface is specified as reentrant [SWS_CryIf_91009]. Since the execution is synchronous, callers are likely to have to consider the execution time of the driver in the respective call context. Question Q-2b2fd50249878177 (open)
This usage note was generated automatically based on the AUTOSAR specification R20-11.
function CryIf_KeyExchangeCalcPubVal [SWS_CryIf_91010] 📄 PDF
Std_ReturnType CryIf_KeyExchangeCalcPubVal (uint32 cryIfKeyId, uint8* publicValuePtr, uint32* publicValueLengthPtr);
This function shall dispatch the key exchange public value calculation function to the configured crypto driver object. Available
The synchronous and reentrant function CryIf_KeyExchangeCalcPubVal forwards the calculation of the public key exchange value to the configured Crypto Driver Object [SWS_CryIf_91010]. The service is available via the header CryIf.h [SWS_CryIf_91010].
During the function call, the following parameters are processed [SWS_CryIf_91010]:
cryIfKeyId: Identifier of the key to be used for the key exchange protocol.publicValuePtr: Pointer to the memory area where the calculated public value is stored.publicValueLengthPtr: Pointer to the length information. When called, this parameter must contain the provided buffer size; upon completion, it stores the actual length of the calculated value.
The function returns a status of type Std_ReturnType [SWS_CryIf_91010]:
E_OK: The request was successful.E_NOT_OK: The request has failed.CRYPTO_E_BUSY: Error because the responsible Crypto Driver Object is busy.CRYPTO_E_KEY_EMPTY: Error due to an uninitialized source key element.CRYPTO_E_KEY_NOT_VALID: Error because the addressed key is in the invalid state.
This text was generated by an AI-supported system and is based exclusively on the specification data from AUTOSAR R20-11.
function CryIf_KeyExchangeCalcSecret [SWS_CryIf_91011] 📄 PDF
Std_ReturnType CryIf_KeyExchangeCalcSecret (uint32 cryIfKeyId, const uint8* partnerPublicValuePtr, uint32 partnerPublicValueLength);
This function shall dispatch the key exchange common shared secret calculation function to the configured crypto driver object.
The synchronous function CryIf_KeyExchangeCalcSecret forwards the calculation of the shared secret during key exchange to the configured Crypto Driver Object [SWS_CryIf_91011]. The identifier of the key (cryIfKeyId), a pointer to the public key value of the communication partner (partnerPublicValuePtr), and its length in bytes (partnerPublicValueLength) are passed to the service [SWS_CryIf_91011].
Error handling: The function returns the result via Std_ReturnType [SWS_CryIf_91011]:
E_OK: The calculation was executed successfully [SWS_CryIf_91011].CRYPTO_E_BUSY: The Crypto Driver Object is busy [SWS_CryIf_91011].CRYPTO_E_KEY_EMPTY: The source key element is not initialized [SWS_CryIf_91011].CRYPTO_E_KEY_NOT_VALID: The key state of the specified key is invalid [SWS_CryIf_91011].E_NOT_OK: The request has failed [SWS_CryIf_91011].
Concurrency: The interface is specified as reentrant [SWS_CryIf_91011]. Since the sequence is executed synchronously, the call is likely typically made in task context. Question Q-b3bca3645b0ef468 (open) The service is provided via the header file CryIf.h [SWS_CryIf_91011].
This usage note was automatically generated based on the AUTOSAR R20-11 specification.
function CryIf_CallbackNotification [SWS_CryIf_91013] 📄 PDF
void CryIf_CallbackNotification (Crypto_JobType* job, Crypto_ResultType result);
Notifies the CRYIF about the completion of the request with the result of the cryptographic operation.
According to [SWS_CryIf_91013], function CryIf_CallbackNotification serves to inform the Crypto Interface (CryIf) about the completion of a cryptographic operation and its result. The declaration is available via header CryIf.h and has service ID 0x0d [SWS_CryIf_91013].
The call is synchronous and processes two mandatory input parameters [SWS_CryIf_91013]:
job(input,Crypto_JobType*): Points to the information structure of the completed job and contains a callback ID for correlating the completed job [SWS_CryIf_91013].result(input,Crypto_ResultType): Transmits the result of the executed cryptographic operation [SWS_CryIf_91013].
Specific error codes or error messages (DET/DEM) are not defined for this service; functional error checking is performed via parameter result, which reflects the success or error status of the operation [SWS_CryIf_91013].
Regarding concurrency, the function is specified as non-reentrant (Non Reentrant) according to [SWS_CryIf_91013] and has no return value (void). Callers must therefore ensure that calls proceed sequentially and that no nested or parallel executions occur. Interpretation: The notification is likely typically called by underlying crypto drivers to return the result of asynchronously processed crypto jobs to the crypto interface. Question Q-ae17af188a970e00 (open)
This usage note was generated automatically based on the specification of AUTOSAR R20-11.
type CryIf_ConfigType [SWS_CryIf_91118] 📄 PDF
Configuration data structure of Cry If module
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_CryIf- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_CryIf@rel:R20-11#4354bd72- Content hash
4354bd72- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CryptoInterface.pdf#nameddest=SWS_CryIf_91000
gemini-3.8-flash-low· 2026-10-13 · German original