SNIP_CLASSIC_CRYPTO_SECTION_7_2_1_Normal_Operation
Wortlaut
7.2.1 Normal Operation
[SWS_Crypto_00017] ⌈"START" indicates a new request of a crypto primitive, and it shall cancel all previous requests of the same job.⌋ Note: "job is being processed" means that the corresponding crypto driver object is currently and actively processing this job. When a job is not finished but the crypto driver object is not active with it (because, e.g., the operation "FINISH" is outstanding) this does not mean that this job is being processed. Note: To unite a single call function and a streaming approach for the crypto services, there is one interface Crypto_ProcessJob with a service operation parameter (embedded in job structure parameter). This service operation is a flag field, that indicates the operation modes "START", "UPDATE" or "FINISH". It declares explicitly which operation will be performed. If the "UPDATE" flag is set, the crypto primitive expects input data. "FINISH" indicates, that after this function call, all data are fed completely and the crypto primitive can finalize the calculations. These operations can be combined to execute multiple operations at once. Then, the operations are performed in the order "START", "UPDATE", "FINISH". 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. The diagram in [SWS_Crypto_00018] shows the state machine of a job of this design without considering the transitions because of errors.
[SWS_Crypto_00018] ⌈ stm Domain Objects Initial Idle Active Start E_OK Error EntryPoint Error E_OK Finish Update [successful finish] Crypto_Operationmode_Update Crypto_Operationmode_Start [error] Crypto_Operationmode_Finish Crypto_Operationmode_Update [error] [error]
⌋
[SWS_Crypto_00019] ⌈After initialization the crypto driver is in "idle" state.⌋
[SWS_Crypto_00020] ⌈If Crypto_ProcessJob is called while in "Idle" or "Active" state and with the operation mode "START", the previous request shall be cancelled. That means, that all previously buffered data for this job shall be reset, and the job shall switch to "Active" state and process the new one.⌋ Note: Resetting a job using "START" is only possible when the job is not actively being processed.
[SWS_Crypto_00118] ⌈If Crypto_ProcessJob is called while the job is in state "Idle" and the "START" flag in the operation mode is not set, the function shall return with E_NOT_OK.⌋ Note: If Crypto_ProcessJob is called while in "Active" state and with the operation mode "UPDATE", the crypto primitive is fed with input data. In terms of streaming of arbitrary amounts of user data multiple calls with operation mode "UPDATE" is used, to feed more input data to the previously ones. In the "Update" state, there are usually also calculations of intermediate results of cryptographic primitives. Actually, in some cases (e.g. AES Encryption in CBC mode) there is also the generation of output data. While operating with the streaming approach ("Start", "Update", "Finish") the Crypto Driver Object is waiting for further input ("Update") until the "Finish" state has been reached. No other job could be processed meanwhile.
[SWS_Crypto_00023] ⌈If Crypto_ProcessJob is called while in "Active" state and with the operation mode "FINISH", the cryptographic calculations shall be finalized. Additional data (i.e. the MAC to be tested on a MAC verification service) shall be available at this point to process this job successfully. The results of the calculations shall be stored in the output buffers. At end of the processing the Crypto Driver shall switch to "Idle" state.⌋ To process a crypto service with a single call with Crypto_ProcessJob the operation mode "CRYPTO_OPERATIONMODE_SINGLECALL" is a disjunction (bitwise OR) of the 3 modes "START", "UPDATE" and "FINISH".
[SWS_Crypto_00025] ⌈If an internal error occurs, the corresponding job state shall be set to "Idle" and all input data and intermediate results shall be discarded.⌋
[SWS_Crypto_00119] ⌈If an internal error occurs while processing an asynchronous job, the corresponding job state shall be set to "Idle" and all input data and intermediate results shall be discarded. Further, the callback notification shall be called with an appropriate error code.⌋
Versionen & Provenienz · Zugeordnete Anforderungen
Diese Angaben zeigt der Versions-Explorer.
Begründung & Zuweisungs-Evidenz
Defines START UPDATE FINISH streaming operation modes.
Dokumenten-Herkunft & Rückverfolgbarkeit
| Spezifikations-Dokument | SWS_CryptoDriver.pdf |
|---|---|
| Dokumentseite | Seite 25 |
| Ziel-Modul | crypto (classic) |
| Ziel-Anforderung | SWS_Csm_01039 |
| Semantische Rolle | heuristic |
| Automatisierungs-Konfidenz | 0.85 |