AUTOSAR Classic Crypto Services
क्लस्टर गाइडएआई जनित
हार्डवेयर और सॉफ़्टवेयर ड्राइवरों के माध्यम से मानकीकृत क्रिप्टोग्राफ़िक कंप्यूटिंग और कुंजी प्रबंधन सेवाएँ प्रदान करता है।
हार्डवेयर और सॉफ़्टवेयर ड्राइवरों के माध्यम से मानकीकृत क्रिप्टोग्राफ़िक कंप्यूटिंग और कुंजी प्रबंधन सेवाएँ प्रदान करता है।
क्लस्टर AUTOSAR Classic Platform EXP_UtilizationOfCryptoServices पृ. 8 में क्रिप्टोग्राफ़िक सेवाओं और कुंजी प्रबंधन कार्यों के हार्डवेयर-स्वतंत्र प्रावधान के लिए CSM, CryIf और Crypto Driver मॉड्यूल को बंडल करता है। क्रिप्टोग्राफ़िक जॉब्स को CSM के माध्यम से प्राथमिकता दी जाती है, CryIf में लॉजिकल चैनलों पर रूट किया जाता है, और Crypto Driver में सिंक्रोनस या एसिंक्रोनस रूप से निष्पादित किया जाता है [SWS_CryIf_91003]। संगति कारणों से, NVM में कुंजी का स्थिरीकरण (persistence) KeySetValid SWS_CryptoDriver पृ. 37 के माध्यम से सफल सत्यापन के बाद ही सख्ती से किया जाता है।
मॉड्यूल क्लस्टर "Crypto Services & Hardware Abstraction" में AUTOSAR Classic मॉड्यूल Crypto Service Manager (csm), Crypto Interface (cryif) और Crypto Driver (crypto) शामिल हैं EXP_UtilizationOfCryptoServices पृ. 8। यह क्रिप्टोग्राफ़िक संचालन (अन्य बातों के अलावा एन्क्रिप्शन, सिग्नेचर, MAC गणना और रैंडम नंबर जनरेशन) के साथ-साथ सुरक्षित कुंजी प्रबंधन के लिए एक हार्डवेयर-स्वतंत्र अमूर्त परत (एब्सट्रैक्शन लेयर) प्रदान करता है [SWS_Csm_00982], [SWS_Csm_00984], SWS_CryptoDriver पृ. 15।
क्रिप्टोग्राफ़िक अनुरोधों को Crypto_JobType के रूप में एनकैप्सुलेट किया जाता है, जो प्राथमिकताओं, इनपुट और आउटपुट बफ़र्स के साथ-साथ संचालन मोड (स्ट्रीमिंग या SingleCall के लिए Start, Update, Finish) को परिभाषित करता है [SWS_Csm_01013], [SWS_Csm_01039]। CSM ऑर्डर प्राप्त करता है, उन्हें सॉफ़्टवेयर-साइड कतारों (queues) को सौंपता है, और उन्हें CryIf_ProcessJob() के माध्यम से अग्रेषित करता है [SWS_Csm_00017], [SWS_CryIf_91003]। CryIf ड्राइवरों के लिए चैनल रूटिंग को संभालता है और CSM कुंजी पहचानकर्ताओं को मॉड्यूल-विशिष्ट ड्राइवर कुंजी IDs में अनुवादित करता है [SWS_CryIf_00133]।
संदर्भ आरेख: AUTOSAR क्रिप्टो स्टैक की लेयर्ड आर्किटेक्चर और इंटरफ़ेस कैस्केड। स्रोत: SWS_CryptoDriver पृ. 15, SWS_CryptoServiceManager पृ. 29
आवधिक Csm_MainFunction() का उपयोग एसिंक्रोनस क्रिप्टो ऑर्डर्स को सिंक्रनाइज़ करने के लिए किया जाता है, जो कतारों को खाली करता है और लंबित गणनाओं को ट्रिगर करता है [SWS_Csm_00479]। एक एसिंक्रोनस हार्डवेयर गणना पूरी होने के बाद, Crypto Driver CryIf_CallbackNotification() के माध्यम से CryIf को सूचित करता है, जो संदेश को Csm_CallbackNotification() और अंततः कॉलिंग एप्लिकेशन को अग्रेषित करता है [SWS_CryIf_91013], [SWS_Csm_00970]।
अनुक्रम आरेख: कतारबद्धता और कॉलबैक कैस्केड के साथ एसिंक्रोनस क्रिप्टो ऑर्डर वर्कफ़्लो। स्रोत: [SWS_Csm_00970], [SWS_CryIf_91013], AUTOSAR_CP_SWS_CryptoServiceManager पृ. 146
कुंजी प्रबंधन Csm_KeyElementSet() और CryIf_KeyElementCopy() जैसे मानकीकृत इंटरफ़ेस के माध्यम से कॉन्फ़िगर किए गए एक्सेस अधिकारों [SWS_Csm_00957], [SWS_CryIf_91015], [SWS_Crypto_00219] के सख्त अनुपालन में किया जाता है। NVM में पर्सिस्टेंस को केवल Crypto_KeySetValid() के माध्यम से स्पष्ट सत्यापन पर ट्रिगर किया जाता है, जिससे अपूर्ण कुंजी संग्रहण से बचा जा सकता है [SWS_Crypto_91014], SWS_CryptoDriver पृ. 37। ओवरलोड या अमान्य कुंजी स्थितियों जैसी त्रुटियों को CRYPTO_E_BUSY या CRYPTO_E_KEY_NOT_VALID के माध्यम से मजबूती से इंटरसेप्ट किया जाता है [SWS_Csm_00018], [SWS_CryIf_91003]।
1. सिस्टम आर्किटेक्चर और मॉड्यूल क्लस्टर की भूमिका
मॉड्यूल क्लस्टर "Crypto Services & Hardware Abstraction" AUTOSAR Classic Platform EXP_UtilizationOfCryptoServices पृ. 8 में क्रिप्टोग्राफ़िक संचालन, सॉफ़्टवेयर- और हार्डवेयर-आधारित कुंजी प्रबंधन, और सुरक्षित ऑन-बोर्ड संचार के लिए कार्यात्मक आधार बनाता है। आर्किटेक्चर को AUTOSAR लेयर मॉडल के साथ सख्ती से तीन मानकीकृत BSW मॉड्यूल में संरचित किया गया है: सर्विस लेयर में Crypto Service Manager (csm), ECU Abstraction Layer में Crypto Interface (cryif), और Microcontroller Abstraction Layer (MCAL) पर कम से कम एक Crypto Driver (crypto) SWS_CryptoDriver पृ. 15। यह स्तरित संरचना सुरक्षा अनुप्रयोगों (उदाहरण के लिए SecOC, TLS कनेक्शन सेटअप, और UDS डायग्नोस्टिक प्रमाणीकरण) को हार्डवेयर सुरक्षा मॉड्यूल (HSM) या सुरक्षित हार्डवेयर एक्सटेंशन (SHE) SWS_SecureOnboardCommunication पृ. 78 जैसे मालिकाना क्रिप्टो को-प्रोसेसर से पूरी तरह से अलग करती है।
Crypto Service Manager (CSM) एप्लिकेशन घटकों (SW-Cs) और उच्च-स्तरीय BSW मॉड्यूल के लिए प्राथमिक सेवा प्रदाता के रूप में कार्य करता है। यह सममित और असममित एल्गोरिदम (उदा. AES, RSA), हैशिंग, Message Authentication Codes (MAC), रैंडम नंबर जनरेशन (RNG), और AEAD प्रक्रियाओं [SWS_Csm_00980], [SWS_Csm_00982], [SWS_Csm_00984], [SWS_Csm_01023] के लिए मानकीकृत प्रोग्रामिंग इंटरफ़ेस प्रदान करता है। इसके अलावा, CSM सॉफ़्टवेयर-साइड जॉब कतारों को लागू करता है और समानांतर क्रिप्टो कार्यों के प्राथमिकता निर्धारण को नियंत्रित करता है [SWS_Csm_00022], SWS_CryptoServiceManager पृ. 29।
Crypto Interface (CryIf) एक अमूर्त परत के रूप में CSM और असीमित संख्या में क्रिप्टो ड्राइवरों के बीच एक समान 1:n इंटरफ़ेस प्रदान करता है। इसका मुख्य कार्य डिस्पैचिंग है: यह कॉन्फ़िगर किए गए लॉजिकल चैनलों (channelId) के आधार पर ऑर्डर्स को संबंधित Crypto Driver इंस्टेंस पर अग्रेषित करता है और लॉजिकल कुंजी संदर्भों (cryIfKeyId) को ड्राइवर-विशिष्ट पहचानकर्ताओं (cryptoKeyId) में बदल देता है [SWS_CryIf_00133], [SWS_CryIf_91003]। Crypto Driver भौतिक निष्पादन इकाई (Crypto Driver Object) को एनकैप्सुलेट करता है और या तो विशुद्ध सॉफ़्टवेयर क्रिप्टो प्रिमिटिव्स या समर्पित हार्डवेयर सुरक्षा मॉड्यूल को सेवा प्रदान करता है [SWS_Crypto_00224], SWS_CryptoDriver पृ. 15।
संदर्भ आरेख: AUTOSAR क्रिप्टो स्टैक की लेयर्ड आर्किटेक्चर और इंटरफ़ेस कैस्केड। स्रोत: SWS_CryptoDriver पृ. 15, SWS_CryptoServiceManager पृ. 29
2. मॉड्यूल के बीच परस्पर क्रिया और इंटरैक्शन पथ
क्लस्टर के भीतर ऑर्डर प्रोसेसिंग मुख्य रूप से संरचना Crypto_JobType [SWS_Csm_01013], AUTOSAR_CP_SWS_CryptoServiceManager पृ. 21 का उपयोग करके जॉब-आधारित मॉडल के माध्यम से होती है। एक क्रिप्टो जॉब में जॉब ID, प्राथमिकता जानकारी, कुंजी संदर्भ, प्रिमिटिव मेटाडेटा, और इनपुट, आउटपुट और लंबाई मापदंडों के पॉइंटर प्रबंधन के लिए संरचना Crypto_JobPrimitiveInputOutputType शामिल होती है [SWS_Csm_01012]। बिटमास्क फ़ील्ड Crypto_OperationModeType (फ्लैग्स START, UPDATE, FINISH के साथ) यह नियंत्रित करता है कि किसी कार्य की गणना एक सन्निहित एकल कॉल (SINGLECALL) के रूप में की जाती है या स्ट्रीमिंग मोड में वृद्धिशील रूप से [SWS_Csm_01039], [SWS_Csm_01029]।
यदि किसी CSM सेवा फ़ंक्शन को सिंक्रोनस रूप से कॉल किया जाता है, तो CSM जॉब की स्थिति की जाँच करता है। यदि ड्राइवर खाली है या जॉब को सिंक्रोनस के रूप में कॉन्फ़िगर किया गया है, तो CSM सीधे CryIf_ProcessJob() को कॉल करता है [SWS_Csm_00017], [SWS_CryIf_91003]। CryIf कुंजी IDs को मैप करता है और जॉब को Crypto_ProcessJob() के माध्यम से निर्दिष्ट ड्राइवर इंस्टेंस को डिस्पैच करता है [SWS_CryIf_00133]। एसिंक्रोनस अनुरोधों के लिए, यदि ड्राइवर ऑब्जेक्ट व्यस्त है तो जॉब को CSM कतार में जोड़ा जाता है [SWS_Csm_00018], AUTOSAR_CP_SWS_CryptoServiceManager पृ. 30। एसिंक्रोनस ड्राइवर गणना पूरी होने के बाद, ड्राइवर CryIf_CallbackNotification() [SWS_CryIf_91013] को ट्रिगर करता है, CryIf संदेश को Csm_CallbackNotification() को अग्रेषित करता है [SWS_Csm_00970], और CSM अंततः अपने कॉन्फ़िगर किए गए कॉलबैक [SWS_Csm_01044], [SWS_Csm_00928] के माध्यम से अनुरोध करने वाले एप्लिकेशन को सूचित करता है।
अनुक्रम आरेख: कतारबद्धता और कॉलबैक कैस्केड के साथ एसिंक्रोनस क्रिप्टो ऑर्डर वर्कफ़्लो। स्रोत: [SWS_Csm_00970], [SWS_CryIf_91013], AUTOSAR_CP_SWS_CryptoServiceManager पृ. 146
प्राथमिक क्रिप्टो निष्पादन के अलावा, कुंजी प्रबंधन क्लस्टर SWS_CryptoDriver पृ. 24 का एक अभिन्न संपर्क पथ बनाता है। एक कुंजी में कई लॉजिकल कुंजी तत्व (जैसे कुंजी सामग्री, इनिशियलाइज़ेशन वैक्टर या पुनरावृत्ति मान) [SWS_Csm_00954], [SWS_Csm_01022] शामिल होते हैं। Csm_KeyElementSet() के माध्यम से कुंजी सामग्री सेट करने, Csm_KeyElementCopy() का उपयोग करके कॉपी करने, या Csm_KeyDerive() के माध्यम से कुंजी व्युत्पत्ति जैसे संचालन को CryIf (CryIf_KeyElementCopy(), CryIf_KeyDerive()) के माध्यम से ड्राइवर फ़ंक्शनों को सिंक्रोनस रूप से अग्रेषित किया जाता है [SWS_Csm_00957], [SWS_Csm_00969], [SWS_CryIf_91015], [SWS_CryIf_91009]। कुंजी तत्वों तक पहुंच की निगरानी कॉन्फ़िगर किए गए एक्सेस अधिकारों (CRYPTO_RA_ALLOWED, CRYPTO_RA_ENCRYPTED, CRYPTO_RA_INTERNAL_COPY) के आधार पर सख्ती से की जाती है [SWS_Crypto_00219]।
3. सिंक्रोनाइज़ेशन, रीएंट्रेंसी और टास्क संदर्भ
क्रिप्टोग्राफ़िक संचालन निष्पादन समय में काफी भिन्न होते हैं। जबकि तेज़ ब्लॉक सिफ़र या हैश गणना कॉलर के टास्क संदर्भ में सिंक्रोनस रूप से निष्पादित की जा सकती हैं, असममित गणना (उदा. RSA सिग्नेचर जनरेशन) या समय लेने वाली हार्डवेयर प्रक्रियाओं के लिए एसिंक्रोनस प्रोसेसिंग की आवश्यकता होती है [SWS_Csm_00984], [SWS_Csm_00992]। डीकंपलिंग के लिए, CSM चक्रीय रूप से कॉल किया जाने वाला मुख्य फ़ंक्शन Csm_MainFunction() प्रदान करता है [SWS_Csm_00479]। यह कतारों की निगरानी करता है, लंबित कार्यों को CryIf को डिस्पैच करता है, और एसिंक्रोनस प्रिमिटिव्स की आंतरिक स्टेट मशीनों को आगे बढ़ाता है [SWS_Csm_00019]।
आधुनिक मल्टी-कोर और मल्टी-सेक्टर आर्किटेक्चर में, CSM एकाधिक इंस्टेंसेस Csm_MainFunction_<shortName>() का समर्थन करता है, जिन्हें समर्पित OS पार्टीशन्स को सौंपा जाता है [SWS_Csm_00479], AUTOSAR_SWS_CryptoServiceManager पृ. 170। एसिंक्रोनस ड्राइवर निष्पादन के मामले में, गणनाओं को या तो ड्राइवर MainFunction में पोलिंग द्वारा या हार्डवेयर-आधारित क्रिप्टो-इंजनों के इंटरप्ट सर्विस रूटीन्स (ISR) द्वारा समाप्त किया जाता है [SWS_Crypto_00027], [SWS_Crypto_00028]। परिभाषा के अनुसार, एक एकल Crypto Driver Object एक ही समय में ठीक एक क्रिप्टो-जॉब को प्रोसेस कर सकता है; n ऑब्जेक्ट्स वाला एक ड्राइवर n जॉब्स को वास्तव में समानांतर रूप से प्रोसेस करता है [SWS_Crypto_00014], [SWS_Crypto_00117]।
रीएंट्रेंसी के संबंध में, Csm_MacGenerate() या CryIf_ProcessJob() जैसे सर्विस इंटरफेस विभिन्न जॉब्स के लिए रीएंट्रेंट होने के लिए डिज़ाइन किए गए हैं, लेकिन एक ही जॉब इंस्टेंस के समवर्ती एकाधिक असाइनमेंट को प्रतिबंधित करते हैं [SWS_Csm_00016], [SWS_CryIf_91003]। Csm_KeyElementCopy(), CryIf_KeyElementCopy() या Crypto_KeyCopy() जैसे की-मैनेजमेंट फ़ंक्शंस रीएंट्रेंट रूप से कार्यान्वित किए गए हैं, लेकिन डेटा असंगतता और रेस कंडीशंस से बचने के लिए उन्हें एक ही सोर्स की आइडेंटिफ़ायर (keyId या cryptoKeyId) पर समवर्ती रूप से लागू नहीं किया जाना चाहिए [SWS_Csm_00969], [SWS_CryIf_91015], [SWS_Crypto_00155]। ISR और टास्क स्तर के बीच रेस कंडीशंस को रोकने के लिए, हार्डवेयर ड्राइवर्स आंतरिक वर्किंग एरियाज और की रजिस्टर्स के संशोधन के लिए आंतरिक एक्सक्लूसिव एरियाज (Exclusive Areas) का उपयोग कर सकते हैं SWS_CryptoDriver पृ. 27। प्रश्न Q-b1e9578255723a0e (खुला)
गतिविधि आरेख: CSM में जॉब स्वीकृति पर निर्णय लॉजिक और कतारबद्ध डीकपलिंग। स्रोत: AUTOSAR_CP_SWS_CryptoServiceManager पृ. 30, [SWS_Csm_00017], [SWS_Csm_00018]
4. विशिष्ट जीवनचक्र और परिचालन मोड
क्रिप्टो क्लस्टर का आरंभीकरण BSW स्टार्टअप के दौरान एक पदानुक्रमित क्रम में होता है। सबसे पहले, EcuM या BswM कॉन्फ़िगरेशन Crypto_ConfigType पास करके Crypto_Init() के माध्यम से ड्राइवर स्तर को प्रारंभ करता है [SWS_Crypto_91016], इसके बाद CryIf_ConfigType के साथ CryIf_Init() के माध्यम से इंटरफ़ेस लेयर आती है [SWS_CryIf_91118]। अंत में, CSM को Csm_Init() के माध्यम से शुरू किया जाता है, जहाँ इसके कॉन्फ़िगरेशन पॉइंटर को विनिर्देश के अनुसार हमेशा NULL_PTR पर सेट किया जाना चाहिए [SWS_Csm_00646]। सभी लेयर्स के पूर्ण आरंभीकरण के बाद ही क्रिप्टोग्राफ़िक जॉब्स या की-एक्सेस को स्वीकार किया जा सकता है [SWS_CryIf_00076], [SWS_Crypto_00196]।
कुंजी जीवनचक्र का एक केंद्रीय पहलू गैर-वाष्पशील मेमोरी (NVM) में सत्यापन और स्थायित्व है। Csm_KeyElementSet() के माध्यम से नए कुंजी मान लोड करने के बाद, कुंजी "अपूर्ण या अज्ञात" स्थिति में रहती है [SWS_Csm_00957]। केवल Csm_JobKeySetValid() या Crypto_KeySetValid() का स्पष्ट कॉल ही स्थिरता की जाँच करता है और कुंजी की स्थिति को मान्य में बदलता है [SWS_Csm_91027], [SWS_Crypto_91014]। स्थायी कुंजियों के लिए, केवल यह सत्यापन ही NVM में स्टोरेज को ट्रिगर करता है [SWS_Crypto_91026], SWS_CryptoDriver पृ. 37। यह कई खंडित NVM लेखन चक्रों को रोकता है और अपूर्ण कुंजी सेटों से बचाता है SWS_CryptoDriver पृ. 37। NVRAM Manager के साथ सिंक्रनाइज़ेशन के लिए, Crypto Driver कॉलबैक Crypto_<vi>_<ai>_NvBlock_ReadFrom_<NvBlock>() और Crypto_<vi>_<ai>_NvBlock_WriteTo_<NvBlock>() के साथ-साथ NvM_WriteBlock() का उपयोग करता है [SWS_Crypto_91024], [SWS_Crypto_91025], [SWS_Crypto_91017]।
चल रहे स्ट्रीमिंग जॉब्स को आवश्यकता पड़ने पर Csm_SaveContextJob() के माध्यम से बाधित किया जा सकता है, एक एप्लिकेशन-विशिष्ट बफर में सहेजा जा सकता है और बाद में संदर्भ पुनर्प्राप्ति के माध्यम से जारी रखा जा सकता है [SWS_Csm_91063], [SWS_Csm_01029]। ECU शटडाउन या लो-पावर मोड में संक्रमण से पहले, एसिंक्रोनस जॉब्स को Csm_CancelJob() के माध्यम से नियंत्रित तरीके से रद्द किया जा सकता है, जिससे CryIf ड्राइवर कतारों और हार्डवेयर चैनलों से जॉब्स को CryIf_CancelJob() के माध्यम से हटा देता है [SWS_Csm_00968], [SWS_CryIf_91014]।
5. त्रुटि हैंडलिंग, DET ट्रेसिंग और डिग्रेडेशन
क्लस्टर एक बहु-स्तरीय त्रुटि पहचान और रोकथाम रणनीति लागू करता है। ट्रेसिंग सक्षम होने पर विकास त्रुटियों की सूचना सीधे Default Error Tracer (DET) मॉड्यूल को दी जाती है [SWS_Csm_91101], [SWS_Crypto_91017]। विशिष्ट DET घटनाओं में आरंभीकरण से पहले मॉड्यूल कॉल (CRYIF_E_UNINIT, CRYPTO_E_UNINIT), अमान्य हैंडल या कुंजी पैरामीटर (CRYIF_E_PARAM_HANDLE, CRYPTO_E_PARAM_HANDLE), और शून्य-पॉइंटर पासिंग शामिल हैं [SWS_CryIf_00076], [SWS_CryIf_00134], [SWS_Crypto_00196], [SWS_Crypto_00217]।
रनटाइम ओवरलोड और संसाधन की कमी को परिभाषित रिटर्न मानों के माध्यम से नियतात्मक रूप से नियंत्रित किया जाता है। यदि किसी एसिंक्रोनस जॉब के लिए CSM कतार समाप्त हो जाती है, तो CSM स्टेटस कोड CRYPTO_E_BUSY के साथ जॉब को अस्वीकार कर देता है और रनटाइम त्रुटि CSM_E_QUEUE_FULL उत्पन्न करता है [SWS_Csm_00018], [SWS_Csm_01089]। यदि प्रदान किया गया परिणाम बफ़र अपर्याप्त आकार का है, तो ड्राइवर CRYPTO_E_SMALL_BUFFER के साथ ऑपरेशन को रद्द कर देता है [SWS_Crypto_00195]। यदि कोई क्रिप्टोग्राफ़िक सेवा किसी अनप्रारंभीकृत या स्पष्ट रूप से अमान्य कुंजी को संदर्भित करती है (उदाहरण के लिए Csm_JobKeySetInvalid() या Crypto_KeySetInvalid() को कॉल करने के बाद), तो सेवा अनुरोध CRYPTO_E_KEY_NOT_VALID या CRYPTO_E_KEY_EMPTY के साथ नियंत्रित तरीके से विफल हो जाते हैं [SWS_Csm_91002], [SWS_CryIf_91003], [SWS_Crypto_91020]।
सिस्टम स्तर पर डिग्रेडेशन और फ़ॉलबैक तंत्र सक्षम हैं: एप्लिकेशन जॉब सबमिशन से पहले Csm_KeyGetStatus() के माध्यम से कुंजियों की अखंडता स्थिति की जाँच कर सकते हैं [SWS_Csm_91047], [SWS_CryIf_91012]। यदि कोई हार्डवेयर क्रिप्टो एक्सेलेरेटर स्थायी रूप से व्यस्त है या विफल हो जाता है, तो CryIf चैनल कॉन्फ़िगरेशन एक सॉफ़्टवेयर-आधारित वैकल्पिक मार्ग की अनुमति देता है, बशर्ते कि एक रिडंडेंट सॉफ़्टवेयर ड्राइवर एकीकृत हो SWS_CryptoDriver पृ. 15।
यह मार्गदर्शिका विशेष रूप से AUTOSAR Classic विनिर्देश R20-11 पर आधारित है और इसे autodocs क्यूरेशन सहायक द्वारा तैयार किया गया था।
Die Crypto Services bieten hardware- und softwaregestützte Kryptographie-Primitive (CSM, CryIf, Crypto-Treiber) für symmetrische/asymmetrische Verschlüsselung, Signaturen und Hashing.
Module im Cluster
Crypto Abstraction Library (Cal)
AUTOSAR Classic Crypto Services-Modul Crypto Abstraction Library (Cal, Spezifikation: AUTOSAR_SWS_CryptoAbstractionLibrary.pdf).
Crypto Interface (CryIf)
Abstracts cryptographic hardware and software acceleration engines.
Crypto Driver (Crypto)
Low-level driver executing cryptographic primitives on hardware security modules (HSM) or software libraries.
Crypto Service Manager (CSM)
Provides standardized cryptographic services (encryption, hashing, digital signatures, key management) to applications and BSW.
आरंभीकरण और स्थिति
CryIf_GetVersionInfoCryIf_InitCrypto_GetVersionInfoCrypto_InitCsm_GetVersionInfoCsm_Initसेवाएँ · Key…
सेवाएँ · Job…
सेवाएँ · Random…
सेवाएँ · Cancel…
सेवाएँ · अन्य
CryIf_CallbackNotificationCryIf_ProcessJobCrypto_ProcessJobCsm_AEADDecryptCsm_AEADEncryptCsm_CallbackNotificationCsm_DecryptCsm_EncryptCsm_HashCsm_MacGenerateCsm_MacVerifyCsm_RestoreContextJobCsm_SaveContextJobCsm_SignatureGenerateCsm_SignatureVerifyकॉलआउट और अपेक्षित इंटरफ़ेस
<Csm_ApplicationCallbackNotification>चक्रीय
Crypto_MainFunctionCsm_MainFunctionटाइप
CryIf_ConfigTypeCrypto_AlgorithmFamilyTypeCrypto_AlgorithmInfoTypeCrypto_AlgorithmModeTypeCrypto_ConfigTypeCrypto_InputOutputRedirectionConfigTypeCrypto_JobPrimitiveInfoTypeCrypto_JobPrimitiveInputOutputTypeCrypto_JobRedirectionInfoTypeCrypto_JobStateTypeCrypto_JobTypeCrypto_KeyStatusTypeCrypto_OperationModeTypeCrypto_PrimitiveInfoTypeCrypto_ProcessingTypeCrypto_ResultTypeCrypto_ServiceInfoTypeCrypto_VerifyResultTypeCsm_AEADDecryptAssociatedDataTypeCsm_AEADDecryptCiphertextTypeCsm_AEADDecryptPlaintextTypeCsm_AEADDecryptTagTypeCsm_AEADEncryptAssociatedDataTypeCsm_AEADEncryptCiphertextTypeCsm_AEADEncryptPlaintextTypeCsm_AEADEncryptTagTypeCsm_ConfigIdTypeCsm_ConfigTypeCsm_DecryptDataTypeCsm_DecryptResultTypeCsm_EncryptDataTypeCsm_EncryptResultTypeCsm_HashDataTypeCsm_HashResultTypeCsm_KeyDataTypeCsm_LengthPtrCsm_MacGenerateDataTypeCsm_MacGenerateResultTypeCsm_MacVerifyCompareTypeCsm_MacVerifyDataTypeCsm_RandomGenerateResultTypeCsm_SignatureGenerateDataTypeCsm_SignatureGenerateResultTypeCsm_SignatureVerifyCompareTypeCsm_SignatureVerifyDataTypeCsm_VerifyResultPtrफ़ंक्शन
<Csm_ApplicationCallbackNotification>CryIf_CallbackNotificationCryIf_CancelJobCryIf_GetVersionInfoCryIf_InitCryIf_KeyCopyCryIf_KeyDeriveCryIf_KeyElementCopyCryIf_KeyElementCopyPartialCryIf_KeyElementGetCryIf_KeyElementSetCryIf_KeyExchangeCalcPubValCryIf_KeyExchangeCalcSecretCryIf_KeyGenerateCryIf_KeyGetStatusCryIf_KeySetInvalidCryIf_KeySetValidCryIf_ProcessJobCryIf_RandomSeedCrypto_CancelJobCrypto_GetVersionInfoCrypto_InitCrypto_KeyCopyCrypto_KeyDeriveCrypto_KeyElementCopyCrypto_KeyElementCopyPartialCrypto_KeyElementGetCrypto_KeyElementIdsGetCrypto_KeyElementSetCrypto_KeyExchangeCalcPubValCrypto_KeyExchangeCalcSecretCrypto_KeyGenerateCrypto_KeyGetStatusCrypto_KeySetInvalidCrypto_KeySetValidCrypto_MainFunctionCrypto_ProcessJobCrypto_RandomSeedCsm_AEADDecryptCsm_AEADEncryptCsm_CallbackNotificationCsm_CancelJobCsm_DecryptCsm_EncryptCsm_GetVersionInfoCsm_HashCsm_InitCsm_JobKeyDeriveCsm_JobKeyExchangeCalcPubValCsm_JobKeyExchangeCalcSecretCsm_JobKeyGenerateCsm_JobKeySetInvalidCsm_JobKeySetValidCsm_JobRandomSeedCsm_KeyCopyCsm_KeyDeriveCsm_KeyElementCopyCsm_KeyElementCopyPartialCsm_KeyElementGetCsm_KeyElementSetCsm_KeyExchangeCalcPubValCsm_KeyExchangeCalcSecretCsm_KeyGenerateCsm_KeyGetStatusCsm_KeySetInvalidCsm_KeySetValidCsm_MacGenerateCsm_MacVerifyCsm_MainFunctionCsm_RandomGenerateCsm_RandomSeedCsm_RestoreContextJobCsm_SaveContextJobCsm_SignatureGenerateCsm_SignatureVerifyटाइप
CryIf_ConfigTypeCrypto_AlgorithmFamilyTypeCrypto_AlgorithmInfoTypeCrypto_AlgorithmModeTypeCrypto_ConfigTypeCrypto_InputOutputRedirectionConfigTypeCrypto_JobPrimitiveInfoTypeCrypto_JobPrimitiveInputOutputTypeCrypto_JobRedirectionInfoTypeCrypto_JobStateTypeCrypto_JobTypeCrypto_KeyStatusTypeCrypto_OperationModeTypeCrypto_PrimitiveInfoTypeCrypto_ProcessingTypeCrypto_ResultTypeCrypto_ServiceInfoTypeCrypto_VerifyResultTypeCsm_AEADDecryptAssociatedDataTypeCsm_AEADDecryptCiphertextTypeCsm_AEADDecryptPlaintextTypeCsm_AEADDecryptTagTypeCsm_AEADEncryptAssociatedDataTypeCsm_AEADEncryptCiphertextTypeCsm_AEADEncryptPlaintextTypeCsm_AEADEncryptTagTypeCsm_ConfigIdTypeCsm_ConfigTypeCsm_DecryptDataTypeCsm_DecryptResultTypeCsm_EncryptDataTypeCsm_EncryptResultTypeCsm_HashDataTypeCsm_HashResultTypeCsm_KeyDataTypeCsm_LengthPtrCsm_MacGenerateDataTypeCsm_MacGenerateResultTypeCsm_MacVerifyCompareTypeCsm_MacVerifyDataTypeCsm_RandomGenerateResultTypeCsm_SignatureGenerateDataTypeCsm_SignatureGenerateResultTypeCsm_SignatureVerifyCompareTypeCsm_SignatureVerifyDataTypeCsm_VerifyResultPtrविषय मानचित्र
CryIf
19Crypto
20CSM
82इस रिलीज़ के लिए कोई तत्व डेटा उपलब्ध नहीं
CryIf
Notifies the CRYIF about the completion of the request with the result of the cryptographic operation.
void CryIf_CallbackNotification (Crypto_JobType* job, Crypto_ResultType result);This interface dispatches the job cancellation function to the configured crypto driver object.
Std_ReturnType CryIf_CancelJob (uint32 channelId, Crypto_JobType* job);Returns the version information of this module.
void CryIf_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the CRYIF module. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CryptoInterface
void CryIf_Init (const CryIf_ConfigType* configPtr);This function shall co py all key elements from the source key to a target key.
Std_ReturnType CryIf_KeyCopy (uint32 cryIfKeyId, uint32 targetCryIfKeyId);This function shall dispatch th e key derive function to the configured crypto driver object.
Std_ReturnType CryIf_KeyDerive (uint32 cryIfKeyId, uint32 targetCryIfKeyId);Service CryIf_KeyElementCopy.
Std_ReturnType CryIf_KeyElementCopy (uint32 cryIfKeyId, uint32 keyElementId, uint32 targetCryIfKeyId, uint32 targetKeyElementId);This function shall dispatch the get key ele ment function to the configured crypto driver object.
Std_ReturnType CryIf_KeyElementGet (uint32 cryIfKeyId, uint32 keyElementId, uint8* resultPtr, uint32* resultLengthPtr);This function shall dispatch the set key element function to the configured crypto driver object.
Std_ReturnType CryIf_KeyElementSet (uint32 cryIfKeyId, uint32 keyElementId, const uint8* keyPtr, uint32 keyLength);This function shall dispatch the key exchange public value calculation function to the configured crypto driver object. Available
Std_ReturnType CryIf_KeyExchangeCalcPubVal (uint32 cryIfKeyId, uint8* publicValuePtr, uint32* publicValueLengthPtr);This function shall dispatch the key exchange common shared secret calculation function to the configured crypto driver object.
Std_ReturnType CryIf_KeyExchangeCalcSecret (uint32 cryIfKeyId, const uint8* partnerPublicValuePtr, uint32 partnerPublicValueLength);This function shall dispatch the key generate function to the configured crypto driver object.
Std_ReturnType CryIf_KeyGenerate (uint32 cryIfKeyId);Returns the key state of the key identified by cry If Key Id.
Std_ReturnType CryIf_KeyGetStatus (uint32 cryIfKeyId, Crypto_KeyStatusType* keyStatusPtr);Sets invalid for the status of the key identifi ed by cry If Key Id.
Std_ReturnType CryIf_KeySetInvalid (uint32 cryIfKeyId);This function shall dispatch the set key valid function to the configured crypto driver object.
Std_ReturnType CryIf_KeySetValid (uint32 cryIfKeyId);Service CryIf_ProcessJob.
Std_ReturnType CryIf_ProcessJob (uint32 channelId, Crypto_JobType* job);This function shall dispatch the random seed function to the configured crypto driver object.
Std_ReturnType CryIf_RandomSeed (uint32 cryIfKeyId, const uint8* seedPtr, uint32 seedLength);Configuration data structure of Cry If module
Crypto
This interface removes the provided job from the queue and cancels the processing of the job if possible.
Std_ReturnType Crypto_CancelJob (uint32 objectId, Crypto_JobType* job);Returns the version information of this module.
void Crypto_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the Crypto Driver.
void Crypto_Init (const Crypto_ConfigType* configPtr);Copies a key with all its elements to another key in the same crypto driver. Note: If the actual key element is directly mapped to flash memory, there could be a bigger delay when calling this function (synchronous operation)
Std_ReturnType Crypto_KeyCopy (uint32 cryptoKeyId, uint32 targetCryptoKeyId);Derives a new key by using the key elements in the given key identified by the crypto Key Id. The given key contains the key elements for the password, salt. The derived key is stored in the key element with the id 1 of the key identified by target Crypto Key Id. The number of iterations is given in the key element CRYPTO_ KE_ KEYDERIVATION_ ITERATIONS.
Std_ReturnType Crypto_KeyDerive (uint32 cryptoKeyId, uint32 targetCryptoKeyId);Service Crypto_KeyElementCopy.
Std_ReturnType Crypto_KeyElementCopy (uint32 cryptoKeyId, uint32 keyElementId, uint32 targetCryptoKeyId, uint32 targetKeyElementId);This interface shall be used to get a key element of the key identified by the crypto
Std_ReturnType Crypto_KeyElementGet (uint32 cryptoKeyId, uint32 keyElementId, uint8* resultPtr, uint32* resultLengthPtr);Used to retrieve information which key elements are available in a given key.
Std_ReturnType Crypto_KeyElementIdsGet (uint32 cryptoKeyId, uint32* keyElementIdsPtr, uint32* keyElementIdsLengthPtr);Sets the given key element bytes to the key identified by crypto Key Id.
Std_ReturnType Crypto_KeyElementSet (uint32 cryptoKeyId, uint32 keyElementId, const uint8* keyPtr, uint32 keyLength);Calculates the public value for the key exchange a nd stores the public key in the memory location pointed by the public value pointer.
Std_ReturnType Crypto_KeyExchangeCalcPubVal (uint32 cryptoKeyId, uint8* publicValuePtr, uint32* publicValueLengthPtr);Calculates the shared secret key for the key exchange with the key material of the key identified by the crypto Key Id and the partner public key. The shared secret key is stored as a key element in the same key.
Std_ReturnType Crypto_KeyExchangeCalcSecret (uint32 cryptoKeyId, const uint8* partnerPublicValuePtr, uint32 partnerPublicValueLength);Generates new key material store it in the key identified by crypto Key Id.
Std_ReturnType Crypto_KeyGenerate (uint32 cryptoKeyId);Returns the key state of the key identified by crypto Key Id.
Std_ReturnType Crypto_KeyGetStatus (uint32 cryptoKeyId, Crypto_KeyStatusType* keyStatusPtr);Sets invalid for the status of the key identifi ed by crypto Key Id.
Std_ReturnType Crypto_KeySetInvalid (uint32 cryptoKeyId);Sets the key state of the key identified by crypto Key Id to valid.
Std_ReturnType Crypto_KeySetValid (uint32 cryptoKeyId);If asynchronous job processing is configured and there are job queues, the function is called cyclically to process queued jobs. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CryptoDriver
void Crypto_MainFunction (void);Service Crypto_ProcessJob.
Std_ReturnType Crypto_ProcessJob (uint32 objectId, Crypto_JobType* job);This function generates the internal seed state using the pro vided entropy source. Furthermore, this function can be used to update the seed state with new entropy
Std_ReturnType Crypto_RandomSeed (uint32 cryptoKeyId, const uint8* seedPtr, uint32 seedLength);Configuration data structure of Cry If module
CSM
CSM notifies the application that a job has finished. The function name is configurable. The function name itself is derived from "{CSM Job/ CSM Job Primitive Callback Ref}/CSM Callback Func".
void <Csm_ApplicationCallbackNotification> (uint32 jobId, Crypto_ResultType result);Service Csm_AEADDecryptManager.
Std_ReturnType Csm_AEADDecrypt (uint32 jobId, Crypto_OperationModeType mode, const uint8* ciphertextPtr, uint32 ciphertextLength, const uint8* associatedDataPtr, uint32 associatedDataLength, const uint8* tagPtr, uint32 tagLength, uint8* plaintextPtr, uint32* plaintextLengthPtr, Crypto_VerifyResultType* verifyPtr);Service Csm_AEADEncrypt.
Notifies the CSM that a job has finished. This function is used by the underlying layer (CRYIF).
void Csm_CallbackNotification (Crypto_JobType* job, Crypto_ResultType result);Cancels the job processing from asynchronous or streaming jobs .
Std_ReturnType Csm_CancelJob (uint32 job, Crypto_OperationModeType mode);Service Csm_Decrypt.
Std_ReturnType Csm_Decrypt (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, uint8* resultPtr, uint32* resultLengthPtr);Service Csm_Encrypt.
Std_ReturnType Csm_Encrypt (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, uint8* resultPtr, uint32* resultLengthPtr);Returns the version information of this module.
void Csm_GetVersionInfo (Std_VersionInfoType* versioninfo);Uses the given data to perform the hash calculation and stores the hash.
Std_ReturnType Csm_Hash (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, uint8* resultPtr, uint32* resultLengthPtr);Initializes the CSM module. In configurations, in which CSM is assigned to more than one partition (i.e. Csm_ Main Functions are mapped to partitions), CSM may provide one init function per partition.
void Csm_Init (const Csm_ConfigType* configPtr);Derives a new key by using the key elements in the given key identified by the key Id. 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 target Crypto
Std_ReturnType Csm_JobKeyDerive (uint32 jobId, uint32 keyId, uint32 targetKeyId);Calculates the public value of the current user for the key exchange and stores the
Std_ReturnType Csm_JobKeyExchangeCalcPubVal (uint32 jobId, uint32 keyId, uint8* publicValuePtr, uint32* publicValueLengthPtr);Calculates the shared secret key for the key exchange with the key material of the key identified by the key Id and the partner public key. The shared secret key is stored as a key element in the same key.
Std_ReturnType Csm_JobKeyExchangeCalcSecret (uint32 jobId, uint32 keyId, const uint8* partnerPublicValuePtr, uint32 partnerPublicValueLength);Generates new key material and stores it in the key identified by key Id.
Std_ReturnType Csm_JobKeyGenerate (uint32 jobId, uint32 keyId);Sets the key status to invalid. The key cannot be used any longer for cryptographic operations until it has been set to valid state again.
Std_ReturnType Csm_JobKeySetInvalid (uint32 jobId, uint32 keyId);Stores the key if necessary and sets the key state of the key identified by key Id to valid.
Std_ReturnType Csm_JobKeySetValid (uint32 jobId, uint32 keyId);Provides a new seed for the specified key that is used for an associated random number generator.
Std_ReturnType Csm_JobRandomSeed (uint32 jobId, uint32 keyId, const uint8* seedPtr, Manager uint32 seedLength);This function shall copy all key elements from the source key to a target key. Ava ilable via Csm.h
Std_ReturnType Csm_KeyCopy (const uint32 keyId, const uint32 targetKeyId);Derives a new key by using the key elements in the given key identified by the key Id. The given key contains the key elements for the password and salt. The derived key is stored in the k ey element with the id 1 of the key identified by target Crypto Key Id.
Std_ReturnType Csm_KeyDerive (uint32 keyId, uint32 targetKeyId);Service Csm_KeyElementCopyManager.
Std_ReturnType Csm_KeyElementCopy (const uint32 keyId, const uint32 keyElementId, const uint32 targetKeyId, const uint32 targetKeyElementId);Service Csm_KeyElementGet.
Std_ReturnType Csm_KeyElementGet (uint32 keyId, uint32 keyElementId, uint8* keyElementPtr, Manager uint32* keyElementLengthPtr);Sets the given key element bytes to the key identified by key Id.
Std_ReturnType Csm_KeyElementSet (uint32 keyId, uint32 keyElementId, const uint8* keyElementPtr, uint32 keyElementLength);Calculates the public value of the current user for the key exchange and stores the pub lic key in the memory location pointed by the public value pointer.
Std_ReturnType Csm_KeyExchangeCalcPubVal (uint32 keyId, uint8* publicValuePtr, uint32* publicValueLengthPtr);Calculates the shared secret key for the key exchange with the key material of the key identified by the key Id and the partner public key. The shared secret key is stored as a key element in the same key.
Std_ReturnType Csm_KeyExchangeCalcSecret (uint32 keyId, const uint8* partnerPublicValuePtr, uint32 partnerPublicValueLength);Generates new key material and store it in the key identified by key Id.
Std_ReturnType Csm_KeyGenerate (uint32 keyId);Returns the key state of the key identified by key Id.
Std_ReturnType Csm_KeyGetStatus (uint32 keyId, Crypto_KeyStatusType* keyStatusPtr);Sets the key status to invalid. The key cannot be used any longer for cryptographic operations until it has been set to valid state again.
Std_ReturnType Csm_KeySetInvalid (uint32 keyId);Sets the key state of the key identified by key Id to valid.
Std_ReturnType Csm_KeySetValid (uint32 keyId);Service Csm_MacGenerate.
Std_ReturnType Csm_MacGenerate (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, uint8* macPtr, uint32* macLengthPtr);Service Csm_MacVerify.
Std_ReturnType Csm_MacVerify (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, const uint8* macPtr, const uint32 macLength, Crypto_VerifyResultType* verifyPtr);API to be called cyclically to process the requested jobs. The Csm_ Main Function shall check the queues for jobs to pass to the underlying CRYIF. Per configured CSM Main Function ins tance one Csm_ Main Function_ shall be implemented. Hereby is the short name of the CSM Main Function configuration container in the ECU configuration.
void Csm_MainFunction (void);Generate a random number and stores it in the memory location pointed by th e result pointer.
Std_ReturnType Csm_RandomGenerate (uint32 jobId, uint8* resultPtr, uint32* resultLengthPtr);Feeds the key element CRYPTO_ KE_ RANDOM_ SEED with a random seed. Manager AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CryptoServiceManager
Std_ReturnType Csm_RandomSeed (uint32 keyId, const uint8* seedPtr, uint32 seedLength);The Crypto Driver extracts the context data from the context Buffer and restores the internal state so that further crypto operation of this crypto service will continue at the exact point when the context was taken.
Std_ReturnType Csm_RestoreContextJob (uint32 jobId, uint8* contextBufferPtr, uint32 contextBufferLength);The Crypto Driver stores the internal context of the respective crypto operation to the context Buffer.
Std_ReturnType Csm_SaveContextJob (uint32 jobId, uint8* contextBufferPtr, uint32* contextBufferLengthPtr);Service Csm_SignatureGenerate.
Std_ReturnType Csm_SignatureGenerate (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, uint8* signaturePtr, uint32* signatureLengthPtr);Service Csm_SignatureVerify.
Std_ReturnType Csm_SignatureVerify (uint32 jobId, Crypto_OperationModeType mode, const uint8* dataPtr, uint32 DataLength, const uint8* signaturePtr, uint32 signatureLength, Crypto_VerifyResultType* verifyPtr);Type Crypto_AlgorithmFamilyType.
Structure which determines the exact algorithm. Note, not every algorithm needs to specify all fields. AUTOSAR shall only allow valid combinations.
Type Crypto_AlgorithmModeType.
Defines which of the input/ output parameters are re - directed to a key element. The values can be combined to define a bit field.
Structure which contains further information, which depends on the job and the crypto primitive.
Type Crypto_JobPrimitiveInputOutputType.
Type Crypto_JobRedirectionInfoType.
Enumeration of the current job state.
Structure which contains further information, which depends on the job and the crypto primitive.
Enumeration for key status.
Enume ration which operation shall be performed. This enumeration is constructed from a bit mask, where the first bit indicates "Start", the second "Update" and the third "Finish".
Structure which contains basic information about the crypto primitive. Manager AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_CryptoServiceManager
Enumeration of the processing type.
Return for Std_ Return Type for Cryptostack.
Enumeration of the kind of the service.
Enumeration of the result type of verification operations.
Array long enough to store the data of the header.
Array long enough to store the ciphertext to be decrypted with AEAD.
Array long enough to store the data of the plaintext.
Array long enough to store the data of the Tag.
Array long enough to store the data of the header.
Array long enough to store the data of the cipher.
Array long enough to store the plaintext to be encrypted with AEAD.
Array long enough to store the data of the Tag.
Identification of a CSM service configuration via a numeric identifier, that is unique within a service. The name of a CSM service configuration, i.e. the name of the container Csm_Config, shall serve as a symbolic name for this parameter Avail able via Csm.h
Configuration data structure of CSM module
Array long enough to store the data to be decrypted.
Array long enough to store the data of the decrypted plaintext.
Array long enough to store the data to be encrypted.
Array long enough to store the data of the cipher.
Array long enough to store the data which shall be hashed.
Array long enough to store the data of the hash.
Array long enough to store any key element of the considered key
Implementation Data Type of category DATA_ REFERENCE with the pointer target uint32 to be able to return asynchronously the length.
Array long enough to store the data from which a MAC shall be generated.
Array long enough to store the data of the MAC.
Array long enough to store a MAC to be verified.
Array long enough to store the data for whichs MAC shall be verified.
Array long enough to store the data of the random number.
Array long enough to store the data from which the signature shall be generated.
Array long enough to store the signature and its length.
Array long enough to store a signature to be verified.
Array long enough to store the data for whichs signature shall be verified.
Implementation Data Type of category DATA_ REFERENCE with the pointer target Csm_ Verify Result Type to be able to return asynchronously the verify result.
gemini-3.8-flash-low· 2026-10-13 · जर्मन मूल