DEENESPTFRRUARHIKOZHNL
CLASSIC Modul: cryif Rolle: constitutive Konfidenz: 95%

SNIP_CLASSIC_CRYIF_SECTION_7_2_2_2_2_Queuing

Quelle: SWS_CryptoServiceManager.pdf (Seite 26) • Ziel-Anforderung: SWS_Csm_91074

Wortlaut

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. A Crypto Driver Object represents an instance of an independent crypto "device" (hardware or software, e.g. AES accelerator). There could be a channel for fast AES and CMAC calculations on an HSM for jobs with high priority, which ends on a native AES calculation service in the Crypto Driver. But it is also possible, that a Crypto Driver Object is a piece of software, e.g. for RSA calculations where users are able to encrypt, decrypt, sign or verify data. Figure 7.4: AUTOSAR Layered View with channels 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. [SWS_Csm_00940] ⌈It shall be possible to queue CSM jobs in configured CsmQueues in the CSM.⌋ [SWS_Csm_00944] ⌈The CsmQueues shall sort the jobs according to the configured job’s priority.⌋ Note: The higher the job priority value, the higher the job’s priority. [SWS_Csm_91072] ⌈A service operation shall only be added to the queue if the data consistency of the job structure can be guaranteed. This shall be particularly considered when services with the same jobID are added to the queue (e.g. with subsequent calls to Csm_SignatureVerify and Csm_SaveContextJob). If this cannot be guaranteed, the service operation shall return with CRYPTO_E_BUSY.⌋ [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_91074] ⌈The Csm_<Service> function shall behave as shown in diagram [SWS_Csm_01041].⌋ [SWS_Csm_01041] ⌈The Csm_<Service> function behavior.⌋ JOB = ACTIVE? retVal = CryIf_ProcessJob() JOB = SYNC? Csm queue empty? retVAL = CryIf_ProcessJob() Is the job priority higher than the highest in the queue? retVal = BUSY CSM queue full? Return BUSY Return Crypto_E_BUSY Enqueue job CSM queue [no] [yes] [no] [yes] [yes] [no] [yes] [no] [no] [yes] [no] [yes] Figure 7.5: Csm_<Service> Function Behavior 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. The queued jobs can be passed to the CRYIF in the Csm_MainFunction. 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.

Versionen & Provenienz · Zugeordnete Anforderungen

Diese Angaben zeigt der Versions-Explorer.

Begründung & Zuweisungs-Evidenz

Cited verbatim in the snippet (deterministic citation).

Dokumenten-Herkunft & Rückverfolgbarkeit

Spezifikations-Dokument SWS_CryptoServiceManager.pdf
Dokumentseite Seite 26
Ziel-Modul cryif (classic)
Ziel-Anforderung SWS_Csm_91074
Semantische Rolle constitutive
Automatisierungs-Konfidenz 0.95