AUTOSAR SWS CryptoServiceManager
AUTOSAR SWS CryptoServiceManager
AUTOSAR CP R20-11
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and
the companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Introduction and Functional Overview .................................................................. 8
2 Acronyms and Abbreviations ................................................................................ 9
2.1 Glossary of Terms ........................................................................................... 9
3 Related documentation ....................................................................................... 11
3.1 Input Documents ........................................................................................... 11
3.2 Related standards and norms....................................................................... 12
3.3 Related specification ..................................................................................... 12
4 Constraints and Assumptions ............................................................................. 13
4.1 Limitations ..................................................................................................... 13
4.2 Applicability to Car Domains ......................................................................... 13
4.3 Security Implications ..................................................................................... 13
5 Dependencies to other Modules ......................................................................... 14
6 Requirements Traceability .................................................................................. 15
7 Functional specification ...................................................................................... 18
7.1 Basic Architecture Guidelines ....................................................................... 18
7.2 General Behavior .......................................................................................... 20
7.2.1 Normal Operation .................................................................................. 21
7.2.2 Design Notes ......................................................................................... 24
7.3 Error Classification ........................................................................................ 34
7.3.1 Development Errors............................................................................... 34
7.3.2 Runtime Errors ...................................................................................... 35
7.3.3 Transient Faults ..................................................................................... 35
7.3.4 Production Errors................................................................................... 35
7.3.5 Extended Production Errors .................................................................. 35
7.4 Error Detection .............................................................................................. 35
7.5 Multicore ........................................................................................................ 36
8 API Specification ................................................................................................. 37
8.1 Imported types .............................................................................................. 37
8.2 Type Definitions ............................................................................................ 37
8.2.1 Extension to Std_ReturnType ............................................................... 37
8.2.2 Csm_ConfigType ................................................................................... 37
8.2.3 Crypto_AlgorithmFamilyType ................................................................ 38
8.2.4 Crypto_AlgorithmModeType.................................................................. 40
8.2.5 Crypto_InputOutputRedirectionConfigType .......................................... 41
8.2.6 Crypto_JobType .................................................................................... 42
8.2.7 Crypto_JobStateType ............................................................................ 43
8.2.8 Crypto_JobPrimitiveInputOutputType ................................................... 43
8.2.9 Crypto_JobPrimitiveInfoType ................................................................ 45
8.2.10 Crypto_ServiceInfoType ........................................................................ 46
8.2.11 Crypto_JobRedirectionInfoType ............................................................ 47
8.2.12 Crypto_AlgorithmInfoType..................................................................... 48
8.2.13 Crypto_ProcessingType ........................................................................ 49
8.2.14 Crypto_PrimitiveInfoType ...................................................................... 49
5 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Abbreviation / Description:
Acronym:
AEAD Authenticated Encryption with Associated Data
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
Terms: Description:
Crypto Driver A Crypto Driver implements one or more Crypto Driver Objects.
Object The Crypto Driver Object can offer different crypto primitives in
hardware or software. The Crypto Driver Objects of one Crypto
Driver are independent of each other.
There is only one workspace for each Crypto Driver Object (i.e.
only one crypto primitive can be performed at the same time)
Key A Key can be referenced by a job in the Csm.
In the Crypto Driver, the key refers a specific key type.
Key Type A key type consists of refers to key elements.
The key types are typically pre-configured by the vendor of the
Crypto Driver.
Key Element Key elements are used to store data. This data can be e.g. key
material or the IV needed for AES encryption.
It can also be used to configure the behaviour oft he key
management functions.
Job A Job is a configured 'CsmJob'. Among others, it refers to a key, a
cryptographic primitive and a reference channel.
Channel A channel is the path from a Crypto Service Manager queue via the
Crypto Interface to a specific Crypto Driver Object.
Primitive A primitive is an instance of a configured cryptographic algorithm
realized in a Crypto Driver Object. Among others it refers to a
functionality provided by the CSM to the application, the concrete
underlining 'algorithmfamily' (e.g. AES, MD5, RSA, etc.), and a
'algorithmmode' (e.g. ECB, CBC, etc).
3 Related documentation
Thus, the specification SWS BSW General shall be considered as additional and
required specification for Crypto Service Manager.
4.1 Limitations
Some type definitions of CSM start with the Prefix “CRYPTO_” which will violate
SRS_BSW_00305. This will be harmonized in release 4.3.1. Nevertheless due to the
constraint [constr_1050] part 1 the ports are still consider to be compatible.
[SWS_Csm_00506] ⌈The CSM module shall use the interfaces of the CRYIF with the
underlying Crypto Drivers (CRYPTO) to calculate the result of a cryptographic
service.
⌋(SRS_CryptoStack_00082)
The incorporated cryptographic library modules or hardware extensions of the Crypto
Driver provide the cryptographic routines, e.g. SHA-1, RSA, AES, Diffie-Hellman key-
exchange, etc.
6 Requirements Traceability
a cryptographic primitive
which can be requested to a
driver
SRS_CryptoStack_00020 The Crypto Stack shall identify SWS_Csm_00984, SWS_Csm_00989
symmetric
encryption/decryption as a
cryptographic primitive which
can be requested to a driver
SRS_CryptoStack_00021 The Crypto Stack shall identify SWS_Csm_00984, SWS_Csm_00989
asymmetric
encryption/decryption as a
cryptographic primitive which
can be requested to a driver
SRS_CryptoStack_00022 The Crypto Stack shall identify SWS_Csm_00982
MAC generation/verification
as a cryptographic primitive
which can be requested to a
driver
SRS_CryptoStack_00023 The Crypto Stack shall identify SWS_Csm_00992, SWS_Csm_00996
asymmetric signature
generation/verification as a
cryptographic primitive which
can be requested to a driver
SRS_CryptoStack_00024 The Crypto Stack shall identify SWS_Csm_00980
hash calculation as a
cryptographic primitive which
can be requested to a driver
SRS_CryptoStack_00026 The Crypto Stack shall SWS_Csm_00955
provide an interface for the
generation of asymmetric keys
SRS_CryptoStack_00027 The Crypto Stack shall SWS_Csm_00955
provide an interface for the
generation of symmetric keys
SRS_CryptoStack_00082 The CSM module specification SWS_Csm_00001, SWS_Csm_00032,
shall specify the interface and SWS_Csm_00506
behavior of the callback
function, if the asynchronous
job processing mode is
selected
SRS_CryptoStack_00084 The CSM module shall use SWS_Csm_01039
the streaming approach for
some selected services
SRS_CryptoStack_00086 The CSM module shall SWS_Csm_01089, SWS_Csm_91004
distinguish between error
types
SRS_CryptoStack_00087 The CSM module shall report SWS_Csm_01088, SWS_Csm_01091
detected development errors
to the Default Error Tracer
SRS_CryptoStack_00090 The CSM shall provide an SWS_Csm_00802, SWS_Csm_00803,
interface to be accessible via SWS_Csm_00902, SWS_Csm_00903,
the RTE SWS_Csm_00912, SWS_Csm_00922,
SWS_Csm_00923, SWS_Csm_00927,
SWS_Csm_00928, SWS_Csm_00930,
SWS_Csm_00934, SWS_Csm_00935,
SWS_Csm_00936, SWS_Csm_00943,
SWS_Csm_00946, SWS_Csm_01042,
SWS_Csm_01074, SWS_Csm_01075,
SWS_Csm_01077, SWS_Csm_01078,
SWS_Csm_01079, SWS_Csm_01906,
SWS_Csm_01910, SWS_Csm_01915,
SWS_Csm_01920, SWS_Csm_01921,
SWS_Csm_01922, SWS_Csm_01923,
SWS_Csm_01924, SWS_Csm_01925,
SWS_Csm_01926, SWS_Csm_01927,
SWS_Csm_01928, SWS_Csm_09000,
SWS_Csm_91023, SWS_Csm_91045,
SWS_Csm_91046, SWS_Csm_91051,
SWS_Csm_91052, SWS_Csm_91053,
SWS_Csm_91054, SWS_Csm_91055,
SWS_Csm_91056, SWS_Csm_91057,
SWS_Csm_91058, SWS_Csm_91059,
SWS_Csm_91060, SWS_Csm_91062,
SWS_Csm_91105
SRS_CryptoStack_00091 The CSM shall provide one SWS_Csm_00934, SWS_Csm_01042,
Provide--Port for each SWS_Csm_91023, SWS_Csm_91062
configuration
SRS_CryptoStack_00095 The Crypto Driver module SWS_Csm_91043, SWS_Csm_91044
shall strictly separate error
and status information
SRS_CryptoStack_00100 Synchronous Job Processing SWS_Csm_01049
SRS_CryptoStack_00101 Asynchronous Job Processing SWS_Csm_01049
SRS_CryptoStack_00103 The Crypto Stack shall SWS_Csm_00956
provide an interface for the
derivation of symmetric keys
SRS_CryptoStack_00906 - SWS_Csm_00947
SRS_CryptoStack_01076 - SWS_Csm_01083
SRS_CrytptoStack_00028 - SWS_Csm_00966, SWS_Csm_00967
SRS_CrytptoStack_00029 - SWS_Csm_00959
SRS_Csm_00066 - SWS_Csm_00691, SWS_Csm_01905
SWS_BSW_00050 Check parameters passed to SWS_Csm_00186
Initialization functions
SWS_BSW_00216 - SWS_Csm_01085
7 Functional specification
The CSM, as a service layer, provides the interface for SW-C or BSW for
cryptographic operations. The main task of the CSM is to schedule and prioritize
services and to call the crypto interface (CryIf) for further operation. The CryIf
schedules the requests to the crypto driver and its crypto driver object that was
statically assigned to this service.
The CSM uses a static configuration of primitives (CsmPrimitives) to define a
cryptographic operation. Such a primitive is then assigned to a job configuration
(CsmJob) that determines further attributes like priority, asynchronous or
synchronous execution and what key shall be used for the operation. It should be
18 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
noted that the key is always located in the crypto driver itself and the CSM uses only
a reference to it.
The separation of the keys and primitives allows to separate the API for the
cryptographic operation and the key management. This allows to let an application
concentrate on the required cryptographic operation like MAC calculation and
verification whereas a key manager provides the keys during a configuration setup.
The API of the CSM can roughly be divided into two categories: a direct API (mainly
for key management) and a job-based API (mainly for cryptographic operations) (see
Fig. x) 1. The direct API has a direct correspondence of the functions in the CryIf and
the Crypto Driver. These functions can only be called synchronously. The CSM will
pass the parameter from the application directly to the function call. The job-based
API uses a job structure, the Crypto_JobType, that contains static and dynamic
parameters and references to structures to provide all necessary information to the
crypto driver to perform that job (see Fig. x+1). Every service that uses a job will use
this structure. All necessary parameter for a service will be packed into the elements
of the structure by the CSM and will then call the CryIf and this, in turn, will call the
configured Crypto Driver.
Figure 7-2 API call tree for CSM, CryIf and Crypto. Divided into job-based API and Direct API
1
Historically, there are a few functions with direct synchronous API and a job based API, because the
need for asynchronous execution was recognized afterwards.
19 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
class System
«enumeration» Crypto_JobPrimitiveInputOutputType
Crypto_OperationModeType
- cryIfKeyId: uint32
Crypto_JobType CRYPTO_OPERATIONMODE_START - inputLength: uint32
CRYPTO_OPERATIONMODE_UPDATE - inputPtr: char *
- cryptoKeyId: uint32 CRYPTO_OPERATIONMODE_FINISH - mode: Crypto_OperationModeType
- jobId: uint32 CRYPTO_OPERATIONMODE_SINGLECALL - outputLengthPtr: char *
- jobInfoType: const Crypto_JobInfoType * - outputPtr: char *
- jobPrimitiveInfoType: const Crypto_JobPrimitiveInfoType * - secondaryInputLength: uint32
«enumeration» - jobPrimitiveInputOutput: Crypto_JobPrimitiveInputOutputType - secondaryInputPtr: char *
Crypto_JobStateType - jobRedirectionInfoRef: Crypto_JobRedirectionInfoType * - secondaryOutputLengthPtr: char *
CRYPTO_JOBSTATE_IDLE - jobState: Crypto_JobStateType Crypto_JobInfoType - secondaryOutputPtr: char *
- targetCryptoKeyId: uint32 - targetCryIfKeyId: uint32
CRPTO_JOBSTATE_ACTIVE
- jobId: uint32 - tertiaryInputLength: uint32
- jobPriority: uint32 - tertiaryInputPtr: char *
0..1 - verifyPtr: char *
Crypto_JobRedirectionInfoType
Crypto_AlgorithmInfoType
«enumeration» «enumeration»
Crypto_ProcessingType Crypto_AlgorithmFamilyType - family: Crypto_AlgorithmFamilyType
- keyLength: uint32
CRYPTO_PROCESSING_ASNC - mode: CryptoAlgorithmModeType
CRYPTO_PROCESSING_SYNC - secondaryFamily: Crypto_AlgorithmFamilyType
«enumeration»
Crypto_AlgorithmModeType
]
[SWS_Csm_00942] ⌈ If any of the SWS items Csm[CsmPrimitives]AlgorithmFamily,
Csm[CsmPrimitives]AlgorithmMode and/or
Csm[CsmPrimitives]SecondaryAlgorithmFamily in the container
Csm[CsmPrimitives]Config is set to CRYPTO_ALGOFAM_CUSTOM (0xFF) resp.
CRYPTO_ALGOMODE_CUSTOM (0xFF), then the value of the reference to
CryptoPrimitiveAlgorithmFamilyCustom/CryptoPrimitiveAlgorithmFamilyCustomId
and/or
CryptoPrimitiveAlgorithmModeCustom/CryptoPrimitiveAlgorithmModeCustomId
defined in the Crypto Driver shall be set to either of the fields “family”, “mode” and/or
“secondaryFamily” in Crypto_AlgorithmInfoType (instead of the “CUSTOM” value 0xff
itself).
⌋()
[SWS_Csm_00016] ⌈ For each job just one instance shall be processed by CSM at a
time.
⌋()
⌋(SRS_CryptoStack_00009)
[SWS_Csm_01039] ⌈To unite a single call function and the streaming approach for
the crypto services, there is the mode parameter, which determines the operation
mode. This service operation is a flag field, indicating the operation mode “START”,
“UPDATE” or “FINISH”. It declares explicitly what operation shall be performed.
These operation modes can be mixed, and execute multiple operations at once.
The diagram in SWS_Csm_00024 shows the state machine of a job of this design.
⌋(SRS_CryptoStack_00084)
Note: The actual transaction of the states is made in the layer, which works with
these states, i.e. in the Crypto Driver.
[SWS_Csm_00024] ⌈
Idle
Initial
Crypto_Operationmode_Start
Activ e
Error E_OK
E_OK
EntryPoint
[successful finish]
[error]
Crypto_Operationmode_Update Crypto_Operationmode_Finish
Update
Crypto_Operationmode_Update
⌋()
Note: The coherent single call approach could improve the performance due to less
overhead. Instead of calling the explicit API multiple times, only one call is necessary.
This approach is intended to be used with small data input, which demand fast
processing.
While operating with the streaming approach (“Start”, “Update”, “Finish”) the
dedicated Crypto Driver Object is waiting for further input (“Update”) until the “Finish”
state has been reached. No other job could be processed on this Crypto Driver
instance meanwhile.Functional Requirements
7.2.1.1 Configuration
Note:
Channels may hold jobs of both asynchronous and synchronous processing type. If
so, a synchronous job might not be accepted for processing although its job's priority
is higher than those of all asynchronous jobs.
Note:
As the underlying Crypto Driver can have its own queue, it can not always be
ensured that the highest priority job provided by the application is processed next.
[SWS_Csm_91007] ⌈ If a synchronous job is issued and the priority is less than the
highest priority available in the queue, the CSM shall return CRYPTO_E_BUSY.
⌋()
Note:
By pausing calls to the CSM main function with e.g. critical sections during calling the
synchronous jobs, it can be ensured, that synchronous jobs can be processed in a
row without having to wait for asynchronous jobs in between if they have a high
enough priority. Also consider disabling queueing in the Crypto Driver Object to
ensure fast processing of synchronous jobs.
If the loading of asynchronous jobs from the queue shall not be paused by
synchronous jobs, the priorities of the synchronous jobs have to be smaller than the
asynchronous jobs.
The CSM provides two services: (1) the crypto services itself and (2) key
management.
The Csm_Init() request shall not be responsible to trigger the initialization of the
underlying CRYIF. It is assumed, that the underlying CRYIF will be initialized by any
appropriate entity (e.g. BswM).
Software components, which are using the CSM module, shall be responsible for
checking global error and status information resulting from the CSM module startup.
Note:
The Csm_<Service>() will call the CryIf_ProcessJob() with a pointer to
Crypto_JobType, where all the necessary information are stored to process the job.
Part of this Crypto_JobType is a Crypto_JobPrimitiveInputOutputType, where all the
information about the input and output parameters depending of the service are
stored. A definition of the mapping from the API parameters of Csm_<Service>() to
the parameters of Crypto_JobPrimitiveInputOutputType, can be found in
[SWS_Crypto_00073] of the Crypto Driver specification.
⌋()
Note: The CryIf is responsible to transform this ID to the corresponding key ID of the
respective crypto driver.
Note: The CryIf is responsible to transform these IDs to the corresponding key IDs of
the respective crypto driver.
7.2.2.2.2 Queuing
The CSM may have several queues, where the jobs are lining up depending on their
priority, to process multiple cryptographic requests. The path from a CSM queue via
the CryIf to a Crypto Driver Object is called a channel. Each queue of the CSM is
mapped to one channel to access the crypto primitives of the Crypto Driver Object.
The size of the queue is configurable.
To optimize the hardware usage of the Crypto Driver Object, there is optionally a
queue in Crypto Driver, too.
Figure 7-4 illustrates an AUTOSAR Layered View with channels. In this example,
there is a HSM with two Crypto Driver Objects (HW-AES and HW-RSA), each of
them has an own channel. Each channel is connected to a CSM queue and a Crypto
Driver Object queue.
In this case, both Crypto Driver Objects are processing a crypto job (AES-high and
RSA) each, while the queue of the Crypto Driver Object contains one more job (AES-
low). If the HW-AES of the HSM finished the AES-high job, AES-low job will be
processed as next one.
Other scenarios with the same setup (without jobs in process or in queues) can be
derived as follows:
It will be assumed, that a new job of an application calls RSA.
If the Crypto Driver Object of the RSA is not busy, the job will be processed
immediately.
If the Crypto Driver Object of the RSA is busy, but the queue of the Crypto
Driver Object is not full, the job will be listed into that queue in order of its
priority. As soon as the Crypto Driver Object is free, the job with the highest
priority from the Crypto Driver Object queue will be executed.
If the Crypto Driver Object of the RSA is busy and the queue of the Crypto
Driver Object is full, the job will be stored in the CSM queue in order of its
priority.
If the Crypto Driver Object of the RSA is busy and the queue of the Crypto
Driver Object as well as the CSM queue are full, the CSM rejects the request.
If the Crypto Driver Object of the RSA is active, the job is already started in the
Crypto Driver and is waiting for either more data to process or the finish
command.
27 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
[SWS_Csm_00944] ⌈The CsmQueues shall sort the jobs according to the configured
job’s priority.
⌋()
The higher the job priority value, the higher the job’s priority.
[SWS_Csm_91073] ⌈ ⌈ If services with the same JobID can be added to the queue,
then the order of execution of these services shall correspond to the order if incoming
services operation requests (“First-In-First-Out”).
⌋()
[SWS_Csm_01041]⌈
⌋()
Synchronous job processing and queuing might not be useful. So, if synchronous job
processing is chosen, the queue sizes should be “0”. However, it is also possible to
use channels (including queues) with synchronous and asynchronous jobs.
If the job has the state “active” the CSM shall assume, that the mapped cryptographic
driver instance is currently processing this job and the caller wants to continue with
the operation (e.g. feeding more data using “update”). The plausibility check has to
be performed in the cryptographic driver instance.
Keys, i.e. the corresponding key IDs have symbolic names given by the
configuration. The Crypto Stack API uses the following key element index definition
from the CSM module:
[SWS_Csm_01022] ⌈
Crypto Service: key element: key element Name: key element ID:
Seed CRYPTO_KE_KEYGENERATE_SEED 16
Base CRYPTO_KE_KEYEXCHANGE_BASE 8
Algorithm CRYPTO_KE_KEYEXCHANGE_ALGORITHM 12
Password CRYPTO_KE_KEYDERIVATION_PASSWORD 1
Iterations CRYPTO_KE_KEYDERIVATION_ITERATIONS 14
Algorithm CRYPTO_KE_KEYDERIVATION_ALGORITHM 15
Seed CRYPTO_KE_KEYGENERATE_SEED 16
Key Generate
Algorithm CRYPTO_KE_KEYGENERATE_ALGORITHM 17
⌋()
[SWS_Csm_00951] ⌈For each key element that contains cryptographic key material,
the format of the provided key shall be specified in the configuration used for data
exchange, e.g. for Csm_KeyElementGet() or Csm_KeyElementSet().The key
formats supported by a specific crypto driver are part of the pre-configuration
information that comes along with the crypto driver.
⌋(SRS_CryptoStack_00008)
Note:
The key elements CRYPTO_KE_[…]_ALGORITHM are used to configure the behavior
of the key management functions, because they are independent of jobs and
therefore can not be configured like a primitive.
[SWS_Csm_01092] ⌈If a cryptographic primitive uses elliptic curve algorithm but the
concrete curve parameter cannot sufficiently specified by its algorithm families and its
algorithm mode, an additional key element of type CRYPTO_KE_xxxxx_CURVETYPE
shall be used to provide the required information. This information is set at runtime
through the key element interface. The data of the key element shall be set with its
object identifier follows the format defined in [19] and [20].
⌋(SRS_CryptoStack_00008)
Example: Definition for an ECC Brainpool 160 P1 key used for signature generation.
// According to RFC5639:
// {iso(1) identified-organization(3) teletrust(36)
algorithm(3) signatureAlgorithm(3) ecSign(2)
ecStdCurvesAndGeneration(8) ellipticCurve(1)}
brainpoolP160r1(1)
P2CONST(uint8, AUTOMATIC, MSN_CONST) EccType =
{ 1, 3, 36, 3, 3, 2, 8, 1, 1 }
; //OID definition of ECC Brainpool 160 P1
[SWS_Csm_91015] ⌈If input or output redirection is not used for a job element (no
CsmInOutRedirectionRef ECUC_Csm_00262 is existing),
jobRedirectionInfoRef shall be set to NULL_PTR. If redirection is used element
(CsmInOutRedirectionRef ECUC_Csm_00262 is existing) the
jobRedirectionInfoRef shall point to a structure of
Crypto_JobRedirectionInfoType.
⌋()
The job context interface allows to save or restore the context data of the workspace
for a specific crypto service from the crypto driver. This allows to store all dynamically
created data within a crypto driver so that it can later be restored to continue this
operation at the exact point where the context snapshot was taken.
Key element data are not affected. This means, that key elements are not part of the
context data and must be set or read by the key element interface separately if
necessary.
Based on this foundation, the following section specifies particular errors arranged in
the respective subsections below.
[SWS_Csm_91004]⌈
Error
Type of error Related error code
value
CSM_E_PARAM_
API request called with invalid parameter (Nullpointer) 0x01
POINTER
CSM_E_PROCESSING_
API request called with invalid processing mode 0x08
MODE
⌋(SRS_CryptoStack_00086)
[SWS_Csm_01089]⌈
Type of error Related error code Error value
⌋(SRS_CryptoStack_00086)
[SWS_Csm_91011] ⌈If a CSM API with a ID handle in its interface is called and the
ID handle is out of range, the operation shall not be performed and
35 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
[SWS_Csm_01091] ⌈If a CSM API with a job handle (called jobId) in its interface is
called and the Crypto_ServiceInfoType of the job does not match the requested
service, the operation shall not be performed and CSM_E_SERVICE_TYPE shall be
reported to the DET when CsmDevErrorDetect is true.
⌋(SRS_CryptoStack_00087)
[SWS_Csm_01088] ⌈If a CSM job needs to be queued and the queue is full, the
runtime error CSM_E_QUEUE_FULL shall be reported to the DET.
⌋(SRS_CryptoStack_00087)
7.5 Multicore
In case the Crypto-Stack is distributed across several partitions, Csm shall allow calls
of its <sevice> APIs in different partitions.
Note:
In case the a CsmJob is not processed inside MainFunction context at all
(Synchronous interfacing), the MainFunction assignment (via the respective
CsmQueue) defines the partition, where the CsmJob is assigned to.
8 API Specification
[SWS_Csm_91043]⌈
The service request failed because the service is
CRYPTO_E_BUSY 0x02
still busy
Description --
Available
Crypto_GeneralTypes.h
via
⌋(SRS_CryptoStack_00095)
8.2.2 Csm_ConfigType
[SWS_Csm_01085]⌈
Name Csm_ConfigType
Kind Structure
implementation specific
Type --
Elements
The content of the configuration data structure is implementation
Comment
specific.
Available
Csm.h
via
⌋(SWS_BSW_00216)
8.2.3 Crypto_AlgorithmFamilyType
[SWS_Csm_01047]⌈
Name Crypto_AlgorithmFamilyType
Kind Enumeration
CRYPTO_ALGOFAM_NOT_
0x00 Algorithm family is not set
SET
CRYPTO_ALGOFAM_
0x02 SHA2-224 hash
SHA2_224
CRYPTO_ALGOFAM_
0x03 SHA2-256 hash
SHA2_256
CRYPTO_ALGOFAM_
0x04 SHA2-384 hash
SHA2_384
CRYPTO_ALGOFAM_
0x05 SHA2-512 hash
SHA2_512
Range
CRYPTO_ALGOFAM_
0x06 SHA2-512/224 hash
SHA2_512_224
CRYPTO_ALGOFAM_
0x07 SHA2-512/256 hash
SHA2_512_256
CRYPTO_ALGOFAM_
0x08 SHA3-224 hash
SHA3_224
CRYPTO_ALGOFAM_
0x09 SHA3-256 hash
SHA3_256
CRYPTO_ALGOFAM_
0x0a SHA3-384 hash
SHA3_384
CRYPTO_ALGOFAM_
0x0b SHA3-512 hash
SHA3_512
CRYPTO_ALGOFAM_
0x0c SHAKE128 hash
SHAKE128
CRYPTO_ALGOFAM_
0x0d SHAKE256 hash
SHAKE256
CRYPTO_ALGOFAM_
0x0e RIPEMD hash
RIPEMD160
CRYPTO_ALGOFAM_
0x0f BLAKE-1-256 hash
BLAKE_1_256
CRYPTO_ALGOFAM_
0x10 BLAKE-1-512 hash
BLAKE_1_512
CRYPTO_ALGOFAM_
0x11 BLAKE-2s-256 hash
BLAKE_2s_256
CRYPTO_ALGOFAM_
0x12 BLAKE-2s-512 hash
BLAKE_2s_512
CRYPTO_ALGOFAM_
0x15 ChaCha cipher
CHACHA
CRYPTO_ALGOFAM_
0x17 ED22519 elliptic curve
ED25519
CRYPTO_ALGOFAM_
0x18 Brainpool elliptic curve
BRAINPOOL
CRYPTO_ALGOFAM_
0x19 NIST ECC elliptic curves
ECCNIST
CRYPTO_ALGOFAM_
0x1c SipHash
SIPHASH
CRYPTO_ALGOFAM_
0x1e Elliptic curve according to ANSI X9.62
ECCANSI
CRYPTO_ALGOFAM_
0x1f Elliptic curve according to SECG
ECCSEC
CRYPTO_ALGOFAM_
0x22 Cipher padding according to PKCS.7
PADDING_PKCS7
CRYPTO_ALGOFAM_
0x24 Password-Based Key Derivation Function 2
PBKDF2
CRYPTO_ALGOFAM_
0x25 ANSI X9.63 Public Key Cryptography
KDFX963
CRYPTO_ALGOFAM_
0x2C Elliptic-curve Digital Signatures
ECDSA
CRYPTO_ALGOFAM_
0x2D MAC calculation algorithm
POLY1305
CRYPTO_ALGOFAM_
0x2E Elliptic curve X25519 for ECDH
X25519
CRYPTO_ALGOFAM_
0xff Custom algorithm family
CUSTOM
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.4 Crypto_AlgorithmModeType
[SWS_Csm_01048]⌈
Name Crypto_AlgorithmModeType
Kind Enumeration
CRYPTO_ALGOMODE_RSASSA_
0x0a RSA Probabilistic Signature Scheme
PSS
CRYPTO_ALGOMODE_RSASSA_
0x0b RSA signature with PKCS#1 v1.5
PKCS1_v1_5
Counter-based Deterministic
CRYPTO_ALGOMODE_CTRDRBG 0x12
Random Bit Generator
CRYPTO_ALGOMODE_
0x13 Siphash-2-4
SIPHASH_2_4
CRYPTO_ALGOMODE_
0x14 Siphash-4-8
SIPHASH_4_8
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.5 Crypto_InputOutputRedirectionConfigType
[SWS_Csm_91024]⌈
Name Crypto_InputOutputRedirectionConfigType
Kind Enumeration
CRYPTO_REDIRECT_CONFIG_PRIMARY_INPUT 0x01 --
CRYPTO_REDIRECT_CONFIG_SECONDARY_INPUT 0x02 --
CRYPTO_REDIRECT_CONFIG_PRIMARY_OUTPUT 0x10 --
CRYPTO_REDIRECT_CONFIG_SECONDARY_OUTPUT 0x20 --
Defines which of the input/output parameters are re-directed to a key element. The
Description
values can be combined to define a bit field.
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.6 Crypto_JobType
[SWS_Csm_01013]⌈
Name Crypto_JobType
Kind Structure
jobId
Type uint32
jobState
Type Crypto_JobStateType
jobPrimitiveInputOutput
jobPrimitiveInfo
cryptoKeyId
Type uint32
Identifier of the Crypto Driver key. The identifier shall be written by the
Comment
Crypto Interface.
jobRedirectionInfoRef
Type Crypto_JobRedirectionInfoType*
targetCryptoKeyId
Type uint32
Target identifier of the Crypto Driver key. The identifier shall be written by
Comment
the Crypto Interface.
jobPriority
Comment Specifies the importance of the job (the higher, the more important).
Structure which contains further information, which depends on the job and the crypto
Description
primitive.
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.7 Crypto_JobStateType
[SWS_Csm_01028]⌈
Name Crypto_JobStateType
Kind Enumeration
CRYPTO_ Job is in the state "idle". This state is reached after Csm_
0x00
JOBSTATE_IDLE Init() or when the "Finish" state is finished.
Range
CRYPTO_ Job is in the state "active". There was already some input
JOBSTATE_ 0x01 or there are intermediate results. This state is reached,
ACTIVE when the "update" or "start" operation finishes.
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.8 Crypto_JobPrimitiveInputOutputType
[SWS_Csm_01009]⌈
43 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Name Crypto_JobPrimitiveInputOutputType
Kind Structure
inputPtr
inputLength
Type uint32
secondaryInputPtr
secondaryInputLength
Type uint32
tertiaryInputPtr
tertiaryInputLength
Type uint32
outputPtr
Type uint8*
outputLengthPtr
Type uint32*
secondaryOutputPtr
Type uint8*
secondaryOutputLengthPtr
Type uint32*
verifyPtr
Type Crypto_VerifyResultType*
mode
Type Crypto_OperationModeType
cryIfKeyId
Type uint32
targetCryIfKeyId
Type uint32
Comment Holds the target CryIf key id for key operation services.
Structure which contains input and output information depending on the job and the
Description
crypto primitive.
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.9 Crypto_JobPrimitiveInfoType
[SWS_Csm_01012]⌈
Name Crypto_JobPrimitiveInfoType
Kind Structure
callbackId
Type uint32
cryIfKeyId
Type uint32
processingType
Type Crypto_ProcessingType
Structure which contains further information, which depends on the job and the crypto
Description
primitive.
Available
Crypto_GeneralTypes.h
via
⌋(SRS_CryptoStack_00008)
8.2.10 Crypto_ServiceInfoType
[SWS_Csm_01031]⌈
Name Crypto_ServiceInfoType
Kind Enumeration
CRYPTO_ KeyExchangeCalcPubVal
0x0F
KEYEXCHANGECALCPUBVAL Service
CRYPTO_ KeyExchangeCalcSecret
0x10
KEYEXCHANGECALCSECRET Service
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.11 Crypto_JobRedirectionInfoType
[SWS_Csm_91026]⌈
Name Crypto_JobRedirectionInfoType
Kind Structure
redirectionConfig
Type uint8
inputKeyId
Type uint32
inputKeyElementId
Type uint32
Type uint32
secondaryInputKeyElementId
Type uint32
Comment Identifier of the key element which shall be used as secondary input
tertiaryInputKeyId
Type uint32
tertiaryInputKeyElementId
Type uint32
Comment Identifier of the key element which shall be used as tertiary input
outputKeyId
Type uint32
outputKeyElementId
Type uint32
secondaryOutputKeyId
Type uint32
secondaryOutputKeyElementId
Type uint32
Comment Identifier of the key element which shall be used as secondary output
Structure which holds the identifiers of the keys and key elements which shall be used
Description as input and output for a job and a bit structure which indicates which buffers shall be
redirected to those key elements.
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.12 Crypto_AlgorithmInfoType
[SWS_Csm_01008]⌈
Name Crypto_AlgorithmInfoType
Kind Structure
family
Type Crypto_AlgorithmFamilyType
Elements secondaryFamily
Type Crypto_AlgorithmFamilyType
keyLength
Type uint32
mode
Type Crypto_AlgorithmModeType
Structure which determines the exact algorithm. Note, not every algorithm needs to
Description
specify all fields. AUTOSAR shall only allow valid combinations.
Available
Crypto_GeneralTypes.h
via
⌋()
8.2.13 Crypto_ProcessingType
[SWS_Csm_01049]⌈
Name Crypto_ProcessingType
Kind Enumeration
⌋(SRS_CryptoStack_00100, SRS_CryptoStack_00101)
8.2.14 Crypto_PrimitiveInfoType
[SWS_Csm_01011]⌈
Name Crypto_PrimitiveInfoType
Kind Structure
service
Description Structure which contains basic information about the crypto primitive.
49 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
⌋()
8.2.15 Csm_ConfigIdType
[SWS_Csm_00691]⌈
Name Csm_ConfigIdType
Kind Type
Derived
uint16
from
Range 0..65535 -- --
Available
Csm.h
via
⌋(SRS_Csm_00066)
8.3.1.1 Csm_Init
[SWS_Csm_00646]⌈
Service Name Csm_Init
void Csm_Init (
Syntax const Csm_ConfigType* configPtr
)
Service ID
0x00
[hex]
Sync/Async Synchronous
Parameters
configPtr Pointer to a selected configuration structure
(in)
Parameters
None
(inout)
Parameters
None
(out)
The Configuration pointer configPtr is currently not used and shall therefore be set
null pointer value.
[SWS_Csm_00659] ⌈If the initialization of the CSM module fails, the CSM shall
report CSM_E_INIT_FAILED to the DET when CsmDevErrorDetect is true.
⌋()
8.3.1.2 Csm_GetVersionInfo
[SWS_Csm_00705]⌈
Service Name Csm_GetVersionInfo
void Csm_GetVersionInfo (
Syntax Std_VersionInfoType* versioninfo
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (out) versioninfo Pointer to where to store the version information of this module.
⌋(SRS_BSW_00407)
51 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
8.3.2.1 Csm_Hash
[SWS_Csm_00980]⌈
Service
Csm_Hash
Name
Std_ReturnType Csm_Hash (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax uint32 dataLength,
uint8* resultPtr,
uint32* resultLengthPtr
)
Service ID
0x5d
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
data
Contains the number of bytes to be hashed.
Length
Holds a pointer to the memory location in which the output length in bytes
is stored. On calling this function, this parameter shall contain the size of
result
Parameters the buffer provided by resultPtr. When the request has finished, the
Length
(inout) actual length of the returned value shall be stored. If the provided length
Ptr
information is smaller than the total length of the hash result, the resultPtr
will contain the truncated hash result.
Parameters
resultPtr Contains the pointer to the data where the hash value shall be stored.
(out)
Std_-
E_OK: Request successful
Return value Return-
E_NOT_OK: Request failed
Type
Description Uses the given data to perform the hash calculation and stores the hash.
⌋(SRS_CryptoStack_00024)
8.3.3.1 Csm_MacGenerate
[SWS_Csm_00982]⌈
Service
Csm_MacGenerate
Name
Std_ReturnType Csm_MacGenerate (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax uint32 dataLength,
uint8* macPtr,
uint32* macLengthPtr
)
Service ID
0x60
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
data
Contains the number of bytes to be hashed.
Length
Holds a pointer to the memory location in which the output length in bytes
is stored. On calling this function, this parameter shall contain the size of
mac
Parameters the buffer provided by macPtr. When the request has finished, the actual
Length
(inout) length of the returned MAC shall be stored. If the provided length
Ptr
information is smaller than the total length of the MAC result, the macPtr
will contain the truncated MAC result.
Parameters
macPtr Contains the pointer to the data where the MAC shall be stored.
(out)
Uses the given data to perform a MAC generation and stores the MAC in the memory
Description
location pointed to by the MAC pointer.
⌋(SRS_CryptoStack_00022)
8.3.3.2 Csm_MacVerify
[SWS_Csm_01050]⌈
Service Name Csm_MacVerify
Std_ReturnType Csm_MacVerify (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax uint32 dataLength,
const uint8* macPtr,
const uint32 macLength,
Crypto_VerifyResultType* verifyPtr
)
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
dataPtr Holds a pointer to the data for which the MAC shall be verified.
Parameters (in)
Contains the number of data bytes for which the MAC shall be
dataLength
verified.
Parameters
None
(inout)
Parameters Holds a pointer to the memory location, which will hold the result
verifyPtr
(out) of the MAC verification.
is "invalid"
CRYPTO_E_KEY_SIZE_MISMATCH: Request failed, a key
element has the wrong size
CRYPTO_E_KEY_EMPTY: Request failed because of
uninitialized source key element
Description Verifies the given MAC by comparing if the MAC is generated with the given data.
⌋()
The cipher interfaces can be used for symmetrical and asymmentrical encryption or
decryption. Furthermore, it is also possible to use these interfaces for compression
and decompression, respectively.
8.3.4.1 Csm_Encrypt
[SWS_Csm_00984]⌈
Service
Csm_Encrypt
Name
Std_ReturnType Csm_Encrypt (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax uint32 dataLength,
uint8* resultPtr,
uint32* resultLengthPtr
)
Service ID
0x5e
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
data
Contains the number of bytes to encrypt.
Length
Parameters Contains the pointer to the data where the encrypted data shall be
resultPtr
(out) stored.
Encrypts the given data and store the ciphertext in the memory location pointed by
Description
the result pointer.
⌋(SRS_CryptoStack_00020, SRS_CryptoStack_00021)
In the case of block ciphers, it shall be possible to pass a dataLength which is not
a multiple of the corresponding block size. The underlying Crypto Driver is
responsible for handling these input data.
8.3.4.2 Csm_Decrypt
[SWS_Csm_00989]⌈
Service
Csm_Decrypt
Name
Std_ReturnType Csm_Decrypt (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax
uint32 dataLength,
uint8* resultPtr,
uint32* resultLengthPtr
)
Service ID
0x5f
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
data
Contains the number of bytes to decrypt.
Length
Parameters Contains the pointer to the memory location where the decrypted data
resultPtr
(out) shall be stored.
Decrypts the given encrypted data and store the decrypted plaintext in the memory
Description
location pointed by the result pointer.
⌋(SRS_CryptoStack_00020, SRS_CryptoStack_00021)
8.3.5.1 Csm_AEADEncrypt
[SWS_Csm_01023]⌈
Service
Csm_AEADEncrypt
Name
Std_ReturnType Csm_AEADEncrypt (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* plaintextPtr,
uint32 plaintextLength,
const uint8* associatedDataPtr,
Syntax uint32 associatedDataLength,
uint8* ciphertextPtr,
uint32* ciphertextLengthPtr,
uint8* tagPtr,
uint32* tagLengthPtr
)
Service ID
0x62
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Parameters plaintext
Contains the number of bytes to encrypt.
(in) Length
associated
Contains the pointer to the associated data.
DataPtr
associated
Contains the number of bytes of the associated data.
DataLength
Contains the pointer to the data where the encrypted data shall be
ciphertextPtr
Parameters stored.
(out)
tagPtr Contains the pointer to the data where the Tag shall be stored.
Uses the given input data to perform a AEAD encryption and stores the ciphertext
Description and the MAC in the memory locations pointed by the ciphertext pointer and Tag
pointer.
⌋()
8.3.5.2 Csm_AEADDecrypt
[SWS_Csm_01026]⌈
Service
Csm_AEADDecrypt
Name
Std_ReturnType Csm_AEADDecrypt (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* ciphertextPtr,
uint32 ciphertextLength,
const uint8* associatedDataPtr,
Syntax uint32 associatedDataLength,
const uint8* tagPtr,
uint32 tagLength,
uint8* plaintextPtr,
uint32* plaintextLengthPtr,
Crypto_VerifyResultType* verifyPtr
)
Service ID
0x63
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
ciphertext
Contains the number of bytes to decrypt.
Length
Parameters
(in) associated
Contains the pointer to the associated data.
DataPtr
associated
Contains the length in bytes of the associated data.
DataLength
Contains the pointer to the data where the decrypted data shall be
plaintextPtr
Parameters stored.
(out)
verifyPtr Contains the pointer to the result of the verification.
Uses the given data to perform an AEAD encryption and stores the ciphertext and
Description
the MAC in the memory locations pointed by the ciphertext pointer and Tag pointer.
⌋()
8.3.6.1 Csm_SignatureGenerate
[SWS_Csm_00992]⌈
Service
Csm_SignatureGenerate
Name
Std_ReturnType Csm_SignatureGenerate (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax uint32 dataLength,
uint8* signaturePtr,
uint32* signatureLengthPtr
)
Service ID
0x76
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Parameters signature
Contains the pointer to the data where the signature shall be stored.
(out) Ptr
60 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Uses the given data to perform the signature calculation and stores the signature in
Description
the memory location pointed by the result pointer.
⌋(SRS_CryptoStack_00023)
8.3.6.2 Csm_SignatureVerify
[SWS_Csm_00996]⌈
Service Name Csm_SignatureVerify
Std_ReturnType Csm_SignatureVerify (
uint32 jobId,
Crypto_OperationModeType mode,
const uint8* dataPtr,
Syntax uint32 dataLength,
const uint8* signaturePtr,
uint32 signatureLength,
Crypto_VerifyResultType* verifyPtr
)
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
signature
Contains the signature length in bytes.
Length
Parameters
None
(inout)
Parameters Holds a pointer to the memory location, which will hold the result
verifyPtr
(out) of the signature verification.
Verifies the given MAC by comparing if the signature is generated with the given
Description
data.
⌋(SRS_CryptoStack_00023)
8.3.7.1 Csm_RandomGenerate
[SWS_Csm_01543]⌈
Service
Csm_RandomGenerate
Name
Std_ReturnType Csm_RandomGenerate (
uint32 jobId,
Syntax uint8* resultPtr,
uint32* resultLengthPtr
)
Service ID
0x72
[hex]
Reentrancy Reentrant
Parameters
jobId Holds the identifier of the job using the CSM service.
(in)
Holds a pointer to the memory location in which the result length in bytes
result is stored. On calling this function, this parameter shall contain the number
Parameters
Length of random bytes, which shall be stored to the buffer provided by resultPtr.
(inout)
Ptr When the request has finished, the actual length of the returned value
shall be stored.
Parameters Holds a pointer to the memory location which will hold the result of the
resultPtr
(out) random number generation.
Generate a random number and stores it in the memory location pointed by the result
Description
pointer.
⌋(SRS_CryptoStack_00019)
The following interfaces are used for key management. Basically, a key contains of
one ore more key elements. A key element can be part of multiple keys. For
example, this allows to derive a key element from a password with one keyId, and to
use this derived key element for encryption with another keyId.
Note:
If the actual key element to be modified is directly mapped to flash memory, there
could be a bigger delay when calling the key management functions (synchronous
operation)
8.3.8.1.1 Csm_KeyElementSet
[SWS_Csm_00957]⌈
Service Name Csm_KeyElementSet
Std_ReturnType Csm_KeyElementSet (
uint32 keyId,
uint32 keyElementId,
Syntax
const uint8* keyElementPtr,
uint32 keyElementLength
)
Service ID
0x78
[hex]
Sync/Async Synchronous
Holds the identifier of the key for which a new material shall be
keyId
set.
keyElement
Contains the number of key element bytes.
Length
Parameters
None
(inout)
Parameters
None
(out)
Description Sets the given key element bytes to the key identified by keyId.
⌋()
8.3.8.1.2 Csm_KeySetValid
[SWS_Csm_00958]⌈
Service Name Csm_KeySetValid
Std_ReturnType Csm_KeySetValid (
Syntax uint32 keyId
)
Sync/Async Synchronous
Holds the identifier of the key for which a new material shall be
Parameters (in) keyId
validated.
Parameters
None
(inout)
Description Sets the key state of the key identified by keyId to valid.
⌋()
8.3.8.1.3 Csm_KeySetInvalid
[SWS_Csm_91075]⌈
Service Name Csm_KeySetInvalid
Std_ReturnType Csm_KeySetInvalid (
Syntax uint32 keyId
)
Service ID
0x85
[hex]
Sync/Async Synchronous
Parameters (in) keyId Holds the identifier of the key which shall be invalidated.
Parameters
None
(inout)
Parameters
None
(out)
Sets the key status to invalid. The key cannot be used any longer for cryptographic
Description
operations until it has been set to valid state again.
⌋()
65 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
8.3.8.2.1 Csm_KeyGetStatus
[SWS_Csm_91047]⌈
Service Name Csm_KeyGetStatus
Std_ReturnType Csm_KeyGetStatus (
uint32 keyId,
Syntax Crypto_KeyStatusType* keyStatusPtr
)
Sync/Async Synchronous
Reentrancy Reentrant
Holds the identifier of the key for which the key state shall be
Parameters (in) keyId
returned.
Parameters
None
(inout)
Contains the pointer to the data where the status of the key
Parameters (out) keyStatusPtr
shall be stored.
⌋()
8.3.8.3.1 Csm_KeyElementGet
[SWS_Csm_00959]⌈
Service
Csm_KeyElementGet
Name
Std_ReturnType Csm_KeyElementGet (
uint32 keyId,
Syntax uint32 keyElementId,
uint8* keyElementPtr,
66 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
uint32* keyElementLengthPtr
)
Service ID
0x68
[hex]
Sync/Async Synchronous
Reentrancy Reentrant
Holds the identifier of the key from which a key element shall be
keyId
extracted.
Parameters
(in)
key
Holds the identifier of the key element to be extracted.
ElementId
Holds a pointer to the memory location in which the output buffer length
key
Parameters in bytes is stored. On calling this function, this parameter shall contain
Element
(inout) the buffer length in bytes of the keyElementPtr. When the request has
LengthPtr
finished, the actual size of the written input bytes shall be stored.
Parameters key Holds the pointer to the memory location where the key element shall
(out) ElementPtr be copied to.
Retrieves the key element bytes from a specific key element of the key identified by
Description the keyId and stores the key element in the memory location pointed by the key
pointer.
The underlying Crypto Driver has to decide if and how the key element bytes are
extracted.
[SWS_Csm_00969]⌈
Service Name Csm_KeyElementCopy
Std_ReturnType Csm_KeyElementCopy (
const uint32 keyId,
const uint32 keyElementId,
Syntax
const uint32 targetKeyId,
const uint32 targetKeyElementId
)
Service ID
0x71
[hex]
Sync/Async Synchronous
Holds the identifier of the key whose key element shall be the
keyId
source element.
Holds the identifier of the key element which shall be the source
keyElementId
for the copy operation.
Parameters (in)
Holds the identifier of the key whose key element shall be the
targetKeyId
destination element.
targetKey Holds the identifier of the key element which shall be the
ElementId destination for the copy operation.
Parameters
None
(inout)
Parameters
None
(out)
Description This function shall copy a key elements from one key to a target key.
⌋()
8.3.8.4.2 Csm_KeyCopy
[SWS_Csm_01034]⌈
Service Name Csm_KeyCopy
Std_ReturnType Csm_KeyCopy (
const uint32 keyId,
Syntax const uint32 targetKeyId
)
Sync/Async Synchronous
Holds the identifier of the key whose key element shall be the
keyId
source element.
Parameters (in)
Holds the identifier of the key whose key element shall be the
targetKeyId
destination element.
Parameters
None
(inout)
Parameters
None
(out)
Description This function shall copy all key elements from the source key to a target key.
⌋()
8.3.8.4.3 Csm_KeyElementCopyPartial
[SWS_Csm_91025]⌈
69 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Service
Csm_KeyElementCopyPartial
Name
Std_ReturnType Csm_KeyElementCopyPartial (
uint32 keyId,
uint32 keyElementId,
uint32 keyElementSourceOffset,
Syntax uint32 keyElementTargetOffset,
uint32 keyElementCopyLength,
uint32 targetKeyId,
uint32 targetKeyElementId
)
Service ID
0x79
[hex]
Sync/Async Synchronous
Holds the identifier of the key whose key element shall be the
keyId
source element for copy operation.
keyElementSource This is the offset of the source key element indicating the start
Offset index of the copy operation.
Parameters keyElementTarget This is the offset of the destination key element indicating the
(in) Offset start index of the copy operation.
keyElementCopy
Specifies the number of bytes that shall be copied.
Length
Holds the identifier of the key whose key element shall be the
targetKeyId
destination element.
Parameters
None
(inout)
Parameters
None
(out)
Copies a key element to another key element in the same crypto driver. The key
ElementSourceOffset and keyElementCopyLength allows to copy just a part of the
Description
source key element into the destination. The offset into the target key is also
specified with this function.
⌋()
Note: A Concatenation of partial keys into one key element is possible by calling
Csm_KeyElementCopyPartial() multiple times and adjusting keyElementTargetOffset
properly.
[SWS_Csm_91020] ⌈If the current length of the target key element is greater or
equal than (keyElementTargetOffset + keyElementCopyLength), the key element
length remains unchanged and the target data is overwritten with the contents of the
source data.
⌋()
[SWS_Csm_91021] ⌈ If the current length of the target key element is lower than
(keyElementTargetOffset + keyElementCopyLength) and the maximum
length of the key element is greater or equal than (keyElementTargetOffset +
keyElementCopyLength), then the source data shall be copied into the target key
element and the length shall be set to (keyElementTargetOffset +
keyElementCopyLength).
⌋()
[SWS_Csm_91022] ⌈
If the maximum length of the target key element is lower than
(keyElementTargetOffset + keyElementCopyLength) then the copy operation
shall not be performed and the function shall return with the error code
CRYPTO_E_KEY_SIZE_MISMATCH.
⌋()
The key generation interface is used to generate a key into the key element
CRYPTO_KE_KEYGENERATE_KEY according to the algorithm defined in the key
element CRYPTO_KE_KEYGENERATE_ALGORITHM.
The key will be generated from the random value that is located in the key element
CRYPTO_KE_KEYGENERATE_SEED.
The random value can be generated, for example, with the function
Csm_RandomGenerate() and must be stored in CRYPTO_KE_KEYGENERATE_SEED
before the key generation is triggered.
It is important to check the quality of the randomness and its entropy of the seed,
which depends on the used hardware, and software of a stack. The randomness has
a major impact on the quality of the generated key material.
8.3.8.5.1 Csm_RandomSeed
[SWS_Csm_01051]⌈
Service Name Csm_RandomSeed
Std_ReturnType Csm_RandomSeed (
uint32 keyId,
Syntax const uint8* seedPtr,
uint32 seedLength
)
Sync/Async Synchronous
Holds the identifier of the key for which a new seed shall be
keyId
generated.
Parameters (in) Holds a pointer to the memory location which contains the data
seedPtr
to feed the seed.
Parameters
None
(inout)
⌋()
8.3.8.5.2 Csm_KeyGenerate
[SWS_Csm_00955]⌈
Service Name Csm_KeyGenerate
Std_ReturnType Csm_KeyGenerate (
Syntax uint32 keyId
)
Sync/Async Synchronous
Holds the identifier of the key for which a new material shall be
Parameters (in) keyId
generated.
Parameters
None
(inout)
Parameters
None
(out)
Description Generates new key material and store it in the key identified by keyId.
⌋(SRS_CryptoStack_00026, SRS_CryptoStack_00027)
In cryptography, a key derivation function (or KDF) is a function, which derives one or
more secret keys from a secret value and/or other known information such as a
passphrase or cryptographic key.
Specification of input keys that are protected by hardware means can be achieved by
using the Csm_KeyDeriveKey interface.
8.3.8.6.1 Csm_KeyDerive
[SWS_Csm_00956]⌈
Service
Csm_KeyDerive
Name
Std_ReturnType Csm_KeyDerive (
uint32 keyId,
Syntax
uint32 targetKeyId
)
Service ID
0x6b
[hex]
Sync/Async Synchronous
keyId Holds the identifier of the key which is used for key derivation.
Parameters
(in) Holds the identifier of the key which is used to store the derived
targetKeyId
key.
Parameters
None
(inout)
Parameters
None
(out)
Derives a new key by using the key elements in the given key identified by the keyId.
Description The given key contains the key elements for the password and salt. The derived key
is stored in the key element with the id 1 of the key identified by targetCryptoKeyId.
⌋(SRS_CryptoStack_00103)Csm_KeyGenerate
Two users that each have a private secret can use a key exchange protocol to obtain
a common secret, e.g. a key for a symmetric-key algorithm, without telling each other
their private secret and without any listener being able to obtain the common secret
or their private secrets
The CSM key exchange functions require a key with key elements according to
[SWS_Csm_01022], in the line of Crypto Service "Key Exchange". The key elements
CRYPTO_KE_KEYEXCHANGE_BASE, CRYPTO_KE_KEYEXCHANGE_PRIVKEY and
CRYPTO_KE_KEYEXCHANGE_OWNPUBKEY are used to hold the public/private key
material.
These values can either be pre-defined and set by Csm_KeyElementSet()
followed by Csm_KeySetValid() or generated. For example, these key values can
be generated by Csm_KeyGenerate() and then copied with
Csm_KeyElementCopy() to the corresponding key elements, followed by a call to
Csm_KeySetValid().
In a first step, Alice will call Csm_KeyExchangeCalcPubVal() /
Csm_JobKeyExchangeCalcPubVal() and send the results to Bob (exchanged
data may need to be signed and/or encrypted depending on the protocol).
It should be noted, that if KeyExchangeCalcPubVal is called but no valid key
material exists (key is not valid or essential key elements have length=0), the function
shall generate the necessary key material and continue as normal.
If needed, Bob will put received key material from Alice into the corresponding key
elements. He will also call Csm_KeyExchangeCalcPubVal() to generate his
shared value that needs to be sent to Alice. Afterwards, Bob can call
DH(E) ECDH(E)
CRYPTO_KE_KEYEXCHANGE_BASE Modulo Generator point
CRYPTO_KE_KEYEXCHANGE_PRIVKEY Local exponent Private key
CRYPTO_KE_KEYEXCHANGE_OWNPUBKEY Generator Public key
8.3.8.7.1 Csm_KeyExchangeCalcPubVal
[SWS_Csm_00966]⌈
Service
Csm_KeyExchangeCalcPubVal
Name
Std_ReturnType Csm_KeyExchangeCalcPubVal (
uint32 keyId,
Syntax uint8* publicValuePtr,
uint32* publicValueLengthPtr
)
Service ID
0x6c
[hex]
Sync/Async Synchronous
Parameters Holds the identifier of the key which shall be used for the key exchange
keyId
(in) protocol.
Holds a pointer to the memory location in which the public value length
public information is stored. On calling this function, this parameter shall
Parameters
Value contain the size of the buffer provided by publicValuePtr. When the
(inout)
LengthPtr request has finished, the actual length of the returned value shall be
stored.
Parameters public
Contains the pointer to the data where the public value shall be stored.
(out) ValuePtr
Calculates the public value of the current user for the key exchange and stores the
Description
public key in the memory location pointed by the public value pointer.
⌋(SRS_CrytptoStack_00028)
8.3.8.7.2 Csm_KeyExchangeCalcSecret
[SWS_Csm_00967]⌈
Service
Csm_KeyExchangeCalcSecret
Name
Std_ReturnType Csm_KeyExchangeCalcSecret (
uint32 keyId,
Syntax const uint8* partnerPublicValuePtr,
uint32 partnerPublicValueLength
)
Service ID
0x6d
[hex]
Sync/Async Synchronous
Holds the identifier of the key which shall be used for the
keyId
key exchange protocol.
Parameters Holds the pointer to the memory location which contains the
partnerPublicValuePtr
(in) partner's public value.
partnerPublicValue
Contains the length of the partner's public value in bytes.
Length
Parameters
None
(inout)
Parameters
None
(out)
Calculates the shared secret key for the key exchange with the key material of the
Description key identified by the keyId and the partner public key. The shared secret key is
stored as a key element in the same key.
⌋(SRS_CrytptoStack_00028)
The keyId configured in the Job is only used to determine which driver objects needs
to be used for the specific JobKeyPrimitive operation.
8.3.9.1 Csm_JobKeySetValid
[SWS_Csm_91027]⌈
Service Name Csm_JobKeySetValid
Std_ReturnType Csm_JobKeySetValid (
uint32 jobId,
Syntax
uint32 keyId
)
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Parameters (in)
Holds the identifier of the key for which a new material shall be
keyId
validated.
Parameters
None
(inout)
Stores the key if necessary and sets the key state of the key identified by keyId
Description
to valid.
⌋()
8.3.9.2 Csm_JobKeySetInvalid
[SWS_Csm_91002]⌈
Service Name Csm_JobKeySetInvalid
Std_ReturnType Csm_JobKeySetInvalid (
uint32 jobId,
Syntax uint32 keyId
)
Service ID
0x84
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Parameters (in)
keyId Holds the identifier of the key which shall be invalidated.
Parameters
None
(inout)
Parameters
None
(out)
Sets the key status to invalid. The key cannot be used any longer for cryptographic
Description
operations until it has been set to valid state again.
⌋()
8.3.9.3 Csm_JobRandomSeed
[SWS_Csm_91028]⌈
Service Name Csm_JobRandomSeed
Std_ReturnType Csm_JobRandomSeed (
uint32 jobId,
Syntax
uint32 keyId,
const uint8* seedPtr,
uint32 seedLength
)
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Holds the identifier of the key for which a new seed shall be
keyId
generated.
Parameters (in)
Holds a pointer to the memory location which contains the data
seedPtr
to feed the seed.
Parameters
None
(inout)
Provides a new seed for the specified key that is used for an associated random
Description
number generator.
⌋()
Note: The provided key Id(s) shall be transformed from CsmKeyId’s to CryIfKeyId’s.
8.3.9.4 Csm_JobKeyGenerate
[SWS_Csm_91029]⌈
Service Name Csm_JobKeyGenerate
Std_ReturnType Csm_JobKeyGenerate (
uint32 jobId,
Syntax
uint32 keyId
)
Reentrancy Reentrant
Parameters (in) jobId Holds the identifier of the job using the CSM service.
Holds the identifier of the key for which a new material shall be
keyId
generated.
Parameters
None
(inout)
Parameters
None
(out)
Description Generates new key material and stores it in the key identified by keyId.
⌋()
Note: The provided key Id(s) shall be transformed from CsmKeyId’s to CryIfKeyId’s.
8.3.9.5 Csm_JobKeyDerive
[SWS_Csm_91030]⌈
Service
Csm_JobKeyDerive
Name
Std_ReturnType Csm_JobKeyDerive (
uint32 jobId,
Syntax uint32 keyId,
uint32 targetKeyId
)
Service ID
0x7d
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Parameters keyId Holds the identifier of the key which is used for key derivation.
(in)
Holds the identifier of the key which is used to store the derived
targetKeyId
key.
Parameters
None
(inout)
Parameters
None
(out)
Derives a new key by using the key elements in the given key identified by the keyId.
Description The given key contains the key elements for the password and salt. The derived key
is stored in the key element with the id 1 of the key identified by targetCryptoKeyId.
⌋()
Note: The provided key Id(s) shall be transformed from CsmKeyId’s to CryIfKeyId’s.
8.3.9.6 Csm_JobKeyExchangeCalcPubVal
[SWS_Csm_91031]⌈
Service
Csm_JobKeyExchangeCalcPubVal
Name
Std_ReturnType Csm_JobKeyExchangeCalcPubVal (
uint32 jobId,
uint32 keyId,
Syntax uint8* publicValuePtr,
uint32* publicValueLengthPtr
)
Service ID
0x7e
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Parameters
(in) Holds the identifier of the key which shall be used for the key exchange
keyId
protocol.
Holds a pointer to the memory location in which the public value length
public information is stored. On calling this function, this parameter shall
Parameters
Value contain the size of the buffer provided by publicValuePtr. When the
(inout)
LengthPtr request has finished, the actual length of the returned value shall be
stored.
Parameters public
Contains the pointer to the data where the public value shall be stored.
(out) ValuePtr
Calculates the public value of the current user for the key exchange and stores the
Description
public key in the memory location pointed by the public value pointer.
⌋()
Note: The provided key Id(s) shall be transformed from CsmKeyId’s to CryIfKeyId’s.
8.3.9.7 Csm_JobKeyExchangeCalcSecret
[SWS_Csm_91032]⌈
Service
Csm_JobKeyExchangeCalcSecret
Name
Std_ReturnType Csm_JobKeyExchangeCalcSecret (
uint32 jobId,
uint32 keyId,
Syntax const uint8* partnerPublicValuePtr,
uint32 partnerPublicValueLength
)
Service ID
0x7f
[hex]
Reentrancy Reentrant
jobId Holds the identifier of the job using the CSM service.
Holds the identifier of the key which shall be used for the
keyId
key exchange protocol.
Parameters
(in) Holds the pointer to the memory location which contains the
partnerPublicValuePtr
partner's public value.
partnerPublicValue
Contains the length of the partner's public value in bytes.
Length
Parameters
None
(inout)
Parameters
None
(out)
Calculates the shared secret key for the key exchange with the key material of the
Description key identified by the keyId and the partner public key. The shared secret key is
stored as a key element in the same key.
⌋()
Note: The provided key Id(s) shall be transformed from CsmKeyId’s to CryIfKeyId’s.
8.3.10.1 Csm_SaveContextJob
[SWS_Csm_91063]⌈
Service
Csm_SaveContextJob
Name
Std_ReturnType Csm_SaveContextJob (
uint32 jobId,
Syntax uint8* contextBufferPtr,
uint32* contextBufferLengthPtr
)
Service ID
0x86
[hex]
Reentrancy Reentrant
Parameters
jobId Holds the identifier of the job using the CSM service.
(in)
Pointer to the buffer, where the length value is located. As input data it
context
Parameters provides the maximum length of data available in contextBufferPtr. As
Buffer
(inout) output data it provides the actual length of data located in context
LengthPtr
BufferPtr (or 0 in case of a failure)
Parameters context Pointer to the buffer in the application where the context data shall be
(out) BufferPtr stored to.
The Crypto Driver stores the internal context of the respective crypto operation to the
Description
contextBuffer.
⌋()
8.3.10.2 Csm_RestoreContextJob
[SWS_Csm_91064]⌈
Service Name Csm_RestoreContextJob
Std_ReturnType Csm_RestoreContextJob (
uint32 jobId,
Syntax uint8* contextBufferPtr,
uint32 contextBufferLength
)
Service ID
0x87
[hex]
Reentrancy Reentrant
Parameters Pointer to the buffer, where the context data are located that
contextBufferPtr
(in) shall be restored.
contextBuffer Provides the length of context data that are located in context
Length BufferPtr.
Parameters
None
(inout)
Parameters
None
(out)
The Crypto Driver extracts the context data from the contextBuffer and restores the
Description internal state so that further crypto operation of this crypto service will continue at
the exact point when the context was taken.
⌋()
8.3.11.1 Csm_CancelJob
[SWS_Csm_00968]⌈
Service Name Csm_CancelJob
Std_ReturnType Csm_CancelJob (
uint32 job,
Syntax
Crypto_OperationModeType mode
)
Service ID
0x6f
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
⌋()
86 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
[SWS_Csm_01021] ⌈ The Csm shall remove the job from its own queue or call
CryIf_CancelJob() to cancel a potential job in the driver.⌋ ( )
Note: In case the crypto driver does not support an instant cancelation of the job, the
application need to wait for the job's closing callback to free the buffers. The crypto
driver could potentially still write to the output buffer(s).
8.3.12.1 Csm_CallbackNotification
[SWS_Csm_00970]⌈
Service Name Csm_CallbackNotification
void Csm_CallbackNotification (
Crypto_JobType* job,
Syntax Crypto_ResultType result
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
Notifies the CSM that a job has finished. This function is used by the underlying
Description
layer (CRYIF).
⌋(SRS_BSW_00359, SRS_BSW_00360)
8.3.13.1 Csm_MainFunction
[SWS_Csm_00479]⌈
Service
Csm_MainFunction
Name
void Csm_MainFunction (
Syntax void
)
Service ID
0x01
[hex]
Available
SchM_Csm.h
via
⌋(SRS_BSW_00373, SRS_BSW_00432)
[SWS_Csm_91100]⌈
Header
API Function Description
File
This function shall copy all key elements from the source key to a
CryIf_KeyCopy CryIf.h
target key.
CryIf_Key-
CryIf.h This function shall copy a key elements from one key to a target key.
ElementCopy
CryIf_Key- This function shall dispatch the get key element function to the
CryIf.h
ElementGet configured crypto driver object.
CryIf_Key- This function shall dispatch the set key element function to the
CryIf.h
ElementSet configured crypto driver object.
CryIf_Key-
This function shall dispatch the key exchange common shared secret
ExchangeCalc- CryIf.h
calculation function to the configured crypto driver object.
Secret
CryIf_Key- This function shall dispatch the key generate function to the
CryIf.h
Generate configured crypto driver object.
CryIf_KeySet- This function shall dispatch the set key valid function to the configured
CryIf.h
Valid crypto driver object.
CryIf_Process- This interface dispatches the received jobs to the configured crypto
CryIf.h
Job driver object.
CryIf_Random- This function shall dispatch the random seed function to the
CryIf.h
Seed configured crypto driver object.
Det_Report- Service to report runtime errors. If a callout has been configured then
Det.h
RuntimeError this callout shall be called.
⌋()
[SWS_Csm_91101]⌈
API Function Header File Description
89 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
⌋()
8.4.4.1 <Csm_ApplicationCallbackNotification>
[SWS_Csm_00971]⌈
Service Name <Csm_ApplicationCallbackNotification>
void <Csm_ApplicationCallbackNotification> (
uint32 jobId,
Syntax
Crypto_ResultType result
)
Service ID
0x82
[hex]
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
Parameters
None
(out)
CSM notifies the application that a job has finished. The function name is
Description configurable. The function name itself is derived from "{CsmJob/CsmJobPrimitive
CallbackRef}/CsmCallbackFunc".
⌋(SRS_BSW_00359, SRS_BSW_00360)
[SWS_Csm_01095] ⌈ The CSM shall call the application callback function if the
following condition is met:
({ecuc(Csm/CsmJobs/CsmJob.CsmProcessingMode)} == CRYPTO_PROCESSING_ASYN) &&
(CsmJob/CsmJobInterfaceUsePort == CRYPTO_USE_FNC) &&
(CsmJob/CsmJobPrimitiveCallbackRef != 0)
For the service interface the callback service shall be called if the asynchronous
processing is configured:
({ecuc(Csm/CsmJobs/CsmJob.CsmProcessingMode)} == CRYPTO_PROCESSING_ASYN) &&
(CsmJob/CsmJobInterfaceUsePort != CRYPTO_USE_FNC)
⌋()
8.5.1 Client-Server-Interfaces
8.5.1.1 CsmKeyManagement_{Key}
[SWS_Csm_01905]⌈
Name CsmKeyManagement_{Key}
IsService true
({ecuc(Csm/CsmKeys/CsmKey.CsmKeyUsePort)} == TRUE)
Variation
Key = {ecuc(Csm/CsmKeys/CsmKey.SHORT-NAME)}
Possible CRYPTO_E_KEY_ The service request failed because read access was
6
Errors READ_FAIL denied.
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Operation KeyCopy
Comment This function shall copy all key elements from the source key to a target key.
Variation --
targetKeyId
Type uint32
Direction IN
Parameters
Holds the identifier of the key whose key element shall be the
Comment
destination element.
Variation --
E_OK
E_NOT_OK
CRYPTO_E_BUSY
Possible CRYPTO_E_KEY_READ_FAIL
Errors CRYPTO_E_KEY_WRITE_FAIL
CRYPTO_E_KEY_NOT_AVAILABLE
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
Operation KeyDerive
Derives a new key by using the key elements in the given key. The given key
Comment contains the key elements for the password and salt. The derived key is stored in the
key element with the id 1 of the key identified by targetCryptoKeyId.
Variation --
targetKeyId
Type uint32
Direction IN
Parameters
Holds the identifier of the key which is used to store the derived
Comment
key.
Variation --
E_OK
Possible
E_NOT_OK
Errors
CRYPTO_E_BUSY
CRYPTO_E_KEY_READ_FAIL
CRYPTO_E_KEY_WRITE_FAIL
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
Operation KeyElementCopy
Comment This function shall copy a key elements from one key to a target key
Variation --
keyElementId
Type uint32
Direction IN
Holds the identifier of the key element which shall be the source for the
Comment
copy operation.
Variation --
targetKeyId
Type uint32
Direction IN
Parameters
Holds the identifier of the key whose key element shall be the
Comment
destination element.
Variation --
targetKeyElementId
Type uint32
Direction IN
Holds the identifier of the key element which shall be the destination
Comment
for the copy operation.
Variation --
E_OK
E_NOT_OK
CRYPTO_E_BUSY
Possible CRYPTO_E_KEY_READ_FAIL
Errors CRYPTO_E_KEY_WRITE_FAIL
CRYPTO_E_KEY_NOT_AVAILABLE
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
Operation KeyElementCopyPartial
This function shall copy parts of a a key elements from one key to parts of a target
Comment
key element of a target key.
Variation --
keyElementId
Type uint32
Direction IN
Holds the identifier of the key element which shall be the source for the
Comment
copy operation.
Variation --
keyElementSourceOffset
Type uint32
Direction IN
This is the offset of the source key element indicating the start index of
Comment
the copy operation.
Variation --
keyElementTargetOffset
Type uint32
Direction IN
This is the offset of the destination key element indicating the start
Comment
Parameters index of the copy operation.
Variation --
keyElementCopyLength
Type uint32
Direction IN
Variation --
targetKeyId
Type uint32
Direction IN
Holds the identifier of the key whose key element shall be the
Comment
destination element.
Variation --
targetKeyElementId
Type uint32
Direction IN
Holds the identifier of the key element which shall be the destination
Comment
for the copy operation.
Variation --
E_OK
E_NOT_OK
CRYPTO_E_BUSY
Possible CRYPTO_E_KEY_READ_FAIL
Errors CRYPTO_E_KEY_WRITE_FAIL
CRYPTO_E_KEY_NOT_AVAILABLE
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
Operation KeyElementGet
Retrieves the key element bytes from a specific key element of the key and stores
Comment
the key element in the provided buffer.
Variation --
keyElementId
Type uint32
Direction IN
Variation --
keyElement
Type Csm_KeyDataType_{Crypto}
Variation --
keyElementLength
Type uint32
Direction INOUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_READ_FAIL
CRYPTO_E_KEY_NOT_AVAILABLE
CRYPTO_E_KEY_EMPTY
Operation KeyElementSet
Variation --
keyElementId
Type uint32
Direction IN
Variation --
keyElement
Type Csm_KeyDataType_{Crypto}
Parameters Direction IN
Variation --
keyElementLength
Type uint32
Direction IN
Variation --
E_OK
E_NOT_OK
CRYPTO_E_BUSY
Possible Errors
CRYPTO_E_KEY_WRITE_FAIL
CRYPTO_E_KEY_NOT_AVAILABLE
CRYPTO_E_KEY_SIZE_MISMATCH
Operation KeyExchangeCalcPubVal
Calculates the public value of the current user for the key exchange and stores the
Comment
public key in the provided buffer
Variation --
publicValue
Type Csm_KeyDataType_{Crypto}
Direction OUT
Parameters
Contains the pointer to the memory location where the public value shall
Comment
be stored.
Variation --
96 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
publicValueLength
Type uint32
Direction INOUT
Holds a pointer to the memory location in which the public value length in
bytes is stored. On calling this function, this parameter shall contain the
Comment
size of the buffer in bytes provided by publicValuePtr. When the request
has finished, the actual length of the returned value shall be stored.
Variation --
E_OK
E_NOT_OK
Possible
CRYPTO_E_BUSY
Errors
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
Operation KeyExchangeCalcSecret
Calculates the shared secret key for the key exchange with the key material of the
Comment key identified by the keyId and the partner public key. The shared secret key is
stored as a key element in the same key.
Variation --
partnerPublicValue
Type Csm_KeyDataType_{Crypto}
Direction IN
Variation --
Parameters
partnerPublicValueLength
Type uint32
Direction IN
Variation --
E_OK
E_NOT_OK
Possible
CRYPTO_E_BUSY
Errors
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
Operation KeyGenerate
Comment Generates new key material and store it in the key identified by keyId.
Variation --
E_OK
E_NOT_OK
Possible Errors CRYPTO_E_BUSY
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
Operation KeyGetStatus
Variation --
keyStatusPtr
Type Crypto_KeyStatusType
Variation --
E_OK
Possible Errors
E_NOT_OK
Operation KeySetInvalid
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
Operation KeySetValid
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
Operation RandomSeed
Variation --
seed
Parameters
Type Csm_KeyDataType_{Crypto}
98 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Direction IN
Comment Holds the data which shall be used for the random seed initialization.
Variation --
seedLength
Type uint32
Direction IN
Variation --
E_OK
E_NOT_OK
Possible Errors CRYPTO_E_BUSY
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
⌋(SRS_Csm_00066)
8.5.1.2 CsmHash_{PrimitiveCfg}
[SWS_Csm_00946]⌈
Name CsmHash_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-
NAME)}
Operation Hash
Variation --
data
Type Csm_HashDataType_{Crypto}
Parameters
Direction IN
dataLength
Type uint32
Direction IN
Variation --
result
Type Csm_HashResultType_{Crypto}
Direction OUT
resultLength
Type uint32
Direction INOUT
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
⌋(SRS_CryptoStack_00090)
8.5.1.3 CsmMacGenerate_{PrimitiveCfg}
[SWS_Csm_09000]⌈
Name CsmMacGenerate_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Operation MacGenerate
Uses the given data to perform a MAC generation and stores the MAC in the
Comment
memory location pointed to by the MAC pointer.
Variation --
data
Type Csm_MacGenerateDataType_{Crypto}
Direction IN
Comment Contains the data from which a MAC shall be generated of.
dataLength
Type uint32
Direction IN
Contains the length in bytes of the data from which a MAC shall be
Comment
generated of.
Variation --
Parameters
mac
Type Csm_MacGenerateResultType_{Crypto}
Direction OUT
macLength
Type uint32
Direction INOUT
Variation --
E_OK
Possible E_NOT_OK
Errors CRYPTO_E_BUSY
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.1.4 CsmMacVerify_{PrimitiveCfg}
[SWS_Csm_00936]⌈
Name CsmMacVerify_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
Possible 9 Request failed, the key is not valid.
NOT_VALID
Errors
Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
Operation MacVerify
Uses the given data to perform a MAC generation and stores the MAC in the
Comment
memory location pointed to by the MAC pointer.
Variation --
data
Type Csm_MacVerifyDataType_{Crypto}
Direction IN
Comment Contains the data from which a MAC shall be generated of.
Parameters
Variation Crypto = {ecuc/Csm/CsmPrimitives.SHORT-NAME}
dataLength
Type uint32
Direction IN
Contains the length in bytes of the data for whichs MAC shall be
Comment
verified.
Variation --
mac
Type Csm_MacVerifyCompareType_{Crypto}
Direction IN
macLength
Type uint32
Direction IN
Variation --
verify
Type Crypto_VerifyResultType
Direction OUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.1.5 CsmEncrypt_{PrimitiveCfg}
[SWS_Csm_00947]⌈
Name CsmEncrypt_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Possible
Errors
Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
Operation Encrypt
Encrypts the given data and store the ciphertext in the memory location pointed by
Comment
the result pointer.
Variation --
data
Type Csm_EncryptDataType_{Crypto}
Direction IN
dataLength
Type uint32
Direction IN
Variation --
Parameters
result
Type Csm_EncryptResultType_{Crypto}
Direction OUT
resultLength
Type uint32
Direction INOUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00906)
8.5.1.6 CsmDecrypt_{PrimitiveCfg}
[SWS_Csm_01906]⌈
Name CsmDecrypt_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
Possible 9 Request failed, the key is not valid.
NOT_VALID
Errors
Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
Operation Decrypt
Variation --
data
Type Csm_DecryptDataType_{Crypto}
Direction IN
dataLength
Type uint32
Direction IN
Variation --
result
Type Csm_DecryptResultType_{Crypto}
Direction OUT
resultLength
Type uint32
Direction INOUT
Variation --
E_OK
E_NOT_OK
CRYPTO_E_BUSY
Possible Errors
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.1.7 CsmAEADEncrypt_{PrimitiveCfg}
[SWS_Csm_01910]⌈
Name CsmAEADEncrypt_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Operation AEADEncrypt
Variation --
plaintext
Type Csm_AEADEncryptPlaintextType_{Crypto}
Direction IN
plaintextLength
Type uint32
Direction IN
Variation --
associatedData
Direction IN
Contains the data of the header (that is not part of the encryption but
Comment
authentication).
associatedDataLength
Type uint32
Direction IN
Variation --
ciphertext
Type Csm_AEADEncryptCiphertextType_{Crypto}
Direction OUT
ciphertextLength
Type uint32
Direction INOUT
Comment Contains the length in bytes of the data of the AEAD cipher.
Variation --
tag
Type Csm_AEADEncryptTagType_{Crypto}
Direction OUT
tagLength
Type uint32
Direction INOUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.1.8 CsmAEADDecrypt_{PrimitiveCfg}
[SWS_Csm_01915]⌈
Name CsmAEADDecrypt_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Operation AEADDecrypt
Variation --
ciphertext
Type Csm_AEADDecryptCiphertextType_{Crypto}
Direction IN
ciphertextLength
Type uint32
Direction IN
Variation --
Parameters
associatedData
Type Csm_AEADDecryptAssociatedDataType_{Crypto}
Direction IN
Contains the data of the header (that is not part of the encryption but
Comment
authentication) .
associatedDataLength
Type uint32
Direction IN
Variation --
tag
Type Csm_AEADDecryptTagType_{Crypto}
Direction IN
tagLength
Type uint32
Direction IN
Variation --
plaintext
Type Csm_AEADDecryptPlaintextType_{Crypto}
Direction OUT
plaintextLength
Type uint32
Direction INOUT
Variation --
verify
Type Crypto_VerifyResultType
Direction OUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.1.9 CsmSignatureGenerate_{PrimitiveCfg}
[SWS_Csm_00903]⌈
Name CsmSignatureGenerate_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
Possible 9 Request failed, the key is not valid.
NOT_VALID
Errors
Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
Operation SignatureGenerate
Variation --
data
Type Csm_SignatureGenerateDataType_{Crypto}
Direction IN
Comment Contains the data from which the signature shall be generated.
dataLength
Parameters
Type uint32
Direction IN
Contains the length in bytes of the data from which the signature shall
Comment
be generated.
Variation --
signature
Type Csm_SignatureGenerateResultType_{Crypto}
Direction OUT
signatureLength
Type uint32
Direction INOUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.1.10 CsmSignatureVerify_{PrimitiveCfg}
[SWS_Csm_00943]⌈
Name CsmSignatureVerify_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-NAME)}
CRYPTO_E_KEY_
Possible 9 Request failed, the key is not valid.
NOT_VALID
Errors
Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
Operation SignatureVerify
Variation --
data
Type Csm_SignatureVerifyDataType_{Crypto}
Direction IN
dataLength
Type uint32
Direction IN
Contains the length in bytes of the data for whichs signature shall be
Comment
verified.
Variation --
signature
Type Csm_SignatureVerifyCompareType_{Crypto}
Parameters
Direction IN
signatureLength
Type uint32
Direction IN
Variation --
verify
Type Crypto_VerifyResultType
Direction OUT
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
113 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
8.5.1.11 CsmRandomGenerate_{PrimitiveCfg}
[SWS_Csm_00902]⌈
Name CsmRandomGenerate_{PrimitiveCfg}
IsService true
Primitive = {ecuc(Csm/CsmPrimitives.SHORT-NAME)}
Variation PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-
NAME)}
Operation RandomGenerate
Variation --
result
Type Csm_RandomGenerateResultType_{Crypto}
Direction OUT
Type uint32
Direction INOUT
Variation --
E_OK
E_NOT_OK
Possible Errors
CRYPTO_E_BUSY
CRYPTO_E_ENTROPY_EXHAUSTED
⌋(SRS_CryptoStack_00090)
8.5.2.1 CsmHash
[SWS_Csm_91051]⌈
Name CsmHash
IsService true
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation Hash
Variation --
dataPtr
Type ConstVoidPtr
Direction IN
Variation --
Parameters
dataLength
Type uint32
Direction IN
Variation --
resultPtr
Type VoidPtr
Direction IN
Variation --
resultLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
⌋(SRS_CryptoStack_00090)
8.5.2.2 CsmMacGenerate
[SWS_Csm_91052]⌈
Name CsmMacGenerate
IsService true
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Possible
Errors Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation MacGenerate
Uses the given data to perform a MAC generation and stores the MAC in the
Comment
memory location pointed to by the MAC pointer.
Variation --
dataPtr
Type ConstVoidPtr
Direction IN
Comment References the data from which a MAC shall be generated of.
Variation --
dataLength
Type uint32
Direction IN
Contains the length in bytes of the data from which a MAC shall be
Comment
generated of.
Variation --
Parameters
macPtr
Type VoidPtr
Direction IN
Variation --
macLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
Possible E_NOT_OK
Errors CRYPTO_E_BUSY
CRYPTO_E_KEY_NOT_VALID
117 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.2.3 CsmMacVerify
[SWS_Csm_91053]⌈
Name CsmMacVerify
IsService true
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Possible
Errors Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation MacVerify
Uses the given data to perform a MAC generation and stores the MAC in the
Comment
memory location pointed to by the MAC pointer.
Variation --
dataPtr
Parameters
Type ConstVoidPtr
Direction IN
Comment References the data from which a MAC shall be generated of.
Variation --
dataLength
Type uint32
Direction IN
Contains the length in bytes of the data for whichs MAC shall be
Comment
verified.
Variation --
macPtr
Type ConstVoidPtr
Direction IN
Variation --
macLength
Type uint32
Direction IN
Variation --
verifyPtr
Type Csm_VerifyResultPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.2.4 CsmEncrypt
[SWS_Csm_91054]⌈
119 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Name CsmEncrypt
IsService true
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Possible
Errors Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation Encrypt
Encrypts the given data and stores the ciphertext in the memory location pointed by
Comment
the result pointer.
Variation --
dataPtr
Type ConstVoidPtr
Direction IN
Variation --
dataLength
Type uint32
Direction IN
Variation --
resultPtr
Type VoidPtr
Direction IN
Variation --
resultLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.2.5 CsmDecrypt
[SWS_Csm_91055]⌈
Name CsmDecrypt
IsService true
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation Decrypt
Decrypts the given data and stores the plaintext in the memory location pointed by
Comment
the resultBuffer pointer.
Variation --
dataPtr
Type ConstVoidPtr
Direction IN
Variation --
dataLength
Type uint32
Direction IN
resultPtr
Type VoidPtr
Direction IN
Variation --
resultLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.2.6 CsmAEADEncrypt
[SWS_Csm_91056]⌈
Name CsmAEADEncrypt
IsService true
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Possible
Errors Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation AEADEncrypt
Variation --
plaintextPtr
Type ConstVoidPtr
Parameters
Direction IN
Variation --
plaintextLength
Type uint32
Direction IN
Variation --
associatedDataPtr
Type ConstVoidPtr
Direction IN
References the data of the header (that is not part of the encryption
Comment
but authentication).
Variation --
associatedDataLength
Type uint32
Direction IN
Variation --
ciphertextPtr
Type VoidPtr
Direction IN
Variation --
ciphertextLengthPtr
Type Csm_LengthPtr
Direction IN
Comment Contains the length in bytes of the data of the AEAD cipher.
Variation --
tagPtr
Type VoidPtr
Direction IN
Variation --
tagLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
⌋(SRS_CryptoStack_00090)
8.5.2.7 CsmAEADDecrypt
[SWS_Csm_91057]⌈
Name CsmAEADDecrypt
IsService true
CRYPTO_E_KEY_
Possible 9 Request failed, the key is not valid.
NOT_VALID
Errors
Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation AEADDecrypt
Variation --
ciphertextPtr
Type ConstVoidPtr
Direction IN
Variation --
ciphertextLength
Type uint32
Direction IN
Variation --
associatedDataPtr
Type ConstVoidPtr
Parameters Direction IN
References the data of the header (that is not part of the encryption
Comment
but authentication).
Variation --
associatedDataLength
Type uint32
Direction IN
Variation --
tagPtr
Type ConstVoidPtr
Direction IN
Variation --
tagLength
Type uint32
Direction IN
Variation --
plaintextPtr
Type VoidPtr
Direction IN
Variation --
plaintextLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
verifyPtr
Type Csm_VerifyResultPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
⌋(SRS_CryptoStack_00090)
127 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
8.5.2.8 CsmSignatureGenerate
[SWS_Csm_91058]⌈
Name CsmSignatureGenerate
IsService true
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
Possible
Errors Request failed because the key element is not partially
CRYPTO_E_KEY_
10 accessible and the provided key element length is too
SIZE_MISMATCH
short or too long for that key element.
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation SignatureGenerate
Variation --
dataPtr
Type ConstVoidPtr
Direction IN
Parameters
Comment References the data from which the signature shall be generated.
Variation --
dataLength
Type uint32
Direction IN
Contains the length in bytes of the data from which the signature shall
Comment
be generated.
Variation --
resultPtr
Type VoidPtr
Direction IN
Variation --
resultLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.2.9 CsmSignatureVerify
[SWS_Csm_91059]⌈
Name CsmSignatureVerify
IsService true
CRYPTO_E_KEY_
9 Request failed, the key is not valid.
NOT_VALID
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation SignatureVerify
Variation --
dataPtr
Type ConstVoidPtr
Direction IN
Variation --
dataLength
Type uint32
Direction IN
Parameters
Contains the length in bytes of the data for which signature shall be
Comment
verified.
Variation --
comparePtr
Type ConstVoidPtr
Direction IN
Variation --
compareLength
Type uint32
Direction IN
Variation --
verifyPtr
Type Csm_VerifyResultPtr
Direction IN
Variation --
E_OK
E_NOT_OK
Possible CRYPTO_E_BUSY
Errors CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋(SRS_CryptoStack_00090)
8.5.2.10 CsmRandomGenerate
[SWS_Csm_91060]⌈
Name CsmRandomGenerate
IsService true
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation RandomGenerate
Generates a random number and stores it in the memory location pointed by the
Comment
resultBuffer pointer.
Variation --
resultPtr
Type VoidPtr
Direction IN
Variation --
Parameters
resultLengthPtr
Type Csm_LengthPtr
Direction IN
Variation --
E_OK
Possible E_NOT_OK
Errors CRYPTO_E_BUSY
CRYPTO_E_ENTROPY_EXHAUSTED
⌋(SRS_CryptoStack_00090)
8.5.3.1 CsmJobKeySetValid
[SWS_Csm_91035]⌈
Name CsmJobKeySetValid
IsService true
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation KeySetValid
Variation --
keyId
Type uint32
Parameters Direction IN
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
⌋()
8.5.3.2 CsmJobKeySetInvalid
[SWS_Csm_91003]⌈
Name CsmJobKeySetInvalid
IsService true
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation KeySetInvalid
Variation --
key
Type uint32
Parameters Direction IN
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
⌋()
8.5.3.3 CsmJobRandomSeed
[SWS_Csm_91036]⌈
Name CsmJobRandomSeed
IsService true
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation RandomSeed
Variation --
keyId
Type uint32
Direction IN
Variation --
seedPtr
Type Csm_DataPtr
Parameters Direction IN
Comment Holds the data which shall be used for the random seed initialization.
Variation --
seedLength
Type uint32
Direction IN
Variation --
E_OK
E_NOT_OK
Possible Errors
CRYPTO_E_BUSY
CRYPTO_E_KEY_NOT_VALID
⌋()
8.5.3.4 CsmJobKeyGenerate
[SWS_Csm_91037]⌈
Name CsmJobKeyGenerate
IsService true
Possible CRYPTO_E_KEY_NOT_
9 Request failed, the key is not valid.
Errors VALID
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation KeyGenerate
Comment Generates new key material and stores it in the key identified by keyId.
Variation --
keyId
Type uint32
Parameters Direction IN
Variation --
E_OK
E_NOT_OK
Possible Errors CRYPTO_E_BUSY
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
⌋()
8.5.3.5 CsmJobKeyDerive
[SWS_Csm_91038]⌈
Name CsmJobKeyDerive
IsService true
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation KeyDerive
Derives a new key by using the key elements in the given key. The given key
Comment contains the key elements for the password and salt. The derived key is stored in the
key element with the id 1 of the key identified by targetCryptoKeyId.
Variation --
keyId
Parameters
Type uint32
Direction IN
Variation --
targetKeyId
Type uint32
Direction IN
Holds the identifier of the key which is used to store the derived
Comment
key.
Variation --
E_OK
E_NOT_OK
CRYPTO_E_BUSY
Possible CRYPTO_E_KEY_READ_FAIL
Errors CRYPTO_E_KEY_WRITE_FAIL
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_SIZE_MISMATCH
CRYPTO_E_KEY_EMPTY
⌋()
8.5.3.6 CsmJobKeyExchangeCalcPubVal
[SWS_Csm_91039]⌈
Name CsmJobKeyExchangeCalcPubVal
Comment Interface to execute calculation of the public value for key exchange.
IsService true
Possible CRYPTO_E_KEY_NOT_
9 Request failed, the key is not valid.
Errors VALID
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation KeyExchangeCalcPubVal
Calculates the public value of the current user for the key exchange and stores the
Comment
public key in the provided buffer.
Variation --
keyId
Type uint32
Direction IN
Variation --
publicValuePtr
Type VoidPtr
Direction IN
Parameters Contains the pointer to the memory location where the public value shall
Comment
be stored.
Variation --
publicValueLengthPtr
Type Csm_LengthPtr
Direction IN
Holds a pointer to the memory location in which the public value length in
bytes is stored. On calling this function, this parameter shall contain the
Comment
size of the buffer in bytes provided by publicValuePtr. When the request
has finished, the actual length of the returned value shall be stored.
Variation --
E_OK
E_NOT_OK
Possible
CRYPTO_E_BUSY
Errors
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
⌋()
8.5.3.7 CsmJobKeyExchangeCalcSecret
[SWS_Csm_91040]⌈
139 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
Name CsmJobKeyExchangeCalcSecret
IsService true
Possible CRYPTO_E_KEY_NOT_
9 Request failed, the key is not valid.
Errors VALID
CRYPTO_E_JOB_
12 Request failed because the job has been canceled.
CANCELED
Operation CancelJob
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_JOB_CANCELED
Operation KeyExchangeCalcSecret
Calculates the shared secret key for the key exchange with the key material of the
Comment key identified by the keyId and the partner public key. The shared secret key is
stored as a key element in the same key.
Variation --
keyId
Type uint32
Direction IN
partnerPublicValuePtr
Type Csm_KeyDataType_{Crypto}
Direction IN
Variation --
partnerPublicValueLength
Type uint32
Direction IN
Variation --
E_OK
E_NOT_OK
Possible
CRYPTO_E_BUSY
Errors
CRYPTO_E_KEY_NOT_VALID
CRYPTO_E_KEY_EMPTY
⌋()
8.5.4.1 CsmContextService{Job}
[SWS_Csm_91106]⌈
Name CsmContextService_{Job}
IsService true
{ecuc(Csm/CsmJobs/CsmJob. CsmJobServiceInterfaceContextUsePort)} ==
Variation CRYPTO_USE_PORT
Job = {ecuc(Csm/CsmJobs/CsmJob.SHORT-NAME)}
Operation RestoreContextJob
Variation --
contextBuffer
Direction IN
Variation --
contextBufferLength
Type uint32
Direction IN
Variation --
E_OK
Possible Errors E_NOT_OK
CRYPTO_E_BUSY
Operation SaveContextJob
Variation --
contextBufferPtr
Type VoidPtr
Direction IN
Variation --
Parameters
contextBufferLengthPtr
Type uint32
Direction IN
Variation --
E_OK
Possible
E_NOT_OK
Errors
CRYPTO_E_BUSY
⌋()
8.5.5.1 CallbackNotification
[SWS_Csm_00928]⌈
Name CallbackNotification
IsService true
Variation --
Possible Errors -- -- --
Operation CallbackNotification
Comment Notifies the application with a return value that the job has finished.
Variation --
result
Type Crypto_ResultType
Parameters Direction IN
Variation --
Possible Errors --
⌋(SRS_CryptoStack_00090)
8.5.6.1 Crypto_OperationModeType
[SWS_Csm_01029]⌈
Name Crypto_OperationModeType
Kind Enumeration
CRYPTO_
Operation Mode is "Update". Used to calculate
OPERATIONMODE_ 0x02
intermediate results.
UPDATE
Range
CRYPTO_
Operation Mode is "Stream Start". Mixture of
OPERATIONMODE_ 0x03
"Start" and "Update". Used for streaming.
STREAMSTART
CRYPTO_
Operation Mode is "Single Call". Mixture of
OPERATIONMODE_ 0x07
"Start", "Update" and "Finish".
SINGLECALL
Variation --
Available
Rte_Csm_Type.h
via
⌋()
8.5.6.2 Crypto_VerifyResultType
[SWS_Csm_01024]⌈
Name Crypto_VerifyResultType
Kind Enumeration
Variation --
Available
Rte_Csm_Type.h
via
⌋()
8.5.6.3 Csm_KeyDataType_{Crypto}
[SWS_Csm_00828]⌈
Name Csm_KeyDataType_{Crypto}
max({ecuc(Csm/CsmKeys/CsmKey/CsmKeyRef->CryIfKey/CryIfKeyRef->CryptoKey/
Size CryptoKeyTypeRef->CryptoKeyType/CryptoKeyElementRef->CryptoKeyElement/
CryptoKeyElementSize) Elements
Description Array long enough to store any key element of the considered key
Available
Rte_Csm_Type.h
via
⌋()
8.5.6.4 Crypto_ResultType
[SWS_Csm_91044]⌈
Name Crypto_ResultType
Kind Enumeration
Variation --
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00095)
8.5.6.5 Csm_HashDataType_{Crypto}
[SWS_Csm_01920]⌈
Name Csm_HashDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmHash/CsmHashConfig/CsmHashDataMaxLength}
Size
Elements
Description Array long enough to store the data which shall be hashed.
Variation Crypto={ecuc/Csm/CsmPrimitives.SHORT-NAME}
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.6 Csm_HashResultType_{Crypto}
[SWS_Csm_00912]⌈
Name Csm_HashResultType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmHash/CsmHashConfig/CsmHashResultLength}
Size
Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.7 Csm_MacGenerateDataType_{Crypto}
[SWS_Csm_00935]⌈
Name Csm_MacGenerateDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmMacGenerate/CsmMacGenerateConfig/CsmMac
Size
GenerateDataMaxLength} Elements
Description Array long enough to store the data from which a MAC shall be generated.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.8 Csm_MacGenerateResultType_{Crypto}
[SWS_Csm_00927]⌈
Name Csm_MacGenerateResultType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmMacGenerate/CsmMacGenerateConfig/CsmMac
Size
GenerateResultLength} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.9 Csm_MacVerifyDataType_{Crypto}
[SWS_Csm_00802]⌈
Name Csm_MacVerifyDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmMacVerify/CsmMacVerifyConfig/CsmMacVerifyData
Size
MaxLength} Elements
Description Array long enough to store the data for whichs MAC shall be verified.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.10 Csm_MacVerifyCompareType_{Crypto}
[SWS_Csm_00803]⌈
Name Csm_MacVerifyCompareType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmMacVerify/CsmMacVerifyConfig/CsmMacVerify
Size
CompareLength}/8 Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.11 Csm_EncryptDataType_{Crypto}
[SWS_Csm_01921]⌈
Name Csm_EncryptDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmEncrypt/CsmEncryptConfig/CsmEncryptDataMax
Size
Length} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.12 Csm_EncryptResultType_{Crypto}
[SWS_Csm_01922]⌈
Name Csm_EncryptResultType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmEncrypt/CsmEncryptConfig/CsmEncryptResultMax
Size
Length} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.13 Csm_DecryptDataType_{Crypto}
[SWS_Csm_01923]⌈
Name Csm_DecryptDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmDecrypt/CsmDecryptConfig/CsmDecryptDataMax
Size
Length} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.14 Csm_DecryptResultType_{Crypto}
[SWS_Csm_01924]⌈
Name Csm_DecryptResultType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmDecrypt/CsmDecryptConfig/CsmDecryptResultMax
Size
Length} Elements
Description Array long enough to store the data of the decrypted plaintext.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.15 Csm_AEADEncryptPlaintextType_{Crypto}
[SWS_Csm_01925]⌈
Name Csm_AEADEncryptPlaintextType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmAEADEncrypt/CsmAEADEncryptConfig/Csm
Size
AEADEncryptPlaintextMaxLength} Elements
Description Array long enough to store the plaintext to be encrypted with AEAD.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.16 Csm_AEADEncryptAssociatedDataType_{Crypto}
[SWS_Csm_01928]⌈
Name Csm_AEADEncryptAssociatedDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmAEADEncrypt/CsmAEADEncryptConfig/Csm
Size
AEADEncryptAssociatedDataMaxLength} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.17 Csm_AEADEncryptCiphertextType_{Crypto}
[SWS_Csm_01927]⌈
Name Csm_AEADEncryptCiphertextType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmAEADEncrypt/CsmAEADEncryptConfig/Csm
Size
AEADEncryptCiphertextMaxLength} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.18 Csm_AEADEncryptTagType_{Crypto}
[SWS_Csm_01926]⌈
Name Csm_AEADEncryptTagType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmAEADEncrypt/CsmAEADEncryptConfig/Csm
Size
AEADEncryptTagLength)} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.19 Csm_AEADDecryptCiphertextType_{Crypto}
[SWS_Csm_00922]⌈
Name Csm_AEADDecryptCiphertextType_{Crypto}
{ecuc(Csm/CsmAEADDecrypt/CsmAEADDecryptConfig/CsmAEADDecryptCiphertext
Size
MaxLength} Elements
Description Array long enough to store the ciphertext to be decrypted with AEAD.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.20 Csm_AEADDecryptAssociatedDataType_{Crypto}
[SWS_Csm_00923]⌈
Name Csm_AEADDecryptAssociatedDataType_{Crypto}
{ecuc(Csm/CsmAEADDecrypt/CsmAEADDecryptConfig/CsmAEADDecrypt
Size
AssociatedDataMaxLength} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.21 Csm_AEADDecryptTagType_{Crypto}
[SWS_Csm_01074]⌈
Name Csm_AEADDecryptTagType_{Crypto}
(({ecuc(Csm/CsmPrimitives/CsmAEADDecrypt/CsmAEADDecryptConfig/Csm
Size
AEADDecryptTagLength)}+7)/8) Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.22 Csm_AEADDecryptPlaintextType_{Crypto}
[SWS_Csm_01075]⌈
Name Csm_AEADDecryptPlaintextType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmAEADDecrypt/CsmAEADDecryptConfig/Csm
Size
AEADDecryptPlaintextMaxLength} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.23 Csm_SignatureGenerateDataType_{Crypto}
[SWS_Csm_01083]⌈
Name Csm_SignatureGenerateDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmSignatureGenerate/CsmSignatureGenerateConfig/
Size
CsmSignatureGenerateDataMaxLength} Elements
Description Array long enough to store the data from which the signature shall be generated.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_01076)
8.5.6.24 Csm_SignatureGenerateResultType_{Crypto}
[SWS_Csm_01077]⌈
Name Csm_SignatureGenerateResultType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmSignatureGenerate/CsmSignatureGenerateConfig/
Size
CsmSignatureGenerateResultLength} Elements
Description Array long enough to store the signature and its length.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.25 Csm_SignatureVerifyDataType_{Crypto}
[SWS_Csm_01078]⌈
Name Csm_SignatureVerifyDataType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmSignatureVerify/CsmSignatureVerifyConfig/Csm
Size
SignatureVerifyDataMaxLength} Elements
Description Array long enough to store the data for whichs signature shall be verified.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.26 Csm_SignatureVerifyCompareType_{Crypto}
[SWS_Csm_01079]⌈
Name Csm_SignatureVerifyCompareType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmSignatureVerify/CsmSignatureVerifyConfig/Csm
Size
SignatureVerifyCompareLength} Elements
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.27 Csm_RandomGenerateResultType_{Crypto}
[SWS_Csm_00930]⌈
Name Csm_RandomGenerateResultType_{Crypto}
{ecuc(Csm/CsmPrimitives/CsmRandomGenerate/CsmRandomGenerateConfig/Csm
Size
RandomGenerateResultLength) Elements
Description Array long enough to store the data of the random number.
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.28 Csm_LengthPtr
[SWS_Csm_91045]⌈
Name Csm_LengthPtr
Kind Pointer
Type uint32*
Variation --
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.29 Csm_VerifyResultPtr
[SWS_Csm_91046]⌈
Name Csm_VerifyResultPtr
Kind Pointer
Type Csm_VerifyResultType*
Variation --
Available
Rte_Csm_Type.h
via
⌋(SRS_CryptoStack_00090)
8.5.6.30 Crypto_KeyStatusType
[SWS_Csm_91102]⌈
Name Crypto_KeyStatusType
Kind Enumeration
Variation --
Available
Rte_Csm_Type.h
via
⌋()
8.5.7 Ports
8.5.7.1 CsmKey_{Key}
[SWS_Csm_01042]⌈
Name CsmKey_{Key}
Type uint32
Port Defined Argument
Value(s)
Value {ecuc(Csm/CsmKeys/CsmKey/CsmKeyId)}
{ecuc(Csm/CsmKeys/CsmKey.CsmKeyUsePort)} == TRUE
Variation
Key = {ecuc(Csm/CsmKeys/CsmKey.SHORT-NAME)}
⌋(SRS_CryptoStack_00090, SRS_CryptoStack_00091)
[SWS_Csm_91023]⌈
Name CsmJob_{Job}
Type uint32
Value {ecuc(Csm/CsmJobs/CsmJob.CsmJobId)}
Port Defined
Argument
Type Crypto_OperationModeType
Value(s)
CRYPTO_OPERATIONMODE_
Value
SINGLECALL
({ecuc(Csm/CsmJobs/CsmJob.CsmJobInterfaceUsePort)} == CRYPTO_USE_
PORT) &&({ecuc(Csm/CsmJobs/CsmJob.CsmJobPrimitiveRef)} != NULL)
Job = {ecuc(Csm/CsmJobs/CsmJob.SHORT-NAME)}
Variation Primitive = {ecuc(Csm/CsmJobs/CsmJob.CsmJobPrimitiveRef->Csm
Primitives/*.SHORT-NAME)}
PrimitiveCfg = {ecuc(Csm/CsmPrimitives/{Primitive}/{Primitive}Config.SHORT-
NAME)}
⌋(SRS_CryptoStack_00090, SRS_CryptoStack_00091)
[SWS_Csm_91062]⌈
Name CsmJob_{Job}
Type uint32
Value {ecuc(Csm/CsmJobs/CsmJob.CsmJobId)}
Port Defined
Argument
Type Crypto_OperationModeType
Value(s)
CRYPTO_OPERATIONMODE_
Value
SINGLECALL
({ecuc(Csm/CsmJobs/CsmJob.CsmJobInterfaceUsePort)} == CRYPTO_USE_
PORT_OPTIMIZED) &&({ecuc(Csm/CsmJobs/CsmJob.CsmJobPrimitiveRef)}
!= NULL)
Variation
Job = {ecuc(Csm/CsmJobs/CsmJob.SHORT-NAME)}
Primitive = {ecuc(Csm/CsmJobs/CsmJob.CsmJobPrimitiveRef->Csm
Primitives/*.SHORT-NAME)}
⌋(SRS_CryptoStack_00090, SRS_CryptoStack_00091)
8.5.7.4 CallbackNotification_{Job}
[SWS_Csm_00934]⌈
Name CallbackNotification_{Job}
({ecuc(Csm/CsmJobs/CsmJob.CsmProcessingMode)}==CRYPTO_PROCESSING_
Variation ASYN)&&(CsmJob/CsmJobInterfaceUsePort!=CRYPTO_USE_FNC)
Job = {ecuc(Csm/CsmJobs/CsmJob.SHORT-NAME)}
⌋(SRS_CryptoStack_00090, SRS_CryptoStack_00091)
8.5.7.5 CsmContext_{Job}
[SWS_Csm_91105]⌈
Name CsmContext_{Job}
Type uint32
Port Defined Argument
Value(s)
Value {ecuc(Csm/CsmJobs/CsmJob.CsmJobId)}
{ecuc(Csm/CsmJobs/CsmJob. CsmJobServiceInterfaceContextUsePort)}
Variation == CRYPTO_USE_PORT
Job={ecuc(Csm/CsmJobs/CsmJob.SHORT-NAME)}
⌋(SRS_CryptoStack_00090)
9 Sequence Diagrams
The following sequence diagrams concentrate on the interaction between the CSM
module and software components respectively the ECU state manager.
<Service>()
<Service>()
<Service>()
return()
return()
return()
Crypto_ProcessJob(Std_ReturnType,
uint32, Crypto_JobType**)
<Service>()
<Service>()
<Service>()
10 Configuration
In general, this chapter defines configuration parameters and their clustering into
containers. In order to support the specification Chapter 10.1 describes
fundamentals. It also specifies a template (table) you shall use for the parameter
specification.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
CSM.
Csm: EcucModuleDef
+container CsmGeneral:
lowerMultiplicity = 0 EcucParamConfContainerDef
upperMultiplicity = 1
CsmJobs:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
CsmKeys:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
CsmPrimitives:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
CsmQueues:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
CsmCallbacks:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
CsmInOutRedirections:
+container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.1 Csm
Included Containers
Container Name Multiplicity Scope / Dependency
CsmCallbacks 0..1 Container for callback function configurations
CsmGeneral 1 Container for common configuration options.
CsmInOutRedirections 0..1 Configuration for CSM redirection configurations
CsmJobs 0..1 Container for configuration of CSM jobs.
CsmKeys 0..1 Container for CSM key configurations.
Each element of this container defines one instance of
Csm_MainFunction.
CsmMainFunction 0..* For each partition, where the Csm module shall be
instantiated, at least one MainFunction instance needs to be
configured.
CsmPrimitives 0..* Container for configuration of CsmPrimitives
CsmQueues 0..1 Container for CSM queue configurations
defaultValue = false
+parameter CsmVersionInfoApi:
EcucBooleanParamDef
defaultValue = false
10.2.2 CsmGeneral
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
No Included Containers
Csm: EcucModuleDef
lowerMultiplicity = 0
upperMultiplicity = 1
+container
CsmMainFunction: CsmMainFunctionPeriod:
EcucParamConfContainerDef EcucFloatParamDef
+parameter
lowerMultiplicity = 0 min = 0
upperMultiplicity = * max = INF
lowerMultiplicity = 0
upperMultiplicity = 1
CsmMainFunctionPartitionRef: EcucPartition:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
(from EcucPartition)
10.2.3 CsmMainFunction
No Included Containers
CsmJobs:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
CsmJob: CsmJobId:
EcucParamConfContainerDef +parameter EcucIntegerParamDef
lowerMultiplicity = 1 min = 0
upperMultiplicity = * max = 4294967295
symbolicNameValue = true
CsmJobPriority:
+parameter EcucIntegerParamDef
min = 0
max = 4294967295
+literal
CsmJobInterfaceUsePort: CRYPTO_USE_PORT_OPTIMIZED:
EcucEnumerationParamDef EcucEnumerationLiteralDef
+parameter +literal
CRYPTO_USE_FNC:
EcucEnumerationLiteralDef
+literal
CRYPTO_USE_PORT:
EcucEnumerationLiteralDef
CsmJobPrimitiveCallbackRef: CsmCallback:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
CsmPrimitives:
EcucParamConfContainerDef
+destination
+reference CsmJobPrimitiveRef: lowerMultiplicity = 0
EcucReferenceDef upperMultiplicity = *
CsmQueue: CsmInOutRedirections:
EcucParamConfContainerDef EcucParamConfContainerDef
+reference CsmJobQueueRef: +destination
EcucReferenceDef lowerMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = * upperMultiplicity = 1
CsmKey:
+reference CsmJobKeyRef: +destination EcucParamConfContainerDef
EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = * +subContainer
CsmInOutRedirection:
EcucParamConfContainerDef
CsmInOutRedirectionRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 1
upperMultiplicity = *
lowerMultiplicity = 0
upperMultiplicity = 1
+literal
CsmProcessingMode: CRYPTO_PROCESSING_ASYNC:
+parameter EcucEnumerationParamDef EcucEnumerationLiteralDef
+literal
CRYPTO_PROCESSING_SYNC:
EcucEnumerationLiteralDef
10.2.4 CsmJobs
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of CSM job. The container name
CsmJob 1..* serves as a symbolic name for the identifier of a job
configuration.
10.2.5 CsmJob
CRYPTO_PROCESSING_SYNC --
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Link time --
Post-build time --
Scope / Dependency scope: local
No Included Containers
CsmKeys:
CsmKey:
EcucParamConfContainerDef CsmKeyId:
EcucParamConfContainerDef
+parameter EcucIntegerParamDef
lowerMultiplicity = 0
lowerMultiplicity = 0
upperMultiplicity = 1 symbolicNameValue = true
upperMultiplicity = *
min = 0
+subContainer
max = 4294967295
CsmKeyRef: EcucReferenceDef
+reference
requiresSymbolicNameValue = true
+destination
CryIfKey:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
+parameter CsmKeyUsePort:
EcucBooleanParamDef
10.2.6 CsmKeys
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM key. The container name
CsmKey 0..* serves as a symbolic name for the identifier of a key
configuration.
10.2.7 CsmKey
Name CsmKeyId
Parent Container CsmKey
Description Identifier of the CsmKey. The set of actually configured identifiers shall be
consecutive and gapless.
Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 4294967295
Default value --
Post-Build Variant Value false
Multiplicity Configuration Pre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
No Included Containers
+destination
CryIfChannel:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
CsmQueueSize:
+parameter EcucIntegerParamDef
min = 1
max = 4294967295
CsmQueueMainFunctionRef:
+reference
EcucReferenceDef
lowerMultiplicity = 1
upperMultiplicity = 1
+destination
CsmMainFunction:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
10.2.8 CsmQueues
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM queue.
A queue has two tasks:
CsmQueue 1..* 1. queue jobs which cannot be processed since the underlying
hardware is busy and
2. refer to channel which shall be used
10.2.9 CsmQueue
No Included Containers
174 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
CsmInOutRedirections:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
CsmInputKeyRef: CsmKey:
CsmInOutRedirection:
EcucReferenceDef EcucParamConfContainerDef
EcucParamConfContainerDef +destination
+reference
lowerMultiplicity = 0 lowerMultiplicity = 0
lowerMultiplicity = 1 upperMultiplicity = *
upperMultiplicity = 1
upperMultiplicity = *
CsmSecondaryInputKeyRef:
EcucReferenceDef
+reference +destination
lowerMultiplicity = 0
upperMultiplicity = 1
CsmTertiaryInputKeyRef:
EcucReferenceDef
+reference +destination
lowerMultiplicity = 0
upperMultiplicity = 1
CsmOutputKeyRef:
EcucReferenceDef
+reference +destination
lowerMultiplicity = 0
upperMultiplicity = 1
CsmSecondaryOutputKeyRef:
EcucReferenceDef
+reference +destination
lowerMultiplicity = 0
upperMultiplicity = 1
CsmInputKeyElementId:
EcucIntegerParamDef
+parameter
min = 0
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmSecondaryInputKeyElementId:
EcucIntegerParamDef
+parameter
min = 0
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmTertiaryInputKeyElementId:
EcucIntegerParamDef
+parameter
min = 0
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmOutputKeyElementId:
EcucIntegerParamDef
+parameter
min = 0
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmSecondaryOutputKeyElementId:
+parameter EcucIntegerParamDef
min = 0
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.10 CsmInOutRedirections
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM redirection.
CsmInOutRedirection 1..* A redirection let a CSM job use a specific key element as input
or/and output.
10.2.11 CsmInOutRedirection
Default value --
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Range 0 .. 4294967295
Default value --
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
No Included Containers
10.2.12 CsmPrimitives
Included Containers
180 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
CsmHash:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
+literal
CsmHashAlgorithmSecondaryFamily:
EcucEnumerationParamDef
+parameter
defaultValue = CRYPTO_ALGOFAM_NOT_SET
+literal CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef
CsmHashAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmHashAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmHashDataMaxLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmHashResultLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
+literal CRYPTO_ALGOMODE_CUSTOM:
EcucEnumerationLiteralDef
10.2.13 CsmHash
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM hash. The container
CsmHashConfig 1 name serves as a symbolic name for the identifier of a key
configuration.
10.2.14 CsmHashConfig
Link time --
Post-build time --
Scope / Dependency scope: local
dependency: This parameter is only relevant if CsmJobInterfaceUsePort is
configured as CRYPTO_USE_PORT.
No Included Containers
CsmMacGenerate:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
CsmMacGenerateAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmMacGenerateAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmMacGenerateAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
+literal CRYPTO_ALGOMODE_CUSTOM:
EcucEnumerationLiteralDef
CsmMacGenerateAlgorithmKeyLength:
+parameter EcucIntegerParamDef
min = 1
max = 4294967295
+parameter CsmMacGenerateAlgorithmMode:
EcucEnumerationParamDef
CsmMacGenerateDataMaxLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmMacGenerateResultLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.15 CsmMacGenerate
Configuration Parameters
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM mac generation interface.
CsmMacGenerateConfig 1 The container name serves as a symbolic name for the
identifier of a MAC generation interface.
10.2.16 CsmMacGenerateConfig
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Description Determines the secondary algorithm family used for the crypto service
Multiplicity 1
Type EcucEnumerationParamDef
Range CRYPTO_ALGOFAM_NOT_SET 0x00
CRYPTO_ALGOMODE_CUSTOM 0xFF
Default value CRYPTO_ALGOFAM_NOT_SET
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
No Included Containers
CsmMacVerify:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
CsmMacVerifyAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmMacVerifyAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmMacVerifyAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
+literal CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
CsmMacVerifyDataMaxLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmMacVerifyCompareLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
+parameter CsmMacVerifyAlgorithmKeyLength:
EcucIntegerParamDef
min = 1
max = 4294967295
+parameter
CsmMacVerifyAlgorithmMode:
EcucEnumerationParamDef
10.2.17 CsmMacVerify
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM MAC verification
CsmMacVerifyConfig 1 interface. The container name serves as a symbolic name for
the identifier of a MAC generation interface
10.2.18 CsmMacVerifyConfig
CRYPTO_ALGOFAM_SHA3_224 0x08
CRYPTO_ALGOFAM_SHA3_256 0x09
CRYPTO_ALGOFAM_SHA3_384 0x0A
CRYPTO_ALGOFAM_SHA3_512 0x0B
CRYPTO_ALGOFAM_SHAKE128 0x0C
CRYPTO_ALGOFAM_SHAKE256 0x0D
CRYPTO_ALGOFAM_SIPHASH 0x1C
CRYPTO_ALGOFAM_SM3 0x29
CRYPTO_ALGOMODE_CUSTOM 0xFF
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
No Included Containers
+literal CRYPTO_ALGOFAM_CHACHA:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_AES:
+parameter
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_RSA:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_EEA3:
EcucEnumerationLiteralDef
+literal
CRYPTO_ALGOFAM_CUSTOM:
+literal EcucEnumerationLiteralDef
CsmEncryptAlgorithmSecondaryFamily:
+parameter EcucEnumerationParamDef
CsmEncryptAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef EcucParamConfContainerDef
+destination
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmEncryptAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmEncryptAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
+parameter CsmEncryptAlgorithmMode:
EcucEnumerationParamDef
CsmEncryptAlgorithmKeyLength:
EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 1
upperMultiplicity = 1
CsmEncryptResultMaxLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmEncryptDataMaxLength: EcucIntegerParamDef
min = 1
max = 4294967295
+parameter lowerMultiplicity = 0
upperMultiplicity = 1
CsmEncryptConfig:
EcucParamConfContainerDef
+parameter
defaultValue = CRYPTO_ALGOFAM_NOT_SET
(from CryptoDrv) (from CryptoDrv)
10.2.19 CsmEncrypt
Configuration Parameters
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM encryption interface. The
CsmEncryptConfig 1 container name serves as a symbolic name for the identifier of
an encryption interface.
10.2.20 CsmEncryptConfig
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
CRYPTO_ALGOFAM_SHA2_512_256 0x07
CRYPTO_ALGOFAM_SHA3_224 0x08
CRYPTO_ALGOFAM_SHA3_256 0x09
CRYPTO_ALGOFAM_SHA3_384 0x0A
CRYPTO_ALGOFAM_SHA3_512 0x0B
CRYPTO_ALGOFAM_SHAKE128 0x0C
CRYPTO_ALGOFAM_SHAKE256 0x0D
Default value CRYPTO_ALGOFAM_NOT_SET
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Post-build time --
Scope / Dependency scope: local
dependency: This parameter is only relevant if CsmJobInterfaceUsePort is
configured as CRYPTO_USE_PORT.
No Included Containers
+literal CRYPTO_ALGOFAM_AES:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_3DES:
EcucEnumerationLiteralDef
CsmDecryptConfig:
EcucParamConfContainerDef +literal CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+parameter
+literal CRYPTO_ALGOFAM_RSA:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_CHACHA:
EcucEnumerationLiteralDef
CsmDecryptAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmDecryptAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmDecryptAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmDecryptResultMaxLength: EcucIntegerParamDef
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmDecryptDataMaxLength: EcucIntegerParamDef
min = 1
+parameter max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
CsmDecryptAlgorithmKeyLength:
+parameter EcucIntegerParamDef
min = 1
max = 4294967295
See diagram
CsmDecryptAlgorithmMode: CsmDecryptAlgorithmM
+parameter EcucEnumerationParamDef ode
CsmDecryptConfig: EcucParamConfContainerDef
+parameter
CsmDecryptAlgorithmSecondaryFamily:
CRYPTO_ALGOFAM_CUSTOM: +literal +literal
EcucEnumerationParamDef CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
defaultValue = CRYPTO_ALGOFAM_NOT_SET
(from CryptoDrv) (from CryptoDrv)
10.2.21 CsmDecrypt
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM decryption interface. The
CsmDecryptConfig 1 container name serves as a symbolic name for the identifier of
an decryption interface.
10.2.22 CsmDecryptConfig
CRYPTO_ALGOFAM_SHA3_224 0x08
CRYPTO_ALGOFAM_SHA3_256 0x09
CRYPTO_ALGOFAM_SHA3_384 0x0A
CRYPTO_ALGOFAM_SHA3_512 0x0B
CRYPTO_ALGOFAM_SHAKE128 0x0C
CRYPTO_ALGOFAM_SHAKE256 0x0D
Default value CRYPTO_ALGOFAM_NOT_SET
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Post-build time --
Scope / Dependency scope: local
dependency: This parameter is only relevant if CsmJobInterfaceUsePort is
configured as CRYPTO_USE_PORT.
No Included Containers
CsmAEADEncrypt:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
CsmAEADEncryptAlgorithmKeyLength:
+parameter EcucIntegerParamDef
min = 1
max = 4294967295 See diagram CsmAEADEncryptAlgorithmFamily
+parameter CsmAEADEncryptAlgorithmFamily:
EcucEnumerationParamDef +literal
CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+literal
CsmAEADEncryptAlgorithmSecondaryFamily:
EcucEnumerationParamDef
lowerMultiplicity = 1
+literal CRYPTO_ALGOFAM_POLY1305:
+parameter upperMultiplicity = 1
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef
+parameter
CsmAEADEncryptAlgorithmMode:
EcucEnumerationParamDef See diagram CsmAEADEncryptAlgorithmMode
CsmKey: EcucParamConfContainerDef
+reference CsmAEADEncryptKeyRef: EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = *
CsmAEADEncryptPlaintextMaxLength:
EcucIntegerParamDef
+parameter
min = 1
max = 4294967295
lowerMultiplicity = 0 CsmAEADEncryptCiphertextMaxLength:
upperMultiplicity = 1 EcucIntegerParamDef
+parameter
min = 1
max = 4294967295
CsmAEADEncryptAssociatedDataMaxLength: lowerMultiplicity = 0
EcucIntegerParamDef upperMultiplicity = 1
+parameter
min = 1
max = 4294967295
CsmAEADEncryptTagLength:
lowerMultiplicity = 0
EcucIntegerParamDef
upperMultiplicity = 1
+parameter min = 1
max = 4294967295
lowerMultiplicity = 0
CsmAEADEncryptAlgorithmFamilyCustomRef: upperMultiplicity = 1
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmAEADEncryptAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
10.2.23 CsmAEADEncrypt
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM encryption interface. The
CsmAEADEncryptConfig 1 container name serves as a symbolic name for the identifier of
an encryption interface.
10.2.24 CsmAEADEncryptConfig
No Included Containers
lowerMultiplicity = 1
+literal CRYPTO_ALGOFAM_NOT_SET:
upperMultiplicity = 1
+parameter EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_POLY1305:
EcucEnumerationLiteralDef
lowerMultiplicity = 1
upperMultiplicity = *
CsmAEADDecryptAlgorithmKeyLength:
+parameter EcucIntegerParamDef
+parameter CsmAEADDecryptAlgorithmMode:
EcucEnumerationParamDef CsmKey: EcucParamConfContainerDef
lowerMultiplicity = 0
+destination upperMultiplicity = *
+reference CsmAEADDecryptKeyRef: EcucReferenceDef
+parameter
CsmAEADDecryptAssociatedDataMaxLength:
CsmAEADDecryptCiphertextMaxLength: EcucIntegerParamDef
EcucIntegerParamDef
+parameter min = 1
min = 1 max = 4294967295
max = 4294967295 lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = 1
upperMultiplicity = 1
CsmAEADDecryptTagLength:
EcucIntegerParamDef
CsmAEADDecryptPlaintextMaxLength:
+parameter
min = 1 EcucIntegerParamDef
max = 4294967295
min = 1
lowerMultiplicity = 0
max = 4294967295
upperMultiplicity = 1
+parameter lowerMultiplicity = 0
upperMultiplicity = 1
CsmAEADDecryptAlgorithmFamilyCustomRef:
+reference EcucReferenceDef
CsmAEADDecryptAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmAEADDecryptAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
10.2.25 CsmAEADDecrypt
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM decryption interface. The
CsmAEADDecryptConfig 1 container name serves as a symbolic name for the identifier of
an decryption interface.
10.2.26 CsmAEADDecryptConfig
Description Size of the input associated data buffer for the synchronous RTE service
interface if this primitive is referenced by a Csm job. It may also be
possible that other BSW modules use the length parameter for buffer size
calculation.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 1 .. 4294967295
Default value --
Post-Build Variant Value false
Multiplicity Configuration Pre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
dependency: This parameter is only relevant if CsmJobInterfaceUsePort is
configured as CRYPTO_USE_PORT.
Link time --
Post-build time --
Scope / Dependency scope: local
dependency: This reference shall only be present if
CsmAEADDecryptAlgorithmMode is set to
CRYPTO_ALGOMODE_CUSTOM.
No Included Containers
221 of 265 Document ID 402: AUTOSAR_SWS_CryptoServiceManager
Specification of Crypto Service Manager
AUTOSAR CP R20-11
CsmSignatureGenerate:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
See diagram CsmSignatureGenerateAlgorithmFamily
+subContainer
CsmSignatureGenerateConfig:
+parameter CsmSignatureGenerateAlgorithmFamily:
EcucParamConfContainerDef
EcucEnumerationParamDef +literal
CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+literal
+parameter CsmSignatureGenerateAlgorithmSecondaryFamily:
EcucEnumerationParamDef
CsmSignatureGenerateKeyLength:
defaultValue = CRYPTO_ALGOFAM_NOT_SET EcucIntegerParamDef
+parameter
min = 1
max = 4294967295
CsmSignatureGenerateAlgorithmFamilyCustomRef:
+reference EcucReferenceDef
+destination CryptoPrimitiveAlgorithmFamilyCustom:
lowerMultiplicity = 0 EcucParamConfContainerDef
upperMultiplicity = 1
requiresSymbolicNameValue = true lowerMultiplicity = 0
upperMultiplicity = *
CsmSignatureGenerateAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmSignatureGenerateAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
+literal CRYPTO_ALGOMODE_RSASSA_PSS:
CsmSignatureGenerateAlgorithmMode: EcucEnumerationLiteralDef
EcucEnumerationParamDef
+literal CRYPTO_ALGOMODE_RSASSA_PKCS1_v1_5:
EcucEnumerationLiteralDef
+parameter
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
+literal
CRYPTO_ALGOMODE_CUSTOM:
EcucEnumerationLiteralDef
+parameter CsmSignatureGenerateResultLength:
EcucIntegerParamDef
min = 1
CsmSignatureGenerateDataMaxLength: max = 4294967295
EcucIntegerParamDef lowerMultiplicity = 0
+parameter
min = 1 upperMultiplicity = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.27 CsmSignatureGenerate
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM signature generation
CsmSignatureGenerateConfi
1 interface. The container name serves as a symbolic name for
g
the identifier of signature generation interface.
10.2.28 CsmSignatureGenerateConfig
No Included Containers
CsmSignatureVerify:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
See diagram CsmSignatureVerifyAlgorithmFamily
+subContainer
CsmSignatureVerifyAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmSignatureVerifyAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmSignatureVerifyAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
+literal CRYPTO_ALGOMODE_RSASSA_PKCS1_v1_5:
EcucEnumerationLiteralDef
+parameter
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
+literal
CRYPTO_ALGOMODE_CUSTOM:
EcucEnumerationLiteralDef
CsmSignatureVerifyDataMaxLength:
EcucIntegerParamDef
+parameter
min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
+parameter CsmSignatureVerifyKeyLength:
EcucIntegerParamDef
min = 1
max = 4294967295
lowerMultiplicity = 1
upperMultiplicity = 1
CsmSignatureVerifyCompareLength:
EcucIntegerParamDef
+parameter
min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.29 CsmSignatureVerify
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM signature verification
CsmSignatureVerifyConfig 1 interface. The container name serves as a symbolic name for
the identifier of signature verification interface.
10.2.30 CsmSignatureVerifyConfig
Description Determines the algorithm mode used for the crypto service
Multiplicity 1
Type EcucEnumerationParamDef
Range CRYPTO_ALGOMODE_CUSTOM 0xFF
CRYPTO_ALGOMODE_NOT_SET 0x00
CRYPTO_ALGOMODE_RSASSA_- 0x0B
PKCS1_v1_5
CRYPTO_ALGOMODE_RSASSA_PSS 0x0A
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
No Included Containers
+literal CRYPTO_ALGOFAM_CHACHA:
EcucEnumerationLiteralDef
+subContainer
CsmRandomGenerateConfig:
EcucParamConfContainerDef +literal CRYPTO_ALGOFAM_RNG:
EcucEnumerationLiteralDef
+parameter
+literal CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+literal
CsmRandomGenerateAlgorithmSecondaryFamily:
+parameter EcucEnumerationParamDef
+literal CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef
CsmRandomGenerateAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
EcucReferenceDef EcucParamConfContainerDef
+reference +destination
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmRandomGenerateAlgorithmSecondaryFamilyCustomRef:
EcucReferenceDef +destination
+reference
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmRandomGenerateAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
EcucReferenceDef EcucParamConfContainerDef
+reference +destination
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
CsmRandomGenerateResultLength:
EcucIntegerParamDef
+parameter
min = 1
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.31 CsmRandomGenerate
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM random generator. The
CsmRandomGenerateConfig 1 container name serves as a symbolic name for the identifier of
a random generator configuration.
10.2.32 CsmRandomGenerateConfig
CRYPTO_ALGOFAM_SHAKE128 0x0C
CRYPTO_ALGOFAM_SHAKE256 0x0D
CRYPTO_ALGOFAM_SM3 0x29
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
CsmRandomGenerateAlgorithmMode is set to
CRYPTO_ALGOMODE_CUSTOM.
No Included Containers
CsmJobKeySetValid:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
+literal +literal
CRYPTO_ALGOFAM_CUSTOM: CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
+literal
(from CryptoDrv) +literal
(from CryptoDrv)
CsmJobKeySetValidAlgorithmSecondaryFamily: EcucEnumerationParamDef
+parameter
lowerMultiplicity = 1
upperMultiplicity = 1
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
CsmJobKeySetValidAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobKeySetValidAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
(from CryptoDrv)
CsmJobKeySetValidAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.33 CsmJobKeySetValid
Included Containers
Container Name Multiplicity Scope / Dependency
10.2.34 CsmJobKeySetValidConfig
Type EcucEnumerationParamDef
Range CRYPTO_ALGOFAM_CUSTOM 0xFF
CRYPTO_ALGOFAM_NOT_SET 0x00
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
No Included Containers
CsmJobKeySetInvalid:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
+subContainer
+literal +literal
CRYPTO_ALGOFAM_CUSTOM: CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
+literal
(from CryptoDrv) +literal
(from CryptoDrv)
CsmJobKeySetInvalidAlgorithmSecondaryFamily: EcucEnumerationParamDef
+parameter
lowerMultiplicity = 1
upperMultiplicity = 1
+parameter lowerMultiplicity = 1
upperMultiplicity = 1
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
CsmJobKeySetInvalidAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobKeySetInvalidAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
(from CryptoDrv)
CsmJobKeySetInvalidAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.35 CsmJobKeySetInvalid
Included Containers
Container Name Multiplicity Scope / Dependency
CsmJobKeySetInvalidConfig 1 Container for configuration of a CSM key set invalid operation.
10.2.36 CsmJobKeySetInvalidConfig
No Included Containers
lowerMultiplicity = 0
upperMultiplicity = 1
+literal CRYPTO_ALGOMODE_CUSTOM:
EcucEnumerationLiteralDef
+subContainer
+literal CRYPTO_ALGOMODE_HMAC:
CsmJobRandomSeedConfig:
EcucEnumerationLiteralDef
EcucParamConfContainerDef
+literal CRYPTO_ALGOMODE_SIPHASH_2_4:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_CTRDRBG:
EcucEnumerationLiteralDef
+parameter
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_SIPHASH_4_8:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_GMAC:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_DRBG:
CsmJobRandomSeedAlgorithmFamily:
EcucEnumerationParamDef EcucEnumerationLiteralDef
lowerMultiplicity = 1
(from CryptoDrv)
upperMultiplicity = 1
+literal CRYPTO_ALGOFAM_FIPS186:
EcucEnumerationLiteralDef
+parameter
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_RNG:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
(from CryptoDrv)
CsmJobRandomSeedAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobRandomSeedAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
(from CryptoDrv)
CsmJobRandomSeedAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.37 CsmJobRandomSeed
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM Ramdom Seed
CsmJobRandomSeedConfig 1 operation. The container name serves as a symbolic name for
the identifier of a random seed configuration.
10.2.38 CsmJobRandomSeedConfig
CRYPTO_ALGOFAM_SM3 0x29
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
CRYPTO_ALGOFAM_SHA2_512_256 0x07
CRYPTO_ALGOFAM_SHA3_224 0x08
CRYPTO_ALGOFAM_SHA3_256 0x09
CRYPTO_ALGOFAM_SHA3_384 0x0A
CRYPTO_ALGOFAM_SHA3_512 0x0B
CRYPTO_ALGOFAM_SHAKE128 0x0C
CRYPTO_ALGOFAM_SHAKE256 0x0D
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
No Included Containers
lowerMultiplicity = 0
upperMultiplicity = 1 (from CryptoDrv)
+literal CRYPTO_ALGOFAM_PBKDF2:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOMODE_CTRDRBG:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_CUSTOM:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_GMAC:
EcucEnumerationLiteralDef
+parameter
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_HMAC:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_SIPHASH_2_4:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOMODE_SIPHASH_4_8:
EcucEnumerationLiteralDef
CsmJobKeyDeriveAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobKeyDeriveAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
(from CryptoDrv)
CsmJobKeyDeriveAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.39 CsmJobKeyDerive
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM key derive operation. The
CsmJobKeyDeriveConfig 1 container name serves as a symbolic name for the identifier of
a key derive configuration.
10.2.40 CsmJobKeyDeriveConfig
CRYPTO_ALGOMODE_HMAC 0x0f
CRYPTO_ALGOMODE_NOT_SET 0x00
CRYPTO_ALGOMODE_SIPHASH_2_4 0x17
CRYPTO_ALGOMODE_SIPHASH_4_8 0x18
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
No Included Containers
+literal CRYPTO_ALGOFAM_ECCSEC:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_X25519:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_ED25519:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_ECCNIST:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_ECDH:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal
CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+literal
CsmJobKeyGenerateAlgorithmFamily:
+parameter EcucEnumerationParamDef
(from CryptoDrv)
CsmJobKeyGenerateAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobKeyGenerateAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
(from CryptoDrv)
CsmJobKeyGenerateAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.41 CsmJobKeyGenerate
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM key generate operation.
CsmJobKeyGenerateConfig 1 The container name serves as a symbolic name for the
identifier of a key generate configuration.
10.2.42 CsmJobKeyGenerateConfig
CRYPTO_ALGOMODE_CUSTOM 0xFF
CRYPTO_ALGOMODE_NOT_SET 0x00
Default value CRYPTO_ALGOMODE_NOT_SET
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Post-build time --
Scope / Dependency scope: local
dependency: This reference shall only be present if
CsmJobKeyGenerateAlgorithmMode is set to
CRYPTO_ALGOMODE_CUSTOM.
No Included Containers
lowerMultiplicity = 0
(from CryptoDrv)
upperMultiplicity = 1
+literal CRYPTO_ALGOFAM_ECDH:
+subContainer EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_DH:
+parameter
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal
CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+literal
CsmJobKeyExchangeCalcPubValAlgorithmSecondaryFamily:
EcucEnumerationParamDef (from CryptoDrv)
+literal CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_ECCNIST:
EcucEnumerationLiteralDef
(from CryptoDrv)
+parameter
+literal CRYPTO_ALGOFAM_ECCANSI:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_ECCSEC:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_X25519:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
CsmJobKeyExchangeCalcPubValAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobKeyExchangeCalcPubValAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmJobKeyExchangeCalcPubValAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.43 CsmJobKeyExchangeCalcPubVal
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM
CsmJobKeyExchangeCalcPubValConfi JobKeyExchangeCalcPubVal. The container name
1
g serves as a symbolic name for the identifier of a key
configuration.
10.2.44 CsmJobKeyExchangeCalcPubValConfig
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Post-build time --
Scope / Dependency scope: local
dependency: This parameter shall only be present if
CsmJobKeyExchangeCalcPubValAlgorithmMode is set to
CRYPTO_ALGOMODE_CUSTOM.
No Included Containers
lowerMultiplicity = 0
upperMultiplicity = 1 (from CryptoDrv)
+literal CRYPTO_ALGOFAM_RSA:
EcucEnumerationLiteralDef
+subContainer
(from CryptoDrv)
CsmJobKeyExchangeCalcSecretConfig:
EcucParamConfContainerDef +literal CRYPTO_ALGOFAM_DH:
+parameter EcucEnumerationLiteralDef
(from CryptoDrv)
+literal
CRYPTO_ALGOFAM_CUSTOM:
EcucEnumerationLiteralDef
+literal
CsmJobKeyExchangeCalcSecretAlgorithmSecondaryFamily:
EcucEnumerationParamDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_NOT_SET:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_ECCNIST:
EcucEnumerationLiteralDef
+literal CRYPTO_ALGOFAM_ECCSEC:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_ECCANSI:
EcucEnumerationLiteralDef
(from CryptoDrv)
+literal CRYPTO_ALGOFAM_X25519:
EcucEnumerationLiteralDef
(from CryptoDrv)
CRYPTO_ALGOMODE_CUSTOM:
+literal
EcucEnumerationLiteralDef
CsmJobKeyExchangeCalcSecretAlgorithmMode:
+parameter EcucEnumerationParamDef
+literal CRYPTO_ALGOMODE_NOT_SET:
EcucEnumerationLiteralDef
CsmJobKeyExchangeCalcSecretAlgorithmFamilyCustomRef: CryptoPrimitiveAlgorithmFamilyCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
CsmJobKeyExchangeCalcSecretAlgorithmSecondaryFamilyCustomRef:
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CsmJobKeyExchangeCalcSecretAlgorithmModeCustomRef: CryptoPrimitiveAlgorithmModeCustom:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
requiresSymbolicNameValue = true
(from CryptoDrv)
10.2.45 CsmJobKeyExchangeCalcSecret
Included Containers
Container Name Multiplicity Scope / Dependency
Container for configuration of a CSM
CsmJobKeyExchangeCalcSecretConfi JobKeyExchangeCalcSecret. The container name
1
g serves as a symbolic name for the identifier of a
JobKeyExchangeCalcSecret configuration.
10.2.46 CsmJobKeyExchangeCalcSecretConfig
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Post-build time --
Scope / Dependency scope: local
dependency: This reference shall only be present if
CsmJobKeyExchangeCalcSecretAlgorithmMode is set to
CRYPTO_ALGOMODE_CUSTOM.
No Included Containers
10.2.47 CsmCallbacks
Included Containers
Container Name Multiplicity Scope / Dependency
CsmCallback 0..* Container for configuration of a callback function
10.2.48 CsmCallback
No Included Containers