AUTOSAR Classic Crypto Services
클러스터 가이드AI 생성
하드웨어 및 소프트웨어 드라이버를 통해 표준화된 암호화 연산 및 키 관리 서비스를 제공합니다.
하드웨어 및 소프트웨어 드라이버를 통해 표준화된 암호화 연산 및 키 관리 서비스를 제공합니다.
이 클러스터는 AUTOSAR Classic Platform에서 암호화 서비스 및 키 관리 기능을 하드웨어 독립적으로 제공하기 위해 CSM, CryIf, Crypto Driver 모듈을 통합합니다 EXP_UtilizationOfCryptoServices 8쪽. 암호화 작업은 CSM을 통해 우선순위가 지정되고, CryIf에서 논리 채널로 라우팅되며, Crypto Driver에서 동기식 또는 비동기식으로 실행됩니다 [SWS_CryIf_91003]. 일관성을 위해 NVM 내 키 영속화는 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쪽.
암호화 요청은 우선순위, 입력 및 출력 버퍼, 동작 모드(스트리밍 또는 SingleCall을 위한 Start, Update, Finish)를 정의하는 Crypto_JobType으로 캡슐화됩니다 [SWS_Csm_01013], [SWS_Csm_01039]. CSM은 작업을 접수하여 소프트웨어 큐에 할당하고 CryIf_ProcessJob()을 통해 전달합니다 [SWS_Csm_00017], [SWS_CryIf_91003]. CryIf는 드라이버로의 채널 라우팅을 담당하며 CSM 키 식별자를 모듈별 드라이버 키 ID로 변환합니다 [SWS_CryIf_00133].
컨텍스트 다이어그램: AUTOSAR 암호화 스택의 계층 아키텍처 및 인터페이스 캐스케이드. 출처: SWS_CryptoDriver 15쪽, SWS_CryptoServiceManager 29쪽
비동기 암호화 작업의 동기화를 위해 대기열을 비우고 보류 중인 계산을 트리거하는 주기적 Csm_MainFunction()이 사용됩니다 [SWS_Csm_00479]. 비동기 하드웨어 계산이 완료된 후 Crypto Driver는 CryIf_CallbackNotification()를 통해 CryIf에 알리고, 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 진단 인증)을 Hardware Security Modules(HSM) 또는 Secure Hardware Extensions(SHE)와 같은 독점 암호화 코프로세서로부터 완전히 추상화합니다 SWS_SecureOnboardCommunication 78쪽.
Crypto Service Manager(CSM)는 애플리케이션 컴포넌트(SW-C) 및 상위 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는 키 ID를 매핑하고 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은 전용 OS 파티션에 할당되는 여러 인스턴스를 지원합니다 Csm_MainFunction_<shortName>(), [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_Init()을 통해 CSM이 시작되며, 이때 CSM의 구성 포인터는 사양에 따라 항상 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]. 제어기 셧다운 또는 저전력 모드로의 전환 전에 비동기 작업을 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 · 독일어 원문